10.05.2012, 13:37
Hi, i make a function to verify if a player is Admin or V.I.P to use respective command.
Here is the code:
Ok ... and i use:
If i have V.I.P level 4 and Admin level 4 or highest, the command will execute, but if i have Admin level 10, and V.I.P level 0, the command don't execute, and gave me: "ERROR You need to be ..."
What is the problem?
Here is the code:
Код:
#define VACheck(%0,%1,%2)\ do{\ if(PlayerInfo[(%0)][pVip] < (%1) || PlayerInfo[(%0)][Level] < (%2)){\ new Str[128];\ format(Str, 128, "~r~~h~ERROR!~n~~w~You need to be V.I.P level ~y~~h~%d ~w~ or admin level ~y~~h~%d ~w~to use this command!", (%1), (%2));\ return GameTextForPlayer((%0), Str, 3000, 4);\ }\ }\ while(False)
Код:
CMD:god( playerid, params[ ] ) { VACheck( playerid, 4, 4 ); SendClientMessage( playerid, 0xFFFFF, "Testing" ); return 1; }
What is the problem?