Raised This Month: $12 Target: $400
 3% 

get id's id


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SoccerjamTR
Member
Join Date: May 2021
Old 10-05-2022 , 08:31   get id's id
Reply With Quote #1

I have
PHP Code:
#define RECORDS 2
enum {
    
KILL
    SELFKILL
}
new 
TopPlayer[3][RECORDS+1]

TopPlayer[1][KILL] , TopPlayer[1][SELFKILL
and I want to ( TopPlayer[1][KILL] ) [SELFKILL] how to i learn top kill player's selfkill number?
I try TopPlayer[1][KILL][SELFKILL] but it gives error.

Last edited by SoccerjamTR; 10-05-2022 at 08:58.
SoccerjamTR is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-05-2022 , 22:16   Re: get id's id
Reply With Quote #2

You need to use a named enum:

PHP Code:
enum myEnum {
    
KILL,
    
SELFKILL
}

new 
TopPlayer[32][myEnum
__________________
fysiks is offline
SoccerjamTR
Member
Join Date: May 2021
Old 10-06-2022 , 04:38   Re: get id's id
Reply With Quote #3

I tried but it gave error.
Top Players KILL and SELFKILL
Topplayer[1][KILL] = 10(player A) Topplayer[1][SELFKILL] = 7(player B)

Player A's statistics:
Record[id][KILL] = 10 Record[id][SELFKILL] = 5
Player B's statistics:
Record[id][KILL] = 9 Record[id][SELFKILL] = 7

Now, Topplayer[KILL] id = Player A but he isn't top selfkill because it's number 5 and player B's 7.
I need to learn top player A's selfkill number.
I use it like this message: Top KILLER'S(Rank 1-Player A 10 and Self-Kills: 5 Rank 2-Player B 9 and Self Kills 7)

Last edited by SoccerjamTR; 10-06-2022 at 04:49.
SoccerjamTR is offline
zXCaptainXz
Member
Join Date: May 2017
Old 10-06-2022 , 05:58   Re: get id's id
Reply With Quote #4

Record[TopPlayer[1][KILL]][SELFKILL] should return the most killing player's self kills then
zXCaptainXz is offline
SoccerjamTR
Member
Join Date: May 2021
Old 10-26-2022 , 16:56   Re: get id's id
Reply With Quote #5

it doesn't work.
SoccerjamTR is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 10-26-2022 , 17:59   Re: get id's id
Reply With Quote #6

PHP Code:
....

new 
szName[32], aTopFraggers[MAX_PLAYERS], iCount GetPlayersList(3aTopFraggersPlayers"funcComparsion");

server_print("TOP #%d FRAGGERS :-"iCount);

for(new 
iiCounti++)
{
    
get_user_name(aTopFraggers[i], szNamecharsmax(szName));
    
server_print("* %s"szName);
}

....

public 
funcComparsion(idcompared)
{
    if(
get_user_frags(id) < get_user_frags(compared))
    {
        return 
1;
    }
    return 
0;
}

GetPlayersList(TopFraggersCount=3ArrayList[MAX_PLAYERS], const funcComparePlayersStats[])
{
    static 
players[MAX_PLAYERS], pnum;
    
get_players(playerspnum"h");

    if(!
pnum) return 0;

    if(
TopFraggersCount pnumTopFraggersCount pnum;

    new 
iListCount;

    for(new 
jiplayerchoseniPointeriFuncID get_func_id(funcComparePlayersStats); TopFraggersCountj++)
    {
        
chosen players[ (iPointer=0) ];

        for(
1pnumi++)
        {
            
player players];

            if(
callfunc_begin_i(iFuncID) == 1)
            {
                
callfunc_push_int(chosen);
                
callfunc_push_int(player);
                if(
callfunc_end() == 1)
                {
                    
chosen player;
                    
iPointer i;
                }
            }
        }

        
playersiPointer ] = players[ --pnum ];
        
ArrayListiListCount++ ] = chosen;
    }

    return 
iListCount;

__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 10-26-2022 at 18:00.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
SoccerjamTR
Member
Join Date: May 2021
Old 10-27-2022 , 05:08   Re: get id's id
Reply With Quote #7

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(idrecordtypeamtexp) {
    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]) 
SoccerjamTR is offline
SoccerjamTR
Member
Join Date: May 2021
Old 12-07-2022 , 07:19   Re: get id's id
Reply With Quote #8

Can you help me?
SoccerjamTR is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:55.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode