Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - Mex

#1
https://github.com/MexUK/Essentials">https://github.com/MexUK/Essentials[/url]



Commands:



GENERIC



/pos [player]

/rot [player]

/vehicleinfo [player]

/playermodel [player] [model]

/goto player

/get player

/interior [player] [interior]

/gravity [player] [level]

/id [player]

/health [player] [amount]

/armour [player] [amount]

/spawnhealth [amount]

/spawnarmour [amount]

/bleeding [player] [bool]

/falloffbike [player] [bool]

/crouch [player] [bool]

/mass [player] [player]

/vehiclehealth [player] [health]

/snow [bool]

/speed [player] [speed]

/commands

/whospawned

/whoinvehicle

/occupants [player]

/bulletproof [player] [bool]

/fireproof [player] [bool]

/explosionproof [player] [bool]

/collisionproof [player] [bool]

/meleeproof [player] [bool]

/vehiclemodel [player] [model]

/opengarage garage

/closegarage garage

/isgarageclosed garage

/time [time]

/hour [hour]

/minute [minute]

/second [second]

/kill

/killplayer [player]

/alladmin [level]

/bounds [bool]

/ping [target]

/game [target]

/gameversion [target]

/pointgunat [target]

/bigmessage player int int text

/pagermessage player int int int text

/smallmessage player int int text

/clearmessages [player]

/weather [weather]

/fix

/flip

/gotoposition x y z

/heading [target]

/velocity [x y z]

/turnvelocity [x y z]

/ground [target]

/damage [bool]

/eject [player]

/pingabove ping

/announce text

/calltaxi

/centerofmass [target]

/maxstamina [target] [stamina]

/maxhealth [target]

/entervehicle vehicleID [seat]

/exitvehicle

/weaponstate [target]

/warp [target] [vehicleID] [seat]

/walkstyle [walkStyleID]

/xoffset offset

/yoffset offset

/zoffset offset



WEAPONS



/weapon [player] [weapon] [ammunition]

/clearweapons [player]

/weapons [player]

/weaponall [weapon] [ammunition]



ELEMENTS



/maxplayers

/maxobjects

/maxvehicles

/maxpickups

/maxspheres

/maxpeds

/maxblips



/object [model] [type]

/vehicle [model]

/pickup [model] [type]

/sphere [size]

/ped [model]

/blip [model]



/players

/objects

/vehicles

/pickups

/spheres

/peds

/blips

/elements



/nearplayers

/nearobjects [radius]

/nearvehicles [radius]

/nearpickups [radius]

/nearspheres [radius]

/nearblips [radius]

/nearpeds [radius]



/removeobject objectID

/removevehicle vehicleID

/removepickup pickupID

/removesphere sphereID

/removeblip blipID

/removeped pedID



/isobjectonscreen objectID

/isvehicleonscreen vehicleID

/ispickuponscreen pickupID

/issphereonscreen sphereID

/ispedonscreen pedID

/isbliponscreen blipID



/objectids

/vehicleids

/pickupids

/sphereids

/pedids

/blipids



/clientids

/playerids

/playervehicleids



/objectdistance elementId

/vehicledistance elementId

/pickupdistance elementId

/spheredistance elementId

/peddistance elementId

/blipdistance elementId

/playerdistance [target]



/saveobject objectID

/savevehicle [vehicleID]

/savepickup pickupID

/savesphere sphereID

/saveped pedID

/saveblip blipID



/objectsyncers

/vehiclesyncers

/pickupsyncers

/spheresyncers

/pedsyncers

/blipsyncers



/objectdimensions

/vehicledimensions

/pickupdimensions

/spheredimensions

/peddimensions

/blipdimensions

/playerdimensions



/objectsyncer elenentID

/vehiclesyncer elenentID

/pickupsyncer elenentID

/spheresyncer elenentID

/pedsyncer elenentID

/blipsyncer elenentID



/gotoobject objectID

/gotovehicle vehicleID

/gotopickup pickupID

/gotosphere sphereID

/gotoped pedID

/gotoblip blipID



ADMIN



/level [player]

/admin



/commandlevel [command] [level]

/commandlevels



/disablecommand command

/enablecommand command

/disabledcommands



COMMAND ALIAS



/commandalias [command] [alias]

/removecommandalias [command]

/commandaliases



TELEPORT



/addteleport name

/removetelerport name

/teleports

/gototeleport name



KEYS



/key key [command] [...args]

/unkey key

/keys



ACCOUNT



/register password

/login password

/logout

/accounts



SPAWN



/spawns

/spawnids

/addspawn

/removespawn [spawnID]

/gotospawn spawnID

/savespawn spawnID



RESOURCE



/resources

/resourcenames

/startresource resource

/stopresource resource



MISSION



/mission missionId [player] [player] [player] [...]

/cancelmission

/onmission [target]
#2
Scripting Releases / [JS] MexUI
July 07, 2019, 03:01:25 AM
MexUI



A styleable UI system for input controls and windows.



https://github.com/MexUK/mexui">https://github.com/MexUK/mexui[/url]
#3
We have them server-side, they are needed client-side.



onPedEnterVehicle(event, ped, vehicle, seat)

onPedExitVehicle(event, ped, vehicle)
#4
General Staff Chat / Server Checklist - All Versions
November 01, 2018, 01:07:56 AM
Server Checklist - All Versions



