Player score
#1

Hey guys, I'm trying to create a system so that every 3 hours a player is in game they get 1 score. For example say if a player played 24 hours their score would be 8. I'm having trouble working out the equation that calculates the score.

Here is what I have.

PHP код:
    for(new 0MAX_PLAYERSi++)
    {
        if(!
IsPlayerConnected(i) || LoggedIn[i] != 1) continue;
        new 
string[128], hms;
        
TotalGameTime(i,h,m,s);
        if(
playedTime[i] == 3)
        {
            
PlayerInfo[i][Score] = PlayerInfo[i][Score] +1;
            
SetPlayerScore(iPlayerInfo[i][Score]);
            
GameTextForPlayer(i"~w~+$1000"80003);
            
GivePlayerMoney(i,1000);
            
format(string,sizeof(string), "You have leveled up! Your new level is %d."PlayerInfo[i][Score]);
            
SendClientMessage(iCOLOR_WHITEstring);
        }
    }
TotalGameTime(playerid, &h=0, &m=0, &s=0)
{
    
PlayerInfo[playerid][TotalTime] = ( (gettime() - gPlayerJoin[playerid]) + (PlayerInfo[playerid][TotalTime]) );
    new 
p;
    
floatround(PlayerInfo[playerid][TotalTime] / 10800floatround_floor);
    
floatround(PlayerInfo[playerid][TotalTime] / 3600floatround_floor);
    
floatround(PlayerInfo[playerid][TotalTime] / 60,   floatround_floor) % 60;
    
floatround(PlayerInfo[playerid][TotalTime] % 60,   floatround_floor);
    
playedTime[playerid] = p;
    return 
PlayerInfo[playerid][TotalTime];

Reply


Messages In This Thread
Player score - by Tass007 - 22.09.2016, 11:44
Re: Player score - by Shaheen - 22.09.2016, 12:28
Re: Player score - by Marricio - 22.09.2016, 12:38
Re: Player score - by Tass007 - 22.09.2016, 12:45
Re: Player score - by Konstantinos - 22.09.2016, 12:48
Re: Player score - by Tass007 - 22.09.2016, 13:07
Re: Player score - by Konstantinos - 22.09.2016, 13:11
Re: Player score - by StR_MaRy - 22.09.2016, 13:21
Re: Player score - by iLearner - 22.09.2016, 13:50
Re: Player score - by Marricio - 22.09.2016, 14:22

Forum Jump:


Users browsing this thread: 4 Guest(s)