Posts: 785
Threads: 22
Joined: Jun 2007
Reputation:
0
Why don't you store the users variables into an array when he logs in?
That's so much easier.
Posts: 1,047
Threads: 23
Joined: Jun 2009
pawn Код:
new variable[MAX_PLAYERS];
//on connect
if (dini_Exists(udb_encode(PlayerName(playerid)))) {// i suppose u have the playername func...
new tmp[256];
tmp = dini_Get(udb_encode(PlayerName(playerid)), "level");
variable[playerid] = strval(tmp);
}
//in a command
if(level[playerid] < /*mininal level*/1)...
also i think the lvl is saved in onplayerdisconnect? :P
have fun
Posts: 1,047
Threads: 23
Joined: Jun 2009
if(logged[playerid] == 0)return SendClientMessage(playerid,color,"You Must first login!");
ex
pawn Код:
if(strcmp(cmdtext, "/ad", true)==0)
{
if(logged[playerid] == 0)return SendClientMessage(playerid,color,"You Must first login!");
if(level[playerid] < 1)return SendClientMessage(playerid, COLOR_RED, "You are an admin!, You are not authorized to use this command!");
//here what you cmd will do
return 1;
}