02.04.2018, 06:48
PHP код:
#include <a_samp>
public OnGameModeInit(){
SetTimer("Ranking",40000, 1);
return true;
}
forward Ranking(playerid);
public Ranking(playerid)
{
new
Money, ID_0,
Level, ID_1
;
for(new i = 0; i <= GetPlayerPoolSize(); i++)
{
if(!IsPlayerConnected(i)) continue;
if(GetPlayerScore(i) > Level)
Level = GetPlayerScore(i), ID_0 = i;
if(GetPlayerMoney(i) > Money)
Money = GetPlayerMoney(i), ID_1 = i;
}
new
Name[MAX_PLAYER_NAME],
string[128]
;
GetPlayerName(ID_0, Name, sizeof(Name));
format(string,sizeof(string),"O jogador com maior level online й %s. Level atual : %d", Name, Level);
SendClientMessageToAll(-1,string);
GetPlayerName(ID_1, Name, sizeof(Name));
format(string,sizeof(string),"O jogador com mais dinheiro online й %s. Dinheiro atual : %d", Name, Money);
SendClientMessageToAll(-1,string);
return true;
}