ensure symbols and other data is not in Release build mode



rename short function/variable names



triggerEvent function



player weapon system



vehicle respawn system



server bugs on mantis



--



Notes:



short function/variable names that need changing:



<Property Name="platform" ReadOnly="true" Type="string" />

<Property Name="world" ReadOnly="true" Type="Referenceable" />

<Function Name="message" Mask="s|i" RequiredArguments="1" />
#5
General Checklist - Server and Client



---------------------------------------------------------------------------



ensure entity.heading takes degrees not radians, same with fetching the value - Jack confirmed we will use radians



we probably need a ELEMENT_CLIENT define - it currently doesn't exist server-side, probably not client-side either - skipped by Mex, because type Client does not inherit type Element.



Ensure that the "game" namespace is entirely removed]Server-Side[/i]

- game.createVehicle

 - game.createElement

 - game.getWorld

 - game.fadeCamera

 - game.createBlipAttachedTo
- namespace removed for these items by Vortrex

- World class is currently relative to game namespace - not sure what I (Mex) meant by this so I've crossed it off

Client-Side

 - game.game

 - game.width - also maybe change name to resolutionWidth

 - game.height - also maybe change name to resolutionHeight

 - game.aspectRatio

 - game.tickCount

 - game.timeStep

 - game.gameSpeed

 - game.isDirect3D9 - also maybe change name to direct3D9

 - game.rwRenderStateSet

 - game.createEffect

 - game.setEffect - also maybe change name

 - game.createRenderTarget

 - game.setRenderTarget

 - game.drawRectangle

 - game.time.hour

 - game.time.minute

 - game.time.second

 - game.weather.current

 - game.weather.snowing - also inconsistent name with isDirect3D9

 - game.weather.force

 - game.weather.forceSnowing

 - game.cutsceneMgr.time

 - game.cutsceneMgr.loadStatus

 - game.cutsceneMgr.finished

 - game.cutsceneMgr.load

 - game.cutsceneMgr.start

 - game.cutsceneMgr.stop

 - game.messages.clear

 - game.messages.addJumpQ
- the game namespace has been removed from all of these scripting items by Mex



Server.xml config file: - Mex: I've added the missing items to the wiki server config page and also to the default server xml on dropbox.



- Setting maxplayers default is now 256 not 128, the config file needs updating. - the config file has been updated and placed on dropbox in a new folder

- Is range of processinterval really 0-65535 as mentioned in the config file.  - yes

- Is range of syncinterval really 0-65535 as mentioned in the config file. - yes

- Does setting streamindistance still exist? Because it is in the server.xml config file but not in the c++ config loader. - Found in c++.

- Does setting streamoutdistance still exist? Because it is in the server.xml config file but not in the c++ config loader. - Found in c++.

- Does setting pickupstreamindistance still exist? Because it is in the server.xml config file but not in the c++ config loader. - Found in c++.

- Does setting pickupstreamoutdistance still exist? Because it is in the server.xml config file but not in the c++ config loader. - Found in c++.

- Does setting games still exist? Because it is in the server.xml config file but not in the c++ config loader. - Found in c++.

- Does setting planes still exist? Because it is in the server.xml config file but not in the c++ config loader. - Found in c++.

- Does setting trains still exist? Because it is in the server.xml config file but not in the c++ config loader. - Found in c++.

- Does setting encryption still exist? Because it is in the c++ config loader, but not in the server.xml config file. - Found in c++.

- Does setting duplicatenames still exist? Because it is in the c++ config loader, but not in the server.xml config file. - Found in c++.





cs getScreenFromWorldPosition should probably return a Vec2 not a Vec3 - 2d has depth, so returning a Vec3 makes sense



Vehicle::setCarCruiseSpeed - realised now that this is GTA III only

Vehicle::setCarMission - realised now that this is GTA III only

Vehicle::carWanderRandomly - realised now that this is GTA III only

Vehicle::setDrivingStyle - realised now that this is GTA III only



Function setInterval only calls it's callback once - tested client-side - Already working, my bad. I had documented it incorrectly on the wiki, which is fixed now.



Add createBlah functions for other entities:

- createElement - cs - Added by Mex

- createSphere - ss - Added by Mex

- createObject - ss - Added by Mex

- createPickup - ss - Added by Mex

- createBlip - ss - Added by Mex

- createBuilding - ss - Added by Mex

- createPlayer - ss - Added by Mex

- createCivilian - ss - Added by Mex



- cs getWorldFromScreenPosition should probably take a Vec2 not a Vec3 - Skipped because screen pos has depth.



Add onResourceReady server-side too. - Skipped by Jack and Mex, because this refers to network transfer only.









ss global func spawnPlayer should probably be a method named Player::spawn instead - Edit by Mex: Jack will look into this, and has said that player spawning should probably only be done server-side. There is currently a Player::spawn or spawnPlayer for both ss and cs.



Server crashes on close - right click close on taskbar app icon - probably caused by the world:forceWeather method

Fixed (Vortrex)



Decide if we need, and maybe implement, Automatic reconnect on timeout.

I don't think this is a good idea. In fact, I don't want people auto-reconnecting if they got kicked or banned (Vortrex)



Fix inconsistency of these event names or perhaps improve them if they are consistent: onPostRender2D, onPreRender, onRender, onRender2D



