Raised This Month: $ Target: $400
 0% 

[REQ] top frags every round


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
avril-lavigne
Banned
Join Date: Apr 2009
Old 09-26-2011 , 16:14   [REQ] top frags every round
Reply With Quote #1

PHP Code:
#include <amxmodx>


public plugin_init()
{
  
register_plugin("test""1.0""tester")
  
register_logevent("round_end"2"1=Round_End")    
}

public 
round_end() {

   for(
i=0i<=get_maxplayers(); i++) { 
   if(
is_user_connected(i)) { 
    new 
name[33] or 32???? , frags 
    get_user_name
(iname,32)     
    
frags=get_user_frags(i)   
    
client_print.....
    
}


but how to get 3 best fraggers fast. I need to compare each results.....
__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc
avril-lavigne is offline
plowed
Senior Member
Join Date: Oct 2010
Location: germany
Old 09-26-2011 , 18:12   Re: [REQ] top frags every round
Reply With Quote #2

Ive tried but got confused and tired maybe someone else will do it o.O

PHP Code:
#include <amxmodx>
#include <cstrike>

new g_maxplayers

public plugin_init()
{
    
register_plugin("test""1.0""tester")
    
register_logevent("logevent_round_end"2"1=Round_End")

    
g_maxplayers get_maxplayers()
}


public 
logevent_round_end()
{
    new 
top1[33], top2[33], top3[33]

    for(new try = 
0; try < 4; try++) // Check all player 3 time...
    
{
        for(new 
i=0i<=g_maxplayersi++) { 
        if(
is_user_connected(i)) 
        { 
            new 
name[33], tempFrags
            get_user_name
(iname,32)     
            
tempFrags get_user_frags(i)
            if(
top1 tempFrags) {
                
format(top1charsmax(top1),  "%s"name)
            }
            if((
top2 tempFrags) && (tempFrags top1)) {
                
format(top2charsmax(top2),  "%s"name)
            }
            if((
top3 tempFrags) && (tempFrags top2)) {
                 
format(top3charsmax(top3),  "%s"name)
            }
            else {
                break
            }
        }
    }
        
set_hudmessage(02550, -1.0, -1.0)
        
show_hudmessage(0"Best Frager:^n%s^n%s^n%s"top1top2top3)
    }  
    
//Set the top fragger to 0 here again,,,

and yes its not finished
__________________
Zombie Mod + gameMe stats :
plowed is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 09-26-2011 , 18:47   Re: [REQ] top frags every round
Reply With Quote #3

something like this might work
PHP Code:
public round_end() {
    new 
PlayerFrags[32][2]
    new 
Players[32], num
    get_players
(Playersnum)
    for(new 
0numi++) {
        
PlayerFrags[i][0] = Players[i//player id
        
PlayerFrags[i][1] = get_user_frags(Players[i]) //player frags
    
}
    
SortCustom2D(PlayerFragsi"SortPlayerFrags")
    new 
output[128], name[20], pos
    pos 
+= formatex(outputcharsmax(output), "Top players: ")
    for (new 
03o++) {
        
get_user_name(PlayerFrags[o][0], namecharsmax(name))
        
pos += formatex(output[pos], charsmax(output) - pos"%s "name)
    }
    
client_print(0print_chatoutput)
}  

public 
SortPlayerFrags(elem1[], elem2[]) {
    if (
elem1[0] && elem2[0]) {
        if (
elem1[1] < elem2[1]) return -1
        
else if (elem1[1] == elem2[1]) return 0
        
else return 1
    
}


Last edited by jimaway; 09-26-2011 at 19:34.
jimaway is offline
avril-lavigne
Banned
Join Date: Apr 2009
Old 10-05-2011 , 12:54   Re: [REQ] top frags every round
Reply With Quote #4

#include <amxmodx>
#include <cstrike>
#include <sorting>

???still cant compile/// because you put "i" (index) there?

SortCustom2D(PlayerFrags, i, "SortPlayerFrags")
__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc

Last edited by avril-lavigne; 10-05-2011 at 12:58.
avril-lavigne is offline
Reply



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 19:42.


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