How to get the highest score and give him a prize
#4

PHP Code:
new playergotprize[MAX_PLAYERS]; //make sure you save this where you save player stats
forward ENDGG();
public 
ENDGG()
{
    static 
i;
    for( 
GetMaxPlayers() - 1> -1; --i//Create a loop
    
{
        if(
IsPlayerConnected(i))
        {

            if(
lvl[i] == 30 && playergotprize[i] == 0)
            {
                
//your price here... can be whatever you want
                
SetPlayerScore(iGetPlayerScore(i)+10);
                
playergotprize[i] = 1;
            }
        }
    }

return 
1;
}

//ONGAMEMODEINIT

public OnGameModeInit()
{
    
SetTimer("ENDGG"600000/*1 if you want to repeat, 0 if you don't want to*/);
    return 
1;

Make sure you save/load that variable i did on top.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)