[Ajuda] alquem converte esse comando tapa?
#3

pawn Код:
if(strcmp(cmd, "/tapa", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1,"[ERRO] Voce nao e admin ou nao tem level suficiente.");
new tmp[256];
tmp = strtok(cmdtext, idx);

if(strlen(tmp) == 0) return SendClientMessage(playerid, VERDE, "[SERVER] : /tapa [playerid]");
new nome[30],Gabi[200],giveplayer[MAX_PLAYERS],giveplayerid;
GetPlayerName(playerid,nome,sizeof(nome));
GetPlayerName(giveplayerid,giveplayer,sizeof(giveplayer));
format(Gabi,sizeof(Gabi),"[SERVER] : %s de uma tapa no player %s !",nome,giveplayer);
SendClientMessageToAll(ROXOCLARO,Gabi);
new Float:x,Float:y,Float:w;
GetPlayerPos(giveplayerid,x,y,w);
SetPlayerPos(giveplayerid,x,y,w+10);
return 1;
}

@Edit.

pawn Код:
if (strcmp(cmd, "/tapa", true) == 0) {
        if (IsPlayerConnected(playerid)) { // Player tem que ter passado pela CallBack OnPlayerConnect
            tmp = strtok(cmdtext, idx); // Definida acima
            if (!strlen(tmp)) { // Parametro 1, se nn tiver pelo menos 1 parametro apуs o comando, ele retorna isto
                SendClientMessage(playerid, CINZA, "USE: /tapa [id]");
                return true;
            }
            new iddocmd;
            new Float: x, // Coordenada X
            Float: y, // Coordenada y
            Float: z; // Coordenada z
            iddocmd = ReturnUser(tmp); // Id que recebeu o comando
            if (IsPlayerConnected(iddocmd)) { // Player que recebeu o cmd tem que ter passado pelo OnPlayerConnect
               if (iddocmd != INVALID_PLAYER_ID) { // Verifica se o Id й valido
                 GetPlayerName(iddocmd, giveplayer, sizeof(giveplayer)); // Pega o nome da pessoa que recebeu
                GetPlayerName(playerid, sendername, sizeof(sendername)); // da que usou
                new string[128]; // Armazena os dados abaixo
                format(string,sizeof(string),"%s deu um tapa em %s .", sendername, giveplayer);// sendername e giveplayer sгo os nomes pegados acima
                SendClientMessageToAll(-1,string); // Manda a msg formatada acima

               GetPlayerPos(iddocmd, x, y, z); // Pega a posiзгo de quem usou o cmd
               SetPlayerPos(iddocmd, x, y, z + 12); // Seta a posiзгo de quem usou o cmd e almenta o Z que й a altura em + 12
              }
            }
        }
        return true;
    }
Todos esses achei pesquisando .. :S
Reply


Messages In This Thread
alquem converte esse comando tapa? - by Weslly Stronda - 07.02.2013, 14:26
Re: alquem converte esse comando tapa? - by Weslly Stronda - 07.02.2013, 14:31
Re: alquem converte esse comando tapa? - by Nill.Oliveira - 07.02.2013, 14:33
Re: alquem converte esse comando tapa? - by Weslly Stronda - 07.02.2013, 14:40
Re: alquem converte esse comando tapa? - by smiiir - 07.02.2013, 14:42
Re: alquem converte esse comando tapa? - by Weslly Stronda - 07.02.2013, 14:46
Re: alquem converte esse comando tapa? - by Nill.Oliveira - 07.02.2013, 14:48
Re: alquem converte esse comando tapa? - by Weslly Stronda - 07.02.2013, 14:59
Re: alquem converte esse comando tapa? - by vitere - 07.02.2013, 15:08
Re: alquem converte esse comando tapa? - by Sky™ - 07.02.2013, 15:10

Forum Jump:


Users browsing this thread: 1 Guest(s)