Timer only works for ID 0
#1

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.

Код:
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;
How can I solve this?
Reply


Messages In This Thread
Timer only works for ID 0 - by loleteviejo - 31.03.2009, 14:44
Re: Timer only works for ID 0 - by Norn - 31.03.2009, 14:46
Re: Timer only works for ID 0 - by loleteviejo - 31.03.2009, 15:18
Re: Timer only works for ID 0 - by ICECOLDKILLAK8 - 31.03.2009, 15:22
Re: Timer only works for ID 0 - by Norn - 31.03.2009, 15:24

Forum Jump:


Users browsing this thread: 1 Guest(s)