#1

Hello,
I want a players score to go up 1 point every 30 seconds then in a certain car (car1)
I have part of the code but not the timer bit.
This is the code i have so far:
pawn Код:
if(IsPlayerInVehicle(playerid, car1))
SetPlayerScore(playeridid, GetPlayerScore(playerid) + 1);
Can anyone help me please
Reply
#2

make a function with a timer, than loop it.
Reply
#3

Quote:
Originally Posted by Rk_
make a function with a timer, than loop it.
Sorry im a beginner to scripting
Reply
#4

here you go:
pawn Код:
SetTimer("ScoreGiver",30000,1);

forward ScoreGiver();
public ScoreGiver()
{
  for(new i=0; i<MAX_PLAYERS; i++)
  {
    if(IsPlayerInVehicle(i, car1))
    {
      SetPlayerScore(i, GetPlayerScore(i) + 1);
    }
  }
}
Reply
#5

I get alot of errors

Reply
#6

posting them would be usefull!
Reply
#7

Try putting the SetTimer in OnGameModeInIt
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)