SA-MP Forums Archive
/setlevel prob - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /setlevel prob (/showthread.php?tid=491816)



/setlevel prob - James Coral - 01.02.2014

My Code:

pawn Код:
CMD:setlevel(playerid, params[])
{
 new pID;
 if(pInfo[playerid][Adminlevel] >= 5)
 {
 if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_RED, "Player is not connected.");
 {
     new amount;
     if (sscanf(params, "ud", pID,amount)) return SendClientMessage(playerid, 0xFF0000AA, "Usage: /setlevel [id] [amount]");
     INI_WriteInt(file,"AdminLevel",pInfo[pID][Adminlevel]);
  }
    return 1;
  }
    return 1;
}
Its not working... -.-


Re: /setlevel prob - ScripteRMKD - 01.02.2014

PlayerInfo[pID][pAdmin] = amount;


Re: /setlevel prob - CuervO - 01.02.2014

You're never setting the player's level actual variable to save.

add

pawn Код:
pInfo[pID][AdminLevel] = amount;
after the sscanf check.


EDIT: Ninja'd. Sorry.


Re: /setlevel prob - James Coral - 01.02.2014

Quote:
Originally Posted by ScripteRMKD
Посмотреть сообщение
PlayerInfo[pID][pAdmin] = amount;
Thanks it works now +Rep for you