25.07.2010, 06:45
Information
I've been a bit light on my shoulders lately and decided to release this GVar include (Global Variables). Similar to SA:MP's Player variable functions (Ex: SetPVarInt), these are used globally.
Functions
SetGVarString(varName[], value[])
varName - Variable storage name
value - A string value.
returns - The variable ID.
GetGVarString(varName[])
varName - Variable storage name
returns - The stored string.
SetGVarInt(varName[], value)
varName - Variable storage name
value - The value of the variable.
returns - The variable ID.
GetGVarInt(varName[])
varName - Variable storage name
returns - The value stored.
SetGVarFloat(varName[], Float:value)
varName - Variable storage name
value - The float value you wan't store.
returns - The variable ID
Float:GetGVarFloat(varName[])
varName - Variable storage name
returns - The value stored.
CountGVars()
returns - The amount of variables used.
Notes
\
Download
Click the banner (Pastebin)
I've been a bit light on my shoulders lately and decided to release this GVar include (Global Variables). Similar to SA:MP's Player variable functions (Ex: SetPVarInt), these are used globally.
Functions
SetGVarString(varName[], value[])
varName - Variable storage name
value - A string value.
returns - The variable ID.
Код:
Example - SetGVarString("Cookies", "Taste good");
varName - Variable storage name
returns - The stored string.
Код:
Example - printf("Cookies %s", GetGVarString("Cookies"));
varName - Variable storage name
value - The value of the variable.
returns - The variable ID.
Код:
Example - SetGVarInt("L33t", 1337);
varName - Variable storage name
returns - The value stored.
Код:
Example - printf("He's %i", GetGVarInt("L33t"));
varName - Variable storage name
value - The float value you wan't store.
returns - The variable ID
Код:
Example - new Float:pPos[3]; GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]); SetGVarFloat("X", pPos[0]); SetGVarFloat("Y", pPos[1]); SetGVarFloat("Z", pPos[2]);
varName - Variable storage name
returns - The value stored.
Код:
Example - printf("You're at %f|%f|%f", GetGVarFloat("X"), GetGVarFloat("Y"), GetGVarFloat("Z"));
returns - The amount of variables used.
Код:
Example - printf("We created %i GVars", CountGVars());
\
Download
Click the banner (Pastebin)