[Include] VVars
#1

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
Reply


Messages In This Thread
VVars - by DexXTer - 06.03.2011, 16:06
Re: VVars - by Johnny_Xayc - 06.03.2011, 16:32
Re: VVars - by Ash. - 06.03.2011, 16:32
AW: VVars - by DexXTer - 06.03.2011, 16:36

Forum Jump:


Users browsing this thread: 1 Guest(s)