Interior Vehicles & Players - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Interior Vehicles & Players (
/showthread.php?tid=271633)
Interior Vehicles & Players -
NRJ53 - 25.07.2011
Hi,
I want to get the InteriorID of the Vehicle and set it for the player. This is because of a command
pawn Код:
CMD:vgoto(playerid, params[]) {
if(player[playerid][pAdminLevel] < 3) return 0;
new id,
Float:vehPos[3];
if(sscanf(params, "d", id)) return SendClientMessage(playerid, COLOR_WHITE, "SYNTAX: /vgoto [vehicleID]");
if(id == INVALID_VEHICLE_ID) return SendClientMessage(playerid, COLOR_GREY, "Invalid vehicle ID!");
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "Your already in a vehicle, Leave the vehicle first!");
if(HasVehicleGotDriver(id)) return SendClientMessage(playerid, COLOR_RED, "Someone is already in a that vehicle!");
GetVehiclePos(id, vehPos[0], vehPos[1], vehPos[2]);
SetPlayerPos(playerid, vehPos[0], vehPos[1], vehPos[2]);
PutPlayerInVehicle(playerid, id, 0);
SetPlayerVirtualWorld(playerid, GetVehicleVirtualWorld(id));
return 1;
}
Anyone know?
Re: Interior Vehicles & Players -
Raimis_R - 25.07.2011
I made 2 functions because by default i dont know function "GetVehicleInterior"
pawn Код:
new
interior[MAX_VEHICLES];
stock LinkVehicleToInteriorEx(vehicleid, interiorid)
{
interior[vehicleid] = interiorid; // Write interior.
return LinkVehicleToInterior(vehicleid, interiorid);
}
stock GetVehicleInterior(vehicleid) return interior[vehicleid];
USE
LinkVehicleToInteriorEx(vehicleid, interiorid);
To link vehicle to interior.
GetVehicleInterior(vehicleid);
Will return vehicle interior.
Re: Interior Vehicles & Players -
NRJ53 - 25.07.2011
Okay, Thanks.