01.01.2010, 02:27
Using sscanf (https://sampwiki.blast.hk/wiki/Sscanf_code):
pawn Код:
dcmd_setadmin(playerid,params[])
{
new string[128], id, level;
if(sscanf(params, "ud", id, level))
{
SendClientMessage(playerid, COLOR_RED, "Uso /setadmin [ID] [LIVELLO]");
}
else
{
if(PlayerInfo[playerid][admin]>= 8 || IsPlayerAdmin(playerid))
{
if(IsPlayerConnected(id))
{
Player[playerid][admin] = level;
format(astring,sizeof(astring),"[ADMIN]: L'Admin %s ha settato %s livello %d.",Nome(playerid),Nome(id),livello);
SendClientMessageToAll(COLORE_MESSAGGI,astring);
}
else
{
SendClientMessage(playerid, COLOR_RED, "Giocatore non connesso.");
}
}
}
return 1;
}