[Ajuda] Sistema de Teleport
#1

como faзo um sistema de teleport ex: /tp [id] soq o outro player tem q avaliar se deixa ou nao alguem me da uma forзa ae
Reply
#2

Fiz estб pequena base, aproveite
PHP код:
new bool:Liberado[MAX_PLAYERS];
new 
Player_Ir[MAX_PLAYERS];
CMD:tp(playerid,params[])
{
    if(!
Liberado[playerid])
    {
        new 
Str[50];
        
format(Str,sizeof(Str),"O jogador %s deseja vim atй vocк, aceita ? /sim ou /nao",PlayerName(playerid));
        
SendClientMessage(strlen(params),-1,Str);
        
SendClientMessage(playerid,-1,"Um pedido de confirmaзгo foi enviado");
        
Player_Ir[strlen(params)] = playerid;
        return 
1;
    }
    
Liberado[playerid] = 0;
    new 
Float:Pos[3];
    
GetPlayerPos(strlen(params),Pos[0],Pos[1],Pos[2]);
    
SetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
    return 
1;
}
CMD:sim(playerid)
{
    
Liberado[Player_Ir[playerid]] = true;
    
SendClientMessage(Player_Ir[playerid],-1,"Vocк foi liberado a ir atй o jogador desejado");
    return 
1;
}
CMD:nao(playerid)
{
    
SendClientMessage(Player_Ir[playerid],-1,"Vocк nгo foi liberado a ir atй o jogador desejado");
    return 
1;

Funзгo PlayerName:
pawn Код:
PlayerName(id)
{
    static name[24];
    GetPlayerName(id, name, sizeof(name));
    return name;
}
Reply
#3

esta funcao player name coloco aonde ?
Reply
#4

Eu suponho que seu gamemode jб possua uma funзгo de pegar o nome do player,mas vocк pode colocar estб funзгo em qualquer lugar,fora de callbacks e outras funзхes.
Reply
#5

esta dando este erro
C:\Users\pc\Desktop\UP GM\BdT.pwn(1917) : error 017: undefined symbol "tp"
C:\Users\pc\Desktop\UP GM\BdT.pwn(1922) : error 017: undefined symbol "PlayerName"
C:\Users\pc\Desktop\UP GM\BdT.pwn(1923) : error 017: undefined symbol "params"
C:\Users\pc\Desktop\UP GM\BdT.pwn(1925) : error 017: undefined symbol "params"
C:\Users\pc\Desktop\UP GM\BdT.pwn(192 : warning 213: tag mismatch
C:\Users\pc\Desktop\UP GM\BdT.pwn(1930) : error 017: undefined symbol "params"
C:\Users\pc\Desktop\UP GM\BdT.pwn(1935) : warning 225: unreachable code
C:\Users\pc\Desktop\UP GM\BdT.pwn(1935) : error 017: undefined symbol "sim"
C:\Users\pc\Desktop\UP GM\BdT.pwn(1942) : warning 225: unreachable code
C:\Users\pc\Desktop\UP GM\BdT.pwn(1942) : error 017: undefined symbol "nao"
C:\Users\pc\Desktop\UP GM\BdT.pwn(1949) : warning 225: unreachable code
C:\Users\pc\Desktop\UP GM\BdT.pwn(1917) : warning 203: symbol is never used: "CMD"
C:\Users\pc\Desktop\UP GM\BdT.pwn(7309) : error 025: function heading differs from prototype
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
Reply
#6

@edit
Reply
#7

Falta incude zcmd e a Funзгo coloca no final do seu GM
Reply
#8

ja diminuiu os erros

C:\Users\pc\Desktop\UP GM\BdT.pwn(1919) : error 029: invalid expression, assumed zero
C:\Users\pc\Desktop\UP GM\BdT.pwn(1919) : error 017: undefined symbol "cmd_"
C:\Users\pc\Desktop\UP GM\BdT.pwn(1919) : error 029: invalid expression, assumed zero
C:\Users\pc\Desktop\UP GM\BdT.pwn(1919) : fatal error 107: too many error messages on one line

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


4 Errors.
Reply
#9

Quote:
Originally Posted by FerrariL
Посмотреть сообщение
@edit
qual codigo q faltava?
Reply
#10

Quote:
Originally Posted by Shuffle013
Посмотреть сообщение
qual codigo q faltava?
Nenhum, eu achei que nгo tinha declarado a variбvel.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)