[GameMode] Pacote Iniciante v2.0
#31

Eu concordo que as pessoas precisam comeзar pelo bбsico, mas se vocк acha que strtok й o 'bбsico' se mata.

Vocк acha isso aqui o bбsico?
pawn Код:
//Cуdigo de quando eu comecei a programar
if(strcmp(cmd, "/kick", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /kick [ID/NOME] [MOTIVO]");
                return 1;
            }
            giveplayerid = ReturnUser(tmp);
            if(PlayerInfo[playerid][pAdmin] == 0)
            {
                SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo estб autorizado a usar esse comando");
            }
            if (PlayerInfo[playerid][pAdmin] >= 1 && PlayerInfo[playerid][aDuty] ==1)
            {
                if(IsPlayerConnected(giveplayerid))
                {
                    if(giveplayerid != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        new length = strlen(cmdtext);
                        while ((idx < length) && (cmdtext[idx] <= ' '))
                        {
                            idx++;
                        }
                        new offset = idx;
                        new result[64];
                        while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                        {
                            result[idx - offset] = cmdtext[idx];
                            idx++;
                        }
                        result[idx - offset] = EOS;
                        if(!strlen(result))
                        {
                            SendClientMessage(playerid, COLOR_GRAD2, "USE: /kick [ID/NOME] [motivo]");
                            return 1;
                        }
                        if(strcmp(result,"1", true) == 0) { result = "Nick imprуprio"; }
                        if(strcmp(result,"2", true) == 0) { result = "Anъncio Indevido"; }
                        if(strcmp(result,"3", true) == 0) { result = "Desliga o Cheater -.-'"; }
                        format(string, sizeof(string), "AdmCmd: %s foi kickado por %s. Motivo: %s", giveplayer, sendername, (result));
                        SendClientMessageToAll(COLOR_VIP, string);
                        new year, month,day;
                        getdate(year, month, day);
                        format(string, sizeof(string), "AdmCmd: %s foi kickado por %s, razгo: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year);
                        KickLog(string);
                        Kick(giveplayerid);
                        return 1;
                    }
                }
            }
            else
            {
                format(string, sizeof(string), "%s Nгo й um ID ativo", giveplayerid);
                SendClientMessage(playerid, COLOR_GRAD1, string);
            }
        }
        return 1;
    }

Compare com esse, feito em ZCMD

pawn Код:
CMD:kick(playerid, params[])
{
    if(PodeUsar(playerid, 1)) return 1;//Verifica o nнvel do admin e se ele estб em trabalho.
    if(sscanf(params,"ds[128]", sPlayer, corda[playerid]))//Se ele nгo preencher os parametros
        return SendClientMessage(playerid, cinza,"USE: /kick [playerid] [motivo]");//manda erro
    if(sPlayer == playerid)//Se o ID digitado for igual o ID do admin
        return SendClientMessage(playerid, cinza, "[ERRO] Vocк nгo pode se auto kickar, nгo й modos de admin!"), Kick(playerid);//manda erro e kicka o admin (afinal, ele iria se kickar xD)
    if(!IsPlayerConnected(sPlayer))//Se o jogador nгo estiver online
        return ERRO4//manda erro
    format(corda[sPlayer], 128, "%s(%d) foi kickado por %s(%d) por: %s", gNome(sPlayer), sPlayer, gNome(playerid), playerid, corda[playerid]);//Formata a mensagem
    SendClientMessageToAll(vermelho, corda[sPlayer]);//Envia a mensagem
    Kick(sPlayer);//Kicka o jogador
    SendDeathMessage(playerid, sPlayer, 201);//Manda um desenho na tela, legal sу para o admin :D
    return true;
}
EDIT: Vocк diz do seu mega tudo de como criar uma callback mas nгo mostra a diferenзa entre public e stock
Reply


Messages In This Thread
Pacote Iniciante v2.0 - by JonathanFeitosa - 16.08.2011, 20:31
Re: Pacote Iniciante v2.0 - by Y_Baby - 16.08.2011, 20:40
Re: Pacote Iniciante v2.0 - by Miqueias Barros - 16.08.2011, 20:40
Re: Pacote Iniciante v2.0 - by iPauliinLegendary - 16.08.2011, 20:56
Re: Pacote Iniciante v2.0 - by JonathanFeitosa - 16.08.2011, 21:09
Re: Pacote Iniciante v2.0 - by ViniBorn - 16.08.2011, 21:24
Re: Pacote Iniciante v2.0 - by JonathanFeitosa - 16.08.2011, 21:30
Re: Pacote Iniciante v2.0 - by histire - 16.08.2011, 21:52
Re: Pacote Iniciante v2.0 - by Miqueias Barros - 16.08.2011, 21:54
Re: Pacote Iniciante v2.0 - by JonathanFeitosa - 16.08.2011, 21:55
Re: Pacote Iniciante v2.0 - by histire - 16.08.2011, 22:00
Re: Pacote Iniciante v2.0 - by diretor7 - 16.08.2011, 22:00
Re: Pacote Iniciante v2.0 - by Bruno Pereira - 16.08.2011, 22:03
Re: Pacote Iniciante v2.0 - by JonathanFeitosa - 16.08.2011, 22:18
Re: Pacote Iniciante v2.0 - by Bruno Pereira - 16.08.2011, 22:40
Re: Pacote Iniciante v2.0 - by [S]trong - 16.08.2011, 22:43
Re: Pacote Iniciante v2.0 - by Link_ - 16.08.2011, 22:44
Re: Pacote Iniciante v2.0 - by steki. - 16.08.2011, 23:23
Re: Pacote Iniciante v2.0 - by Lipe_Stronda - 16.08.2011, 23:43
Re: Pacote Iniciante v2.0 - by [AF]Junior - 16.08.2011, 23:51
Re: Pacote Iniciante v2.0 - by BrunoBSF - 17.08.2011, 00:52
Re: Pacote Iniciante v2.0 - by Y_Baby - 17.08.2011, 00:53
Re: Pacote Iniciante v2.0 - by JonathanFeitosa - 17.08.2011, 10:34
Re: Pacote Iniciante v2.0 - by [GuN]Erick[M] - 17.08.2011, 14:30
Re: Pacote Iniciante v2.0 - by JonathanFeitosa - 17.08.2011, 17:50
Re: Pacote Iniciante v2.0 - by Kuddy - 17.08.2011, 18:03
Re: Pacote Iniciante v2.0 - by [GuN]Erick[M] - 17.08.2011, 18:33
Re: Pacote Iniciante v2.0 - by Juninho_Oakley - 17.08.2011, 18:35
Re: Pacote Iniciante v2.0 - by MiTToS - 17.08.2011, 18:36
Re: Pacote Iniciante v2.0 - by JonathanFeitosa - 17.08.2011, 18:43
Re: Pacote Iniciante v2.0 - by MiTToS - 17.08.2011, 18:46
Re: Pacote Iniciante v2.0 - by JonathanFeitosa - 17.08.2011, 18:49
Re: Pacote Iniciante v2.0 - by Samuka[GM] - 19.08.2011, 17:56
Re: Pacote Iniciante v2.0 - by JonathanFeitosa - 20.08.2011, 17:07
Re: Pacote Iniciante v2.0 - by boyz_xD - 20.08.2011, 23:43
Re: Pacote Iniciante v2.0 - by JonathanFeitosa - 21.08.2011, 21:22
Re: Pacote Iniciante v2.0 - by henrique22157 - 27.03.2018, 23:32

Forum Jump:


Users browsing this thread: 1 Guest(s)