SA-MP Forums Archive
[ajuda] COMANDO DE SETPLAYERHELT - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [ajuda] COMANDO DE SETPLAYERHELT (/showthread.php?tid=249287)



[ajuda] COMANDO DE SETPLAYERHELT - JOKERBOY - 18.04.2011

pawn Код:
{
    if(!strcmp("/vida", cmdtext, true))
    {
    if(gTeam[playerid] == ENFERMEIRO)
    {
        SetPlayerHealth(playerid, 100);
        return 1;
    }
 }
Como fasso para isso ficar assim /vida [id] ??


Re: [ajuda] COMANDO DE SETPLAYERHELT - Josma_cmd - 18.04.2011

pawn Код:
if(strcmp(cmd, "/vida", true) == 0)
    {
    if(gTeam[playerid] == ENFERMEIRO)
    {
    new tmp[20], giveplayerid;
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) return SendClientMessage(playerid, Branco, "Uso correto: /Vida [id]");
    giveplayerid = strval(tmp);
    if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, Branco, "Este jogador nгo estб online");
    SetPlayerHealth(giveplayerid, 100);
    }
    else SendClientMessage(playerid, Branco, "Vocк nгo й um enfermeiro");
    return 1;
    }
Vocк tem que comeзar aprender usar strtok JOKERBOY


Re: [ajuda] COMANDO DE SETPLAYERHELT - JOKERBOY - 18.04.2011

C:\Users\GABRIEL\Desktop\samp03csvr_R2-2_win32\gamemodes\JokerBoy.pwn(306) : error 017: undefined symbol "cmd"
C:\Users\GABRIEL\Desktop\samp03csvr_R2-2_win32\gamemodes\JokerBoy.pwn(311) : error 017: undefined symbol "idx"

---
ESTOU APRENDENDO : )


Re: [ajuda] COMANDO DE SETPLAYERHELT - Falcon. - 18.04.2011

Olб JOKERBOY.

Acrescente isto no comeзo de seu OnPlayerCommandText:

pawn Код:
new cmd[256];
new idx;
Atenciosamente,
Falcon.


Re: [ajuda] COMANDO DE SETPLAYERHELT - JOKERBOY - 18.04.2011

THX !!


Re: [ajuda] COMANDO DE SETPLAYERHELT - JOKERBOY - 18.04.2011

Nгo estб pegando isso...


Re: [ajuda] COMANDO DE SETPLAYERHELT - Josma_cmd - 18.04.2011

Gabriel eu jб coloquei o necessбrio pra usar strtok no seu GM, vocк tirou?
bom, to no msn me procura lб;


Re: [ajuda] COMANDO DE SETPLAYERHELT - JOKERBOY - 18.04.2011

Tranquilo , eu ja consegui...