How can i create a top? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How can i create a top? (
/showthread.php?tid=660280)
How can i create a top? -
rockys - 29.10.2018
i want to crate a top
new participants = 10,damage[MAX_PLAYERS],string[128];
how can i get max value of damage?
for use in command like /top
YCMD:top(playerid, params[], help)
{
for(new i = 0; i <= participants; i++) {
if(damage[i] == 0) return SendClientMessage(playerid,COLOR_WHITE,"No one!");
format(string,128,"top %d with %d damage",i,damage[i]);
SendClientMessage(playerid,COLOR_WHITE,string);
return 1;
}
how can i get max value of damage?
Re: How can i create a top? -
TheToretto - 29.10.2018
PHP код:
new MaxKills;
new HighestPlayerID;
for(new i=0; i < MAX_PLAYERS; i++)
{
if (/*Player's kills*/ > MaxKills)
{
HighestPlayerID = i;
MaxKills = /*Player's Kills*/;
}
}
new string[72];
format(string, sizeof(string), "ID:%d with %d Kills", HighestPlayerID, MaxKills);
SendClientMessage(playerid, -1, string);
You'll have to replace the commented variables.