Vector Parameters:

 - cs findGroundZForCoord should probably take a Vec2 instead of 2 floats (x and y)

 - cs Vehicle::driveTo should probably take a Vec3 instead of float,float,float



these cs methods/properties are on the cs wiki but are not in cs xml or cs/core code:

Vehicle::setTaxiLight or Vehicle::taxiLight



Item Naming:

- ss forceWeather inconsistent function name with cs weather.force



------------------------------------------------------------------------------------------------------



[Post Edited]

More checklist items added on 14th August 2018:



Add these MAX_* defines:



MAX_ELEMENTS

MAX_ENTITIES

MAX_PHYSICALS

MAX_TRANSFORMABLES



MAX_BLIPS

MAX_BUILDINGS

MAX_CIVILIANS - removed soon

MAX_MARKERS

MAX_OBJECTS

MAX_PEDS - exists cs

MAX_PICKUPS

MAX_PLAYERS

MAX_VEHICLES - exists cs



MAX_CHAT_MESSAGE_CHARACTERS

MAX_CHAT_MESSAGES - cs only

MAX_CHAT_HISTORY - cs only

MAX_PLAYER_NAME_CHARACTERS

MAX_PATH - os specific possibly

MAX_WEAPON_SLOTS

MAX_VEHICLE_PASSENGERS

MAX_PLAYER_WANTED_LEVEL

MAX_PLAYER_HEALTH

MAX_PLAYER_ARMOUR



MAX_SCRIPTS - unless using std::vector or something

MAX_EVENT - unless using std::vector or something

MAX_EVENT_CALLBACKS - unless using std::vector or something





MAX_ defines - needed server side too

MAX_ defines - other entities needed, like garages and objects

_GARAGE defines - switch naming to GARAGE_ for consistency



/q, or exit game in menu, it currently doesn't end the game process or re-display the launcher window



