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

Scores


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kazuki
Senior Member
Join Date: Dec 2008
Old 02-16-2010 , 09:31   Scores
Reply With Quote #1

Is it possible to detect score from CT and T ?

Something like wolfteam, counter strike online score bar ?

Like this:

Playername | kills | death

CT:
John 6 1
Die17 5 0

T:
zombie1 1 6
zombie2 0 5

The hudmessage will show this:

Humans: 11 | Zombies: 1
kazuki is offline
AzcariaX
Junior Member
Join Date: Jun 2009
Location: Sweden
Old 02-16-2010 , 10:44   Re: Scores
Reply With Quote #2

Something like this?

PHP Code:

new t_roundwon
new ct_roundwon

public plugin_init() 

    
register_plugin("PLUGINNAME","8.0.2.3","Me")
    
register_event("SendAudio""t_win""a""2&%!MRAD_terwin")
    
register_event("SendAudio""ct_win""a""2&%!MRAD_ctwin"
}

public 
t_win(id)
{
    
t_roundwon+=1
    
    set_hudmessage
(255000.00.1506.05.0)
    
show_hudmessage(id"T: %i^nCT: %i"t_roundwonct_roundwon)
    
}

public 
ct_win(id)
{
    
ct_roundwon+=1
    
    set_hudmessage
(255000.00.1506.05.0)
    
show_hudmessage(id"T: %i^nCT: %i"t_roundwonct_roundwon)

AzcariaX is offline
kazuki
Senior Member
Join Date: Dec 2008
Old 02-16-2010 , 10:58   Re: Scores
Reply With Quote #3

Quote:
Originally Posted by AzcariaX View Post
Something like this?

PHP Code:
 
new t_roundwon
new ct_roundwon
 
public plugin_init() 

    
register_plugin("PLUGINNAME","8.0.2.3","Me")
    
register_event("SendAudio""t_win""a""2&%!MRAD_terwin")
    
register_event("SendAudio""ct_win""a""2&%!MRAD_ctwin"
}
 
public 
t_win(id)
{
    
t_roundwon+=1
 
    set_hudmessage
(255000.00.1506.05.0)
    
show_hudmessage(id"T: %i^nCT: %i"t_roundwonct_roundwon)
 
}
 
public 
ct_win(id)
{
    
ct_roundwon+=1
 
    set_hudmessage
(255000.00.1506.05.0)
    
show_hudmessage(id"T: %i^nCT: %i"t_roundwonct_roundwon)

No instead of + 1 it get the team flag and add like for an example:

Ct kill 10 already it show 10 in the hudmessage instead of 1 ?

if T kill 6 together then show 6..
kazuki is offline
AzcariaX
Junior Member
Join Date: Jun 2009
Location: Sweden
Old 02-16-2010 , 11:23   Re: Scores
Reply With Quote #4

Do you mean like this?

PHP Code:

public t_win(id)
{
    new 
Players[32], playerCountict_playerst_players

    get_players
(PlayersplayerCount
    
    while(
i<playerCount)
    {
        if(
get_user_team(Players[i])==1)
        {
            
t_players++
                    
        }
            
        if(
get_user_team(Players[i])==)
        {
            
ct_players++

        }
        
        
i++
    }
    
    
t_roundwon+=ct_players
    
    set_hudmessage
(255000.00.1506.05.0)
    
show_hudmessage(id"T: %i^nCT: %i"t_roundwonct_roundwon)
    
}

public 
ct_win(id)
{
    new 
Players[32], playerCountict_playerst_players

    get_players
(PlayersplayerCount
    
    while(
i<playerCount)
    {
        if(
get_user_team(Players[i])==1)
        {
            
t_players++
                    
        }
            
        if(
get_user_team(Players[i])==)
        {
            
ct_players++

        }
        
        
i++
    }
    
    
ct_roundwon+=t_players
    
    set_hudmessage
(255000.00.1506.05.0)
    
show_hudmessage(id"T: %i^nCT: %i"t_roundwonct_roundwon)

AzcariaX is offline
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 02-16-2010 , 17:23   Re: Scores
Reply With Quote #5

No. He wants every single frag counting as one point.
Seta00 is offline
schmurgel1983
Veteran Member
Join Date: Aug 2006
Location: Germany
Old 02-16-2010 , 18:47   Re: Scores
Reply With Quote #6

No, kazuki mean this.
PHP Code:
#include <amxmodx>
#include <cstrike>

new g_maxplayers  

public plugin_init()
{
    
register_plugin("Pluginname""1.0""Author")
    
register_event("SendAudio""event_end_round""a""2&%!MRAD_terwin""2&%!MRAD_ctwin""2&%!MRAD_rounddraw")
    
g_maxplayers get_maxplayers()
}
 
public 
event_end_round()
{
    static 
CT_FragsT_Frags
    CT_Frags 
0
    T_Frags 
0
    
    
for(new id 1id <= g_maxplayersid++)
    {
        if(!
is_user_connected(id))
            continue;
        
        if(
cs_get_user_team(id) == CS_TEAM_T)
        {
            
T_Frags += get_user_frags(id)
        }
        else if(
cs_get_user_team(id) == CS_TEAM_CT)
        {
            
CT_Frags += get_user_frags(id)
        }
    }
    
    
set_hudmessage(02000, -1.00.1500.26.00.51.0, -1)
    
show_hudmessage(0"TEAM SCORE^nHumans : %i | Zombies: %i"CT_FragsT_Frags)

Attached Files
File Type: sma Get Plugin or Get Source (team_score.sma - 690 views - 810 Bytes)
__________________

Working on:
nothing

Last edited by schmurgel1983; 02-16-2010 at 19:48.
schmurgel1983 is offline
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 02-16-2010 , 19:19   Re: Scores
Reply With Quote #7

If you don't know what you're coding, I don't know what to say.
Seta00 is offline
schmurgel1983
Veteran Member
Join Date: Aug 2006
Location: Germany
Old 02-16-2010 , 19:50   Re: Scores
Reply With Quote #8

i edit my script post, have do some mistakes
__________________

Working on:
nothing
schmurgel1983 is offline
kazuki
Senior Member
Join Date: Dec 2008
Old 02-17-2010 , 04:07   Re: Scores
Reply With Quote #9

Quote:
Originally Posted by schmurgel1983 View Post
i edit my script post, have do some mistakes
Doesn't work the hud message didn't appear.

And i want the message to appear forever and it doesn't overwrite my admin chat.
kazuki is offline
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 02-17-2010 , 07:25   Re: Scores
Reply With Quote #10

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

new g_maxplayers,
      
CT_Frags,
      
T_Frags;

public 
plugin_init() {
    
register_event("SendAudio""event_end_round""a""2&%!MRAD_terwin""2&%!MRAD_ctwin""2&%!MRAD_rounddraw");
    
register_event("HLTV""NewRound""a""1=0""2=0");
    
g_maxplayers get_maxplayers();
}
 
public 
event_end_round() {
    for(new 
id 1id <= g_maxplayersid++)
    {
        if(!
is_user_connected(id))
            continue;
        
        if(
cs_get_user_team(id) == CS_TEAM_T)
        {
            
T_Frags += get_user_frags(id)
        }
        else if(
cs_get_user_team(id) == CS_TEAM_CT)
        {
            
CT_Frags += get_user_frags(id)
        }
    }
}

public 
NewRound() {
   
set_hudmessage(02000, -1.00.1500.299999.00.599999.0, -1)
   
show_hudmessage(0"TEAM SCORE^nHumans : %i | Zombies: %i"CT_FragsT_Frags)

EDIT: Tested, working version.

Last edited by Seta00; 02-17-2010 at 07:34.
Seta00 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 11:20.


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