/makeadmin doesnt saves ? - 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: /makeadmin doesnt saves ? (
/showthread.php?tid=377508)
/makeadmin doesnt saves ? -
Benzke - 14.09.2012
Hello all,
pawn Код:
COMMAND:makeadmin(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
new id, lvl;
if(sscanf(params, "ui", id, lvl)) return SendClientMessage(playerid, COLOR_SYNTAX, "[SYNTAX]: /makeadmin [PlayerID/PartOfName] [Level]");
else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR]: Invalid ID");
else if(lvl > 5) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR]: Administrator level cannot be higher then 5!");
else
{
PlayerInfo[id][Adminlevel] = lvl;
}
return 1;
}
Basically this CMD doesnt saves my admin.. I'm using
Y_ini
In my scriptfiles >> users info.. It comes Adminlevel = 5
but Admin cmds doesnt work when I go IG.
AW: /makeadmin doesnt saves ? -
BiosMarcel - 14.09.2012
is PlayerInfo[id][Adminlevel] = lvl; a default function
the normal new variable;
won't be saved
Re: /makeadmin doesnt saves ? -
Benzke - 14.09.2012
What do you mean..
Re: /makeadmin doesnt saves ? -
clarencecuzz - 14.09.2012
First of all:
pawn Код:
COMMAND:makeadmin(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
new id, lvl;
if(sscanf(params, "ui", id, lvl)) return SendClientMessage(playerid, COLOR_SYNTAX, "[SYNTAX]: /makeadmin [PlayerID/PartOfName] [Level]");
if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR]: Invalid ID");
if(lvl > 5 || level < 0) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR]: Administrator level must be between 0 and 5!");
PlayerInfo[id][Adminlevel] = lvl;
return 1;
}
If you're using y_ini, you must use the 'INI_ParseFile' function. You can search for more information on it in the y_ini thread by ******.