new scoreholder[MAX_PLAYERS];
public OnPlayerDeath(playerid,killerid,reason)
{
if(killerid != INVALID_PLAYER_ID)
{
scoreholder[killerid]++;
}
return 1;
}
//to be used with something else
stock CheckScore()
{
for(new y=0; y<MAX_PLAYERS; y++)
{
}
return 1;
}
|
I can't see where to get that info, if that player got most score, then they get a prize.
|
stock CheckScore()
{
new t=-1;
for(new i,y; i<MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
if(scoreholder[i] > y) y=scoreholder[i],t=i;
}
if(t == -1) return SendClientMessageToAll(-1,"Nobody is online or all have score 0 ._.");
new string[128];
GetPlayerName(t,string,MAX_PLAYER_NAME);
format(string,128,"Player %s (ID: %d) has the most score with: %d",string,t,scoreholder[t]);
SendClientMessageToAll(-1,string);
return 1;
}