Top killers and top killer - 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: Top killers and top killer (
/showthread.php?tid=131277)
Top killers and top killer -
Naxix - 02.03.2010
Hey there!
I'm makeing a DM gamemode and i was wondering if it's possible to get a command which send you like the 3 top killers on /top3.
anyway, the code i actully know exsist is when the gamemode ends it displays a msg to all players that "%s has won the Deathmatch"
I was wondering if any1 have or can make these codes? or explain how to.
-Naxix
Re: Top killers and top killer -
Calgon - 02.03.2010
pawn Код:
new Deaths[ MAX_PLAYERS ], Kills[ MAX_PLAYERS ];
public OnPlayerConnect( playerid )
{
Deaths[ playerid] = 0;
Kills[ playerid ] = 0;
return 1;
}
public OnGameModeExit()
{
new string[ 128 ], name[ MAX_PLAYER_NAME ], bestkiller, bestkillerkills;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if( bestkillerkills > Kills[ i ] )
{
bestkiller = i;
bestkillerkills, Kills[ i ]
}
}
GetPlayerName( playerid, name, sizeof( name ) );
format( string, sizeof( string ), "%s has won the round!", name );
SendClientMessageToAll( COLOR, string );
return 1;
}
public OnPlayerDeath( playerid, killerid, reason )
{
Kills[killerid]++;
Deaths[playerid]++;
return 1;
}
Something like that, I'm extremely tired so it's probably completely illogical.