Help dcmd /setadmin ID LEVEL
#3

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;
}
Reply


Messages In This Thread
Help dcmd /setadmin ID LEVEL - by ReVo_ - 31.12.2009, 16:41
Re: Help dcmd /setadmin ID LEVEL - by GATOSSSSSSS - 31.12.2009, 17:10
Re: Help dcmd /setadmin ID LEVEL - by Calon - 01.01.2010, 02:27

Forum Jump:


Users browsing this thread: 1 Guest(s)