03.12.2018, 18:34
Just seen you're trying to do some sort of mechanic thing.
I would just use something like this, but you'd have to change the interaction key from Enter, to avoid the player getting in the vehicle.
Not tested, but should work with a bit of tweaking by yourself.
I would just use something like this, but you'd have to change the interaction key from Enter, to avoid the player getting in the vehicle.
PHP код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) {
if((newkeys & KEY_LOOK_LEFT)) //press Q
{
//Search or make some code to grab the nearest vehicle ID (very easy to find/do)
StartFixing(playerid, /*Returned closest vehID*/);
}
if((oldkeys & KEY_LOOK_LEFT)) //releases Q
{
StopFixing(playerid);
}