28.02.2010, 13:56
You need a timer when the player enters the truck.
As I mentioned I don't have PAWNO on this computer, You can test it and I think it should work.
Код:
forward RemovePlayerFromAVehicle(playerid);
Код:
public OnPlayerEnterVehicle(playerid, vehicleid) { if(vehicleid == truck1) { if(gTeam[playerid] == TEAM_ARMY) return 1; //You should use numbers instead of defines, this will work better. Ex: (gTeam[playerid] == 1) SetTimerEx("RemovePlayerFromAVehicle",......) // Search the function on wiki 'cause I'm on myGF's computer so I don't have access to pawno //Timer should be like 2 seconds return SendClientMessage(playerid, RED,"You're not allowed to use this vehicle."); } return 1; }
Код:
public RemovePlayerFromAVehicle(playerid) { new veh = GetPlayerVehicleID(playerid); RemovePlayerFromVehicle(playerid, veh); return 1; }