06.03.2011, 16:06
Like PVars just for Vehicles.
Set
SetVVarInt(vehicleid,"VarName",Value);
SetVVarFloat(vehicleid,"VarName",Float:Value);
SetVVarString(vehicleid,"VarName",Text[]);
Get
GetVVarInt(vehicleid,"VarName");
GetVVarFloat(vehicleid,"Varname");
GetVVarString(vehicleid,"VarName");
Specials
DeleteVVar(vehicleid,"VarName");
SetVVar(Int/Float/String):
Sets the vehicles var "VarName" to the value. If success: returns the ID of the slot where the value is saved. If fail (e.g. not enough slots avaible): returns -1.
GetVVar(Int/Float/String):
Gets the vehicles var "VarName". If success: returns the saved value. If fail (e.g. no var is named "VarName": returns 0 like the PVars.
DeleteVVar
Resets Integer, Float and String from vehicles var "VarName" to 0.
Pastebin: http://pastebin.com/3TFv5E4L
Notes:
- #define MAX_VARS defines the number of slots per vehicle. More slots more the time to compile and more ressources needed. Keep it as low a possible
- Theoretically but not practically tested. Should work anyhow
- Bugs are not known yet
Set
SetVVarInt(vehicleid,"VarName",Value);
SetVVarFloat(vehicleid,"VarName",Float:Value);
SetVVarString(vehicleid,"VarName",Text[]);
Get
GetVVarInt(vehicleid,"VarName");
GetVVarFloat(vehicleid,"Varname");
GetVVarString(vehicleid,"VarName");
Specials
DeleteVVar(vehicleid,"VarName");
SetVVar(Int/Float/String):
Sets the vehicles var "VarName" to the value. If success: returns the ID of the slot where the value is saved. If fail (e.g. not enough slots avaible): returns -1.
GetVVar(Int/Float/String):
Gets the vehicles var "VarName". If success: returns the saved value. If fail (e.g. no var is named "VarName": returns 0 like the PVars.
DeleteVVar
Resets Integer, Float and String from vehicles var "VarName" to 0.
Pastebin: http://pastebin.com/3TFv5E4L
Notes:
- #define MAX_VARS defines the number of slots per vehicle. More slots more the time to compile and more ressources needed. Keep it as low a possible
- Theoretically but not practically tested. Should work anyhow
- Bugs are not known yet