26.09.2018, 03:44
PHP Code:
new playergotprize[MAX_PLAYERS]; //make sure you save this where you save player stats
forward ENDGG();
public ENDGG()
{
static i;
for( i = GetMaxPlayers() - 1; i > -1; --i) //Create a loop
{
if(IsPlayerConnected(i))
{
if(lvl[i] == 30 && playergotprize[i] == 0)
{
//your price here... can be whatever you want
SetPlayerScore(i, GetPlayerScore(i)+10);
playergotprize[i] = 1;
}
}
}
return 1;
}
//ONGAMEMODEINIT
public OnGameModeInit()
{
SetTimer("ENDGG", 600000, 1 /*1 if you want to repeat, 0 if you don't want to*/);
return 1;
}