SetPlayerScore Help
#1

Thank you for taking the time to view this topic. In my script that I have downloaded, it appears that the players level is their score. I would like to change this from the score to how many minutes they have been online. If anyone knows how to do this, please let me know. Anything with // is not in the script, and is a comment I have made to you.

Код:
public DollahScoreUpdate()  //< forward DollahScoreUpdate();
{
	new LevScore;
	for(new i=0; i<MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
   			LevScore = PlayerInfo[i][pLevel];
			SetPlayerScore(i, LevScore);
		}
	}
	return 1;
}
Reply
#2

OnPlayerConnect set it to 0, then add a timer that sets everyone's score to +1 every minute
Reply
#3

**Removed by poster!**
Reply
#4

Quote:
Originally Posted by Lenny the Cup
Посмотреть сообщение
OnPlayerConnect set it to 0, then add a timer that sets everyone's score to +1 every minute
I'm not quite sure what you mean by add a timer, and OnPlayerConnect isn't even on the script cut I sent you. Can you please send me an example either via PM, or replying to this post?
Reply
#5

You should look at the wiki or search for timer tutorials or something because that is pretty basic stuff you should know how to do.
Reply
#6

PHP код:
new TimeScore[MAX_PLAYERS]; // globar var at top of script
public TimeScoreUpdate()  //< forward DollahScoreUpdate();
{
    for(new 
i=0i<MAX_PLAYERSi++){
        if(!
IsPlayerConnected(i))continue;
        
TimeScore[i]++;
          
SetPlayerScore(iTimeScore[i]);
    }
    return 
1;
}
//then under on player connect
TimeScore[playerid] = 0;
//then put a new timer under OnGamemodeInit
SetTimer("TimeScoreUpdate",60000,true); 
something like that and just delete the old DollarScoreUpdate timer or comment it out with //
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)