PHP Code:
#define RECORDS 2
enum {
KILL
SELFKILL
}
new TopPlayer[3][RECORDS+1]
new TopPlayerName[RECORDS+1][33]
new Record[33][RECORDS+1]
TopPlayer[1][KILL] , TopPlayer[1][SELFKILL]
Event_Record(id, recordtype, amt, exp) {
if(amt == -1)
Record[id][recordtype]++
else
Record[id][recordtype] = amt
new playerRecord = Record[id][recordtype]
if(playerRecord > TopPlayer[1][recordtype])
{
TopPlayer[0][recordtype] = id
TopPlayer[1][recordtype] = playerRecord
new name[MAX_NAME_LENGTH+1]
get_user_name(id,name,MAX_NAME_LENGTH)
format(TopPlayerName[recordtype],MAX_NAME_LENGTH,"%s",name)
}
}
I didn't understand your code. My functions are example. I need index Topplayer[1][KILL] and this index's SELFKILL number because i want to make this:
newid = Topplayer[1][KILL]
(How to learn this player id)
Record[newid][SELFKILL]
I tried newid = find_player("a",TopPlayerName[KILL]) but sometimes it return 0
I use it like this message: Top KILLER'S(Rank 1-Player A 10 and Self-Kills: 5 )
PHP Code:
client_print(0,print_chat,"Rank1 Player %s - %d and Selfkills %d", id,Record[newid][KILL],Record[newid][SELFKILL])