[HELP] 1 question - player speed
#7

pawn Код:
new Pseconds[MAX_PLAYERS];

public OnGameModeInit()
{
  SetTimer("PsecondsUpdate", 1000, true);
  return 1;
}

public OnPlayerConnect(playerid)
{
  Pseconds[playerid] = 0;
  return 1;
}
forward PsecondsUpdate();
public PsecondsUpdate()
{
  for(new i=0;i<MAX_PLAYERS();i++)
  {
    if(GetPlayerSpeed(i) < 30)
    {
      Pseconds[i] = 0;
    }
    if(GetPlayerSpeed(i) > 29)
    {
      Pseconds[i] ++;
    }
    if(Pseconds[i] == 60)
    {
      GivePlayerMoney(i, 1);
      Pseconds[i] = 0;
    }
  }
  return 1;
}
Added this
pawn Код:
if(GetPlayerSpeed(i) < 30)
{
    Pseconds[i] = 0;
}
So if you are under 30 you will lose the bonus.
Reply


Messages In This Thread
[HELP] 1 question - player speed - by ben1 - 24.12.2009, 20:50
Re: [HELP] 1 question - player speed - by [HiC]TheKiller - 24.12.2009, 22:22
Re: [HELP] 1 question - player speed - by ben1 - 25.12.2009, 21:00
Re: [HELP] 1 question - player speed - by ben1 - 27.12.2009, 18:41
Re: [HELP] 1 question - player speed - by [HiC]TheKiller - 28.12.2009, 21:10
Re: [HELP] 1 question - player speed - by ben1 - 28.12.2009, 21:13
Re: [HELP] 1 question - player speed - by Dark_Kostas - 28.12.2009, 21:29
Re: [HELP] 1 question - player speed - by ben1 - 28.12.2009, 22:00
Re: [HELP] 1 question - player speed - by Blantas - 28.12.2009, 22:05

Forum Jump:


Users browsing this thread: 1 Guest(s)