CMD /top10 - 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: CMD /top10 (
/showthread.php?tid=395103)
CMD /top10 -
Louris - 25.11.2012
Can someone make CMD /top10, it show top 10 killers simple:
1. Nickname [Kills]
2. Nicknamee [Kills]
Re: CMD /top10 -
RenSoprano - 25.11.2012
Wrong section mate
Post it here
Re: CMD /top10 -
Louris - 25.11.2012
up...
Re: CMD /top10 -
Louris - 25.11.2012
Up, help..
AW: CMD /top10 -
Skimmer - 25.11.2012
Do you have a variable for saving player kills? Like
pInfo[playerid][pKills] or
Kills[playerid]
Re: CMD /top10 -
SadGasm - 24.07.2013
hi, im kinda new to this scripting in sa:mp and i got a question about how to make the command /top15 for my server ?
I would like a table to popout when you do /top15 and on it like this:
TOP 15 LIST
1. <username> <kills> <deaths> <k/d rate>
2. -||-
3. -||-
...
Can someone help me please ?
Re: CMD /top10 -
George_Fratelli - 24.07.2013
You need to add a system that will save the variables. In this case the variables are the Kills, Deaths and the K/D rate of the player.
Re: CMD /top10 -
Champ - 24.07.2013
Just created this example. Hope this would be help full
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/top", true) == 0) {
new
string[ 128 ], First_Killer = -1, Second_Killer = -1, Third_Killer = -1, Fourth_Killer = -1, HighestKills = -9999;
foreach(Player, x )
if( PlayerInfo[ x ][ Kills ] >= HighestKills ) {
HighestKills = PlayerInfo[ x ][ Kills ];
First_Killer = x;
}
HighestKills = -9999;
for( new x = 0; x < MAX_PLAYERS; x ++ )
if( IsPlayerConnected( x ) && x != First_Killer )
if( PlayerInfo[ x ][ Kills ] >= HighestKills ) {
HighestKills = PlayerInfo[ x ][ Kills ];
Second_Killer = x;
}
HighestKills = -9999;
for( new x = 0; x < MAX_PLAYERS; x ++ )
if( IsPlayerConnected( x ) && x != First_Killer && x != Second_Killer )
if( PlayerInfo[ x ][ Kills ] >= HighestKills ) {
HighestKills = PlayerInfo[ x ][ Kills ];
Third_Killer = x;
}
HighestKills = -9999;
for( new x = 0; x < MAX_PLAYERS; x ++ )
if( IsPlayerConnected( x ) && x != First_Killer && x != Second_Killer && x != Third_Killer )
if( PlayerInfo[ x ][ Kills ] >= HighestKills ) {
HighestKills = PlayerInfo[ x ][ Kills ];
Fourth_Killer = x;
}
format( string, sizeof( string ), "Player %s (%d) - %d Kills", GetName(First_Killer ), First_Killer, PlayerInfo[ First_Killer ][ Kills ] );
SendClientMessage( playerid, -1, string );
if( Second_Killer != -1) {
format( string, sizeof( string ), "Player %s (%d) - %d Kills", GetName(Second_Killer ), Second_Killer, PlayerInfo[ Second_Killer ][ Kills ] );
SendClientMessage( playerid, -1, string );
}
if( Third_Killer != -1) {
format( string, sizeof( string ), "Player %s (%d) - %d Kills", GetName(Third_Killer ), Third_Killer, PlayerInfo[ Third_Killer ][ Kills ] );
SendClientMessage( playerid, -1, string );
}
if( Fourth_Killer != -1) {
format( string, sizeof( string ), "Player %s (%d) - %d Kills", GetName(Fourth_Killer ), Fourth_Killer, PlayerInfo[ Fourth_Killer ][ Kills ] );
SendClientMessage( playerid, -1, string );
}
return 1;
}
return 0;
}
GetName( playerid )
{
new Name[ MAX_PLAYER_NAME ];
GetPlayerName( playerid, Name, sizeof( Name ) );
return Name;
}
Don't forget to download and include foreach
Re: CMD /top10 -
SadGasm - 24.07.2013
hmm so this would be the in filterscripts ? the code i mean and George with the system you mean a mysql base ?