How to Get The Highest Kills Of The Player On the Server - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to Get The Highest Kills Of The Player On the Server (
/showthread.php?tid=77317)
How to Get The Highest Kills Of The Player On the Server -
Bearfist - 10.05.2009
What I mean Is something like that
"%s is the Dominating Killer with %d Kills"
Could someone tell me how that's working ?
Re: How to Get The Highest Kills Of The Player On the Server -
Think - 10.05.2009
well lets say you got this variable for the kills, Kills[MAX_PLAYERS];
youll need to do something like this
pawn Код:
public onplayerdeath(playerid,killerid,reason)
{
for(new i=0;i<MAX_PLAYERS;i++)
{
if(Kills[killerid] > Kills[i])
{
getplayername(killerid, playername, 26);
format(string,sizeof(string),"%s is dominating with %d kills",playername,Kills[killerid]);
}
}
This wouldn't work but it is something to show you how to do it
Re: How to Get The Highest Kills Of The Player On the Server -
Bearfist - 10.05.2009
Thanks, i added it like this
Код:
for(new i = 0;i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(BWins[killerid] > BWins[i])
{
new killer[MAX_PLAYER_NAME];
GetPlayerName(killerid, killer,sizeof(killer));
format(string,sizeof(string),"%s is dominating with %d Wins!",killer,BWins[killerid]);
SendClientMessageToAll(COLOR_YELLOW,string);
}
}
}
But I doesn't show the Message =/
Anyone could explain it ?