08.11.2013, 20:07
Try this:
Under the SetVehicleParamsForPlayer add this:
It'll looks:
And on the end of code add:
This makes that the car will be unlocked - the animation starts again if a player presses F
Sorry, for my bad English. I'm Czech.
//EDIT: A little mistake - the timer for 500 is small. When you are farther you can enter the car. So change 500 to 3000 - it should be ok
Under the SetVehicleParamsForPlayer add this:
Код:
SetTimerEx("CarLocked", 500, false, "ii", playerid, vehicleid);
Код:
public OnPlayerEnterVehicle (playerid, vehicleid, ispassenger) { for (new i = 0; i < 12; i++) { if (vehicleid == PoliceCruiser [i]) { if (PlayerInfo [playerid] [pFaction] != 1) { SetVehicleParamsForPlayer (PoliceCruiser [i], playerid, 0, 1); SetTimerEx("CarLocked", 3000, false, "ii", playerid, vehicleid); } } } return true; }
This makes that the car will be unlocked - the animation starts again if a player presses F
Код:
forward CarLocked(playerid, vehicleid); public CarLocked(playerid, vehicleid) { SetVehicleParamsForPlayer(vehicleid, playerid, false, false); return 1; }
//EDIT: A little mistake - the timer for 500 is small. When you are farther you can enter the car. So change 500 to 3000 - it should be ok