[Help]Score System
#1

I want to change 60 seconds to 30 mins. how? i think its not just SetTimer("scoretimer", 1000, true);

PHP код:
new seconds[MAX_PLAYERS];
public 
OnGameModeInit()
{
    
SetTimer("scoretimer"1000true);
    return 
1;
}
public 
OnPlayerConnect(playerid)
{
    
seconds[playerid] = 0;
    return 
1;
}
forward scoretimer();
public 
scoretimer()
{
    for(new 
ii<MAX_PLAYERSi++)
    {
        if(!
IsPlayerConnected(i)) continue;
        
seconds[i] ++;
        if(
seconds[i] == 60
        {
            
SetPlayerScore(iGetPlayerScore(i) + 1);
            
seconds[i] = 0;
        }
    }
    return 
1;

Also after typing in chat. My id doesnt show after my name.
Reply
#2

pawn Код:
new seconds[MAX_PLAYERS];
public OnGameModeInit()
{
    SetTimer("scoretimer", 1000, true);
    return 1;
}
public OnPlayerConnect(playerid)
{
    seconds[playerid] = 0;
    return 1;
}


forward scoretimer();
public scoretimer()
{
    for(new i; i<MAX_PLAYERS; i++)
    {
        if(!IsPlayerConnected(i)) continue;
        seconds[i] ++;
        if(seconds[i] == 1800)  
        {
            SetPlayerScore(i, GetPlayerScore(i) + 1);
            seconds[i] = 0;
        }
    }
    return 1;
}
EDIT: LOOOOOOOOOL @ SIGNATURE!!!!!
Reply
#3

Quote:
Originally Posted by tyler12
Посмотреть сообщение
pawn Код:
new seconds[MAX_PLAYERS];
public OnGameModeInit()
{
    SetTimer("scoretimer", 1000, true);
    return 1;
}
public OnPlayerConnect(playerid)
{
    seconds[playerid] = 0;
    return 1;
}


forward scoretimer();
public scoretimer()
{
    for(new i; i<MAX_PLAYERS; i++)
    {
        if(!IsPlayerConnected(i)) continue;
        seconds[i] ++;
        if(seconds[i] == 1800)  
        {
            SetPlayerScore(i, GetPlayerScore(i) + 1);
            seconds[i] = 0;
        }
    }
    return 1;
}
EDIT: LOOOOOOOOOL @ SIGNATURE!!!!!
Lol i supposed to edit the SetTimer("scoretimer", 1000, true); to 1800 or something if you ddint show me.

@signature just a spam

EDIT: Can you help me with Id number? In chat my id number is not showing up!
Reply
#4

pawn Код:
SetTimer("scoretimer", 1000, true); // 1 second

SetTimer("scoretimer", 1000*60, true); // 1 minute

SetTimer("scoretimer", 1000*60*30, true); // 30 minutes
Reply
#5

Quote:
Originally Posted by Viniborn
Посмотреть сообщение
pawn Код:
SetTimer("scoretimer", 1000, true); // 1 second

SetTimer("scoretimer", 1000*60, true); // 1 minute

SetTimer("scoretimer", 1000*60*30, true); // 30 minutes
This mean i will wait 30mins to get 1 score??

And your answer is different from tyler.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)