17.08.2011, 16:32
Can some1 plzz hel me with the "/goto" command i got this:
its working but when im in vehicle only player "teleport" can someone help me to get the vehicle to "teleport" if player is in vehicle.. Thank you! BTW!: no error's/warning's!
Code:
command(goto, playerid, params[]) { new ID; new vehicleid; if(sscanf(params, "u", ID)) SendClientMessage(playerid, COLOR_RED, "USAGE: /goto [id]"); else if(IsPlayerConnected(ID) == 0) SendClientMessage(playerid, COLOR_RED, "Player is not connected!"); else if(IsPlayerInVehicle(playerid, vehicleid)) { new Float:x, Float:y, Float:z; GetVehiclePos(vehicleid, x, y, z); SetVehiclePos(vehicleid, x+1, y+1, z); } else { new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); SetPlayerPos(playerid, x+1, y+1, z); } return 1; }