31.10.2009, 21:46
What is the problem you are having?
your sscanf statement formatting was incorrect got the givelvl. it should be "ii" not "iz", though i think this may not be your problem.
https://sampwiki.blast.hk/wiki/Fast_Commands#Data_types
your sscanf statement formatting was incorrect got the givelvl. it should be "ii" not "iz", though i think this may not be your problem.
https://sampwiki.blast.hk/wiki/Fast_Commands#Data_types
pawn Код:
dcmd_setadmin(playerid,params[])
{
if(AdminLvL[playerid] >= 5 || IsPlayerAdmin(playerid))
{
new giveplayerid, givelvl;
if(!sscanf(params,"ii", giveplayerid, givelvl))
{
if(!IsPlayerConnected(giveplayerid))
{
new Stringy[128];
format(Stringy, sizeof(Stringy), "ID (%d) Is not an active player", giveplayerid);
SendClientMessage(playerid, COLOR_RED, Stringy);
return 1;
}
new Stringy[128];
format(Stringy, sizeof(Stringy), "You gave ID(%d) LVL %d Admin", giveplayerid, givelvl);
SendClientMessage(playerid, COLOR_RED, Stringy);
format(Stringy, sizeof(Stringy), "You are now lvl %d Admin", givelvl);
SendClientMessage(giveplayerid, COLOR_RED, Stringy);
AdminLvL[giveplayerid] = givelvl;
return 1;
}
else SendClientMessage(playerid,COLOR_RED,"Usage: /setadmin [id] [lvl]");
}
else SendClientMessage(playerid,COLOR_RED,"You need to be admin level 5+ or RCON Admin to do that!");
}