[dudb] Check if variable is higher or lower
#7

Quote:
Originally Posted by gamer_Z
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
nice, it works, this is my command:

pawn Код:
if(strcmp(cmdtext, "/ad", true)==0)
  {
  if(level[playerid] < 1)
  {
  SendClientMessage(playerid, COLOR_RED, "You are an admin!");
  }
  else
  {
    SendClientMessage(playerid, COLOR_RED, "You are not authorized to use this command!");
  }
  return 1;
  }
But now, players can use an admins name, and not login and still use the command!

How do I check if
Код:
logged[playerid] = 1;
if it is 0, then you can't use the command, if it is 1 and your an admin, you can use the command.
Reply


Messages In This Thread
[dudb] Check if variable is higher or lower - by Memoryz - 25.08.2009, 22:29
Re: [dudb] Check if variable is higher or lower - by woot - 25.08.2009, 22:32
Re: [dudb] Check if variable is higher or lower - by Memoryz - 25.08.2009, 23:26
Re: [dudb] Check if variable is higher or lower - by GTA967 - 26.08.2009, 02:11
Re: [dudb] Check if variable is higher or lower - by Memoryz - 26.08.2009, 12:59
Re: [dudb] Check if variable is higher or lower - by Gamer_Z - 26.08.2009, 13:09
Re: [dudb] Check if variable is higher or lower - by Memoryz - 26.08.2009, 13:57
Re: [dudb] Check if variable is higher or lower - by Gamer_Z - 26.08.2009, 15:12

Forum Jump:


Users browsing this thread: 1 Guest(s)