27.01.2013, 01:35
I'm trying to figure out how to disable a vehicle from being driven if it's HP is at a certain level.
I run a heavy roleplay server and would like this achieved. This is what I have come up with:
However, it seems that all someone has to do, is press their button to exit the vehicle, then they do, and then they can get back in and drive off.
Any ideas?
I run a heavy roleplay server and would like this achieved. This is what I have come up with:
pawn Код:
public CrashCar()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
{
new vehicle[MAX_PLAYERS];
vehicle[i] = GetPlayerVehicleID(i);
new Float:health;
GetVehicleHealth(vehicle[i], health);
if (health <= 500)
{
if (carcrashed[i] == 0)
{
TogglePlayerControllable(i, 0);
GameTextForPlayer(i, "~w~Your car is~n~~p~Broken", 3500, 1);
Any ideas?