Dini error
#10

Try this command instead. Your command had a few problems with it.
pawn Код:
if(strcmp(cmd, "/giveadmin", true) == 0)
{
  new tmp[256], tmpp[256];
  if(IsPlayerAdmin(playerid) || level[playerid] >= 4)
  {
   tmp = strtok(cmdtext, idx);
   if(!strlen(tmp)) return SendClientMessage(playerid, color, "Usage: /giveadmin <id> <level (1-4)>");
   new targetid = strval(tmp); if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, color, "Invalid Player ID");
   tmpp = strtok(cmdtext, idx);
   if(!strlen(tmpp)) return SendClientMessage(playerid, color, "Usage: /giveadmin <id> <level (1-4)>");
   new admlevel = strval(tmpp);
   new str[128], name[24];
   GetPlayerName(playerid, name, sizeof name);
   format(str, sizeof str, "\\Users\\%s.ini", name);
   dini_IntSet(str, admlevel);
   return 1;
  }
  else return SendClientMessage(playerid, color, "You're not allowed to use this command!");
}
EDIT:

Sorry, just realized you are using dcmd. Also, I think your command problem is that you are making the "admlevel" variable carry the selected playerid amount. (which if you are testing by yourself, would always be zero).
Reply


Messages In This Thread
Dini error - by teddyman - 04.12.2009, 19:52
Re: Dini error - by Zamaroht - 04.12.2009, 19:57
Re: Dini error - by teddyman - 04.12.2009, 20:04
Re: Dini error - by Zamaroht - 04.12.2009, 22:21
Re: Dini error - by teddyman - 05.12.2009, 20:57
Re: Dini error - by Grim_ - 05.12.2009, 21:12
Re: Dini error - by teddyman - 05.12.2009, 21:24
Re: Dini error - by Grim_ - 05.12.2009, 21:25
Re: Dini error - by teddyman - 05.12.2009, 21:29
Re: Dini error - by Grim_ - 05.12.2009, 21:39

Forum Jump:


Users browsing this thread: 1 Guest(s)