Leaderboard [help?] -
Thanks - 11.06.2017
So.. hey everyone im trying to searching at ****** how to make leaderboard with Textdraws so i find many but Not in my brain...
What do you mean?After players joining DM MAP... Showing him a Leaderboard - Textdraw Top5 kills only So after a map finished automacily says who win the map..So i want now a How to make Leaderboard with Textdraw TOP5 Kills... how?
Still not understand? I Want like this
http://forum.sa-mp.com/showpost.php?...2&postcount=44 But without Score i want Kills how?!
Re: Leaderboard [help?] -
Toroi - 11.06.2017
Care if I use this thread as my signature?
Re: Leaderboard [help?] -
Thanks - 11.06.2017
no problem.
Re: Leaderboard [help?] -
Thanks - 11.06.2017
HELP?
Re: Leaderboard [help?] -
Thanks - 12.06.2017
OK Everyone... im creating the Textdraws.. but i need help after player killing someone Make his name at Player#[num]
Example:
Thanks - 30Kills
Test - 25Kills
Pro - 20 Kills
Me - 5kills
Like this but After player killing someone +1Kills to him... i hope if you understood me.
Code:
Textdraw7 = TextDrawCreate(35.200004, 181.440032, "Player #1 - Kills");
TextDrawLetterSize(Textdraw7, 0.289199, 1.562666);
TextDrawTextSize(Textdraw7, -366.400024, 71.680007);
TextDrawAlignment(Textdraw7, 1);
TextDrawColor(Textdraw7, -1);
TextDrawSetShadow(Textdraw7, 0);
TextDrawSetOutline(Textdraw7, 1);
TextDrawBackgroundColor(Textdraw7, 51);
TextDrawFont(Textdraw7, 1);
TextDrawSetProportional(Textdraw7, 1);
Textdraw8 = TextDrawCreate(33.600059, 201.600067, "Player #2 - Kills");
TextDrawLetterSize(Textdraw8, 0.309999, 1.495466);
TextDrawAlignment(Textdraw8, 1);
TextDrawColor(Textdraw8, -1);
TextDrawSetShadow(Textdraw8, 0);
TextDrawSetOutline(Textdraw8, 1);
TextDrawBackgroundColor(Textdraw8, 51);
TextDrawFont(Textdraw8, 1);
TextDrawSetProportional(Textdraw8, 1);
Textdraw9 = TextDrawCreate(33.600051, 221.760101, "Player#3 - Kills");
TextDrawLetterSize(Textdraw9, 0.309199, 1.622400);
TextDrawAlignment(Textdraw9, 1);
TextDrawColor(Textdraw9, -1);
TextDrawSetShadow(Textdraw9, 0);
TextDrawSetOutline(Textdraw9, 1);
TextDrawBackgroundColor(Textdraw9, 51);
TextDrawFont(Textdraw9, 1);
TextDrawSetProportional(Textdraw9, 1);
Textdraw10 = TextDrawCreate(32.799991, 241.173385, "Player #4 - Kills");
TextDrawLetterSize(Textdraw10, 0.316400, 1.712000);
TextDrawAlignment(Textdraw10, 1);
TextDrawColor(Textdraw10, -1);
TextDrawSetShadow(Textdraw10, 0);
TextDrawSetOutline(Textdraw10, 1);
TextDrawBackgroundColor(Textdraw10, 51);
TextDrawFont(Textdraw10, 1);
TextDrawSetProportional(Textdraw10, 1);
Re: Leaderboard [help?] -
Private200 - 12.06.2017
You should use your kills variable if any. Easiest way to do it without working much onto the code would be replacing in this line:
playerScores[index][player_Score] =
GetPlayerScore(i);
GetPlayerScore(i) with your player variable.
Re: Leaderboard [help?] -
Thanks - 12.06.2017
Sorry but still not understand you can you explain more?!?
Re: Leaderboard [help?] -
Thanks - 12.06.2017
bumb?
Re: Leaderboard [help?] -
RedRex - 12.06.2017
A textdraws?!? You mean after a player killing someone put his name in the #1player between the players kills!!?
Re: Leaderboard [help?] -
Thanks - 12.06.2017
Yes how can everyone help me pleaseeeeeeeeeee
Re: Leaderboard [help?] -
RedRex - 12.06.2017
stop bumb your threads... if someone know they will helping you.
Re: Leaderboard [help?] -
Thanks - 12.06.2017
YOU GUYS STILL NOT UNDERSTAND? HERE YOU GO LEAVE THE NAMES.. ONLY HOW TO MAKE LIKE THIS. MY TEXTDRAW IS READY
Re: Leaderboard [help?] -
Thanks - 13.06.2017
Help meeeeee
Re: Leaderboard [help?] -
Sew_Sumi - 13.06.2017
You need to look up sorting in pawn... That\'s how this is done... Sort the values, and update the textdraw strings.
Re: Leaderboard [help?] -
Thanks - 13.06.2017
Thanks god someone Replyed but how to do that?
Re: Leaderboard [help?] -
Sew_Sumi - 14.06.2017
Code.
You need to store the leaderboard to an array, and then go through that array comparing it to whoever has gone into bottom place, and moving up the board simply putting whoever was above them, down one...
Re: Leaderboard [help?] -
Thanks - 14.06.2017
... man first time i\'ll try it can you give me a Example?? pls
Re: Leaderboard [help?] -
CheezIt - 14.06.2017
Store the players\' score in an array, use a sorting algorithm (
http://forum.sa-mp.com/showpost.php?...postcount=1737) then take the last 5 values.
An example is provided beyond the provided link.
If you have any questions or need help, then I can\'t help you. Bye.
Re: Leaderboard [help?] -
Thanks - 14.06.2017
I really not understand this how it will update the textdraws after someone killing many players? you should understand what i mean...
Example:
Code:
#1- %s[PlayerName] - 43[Kills]
2. etc
3. etc
4.etc
we should use OnPlayerDeath kills++; right but how.
Re: Leaderboard [help?] -
andrejc999 - 14.06.2017
add
new kills[MAX_PLAYERS];
on top of your script under includes and defines,
then under
Code:
public OnPlayerDeath(playerid, killerid, reason)
{
kills[killerid]++; //add this
return 1;
}
//Then under
public OnPlayerSpawn(playerid) // you can also use onplayerconnect...
{
new first, second, third, fourth, fifth;
//make a loop
for(new i=0;i<MAX_PLAYERS;i++) // This loop will check for the player that has the most kills
{
if(kills[i] > kills[first])
{
first = i;
}
}
for(new d=0;d<MAX_PLAYERS;d++) // This loop will check for the player that has the second most kills
{
if(first == d) continue;
if(kills[d] > kills[second])
{
second = d;
}
}
for(new s=0;s<MAX_PLAYERS;s++) // This loop will check for the player that has the third most kills
{
if(first == s || second == s) continue;
if(kills[s] > kills[third])
{
third = s;
}
}
for(new a=0;a<MAX_PLAYERS;a++) // This loop will check for the player that has the fourth most kills
{
if(first == a || second == a || third == a) continue;
if(kills[a] > kills[fourth])
{
fourth = a;
}
}
for(new c=0;c<MAX_PLAYERS;c++) // This loop will check for the player that has the fifth most kills
{
if(first == c || second == c || third == c || fourth == c) continue;
if(kills[c] > kills[fifth])
{
fifth = c;
}
}
//Now you have the top 5 players with most kills
/*Variables:
first - id of the player with most kills
second - id of the player with second most kills
third - id of the player with third most kills
fourth - id of the player with fourth most kills
fifth - id of the player with fifth most kills
*/
//Your only job now is to set the string of a textdraw to these 5 players and show it to a player that just connected(playerid)
return 1;
}
I hope you can understand the code which I just wrote.
You\'re welcome.