SA-MP Forums Archive
[Pedido]Comano /goto - 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: [Pedido]Comano /goto (/showthread.php?tid=297369)



[Pedido]Comano /goto - viniciusmcf - 15.11.2011

eu queria um comando para que os players digitem /goto id da pessoa e o player q digitou vai ser teleportado para a pessoa com o id q ela digitou. obs: ja procurei no search so achei comando goto de admin


Re: [Pedido]Comano /goto - [KoS]Izaac - 15.11.2011

Coloca no OnPlayer command text:

pawn Код:
if(strcmp(cmd, "/ir", true) == 0 || strcmp(cmd, "/goto", true) == 0)
   {
            new tmp[128];
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USO: /ir(goto) [playerid]");
                return 1;
            }
            new Float:plocx,Float:plocy,Float:plocz;
            new plo;
            plo = ReturnUser(tmp);
            if (IsPlayerConnected(plo))
            {
            GetPlayerPos(plo, plocx, plocy, plocz);
            SetPlayerPos(playerid,plocx,plocy+2, plocz);
            }
        else
        {
        SendClientMessage(playerid, COLOR_GRAD2, "Jogador nao conectado");
        }
        return 1;
    }
Fiz esse cmd do 0 se tiver algo errado me avisa ae


Re: [Pedido]Comano /goto - viniciusmcf - 15.11.2011

C:\Users\Vinicius\Desktop\srv gta\filterscripts\Salvar.pwn(60) : warning 217: loose indentation
C:\Users\Vinicius\Desktop\srv gta\filterscripts\Salvar.pwn(60) : error 029: invalid expression, assumed zero
C:\Users\Vinicius\Desktop\srv gta\filterscripts\Salvar.pwn(60) : warning 215: expression has no effect
C:\Users\Vinicius\Desktop\srv gta\filterscripts\Salvar.pwn(60) : warning 215: expression has no effect
C:\Users\Vinicius\Desktop\srv gta\filterscripts\Salvar.pwn(60) : error 001: expected token: ";", but found ")"
C:\Users\Vinicius\Desktop\srv gta\filterscripts\Salvar.pwn(60) : error 029: invalid expression, assumed zero
C:\Users\Vinicius\Desktop\srv gta\filterscripts\Salvar.pwn(60) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 C:\Users\Vinicius\Desktop\srv gta\filterscripts\Salvar.pwn(60) : warning 217: loose indentation
C:\Users\Vinicius\Desktop\srv gta\filterscripts\Salvar.pwn(60) : error 029: invalid expression, assumed zero
C:\Users\Vinicius\Desktop\srv gta\filterscripts\Salvar.pwn(60) : warning 215: expression has no effect
C:\Users\Vinicius\Desktop\srv gta\filterscripts\Salvar.pwn(60) : warning 215: expression has no effect
C:\Users\Vinicius\Desktop\srv gta\filterscripts\Salvar.pwn(60) : error 001: expected token: ";", but found ")"
C:\Users\Vinicius\Desktop\srv gta\filterscripts\Salvar.pwn(60) : error 029: invalid expression, assumed zero
C:\Users\Vinicius\Desktop\srv gta\filterscripts\Salvar.pwn(60) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.


ta dando isso


Re: [Pedido]Comano /goto - [KoS]Izaac - 15.11.2011

Manda a linha 60


Re: [Pedido]Comano /goto - viniciusmcf - 15.11.2011

if(strcmp(cmd, "/ir", true) == 0 || strcmp(cmd, "/goto", true) == 0) <linha 60


Re: [Pedido]Comano /goto - [KoS]Izaac - 16.11.2011

Voce usa zcmd ou algum outro?

Ou so strcmp msm?

Troque a linha

pawn Код:
if(strcmp(cmd, "/ir", true) == 0 || strcmp(cmd, "/goto", true) == 0)
por:

pawn Код:
if(strcmp(cmd, "/goto", true) == 0)
Se continuar coloque o strtok
final do gm coloqe:
pawn Код:
strtok(const string[], &index)
{
        new length = strlen(string);
        while ((index < length) && (string[index] <= ' '))
        {
                index++;
        }
 
        new offset = index;
        new result[20];
        while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
        {
                result[index - offset] = string[index];
                index++;
        }
        result[index - offset] = EOS;
        return result;
}



Re: [Pedido]Comano /goto - viniciusmcf - 16.11.2011

so strcmp


Re: [Pedido]Comano /goto - viniciusmcf - 16.11.2011

olha amigo naum resolveu so deu mais erros



C:\Users\Vinicius\Desktop\srv gta\filterscripts\Salvar.pwn(16) : error 079: inconsistent return types (array & non-array)
C:\Users\Vinicius\Desktop\srv gta\filterscripts\Salvar.pwn(43) : error 079: inconsistent return types (array & non-array)
C:\Users\Vinicius\Desktop\srv gta\filterscripts\Salvar.pwn(50) : error 079: inconsistent return types (array & non-array)
C:\Users\Vinicius\Desktop\srv gta\filterscripts\Salvar.pwn(56) : error 079: inconsistent return types (array & non-array)
C:\Users\Vinicius\Desktop\srv gta\filterscripts\Salvar.pwn(60) : warning 217: loose indentation
C:\Users\Vinicius\Desktop\srv gta\filterscripts\Salvar.pwn(60) : error 029: invalid expression, assumed zero
C:\Users\Vinicius\Desktop\srv gta\filterscripts\Salvar.pwn(60) : warning 215: expression has no effect
C:\Users\Vinicius\Desktop\srv gta\filterscripts\Salvar.pwn(60) : warning 215: expression has no effect
C:\Users\Vinicius\Desktop\srv gta\filterscripts\Salvar.pwn(60) : error 001: expected token: ";", but found ")"
C:\Users\Vinicius\Desktop\srv gta\filterscripts\Salvar.pwn(60) : error 029: invalid expression, assumed zero
C:\Users\Vinicius\Desktop\srv gta\filterscripts\Salvar.pwn(60) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


8 Errors.