31.03.2009, 14:44
I have a Problem.
In my Gamemode, I have a Engine System that Freezes the player when he enter to the vehicle, and unfreeze the player when he starts the engine. But.. if a player is in a stopped vehicle and other player steal his vehicle, the first player will be freezed out of the car.
I have a timer, that monitors if a player is out of a car and if he is freezed, unfreeze he <--- This only works for ID 0 player.
How can I solve this?
In my Gamemode, I have a Engine System that Freezes the player when he enter to the vehicle, and unfreeze the player when he starts the engine. But.. if a player is in a stopped vehicle and other player steal his vehicle, the first player will be freezed out of the car.
I have a timer, that monitors if a player is out of a car and if he is freezed, unfreeze he <--- This only works for ID 0 player.
Код:
new EngineStop[MAX_PLAYERS];
Код:
if(newstate == PLAYER_STATE_DRIVER) { if (Engine[newcar] == 0) { if(PoliceCar(newcar)) { GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~r~Engine: Stopped", 6000, 5); EngineStop[playerid] = 1; TogglePlayerControllable(playerid, 0); } } }
Код:
public OnGameModeInit() { SetTimer("EngineStopped",1500,true); }
Код:
public EngineStopped(playerid) { if(EngineStop[playerid] == 1 && !IsPlayerInAnyVehicle(playerid)) { TogglePlayerControllable(playerid, 1); EngineStop[playerid] = 0; } } return 1;