SetVehicleParamsForPlayer maybe little bugs, big thanks for your replies!
#5

Try this:

Under the SetVehicleParamsForPlayer add this:
Код:
SetTimerEx("CarLocked", 500, false, "ii", playerid, vehicleid);
It'll looks:
Код:
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;
}
And on the end of code add:
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;
}
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
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)