24.03.2016, 22:34
IIRC scrolling into a vehicle doesn't call OnPlayerEnterVehicle. You can probably set a variable there, but you also have to put the PutPlayerInVehicle function into account as well as it doesn't call it either.
Example:
Example:
pawn Код:
new PlayerEnterVehicle[MAX_PLAYERS] = INVALID_VEHICLE_ID;
PutPlayerInVehicle(playerid, vehicleid, seat) {
if(PutPlayerInVehicle(playerid, vehicleid, seat) == 1) {
PlayerEnterVehicle[playerid] = vehicleid;
}
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) {
PlayerEnterVehicle[playerid] = vehicleid;
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate) {
if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER) {
if(PlayerEnterVehicle[playerid] != GetPlayerVehicleID(playerid)) BanEx(playerid, "Vehicle Teleport Hacks");
PlayerEnterVehicle[playerid] = INVALID_VEHICLE_ID;
}
return 1;
}
public OnPlayerConnect(playerid) PlayerEnterVehicle[playerid] = INVALID_VEHICLE_ID;