17.07.2011, 01:19
Every car have ID.
This is the simple code:
This is the simple code:
pawn Код:
CMD:goto(playerid,params[])
{
new toplayerid;
if(sscanf(params,"r ",toplayerid)) return SendClientMessage(playerid,SYellow,"Usage: /goto <playerid/name> ~To teleport to certain player.");
else
{
new Float:Pos[3];
GetPlayerPos(toplayerid,Pos[0],Pos[1],Pos[2]);
if(IsPlayerInAnyVehicle(playerid))
{
new vid = GetPlayerVehicleID(playerid);
SetVehiclePos(vid,Pos[0],Pos[1],Pos[2]);
PutPlayerInVehicle(playerid,vid);
}
else SetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
}
return 1;
}