[ (square bracket) text bug in chat - found by Vortrex

Last time I checked, this was fixed (Vortrex)



changing san andreas resolution doesn't save after game close



server version column for server list in client launcher



version number in server console's window title bar - i.e. 1.0.72 etc



setTrainsEnabled probably shouldnt exist as a scripting function for VC, as no trains are in VC.



audio.createSound - should probably be named createSound instead - Edit by Mex: Jack has said he will likely delete the whole audio thing for now.



------------------------------------------------------------------------------------------------------



[Post Edited]

More checklist items added on 16th August 2018:



this server-side code causes a server crash:

addCommandHandler('t', function(cmd,args,client)

   httpGet('http://www.google.com">http://www.google.com[/url]', '', function() end, function(data)

   end)

end)



Function outputChatBox should have optional colour parameter. Edit by Mex: Jack has said that this function will probably be renamed, and that it can have an optional colour parameter too in one of the new signatures/functions for it.

This has been renamed to message or messageClient, and accepts a colour arg (Vortrex)



Vortrex: I noticed that using vehicle.engine turns off the engine but the car is still driveable.



------------------------------------------------------------------------------------------------------



[Post Edited]

More checklist items added on 18th August 2018:



rename civilian stuff to ped or something else



add missing global functions to fetch multiple elements, both server-side and client-side:

- getElements

- getSpheres

- getObjects

- getPickups

- getBlips

- getBuildings

- getPlayers

- getCivilians
#6
General / New Testing Structure
May 17, 2018, 02:17:12 AM
The new testing structure has 3 stages.



Stage 1 - Role "Developer" makes a new post on the forum, with a new build and a list of scripting functionality that needs testing.

Stage 2 - Role "Scripter" creates a basic test script to allow role "Tester" to test the functionality in game with commands.

Stage 3 - Role "Tester" installs the script and tests the functionality in game by typing commands, using multiple players for testing if needed.



This should involve the team more with the project, and allows developers to work on more stuff.
#7
Be sure to have "nodes/paths.ipl" file existing, copied from game folder.


traffic = {}
traffic.sidewalk = {}
traffic.sidewalk.nodes = {}
traffic.sidewalk.nodeGroups = {}
traffic.road = {}
traffic.road.nodes = {}
traffic.road.nodeGroups = {}
traffic.water = {}
traffic.water.nodes = {}
traffic.water.nodeGroups = {}

addEventHandler('OnResourceStart', function(event, resource)
if resource ~= thisResource then return end

-- load ped nodes into server memory
print('Loading traffic data..')

local file = openFile('nodes/paths.ipl')
local data = file:readBytes(1171556)
file:close()
local lines = explode("rn", data)

local groupType, node
local groupNodes_sidewalk, groupNodes_road, groupNodes_water = {}, {}, {}
for i,v in ipairs(lines) do
if v:find(',', 0, true) then

if v:len() <= 8 then
-- group type
if #groupNodes_sidewalk > 0 then table.insert(traffic.sidewalk.nodes, groupNodes_sidewalk) end
if #groupNodes_road > 0 then table.insert(traffic.road.nodes, groupNodes_road) end
if #groupNodes_water > 0 then table.insert(traffic.water.nodes, groupNodes_water) end
groupNodes_sidewalk = {}
groupNodes_road = {}
groupNodes_water = {}

groupType = tonumber(v:sub(1, 1))
else
-- node type
node = explode(',', v)
for i2,v2 in ipairs(node) do
node[i2] = tonumber(v2)
end

node[4] = node[4] / 16.0
node[5] = node[5] / 16.0
node[6] = node[6] / 16.0

if groupType == 0 then -- sidewalk
table.insert(groupNodes_sidewalk, node)
traffic.sidewalk.nodeGroups[node] = groupNodes_sidewalk
elseif groupType == 1 then -- road
table.insert(groupNodes_road, node)
traffic.road.nodeGroups[node] = groupNodes_road
elseif groupType == 2 then -- water
table.insert(groupNodes_water, node)
traffic.water.nodeGroups[node] = groupNodes_water
end
end

end
end
if #groupNodes_sidewalk > 0 then table.insert(traffic.sidewalk.nodes, groupNodes_sidewalk) end
if #groupNodes_road > 0 then table.insert(traffic.road.nodes, groupNodes_road) end
if #groupNodes_water > 0 then table.insert(traffic.water.nodes, groupNodes_water) end

print('Done.')
end)

function explode(div,str) -- credit: http://richard.warburton.it
  -- http://lua-users.org/wiki/MakingLuaLikePhp
  if (div=='') then return false end
  local pos,arr = 0,{}
  -- for each divider found
  for st,sp in function() return string.find(str,div,pos,true) end do
    table.insert(arr,string.sub(str,pos,st-1)) -- Attach chars left of current divider
    pos = sp + 1 -- Jump past current divider
  end
  table.insert(arr,string.sub(str,pos)) -- Attach chars right of last divider
  return arr
end
#8
Scripting Releases / [JS] Intervaled messages
May 12, 2018, 07:06:58 AM
var intervaledMessages = {};

intervaledMessages.enabled = true;
intervaledMessages.messages = [];
intervaledMessages.messageIndex = 0;
intervaledMessages.messageInterval = 60000;

intervaledMessages.messages[0] = 'Message 1';
intervaledMessages.messages[1] = 'Message 2';
intervaledMessages.messages[2] = 'Message 3';

if(intervaledMessages.enabled && intervaledMessages.messages.length != 0)
{
setInterval(function(){
outputChatBox(intervaledMessages.messages[intervaledMessages.messageIndex], COLOUR_BLUE);

if(intervaledMessages.messageIndex == (intervaledMessages.messages.length - 1))
intervaledMessages.messageIndex = 0;
else
intervaledMessages.messageIndex++;
}, intervaledMessages.messageInterval);
}
#9
var admin = {};

admin.playerNamesData = {};
admin.connectedPlayersData = {};
admin.commandLevels = {};

// players
admin.playerNamesData['username1'] = {};
admin.playerNamesData['username1'].level = 10;
admin.playerNamesData['username1'].password = 'abc';

admin.playerNamesData['secondUsername'] = {};
admin.playerNamesData['secondUsername'].level = 10;
admin.playerNamesData['secondUsername'].password = 'abc';

// commands
admin.commandLevels['commanda'] = 5;
admin.commandLevels['commandb'] = 10;
admin.commandLevels['commandc'] = 11;

// code
function checkPlayerCommandLevel(client, commandName)
{
if(admin.commandLevels[commandName])
{
if(!admin.connectedPlayersData[client.player.name].loggedIn || admin.playerNamesData[client.player.name].level < admin.commandLevels[commandName])
{
outputChatBox("You do not have high enough admin level to use this command!", COLOUR_RED, client);
return false;
}
}
return true;
}

addEventHandler("OnPlayerJoined", (event,client) => {
admin.connectedPlayersData[client.player.name] = {};
});

addEventHandler("OnPlayerQuit", (event,client,reason) => {
admin.connectedPlayersData[client.player.name] = null;
});

addCommandHandler("login", (commandName, args, client) => {
if(admin.playerNamesData[client.player.name])
{
if(args == admin.playerNamesData[client.player.name].password)
{
admin.connectedPlayersData[client.player.name].loggedIn = true;
outputChatBox("You have logged in!", COLOUR_BLUE, client);
}
else
{
outputChatBox("Incorrect password!", COLOUR_RED, client);
}
}
else
{
outputChatBox("Account does not exist!", COLOUR_RED, client);
}
});

addCommandHandler("commanda", (commandName, args, client) => {
if(!checkPlayerCommandLevel(client, commandName))
{
return;
}

outputChatBox("Command a", COLOUR_BLUE, client);
});

addCommandHandler("commandb", (commandName, args, client) => {
if(!checkPlayerCommandLevel(client, commandName))
{
return;
}

outputChatBox("Command b", COLOUR_BLUE, client);
});

addCommandHandler("commandc", (commandName, args, client) => {
if(!checkPlayerCommandLevel(client, commandName))
{
return;
}

outputChatBox("Command c", COLOUR_BLUE, client);
});
#10
Testers / Scripting Items for Testing
April 15, 2018, 04:24:38 AM
This is a list of scripting items that currently need testing.

After testing something, please post the results in this thread.



Scripting Items for Testing



void vehicle.setSuspensionHeight(int suspensionItem, float suspension)

float vehicle.getSuspensionHeight(int suspensionItem)



float readonly vehicle.burnDuration



void vehicle.setTyreStatus(int tyre, bool status)

bool vehicle.getTyreStatus(int tyre)



void vehicle.setLightStatus(int light, bool status)

bool vehicle.getLightStatus(int light)



void vehicle.setDoorStatus(int door, int status)

int vehicle.getDoorStatus(int door)



int vehicle.handlingIndex



VehicleHandling readonly vehicle.handling



string vehicle.handling.name

float vehicle.handling.mass

vec3 vehicle.handling.size

vec3 vehicle.handling.centerOfMass

float vehicle.handling.submergedRatio

float vehicle.handling.tractionMultiplier

float vehicle.handling.tractionLoss

float vehicle.handling.tractionBias

int vehicle.handling.gears

float vehicle.handling.maxSpeed

float vehicle.handling.acceleration

int vehicle.handling.driveType

int vehicle.handling.engineType

float vehicle.handling.brakeDeacceleration

float vehicle.handling.brakeBias

int vehicle.handling.ABS

float vehicle.handling.steeringLockAngle

float vehicle.handling.suspensionForce

float vehicle.handling.suspensionDamping

float vehicle.handling.seatOffsetDistance

float vehicle.handling.collisionDamageMultiplier

int vehicle.handling.monetaryValue

float vehicle.handling.minSuspension

float vehicle.handling.maxSuspension

float vehicle.handling.suspensionBias

float vehicle.handling.suspensionAntiDiveMultiplier [Not in III]

int vehicle.handling.handlingFlags

int vehicle.handling.frontLightsSize

int vehicle.handling.rearLightsSize

int vehicle.handling.modelFlags [SA only]

float vehicle.handling.turnMass [SA only]

float vehicle.handling.dragMultiplier [SA only]

float vehicle.handling.engineIntertia [SA only]

float vehicle.handling.suspensionHighSpeedDampening [SA only]

int vehicle.handling.animationGroup [SA only]



bool ped.crouching



bool ped.jumping - todo: III getter, III setter, SA setter



float ped.upperTorsoRotation - todo: III & SA



float ped.stamina - todo: III & SA

float ped.maxStamina - todo: III & SA

float ped.staminaDuration - todo: III & SA



float physical.collisionPower - todo: III



float physical.mass

vector physical.centerOfMass



int player.money
#11
Testers / Utility Function Ideas
April 14, 2018, 07:16:36 AM
vec2.getDistance(vec2)

vec2.getPointsAngle(vec2)



vec3.getDistance(vec3)



entity.offsetPolar(deg, radius)

entity.offsetSpherical(flatDeg, inclinationDeg, radius)

entity.inFront(radius)

entity.behind(radius)

entity.leftOf(radius)

entity.rightOf(radius)



util.getNearestVehicle()

util.getNearestObject()

util.getNearestPed()

util.getRandomSkin()

util.getRandomVehicleModel()

util.getAngleDifference(deg1, deg2)

util.polarToCartesian(deg, radius)

util.sphericalToCartesian(flatDeg, inclinationDeg, radius)



world.getGroundZ(vec2)

world.processLineOfSight(vec3, vec3)



Edit by Lyudmila: since GTA3 doesn't have ground under water, getGroundZ will give some issues
#12
Testers / Anti Hacks Discussion
April 13, 2018, 04:15:05 AM
packet sizes - for packets being received into server

packet values - for packets being received into server

packet rates - for packets being received into server



server control over client entity attributes - e.g. player being given a weapon client-side, but server disallowing a particular weapon

weapon fire rate - taking into account packets being received into server more frequently than packet send rate which is uncontrollable

player/vehicle speed hacks

chat spam

connect/disconnect spam

anti collision

brute force server password guessing
#13
Testers / Task List - General Ideas
April 08, 2018, 06:48:41 AM
This forum thread is for any GTAC ideas.



There is also a public forum section for this, but now we have a private thread for it too 8-)
#14
Testers / Task List - Somewhat Urgent Stuff
April 08, 2018, 04:48:34 AM
This thread is a list of somewhat urgent stuff that needs fixing or adding to GTAC!

