Posts: 1,547
Threads: 122
Joined: Jun 2014
Reputation:
0
Native for player is available.
GetPlayerInterior(playerid)
But theres no GetVehicleInterior so im not sure how'd I compare a vehicle's and a player's a interior.
Posts: 1,192
Threads: 10
Joined: Dec 2017
Reputation:
0
Create it manually, basically before you do LinkVehicleToInterior save that interior into a variable and compare that variable to the player's interior u wanna compare to.
Posts: 1,547
Threads: 122
Joined: Jun 2014
Reputation:
0
Uh, I don't think so.
I don't want to set it's interior, I just want to retrieve it's current interior.
Posts: 150
Threads: 1
Joined: Jan 2015
Reputation:
0
There is no native function to return the vehicle's interior and from a quick search I can't find any plugin/extensions that claim to do so.
As RogueDrifter stated you need to store the interior variable when you use LinkVehicleToInterior and use that variable later.
By default when you create a vehicle it is set to interior 0, so unless you specify otherwise you can assume that the interior is always 0. If you add a variable to your vehicle enumerator that stores the interior ID even if it is 0 you can just retrieve that value to compare the interior.
Posts: 240
Threads: 5
Joined: Nov 2017
PHP код:
#include <a_samp>
#include <izcmd>
#include <sscanf2>
new vInt[MAX_PLAYERS] = 0;
CMD:vehicleint(playerid, parms[]) {
new vehicle = AddStaticVehicle(559, 2543.7505, -21.8345, 27.1899, 52.6054, -1, -1);
vInt[playerid] = LinkVehicleToInterior(vehicle, 6);
if(GetPlayerInterior(playerid) == vInt[playerid])
{
//execute code here
}
return 1;
}
idk
or
PHP код:
CMD:vehicleint1(playerid, parms[]) {
new vehicle = AddStaticVehicle(559, 2543.7505, -21.8345, 27.1899, 52.6054, -1, -1);
vInt[playerid] = LinkVehicleToInterior(vehicle, 6);
new string[64];
format(string, sizeof(string),"vehicle interior is %i.",vInt[playerid]);
SendClientMessage(playerid, -1, string);
return 1;
}
idk