CMD:start gg (only for admins) //otherinfo SetTimer("ENDGG", 100000, false); ----------------------- public ENDGG(); //IDK how to do this part as i want in the description my var is "lvl[MAX_PLAYERS]" (there are 30 lvls)
forward ENDGG(); public ENDGG() { static i; for( i = GetMaxPlayers() - 1; i > -1; --i) //Create a loop { if(IsPlayerConnected(i)) { if(lvl[i] == 30) { //your price here... can be whatever you want SetPlayerScore(i, GetPlayerScore(i)+10); } } } return 1; } //ONGAMEMODEINIT public OnGameModeInit() { SetTimer("ENDGG", 600000, 1 /*1 if you want to repeat, 0 if you don't want to*/); return 1; }
Code:
forward ENDGG(); public ENDGG() { static i; for( i = GetMaxPlayers() - 1; i > -1; --i) //Create a loop { if(IsPlayerConnected(i)) { if(lvl[i] == 30) { //your price here... can be whatever you want SetPlayerScore(i, GetPlayerScore(i)+10); } } } return 1; } //ONGAMEMODEINIT public OnGameModeInit() { SetTimer("ENDGG", 600000, 1 /*1 if you want to repeat, 0 if you don't want to*/); return 1; } |
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;
}
i-- and --i
--i // It decreases the value first and then asign it to the variable
new lastScore=-1,
lastUser;
foreach(Player,i){
if(lastScore < User[i][Score]){
lastUser=i;
lastScore=User[i][Score];
}
}