Feel free to add a post with ideas that urgently need implementing.



----------------------------------------------------------------------------



1) Server side .gameMode as a property for scripting.



3) Server side client.ip



4) Server side client.ping



5) Server side client.disconnect()



6) Increase chat message max length.



7) Update chat message history - swap message order.



8) Update chat message history - still work with latest messages when reached max message history limit.



9) Update chat message history - unlimited chat messages in history. - Jack said this would use too much memory.



12) Don't clear chat history after disconnected from server.



13) Verify ped]



14) Update sync matrix stuff, restoring couple things like reading packet matrix into object but not GTA's object.



17) Squirrel events.



24) Prevent same username being used in server.



36) Add server side .serverPassword property - Removed for security reasons, a setter is planned though.



37) Change some global properties to be namespaced]



38) Change chat input history size to double of 2, so 16 32 64 128 256 etc



40) Make name-in-use kicker a server setting



29) Make /reconnect also reconnect to last used server if not connected to a server - per game instance, no need to store data in files



34) Add .serverName property server-side



30) Decide on order of callback parameters for command handlers and event handlers for scripting. - Makes most logical sense leaving it as currently implemented.



22) Fix g to enter vehicle as passenger. Pending discussion regarding if it's needed



33) Chat box doesn't appear sometimes apparently



28) Sort out uncommitted function register code for Mex's build.



