17.03.2014, 19:42
This command teleports me to the wrong vehicle ID. I typed vehicleid 9 and it set me to vehicle id 2.
I made this myself, very confused!
I made this myself, very confused!
pawn Код:
CMD:tptov(playerid, params[])
{
if(LoggedIn[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You must be logged in to use this command.");
new id;
if(AdminLevel[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You are not authorized to use this command.");
if(sscanf(params, "d", id)) return SendClientMessage(playerid, COLOUR_GREY, "Usage: /tptov [vehicleid]");
if(id == INVALID_VEHICLE_ID) return SendClientMessage(playerid, COLOUR_GREY, "That vehicle does not exist.");
new Float:x, Float: y, Float: z;
GetVehiclePos(id, x, y, z);
SetPlayerInterior(playerid, GetVehicleVirtualWorld(id));
SetPlayerPos(playerid, x, y, z);
new string[128];
format(string, sizeof(string), "You have teleported to Vehicle ID: %d", id);
SendClientMessage(playerid, COLOUR_LIGHTBLUE, string);
return 1;
}