[Pedido]Comano /goto
#1

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
Reply
#2

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
Reply
#3

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
Reply
#4

Manda a linha 60
Reply
#5

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

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;
}
Reply
#7

so strcmp
Reply
#8

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.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)