17.07.2011, 08:35
Код:
CMD:goto(playerid, params[]) { if(!strlen(params)) return SendClientMessage(playerid, LIGHTBLUE2, "Usage: /vgoto [VehicleID]") SendClientMessage(playerid, orange, "Function: Will Go to specified vehicle"); new player1; new string[128]; player1 = strval(params); SendCommandToAdmins(playerid,"VGoto"); new Float:x, Float:y, Float:z; GetVehiclePos(player1,x,y,z); SetPlayerVirtualWorld(playerid,GetVehicleVirtualWorld(player1)); if(GetPlayerState(playerid) == 2) { SetVehiclePos(GetPlayerVehicleID(playerid),x+3,y,z); SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), GetVehicleVirtualWorld(player1)); } else { SetPlayerPos(playerid,x+2,y,z); format(string,sizeof(string),"|- You have teleported to Vehicle ID: %d -|", player1); return SendClientMessage(playerid,BlueMsg,string); } return 1; }