I want to get the team all the player information (name, Kills, Deaths).Then sort it.How to do this?
I want to make a nice scoreboard.
I want to use AMX MOD X to achieve.
Witamy w Nieoficjalnym polskim support'cie AMX Mod X
Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
|
Guest Message by DevFuse
Get the team all the player information (name, Kills, Deaths). Then sort it.
Temat rozp. Lonely, 17.03.2013 10:45
amx mod x
2 odpowiedzi w tym temacie
#1
Napisano 17.03.2013 10:45
#2 Gość_21977_*
Napisano 17.03.2013 10:53
Automatyczna wiadomość
Ten temat został przeniesiony z forum
AMX Mod X → Pytania
do
AMX Mod X → Multilingual
Ten temat został przeniesiony z forum
AMX Mod X → Pytania
do
AMX Mod X → Multilingual
#3
Napisano 31.03.2013 22:19
Use for example bubble sort
Here you are
public SORT(id)
{
if (!is_user_connected(id))
return
const SIZE = 1024
static msg[SIZE + 1], len; len = 0
new players[32], pnum, player, sortT[16], sortCT[16], counterT, counterCT
get_players(players, pnum)
for (new i = 0; i < pnum; i++)
{
player = players[i]
switch(get_user_team(player))
{
case 1:
{
sortT[counterT] = player
counterT++
}
case 2:
{
sortCT[counterCT] = player
counterCT++
}
}
}
bubble_sort_by_kills(sortT, counterT)
bubble_sort_by_kills(sortCT, counterCT)
len += formatex(msg[len], SIZE - len, " .: NICK :. ... KILLS | DEATHS ")
// T's
len += formatex(msg[len], SIZE - len, "_____________Terrorists (TT) _____________^n")
for (new t = 0; t < counterT; t++)
{
player = sortT[t]
len += formatex(msg[len], SIZE - len, "[ %s ... %i ... %i ]^n",
player_name[player], g_kills[player], g_deaths[player])
}
// CT's
len += formatex(msg[len], SIZE - len, "^n_____________C-Terrorists (CT) ______________^n")
for (new ct = 0; ct < counterCT; ct++)
{
player = sortCT[ct]
len += formatex(msg[len], SIZE - len, "[ %s ... %i ... %i ]^n",
player_name[player], g_kills[player], g_deaths[player])
}
set_hudmessage(25, 125, 225, 0.3, 0.3, 0, 6.0, 1.1, 0.0, 0.0, 1)
ShowSyncHudMsg(id, CreateHudSyncObj(), msg)
}
bubble_sort_by_kills(list[16], count) {
if(count < 2)
return
static temp, a, b
for (a = 0; a < count; a++)
{
for (b = a + 1; b < count; b++)
{
if (g_kills[list[a]] < g_kills[list[b]])
{
temp = list[a]
list[a] = list[b]
list[b] = temp
}
}
}
}
Here you are
Sell - System Klanów (wojny, top15 etc)
Kontakt GG: 7285018
Również z jednym lub większą ilością słów kluczowych: amx mod x
GmAMXBans
Odbanowani w AMXBansNapisany przez Mario14125, 25.01.2013 gmamxbans, amx mod x, amxbans i 2 więcej |
|
Użytkownicy przeglądający ten temat: 0
0 użytkowników, 0 gości, 0 anonimowych