[Include] Global Variable || GVar.inc
#1


Hi. SetPVar my mind as I recently came to a variable recorder.
I've create this. And I share with you.
Usage;
SetGVarInt
What does it do?
With this you can save integer data.
Usage;
Код:
SetGVarInt("news",18,3);//'news' glabal variable name, 18 the number of variables, 3 the index of glabal variable
GetGVarInt
What does it do?
With this as we noted numeric integer that pulls data.
Usage;
Код:
SetGVarInt("news",18);
printf("%d",GetGVarInt("news"));//18
SetGVarFloat
What does it do?
With this float, decimal numbers, so you can save.
Usage;
Код:
SetGVarFloat("news2",18.77,8);//'news' glabal variable name, 18.77 the float of variables, 8 the index of glabal variable
GetGVarFloat
What does it do?
With this as we noted decimal numbers that float pulls data.
Usage;
Код:
SetGVarInt("news2",15.389);
printf("%f",GetGVarFloat("news"));//15.389
SetGVarString
What does it do?
Bununla string yani yazıyı kaydedebilirsiniz.
Usage;
Код:
SetGVarString("news2","string :D",8);//'news' glabal variable name, 'string :D' the string of variables, 8 the index of glabal variable
GetGVarString
What does it do?
The data we save it pulls you in writing.
Usage;
Код:
SetGVarString("news2","string :D");
new string[64];
GetGVarString("news2",string);
printf(string);//string :D
DeleteGVar
What does it do?
Deletes the data you have saved.
Usage;
Код:
SetGVarString("news2","string :D",57);
DeleteGVar("news2",57);
new string[64];
GetGVarString("news2",string,sizeof(string),57);
printf(string);//
IsSetGVar
What does it do?
If the specified name is recorded in the data gives a value of 1.
Usage;
Код:
SetGVarInt("news",7);
if(IsSetGVar("news"))printf("print");
And finally native list;
Код:
/* natives
native SetGVarInt(gname[],veri,id = 0);
native GetGVarInt(gname[],id = 0);
native SetGVarFloat(gname,Float:veri,id = 0);
native GetGVarFloat(gname[],id = 0);
native SetGVarString(gname[],veri[],id = 0);
native GetGVarString(gname[],str_return[],len,id = 0);
native DeleteGVar(gname[],id = 0);
native IsSetGVar(gname[],id = 0);
*/
Thanks for reading.
I am sorry because bad english.

Pastebin
Reply
#2

No really useful, unless your a PVar fanatic.
Reply
#3

This has already been done before, but this is still some decent work.

However, properties are slow - I would recommend using hash maps and y_master for more efficient data storage.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)