13.07.2011, 21:40
It is possible to detect if a player is trying to enter in a vehicle when the doors are locked?
Thanks!
Thanks!
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
public OnPlayerEnterVehicle(playerid, vehicleid)
{
if(IsVehicleLocked[playerid] == true) return OnPlayerEnterLockedVehicle(playerid, vehicleid);
}
forward OnPlayerEnterLockedVehicle(playerid, vehicleid);
public OnPlayerEnterLockedVehicle(playerid, vehicleid)
{
return 1;
}
new locked[MAX_VEHICLES];
stock LockVehicle(vehicleid)
{
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, engine, lights, alarm, 0, bonnet, boot, objective);
locked[vehicleid] = 1;
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(locked[vehicleid] == 1)
{
//your code
}
return 1;
}