27.05.2017, 08:34
i have this command to make teleport
i want change this command when playerid to teleport in front of player
PHP код:
COMMAND:tp(playerid, params[])
{
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(Target, pos[0], pos[1], pos[2]); //<<< i want the player in front of playerid
SetPlayerPos(playerid, pos[0], pos[1], pos[2]);//<<< same
}
} else return SendClientMessage(playerid, -1, "Usage: /goto [playerid]");
return 1;
}