How to make players score rise every 1 hour?
#1

Hello.

Im using GTA:RP (LARP edit), and i want people to get score +1 every hour, and it would save it. Right now you will need to play like X hours, do /levelup and then your score will be 2. I want it to be every hour +1 if player is online.

Please help me with that, i have asked for this before and I didnt get any help from you guys!
Reply
#2

Start a one hour timer when the game mode beings.

Each time the timer is called (ever hour from the time the game-mode began), loop through all players (would recommend using foreach by ****** for this).

For each player, update their score like this:

pawn Код:
SetPlayerScore(i, GetPlayerScore(i)+1);
That will get their score, then set their score to what it was plus one.

Good luck!
Reply
#3

for dynamic i recomment you to use SetTimerEx
Reply
#4

Quote:
Originally Posted by Tigerkiller
Посмотреть сообщение
for dynamic i recomment you to use SetTimerEx
What the hell are you talking about? There is no reason for them to use SetTimerEx.
Reply
#5

yep lol but when he loops thought all players, that havent played for a hour?

i play 1 min and get rep or what ?
Reply
#6

I see I made a mistake.

You need to set a timer for EACH player when they connect- when the timer get's called then update their score. Keep in mind, if they are online for 59 minutes, then they'll need to be online another hour (if they disconnect) before their score increases. It may be a good idea to save this for later use.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)