command tp
#1

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

Get the facing angle and make the =/.
Reply
#3

how?
Reply
#4

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


Forum Jump:


Users browsing this thread: 1 Guest(s)