31.12.2009, 16:41
Hello All,
I need to create a command /setadmin ID LEVEL
What I did:
The problem is that the id of the player and the level are the same ie I can not share with the ID LEVEL
Sorry for my English, I used a translator xD
I need to create a command /setadmin ID LEVEL
What I did:
pawn Код:
dcmd_setadmin(playerid,params[])
{
if(PlayerInfo[playerid][admin]>=8 || IsPlayerAdmin(playerid))
{
new id,livello;
id = strval(params);
if(!strlen(params)) return SendClientMessage(playerid, COLOR_RED, "Uso /setadmin [ID] [LIVELLO]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Giocatore non connesso.");
livello = strval(params);
format(astring,sizeof(astring),"[ADMIN]: L'Admin %s ha settato %s livello %d.",Nome(playerid),Nome(id),livello);
SendClientMessageToAll(COLORE_MESSAGGI,astring);
PlayerInfo[id][admin]=livello;
} else { SendClientMessage(playerid, COLOR_RED, "Devi essere minimo admin livello 8 per usare questo comando!"); }
return 1;
}
Sorry for my English, I used a translator xD