16.11.2018, 16:17
I don't know.. but it might work _:_ give it a try tho
PS: sry for using English :P
PHP Code:
CMD:goto(playerid, params[])
{
new idPlayer;
new Float:xPlayer, Float:yPlayer, Float:zPlayer;
new StringMen[64];
new playername[MAX_PLAYER_NAME];
new targetname[MAX_PLAYER_NAME];
GetPlayerName(idPlayer,targetname,sizeof(targetname));
GetPlayerName(playerid,playername,sizeof(playername));
if(Info[playerid][Admin] >= 1)
{
if(sscanf(params,"u",idPlayer)) return SendClientMessage(playerid,-1, "/goto [ID]");
if(!IsPlayerConnected(idPlayer)) return SendClientMessage(playerid, -1, "The ID is wrong or the player isn't online!");
if(IsPlayerInAnyVehicle(playerid))
{
new vehicle = GetPlayerVehicleID(playerid);
new seat = GetPlayerVehicleSeat(playerid);
GetPlayerPos(idPlayer, xPlayer, yPlayer, zPlayer);
SetPlayerPos(playerid, xPlayer, yPlayer+2, zPlayer);
SetVehiclePos(vehicle, xPlayer, yPlayer+2, zPlayer);
PutPlayerInVehicle(playerid, vehicle, seat);
}
else
{
GetPlayerPos(idPlayer, xPlayer, yPlayer, zPlayer);
SetPlayerPos(playerid, xPlayer+1, yPlayer+1, zPlayer);
format(StringMen, sizeof StringMen, "[GOTO] %s teleported to %s", playername, targetname);
SendClientMessage(playerid, -1, StringMen);
}
}
else return SendClientMessage(playerid, -1, "You're not allowed to use this command!");
return 1;
}