[Include] PVars defines
#1

Its not actually include, but very usefull defines.

Simplest way to use pvars.

1.
PHP код:
#define set.%0[%1]=%2; SetPVarInt(%1,#0,%2);
#define fset.%0[%1]=%2; SetPVarFloat(%1,#%0,%2);
#define get.%0[%1] GetPVarInt(%1,#%0)
#define fget.%0[%1] GetPVarFloat(%1,#%0)
#define del.%0[%1] DeletePVar(%1,#%0) 
usage:

Код:
set.money[playerid] = 500;
fset.health[playerid] = 1.234;
get.money[playerid];
fget.health[playerid];
del.money[playerid];
del.health[playerid];
2.
PHP код:
#define set.%0.%1=%2; SetPVarInt(%0,#%1,%2);
#define fset.%0.%1=%2; SetPVarFloat(%0,#%1,%2);
#define get(%0.%1) GetPVarInt(%0,#%1)
#define fget(%0.%1) GetPVarFloat(%0,#%1)
#define del.%0.%1; DeletePVar(%0,#%1); 
usage:

Код:
set.playerid.money = 500;
fset.playerid.health= 1.234;
get(playerid.money);
fget(playerid.health);
del.playerid.money;
del.playerid.health;
3.
PHP код:

#define set.%0.%1()=%2; SetPVarInt(%0,#%1,%2);
#define fset.%0.%1()=%2; SetPVarFloat(%0,#%1,%2);
#define get.%0.%1() GetPVarInt(%0,#%1)
#define fget.%0.%1() GetPVarFloat(%0,#%1)
#define del.%0.%1() DeletePVar(%0,#%1); 
usage:

Код:
set.playerid.money() = 500;
fset.playerid.health() = 1.234;
get.playerid.money();
fget.playerid.health();
del.playerid.money();
del.playerid.health();
Reply
#2

Nice.
Reply
#3

Quote:
Originally Posted by oOFotherOo
Посмотреть сообщение
Nice.
Reply
#4

Very nice
Reply
#5

This is more like a snippet script than an include.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)