41) Sort out scripting functions - remove old version of functions, replace with new scripting system version - and uncomment several functions too



45) Sort out the several scripting functions named LuaFunction* in server using old scripting system



16) Support compiling all 4 VS projects in release mode - so that builds can be sent to certain people. Only Jack can do this task



20) Enable heli blades spinning for syncd vehicles.



42) Remove duplicatenames setting and code?



46) Sort out the 160 scripting functions named LuaFunction* in core using old scripting system - skipped as they are not related to GTA games



47) Don't interpolate pedals as they are only ever 0.0 or 1.0 - but still set the values at the correct time to be in sync with vehicle sync



25) Huge task - Split tons of code up into more files. - skipped



15) Move velocity interpolation code from Vehicle]Probably need a CPhysical::Process hook[/color]



10) Double click server in server browser to connect. Server browser doesn't open in debug mode



11) Server browser - it says connected when the game isn't started. Server browser doesn't open in debug mode



----------------------------------------------------------------------------



Immediate Priority



(none)



Urgent Priority



23) Sometimes vehicles can't be entered, happens for both driver or passenger.



27) Big task - Get the new wiki working.



31) Table and/or Array support for modules.



Very High Priority



26) Explosions happen multiple times when a vehicle explodes.



39) Autoscale the chat to the resolution - idea by Lyudmila



High Priority



2) Server logs are always empty, but they should get written to because the log path is set in the settings xml.



18) Remove internal sidewalk traffic that appears when spawning, whether connected to a server or not. Pending discussion regarding if it's needed



19) Sort out sync packet rates - server -> client, is inconsistent with, client -> server - 10ms server process rate will probably flood clients currently. Pending discussion regarding if it's needed



21) Sync aborting entering a vehicle. Skipped by Mex for now - probably need a CPed]



32) /connect can hang for a long time possibly unlimited time - possibly when server is restarting



35) Get all 4 VS projects compiled with VS 2017 instead of VS 2015 - mozilla or something is causing need for VS 2015. Only Jack can do this task



43) Sort out the 8 remaining scripting functions named LuaFunction* in client using old scripting system - movie functions



44) Add ability to send server-side ped objects as table to client-side with triggerNetworkEvent and then to use setWanderPath on those peds client-side
#15
Scripting Releases / [Lua] Run Code Ingame
April 07, 2018, 07:07:54 PM
Commands:

/s <code> (for server-side Lua expressions)

/c <code> (for client-side Lua expressions)

/s2 <code> (for server-side Lua statements)

/c2 <code> (for client-side Lua statements)



Server-side Code:


addCommandHandler("s",function(commandName,code,client) -- expressions
if code == '' then
outputChatBox(client.player.name..", you must type some server code to run! Syntax /s <code>", CHAT_TYPE_INFO)
else
local returns = { pcall(load("return "..code)) }
local status = table.remove(returns, 1)
if not status then
local _error = returns[1]
outputChatBox(client.player.name.."'s server code had an error!", CHAT_TYPE_INFO)
outputChatBox("Code: "..code, CHAT_TYPE_INFO)
outputChatBox("Error: ".._error, CHAT_TYPE_INFO)
else
outputChatBox(client.player.name.." ran server code: "..code, CHAT_TYPE_INFO)
local argsStr = getArgsString(table.unpack(returns))
outputChatBox("Returns: "..argsStr, CHAT_TYPE_INFO)
end
end
end)
addCommandHandler("s2",function(commandName,code,client) -- statements
if code == '' then
outputChatBox(client.player.name..", you must type some server code to run! Syntax /s2 <code>", CHAT_TYPE_INFO)
else
local status, _error = pcall(load(code))
if not status then
outputChatBox(client.player.name.."'s server code had an error!", CHAT_TYPE_INFO)
outputChatBox("Code: "..code, CHAT_TYPE_INFO)
outputChatBox("Error: ".._error, CHAT_TYPE_INFO)
else
outputChatBox(client.player.name.." ran server code: "..code, CHAT_TYPE_INFO)
end
end
end)

function ocb(...)
outputChatBox(getArgsString(...), CHAT_TYPE_INFO)
end

function getArgsString(...)
local arg = {...}
    local Values, Value, Type = {}
    for i,v in ipairs(arg) do
        Type = type(v)
        if     Type == "number"   then Value = v
        elseif Type == "boolean"  then Value = (v) and "true" or "false"
        elseif Type == "string"   then Value = [[']]..replace(replace(v, [[]], [[\]]), [[']], [[']])..[[']]
        elseif Type == "table"    then Value = getTableString(v)
        elseif Type == "function" then Value = "function"
        elseif Type == "userdata" then Value = "userdata: "..tostring(v)
        elseif Type == "nil"      then Value = "nil"
        else                           Value = (Type) and ""..Type.."" or "unknown data type"
        end
        table.insert(Values, Value)
    end
    return (Values[1]) and table.concat(Values, ", ") or "nil"
end

