[AJUDA] /daradmin
#7

Код:
new cmd[256], idx;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/daradmin", true) == 0)
{
       new string[128];
       new tmp[256];
       new player[MAX_PLAYER_NAME], giveplayer[MAX_PLAYER_NAME];
       new giveplayerid;
       if (IsPlayerAdmin(playerid))
       {
               tmp = strtok(cmdtext, idx);
               if(!strlen(tmp))
               {
                       SendClientMessage(playerid, ORANGE, "USO: /daradmin [playerid] [level]");
                       SendClientMessage(playerid, ORANGE, "FUNЗГO: o jogador serб um admin");
                       return 1;
               }
               giveplayerid = ReturnUser(tmp);
               tmp = strtok(cmdtext, idx);
               new level = strval(tmp);
               if(giveplayerid != INVALID_PLAYER_ID)
               {
                       GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                       GetPlayerName(playerid, player, sizeof(player));
                       PlayerInfo[giveplayerid][AdminLevel] = level;
                       printf("Admin %s made %s a level %d admin.", player, giveplayer, level);
                       format(string, sizeof(string), "Agora vocк й um administrador level %d obrigado para %s.", level,  player);
                       SendClientMessage(giveplayerid, 0x00C2ECFF, string);
                       format(string, sizeof(string), "Vocк deu o %s level %d admin.",  giveplayer,PlayerInfo[giveplayerid][AdminLevel]);
                               SendClientMessage(playerid, 0x00C2ECFF, string);
               }
               else if(giveplayerid == INVALID_PLAYER_ID)
               {
                       format(string, sizeof(string), "%i nгo й um jogador ativo.", giveplayerid);
                       SendClientMessage(playerid, 0xE60000FF, string);
               }
       }
       else
       {
           SendClientMessage(playerid, 0xE60000FF, "Vocк nгo tem poderes!");
       }
       return 1;
}
Cуdigo retirado da samp wiki.
Reply


Messages In This Thread
[AJUDA] /daradmin - by mengueh - 10.05.2012, 15:43
Re: [AJUDA] /daradmin - by [NWD]Jim._.Carrey - 10.05.2012, 15:50
Re: [AJUDA] /daradmin - by zbt - 10.05.2012, 15:51
Re: [AJUDA] /daradmin - by Dolby - 10.05.2012, 15:51
Re: [AJUDA] /daradmin - by rjjj - 10.05.2012, 15:52
Re: [AJUDA] /daradmin - by mengueh - 10.05.2012, 15:52
Re: [AJUDA] /daradmin - by leonardo1434 - 10.05.2012, 15:54
Re: [AJUDA] /daradmin - by mengueh - 10.05.2012, 15:55
Re: [AJUDA] /daradmin - by [NWD]Jim._.Carrey - 10.05.2012, 16:00

Forum Jump:


Users browsing this thread: 5 Guest(s)