SA-MP Forums Archive
command tp - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: command tp (/showthread.php?tid=634841)



command tp - crukk11 - 27.05.2017

i have this command to make teleport

PHP код:
COMMAND:tp(playeridparams[])
{
    new 
Target;
    if(!
sscanf(params"i"Target))
    {
        if(
Target == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1"This player is not connected!");
        if(
IsPlayerInAnyVehicle(playerid))
        {
            new 
Float:pos[3];
            
GetVehiclePos(GetPlayerVehicleID(Target), pos[0], pos[1], pos[2]);
            
SetVehiclePos(GetPlayerVehicleID(playerid), pos[0], pos[1], pos[2]);
        } else {
            new 
Float:pos[3];
            
GetPlayerPos(Targetpos[0], pos[1], pos[2]); //<<< i want the player in front of playerid
            
SetPlayerPos(playeridpos[0], pos[1], pos[2]);//<<< same
        
}
    } else return 
SendClientMessage(playerid, -1"Usage: /goto [playerid]");
    return 
1;

i want change this command when playerid to teleport in front of player


Re: command tp - Wary - 27.05.2017

Get the facing angle and make the =/.


Re: command tp - asri - 27.05.2017

how?


Re: command tp - Wary - 27.05.2017

https://sampwiki.blast.hk/wiki/GetPlayerFacingAngle
Use
PHP код:
GetPlayerFacingAngle