function replace(String, LookFor, ReplaceWith)
    if not String or not LookFor or not ReplaceWith then return end
    String, LookFor, ReplaceWith = tostring(String), tostring(LookFor), tostring(ReplaceWith)
   
    local NewString = ""
    local OccuranceStartPos = string.find(String, LookFor, 1, true)
    if not OccuranceStartPos then return String end
   
    if OccuranceStartPos > 1 then
        NewString = NewString..string.sub(String, 1, OccuranceStartPos - 1)
    end
   
    local OccuranceEndPos
    while OccuranceStartPos do
        OccuranceEndPos = OccuranceStartPos + (string.len(LookFor) - 1)
        NewString = NewString..ReplaceWith
        OccuranceStartPos = string.find(String, LookFor, OccuranceEndPos + 1, true)
        if (OccuranceStartPos or 0) - 1 > OccuranceEndPos then
            NewString = NewString..string.sub(String, OccuranceEndPos + 1, OccuranceStartPos - 1)
        end
    end
   
    if OccuranceEndPos < string.len(String) then
        NewString = NewString..string.sub(String, OccuranceEndPos + 1)
    end
   
    return NewString
end

function getTableString(Table)
    local String, IntKey, Element = {}, (isTableIntKey(Table)) and true or false
    table.insert(String, '{')
    for i,v in _G[((IntKey) and 'i' or '')..'pairs'](Table) do
        Element = { i, v }
        for j,w in ipairs(Element) do
            if j == 1 then table.insert(String, ((#String > 1) and ',' or '')..((IntKey) and '' or '[')) end
           
            if not IntKey or j == 2 then
                Type = type(w)
                if Type == 'number' then table.insert(String, w)
                elseif Type == 'boolean' then table.insert(String, ((w) and 'true' or 'false'))
                elseif Type == 'string' then table.insert(String, [[']]..replace(replace(w, [[]], [[\]]), [[']], [[']])..[[']])
                elseif Type == 'table' then table.insert(String, getTableString(w))
                elseif Type == 'function' then table.insert(String, 'function')
                elseif Type == 'userdata' then table.insert(String, 'userdata: '..tostring(w))
                elseif Type == 'nil' then table.insert(String, 'nil')
                else table.insert(String, 'unknown data type')
                end
            end
           
            if j == 1 then table.insert(String, ((IntKey) and '' or ']=')) end
        end
    end
    table.insert(String, '}')
    return table.concat(String)
end

function isTableIntKey(Table)
    local b = 0
    for i,v in pairs(Table) do b = b + 1 end
    for a=1, b do
        if Table[a] == nil then return false end
    end
    return true
end

Client-side code:


addCommandHandler("c",function(commandName,code) -- expressions
if code == '' then
outputChatBox(localPlayer.name..", you must type some client code to run! Syntax /c <code>", CHAT_TYPE_INFO)
else
local returns = { pcall(load("return "..code)) }
local status = table.remove(returns, 1)
if not status then
local _error = returns[1]
outputChatBox(localPlayer.name.."'s client code had an error!", CHAT_TYPE_INFO)
outputChatBox("Code: "..code, CHAT_TYPE_INFO)
outputChatBox("Error: ".._error, CHAT_TYPE_INFO)
else
outputChatBox(localPlayer.name.." ran client code: "..code, CHAT_TYPE_INFO)
local argsStr = getArgsString(table.unpack(returns))
outputChatBox("Returns: "..argsStr, CHAT_TYPE_INFO)
end
end
end)
addCommandHandler("c2",function(commandName,code) -- statements
if code == '' then
outputChatBox(localPlayer.name..", you must type some client code to run! Syntax /c2 <code>", CHAT_TYPE_INFO)
else
local status, _error = pcall(load(code))
if not status then
outputChatBox(localPlayer.name.."'s client code had an error!", CHAT_TYPE_INFO)
outputChatBox("Code: "..code, CHAT_TYPE_INFO)
outputChatBox("Error: ".._error, CHAT_TYPE_INFO)
else
outputChatBox(localPlayer.name.." ran client code: "..code, CHAT_TYPE_INFO)
end
end
end)

function ocb(...)
outputChatBox(getArgsString(...), CHAT_TYPE_INFO)
end

function getArgsString(...)
local arg = {...}
    local Values, Value, Type = {}
    for i,v in ipairs(arg) do
        Type = type(v)
        if     Type == "number"   then Value = v
        elseif Type == "boolean"  then Value = (v) and "true" or "false"
        elseif Type == "string"   then Value = [[']]..replace(replace(v, [[]], [[\]]), [[']], [[']])..[[']]
        elseif Type == "table"    then Value = getTableString(v)
        elseif Type == "function" then Value = "function"
        elseif Type == "userdata" then Value = "userdata: "..tostring(v)
        elseif Type == "nil"      then Value = "nil"
        else                           Value = (Type) and ""..Type.."" or "unknown data type"
        end
        table.insert(Values, Value)
    end
    return (Values[1]) and table.concat(Values, ", ") or "nil"
end

function replace(String, LookFor, ReplaceWith)
    if not String or not LookFor or not ReplaceWith then return end
    String, LookFor, ReplaceWith = tostring(String), tostring(LookFor), tostring(ReplaceWith)
   
    local NewString = ""
    local OccuranceStartPos = string.find(String, LookFor, 1, true)
    if not OccuranceStartPos then return String end
   
    if OccuranceStartPos > 1 then
        NewString = NewString..string.sub(String, 1, OccuranceStartPos - 1)
    end
   
    local OccuranceEndPos
    while OccuranceStartPos do
        OccuranceEndPos = OccuranceStartPos + (string.len(LookFor) - 1)
        NewString = NewString..ReplaceWith
        OccuranceStartPos = string.find(String, LookFor, OccuranceEndPos + 1, true)
        if (OccuranceStartPos or 0) - 1 > OccuranceEndPos then
            NewString = NewString..string.sub(String, OccuranceEndPos + 1, OccuranceStartPos - 1)
        end
    end
   
    if OccuranceEndPos < string.len(String) then
        NewString = NewString..string.sub(String, OccuranceEndPos + 1)
    end
   
    return NewString
end

function getTableString(Table)
    local String, IntKey, Element = {}, (isTableIntKey(Table)) and true or false
    table.insert(String, '{')
    for i,v in _G[((IntKey) and 'i' or '')..'pairs'](Table) do
        Element = { i, v }
        for j,w in ipairs(Element) do
            if j == 1 then table.insert(String, ((#String > 1) and ',' or '')..((IntKey) and '' or '[')) end
           
            if not IntKey or j == 2 then
                Type = type(w)
                if Type == 'number' then table.insert(String, w)
                elseif Type == 'boolean' then table.insert(String, ((w) and 'true' or 'false'))
                elseif Type == 'string' then table.insert(String, [[']]..replace(replace(w, [[]], [[\]]), [[']], [[']])..[[']])
                elseif Type == 'table' then table.insert(String, getTableString(w))
                elseif Type == 'function' then table.insert(String, 'function')
                elseif Type == 'userdata' then table.insert(String, 'userdata: '..tostring(w))
                elseif Type == 'nil' then table.insert(String, 'nil')
                else table.insert(String, 'unknown data type')
                end
            end
           
            if j == 1 then table.insert(String, ((IntKey) and '' or ']=')) end
        end
    end
    table.insert(String, '}')
    return table.concat(String)
end

function isTableIntKey(Table)
    local b = 0
    for i,v in pairs(Table) do b = b + 1 end
    for a=1, b do
        if Table[a] == nil then return false end
    end
    return true
end
#16
Testers / Changelog
April 07, 2018, 10:36:00 AM
Next Client Version: 1.0.71

Next Server Version: 1.0.19



------------------------------------------------------------------



Jack



Added support for squirrel callbacks

Added support for   via addEventHandler

Added clipboard support. Can now paste (CTRL+V) in chatbox.

Added support for foreign characters in chat.



------------------------------------------------------------------



Lucas



------------------------------------------------------------------



Mex



Fixed ped.walkTo and ped.runTo for Vice City

Fixed vehicle exit sync

Numpad enter key now submits chatbox message too

Improved Vehicle sync for passengers

Fixed crash for chatbox messages when not connected

Added /q to match /quit

Added chatbox message history for 128 items

Added server side property server.name

Added server side property server.gameMode

Added server side property server.port

Added server side property server.maxClients

Added server side property client.ip

Added server side property client.ping

Added server side method client.disconnect()

Doubled max chat message length from 64 to 128

Chat input history preserved on disconnect

Made /reconnect also reconnect to last used server if not connected to a server

Added server-side setting duplicatenames defaulting to true to allow same player name in server

Added client-side ped.seat getter/setter

Added client-side ped.pedType getter

Added client-side ped.setWanderPath(int)

Added client-side ped.isEnteringVehicle getter

Added client-side ped.isExitingVehicle getter

Added client-side ped.getObjective()

Added client-side ped.setObjective(int,[float,float,float])

Added client-side ped.removeBodyPart(int)

Added client-side vehicle.baseType getter

Added client-side vehicle.subType getter

Added client-side vehicle.colour1 getter/setter

Added client-side vehicle.colour2 getter/setter

Added client-side vehicle.colour3 getter/setter

Added client-side vehicle.colour4 getter/setter

Added client-side vehicle.getOccupant(int seat)

Added client-side ped.fuckU()

Added client-side ped.resurrect()

Added client-side ped.animGroup getter/setter

Added client-side game.loadDFF(int model, str path)

Added client-side game.loadTXD(str slotName, str path)

Added client-side game.getRubbishTexture(int slot)

Added client-side game.setRubbishTexture(int slot, str texture)

Added server-side entity.rotation getter/setter

Added server-side ped.isInVehicle getter

Added server-side ped.vehicle getter

Added server-side ped.warpIntoVehicle(vehicle, int seat)

Added server-side ped.enterVehicle(vehicle, driver)

Added server-side ped.exitVehicle()

Added server-side ped.health getter/setter

Added server-side ped.weapon getter/setter

Added server-side player.spawn(pos, model, [ interior ])

Added server-side blp.setMarkerEnabled(bool)

Added server-side blip.setColour(int)

Added server-side blip.setSize(int)

Added server-side pickup.setType(int)

Added server-side game.createCivilian(int model, int game)

Added server-side game.createPlayer(int model, int game)

Added server-side game.createObject(int model, int game)

Added server-side game.createBuilding(int model, int game)

Added server-side game.createPickup(int model, int game)

Added server-side game.createBlip(int icon/colour, int game)

Added client-side connect(host,port,pass)

Added client-side disconnect()

Temp fix for heli rotors sync

Added server-side SERVER_VERSION (excluding in JS for now as having difficulties coding that)

Added client-side CLIENT_VERSION (excluding in JS for now as having difficulties coding that)