Raised This Month: $ Target: $400
 0% 

How to show CT players as T on the scoreboard all the time?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
edward0810
Member
Join Date: Mar 2009
Location: H.K.
Old 03-10-2010 , 09:05   How to show CT players as T on the scoreboard all the time?
Reply With Quote #1

Hi all
How to show CT players as T on the scoreboard all the time?
I've mae a plugin but it doesn't seemed to be working properly.
Please help me and point out what I'm exactly doing.
Thanks a lot!!
Code:
#include <amxmodx> #include <amxmisc> #define PLUGIN "Fake T's" #define VERSION "1.0" #define AUTHOR "Ad" new g_msgTeamInfo public plugin_init() {  register_plugin(PLUGIN, VERSION, AUTHOR)  g_msgTeamInfo = get_user_msgid("TeamInfo")  register_event ("ResetHUD", "setTeam", "b")  //register_clcmd ("set_team", "setTeam", 0, "Change Team Info.")  //Just for testing. Can be neglected. } public setTeam(id) {  message_begin(MSG_ALL, g_msgTeamInfo)  write_byte(id)  write_string("TERRORIST")  message_end() }
__________________
I am a newbie. Don't blame for my stupid question

Last edited by edward0810; 03-20-2010 at 11:01. Reason: Changed the question
edward0810 is offline
edward0810
Member
Join Date: Mar 2009
Location: H.K.
Old 03-20-2010 , 11:10   Re: How to show CT players as T on the scoreboard all the time?
Reply With Quote #2

Should I use MSG_ONE or MSG_BROADCAST for this issue?
And can someone give me a table showing how these things work?
__________________
I am a newbie. Don't blame for my stupid question
edward0810 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-20-2010 , 11:27   Re: How to show CT players as T on the scoreboard all the time?
Reply With Quote #3

Try this :

Any code (included this one) will fail if you use a plugin that send some colorchat with change team color.

PHP Code:
#include <amxmodx>

new const VERSION[] = "0.0.1"

public plugin_init()
{
    
register_plugin("CT as T"VERSION"ConnorMcLeod")

    
register_message(get_user_msgid("TeamInfo"), "Message_TeamInfo")
}

public 
Message_TeamInfo(/*msg_type, msg_dest, ed*/)
{
    new 
szTeam[4]
    if( 
get_msg_arg_string(2szTeamcharsmax(szTeam))) == )
    {
        
set_msg_arg_string(2"TERRORIST")
    }

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
edward0810
Member
Join Date: Mar 2009
Location: H.K.
Old 03-20-2010 , 11:33   Re: How to show CT players as T on the scoreboard all the time?
Reply With Quote #4

Quote:
Originally Posted by ConnorMcLeod View Post
Try this :

Any code (included this one) will fail if you use a plugin that send some colorchat with change team color.

PHP Code:
#include <amxmodx>
 
new const VERSION[] = "0.0.1"
 
public plugin_init()
{
    
register_plugin("CT as T"VERSION"ConnorMcLeod")
 
    
register_message(get_user_msgid("TeamInfo"), "Message_TeamInfo")
}
 
public 
Message_TeamInfo(/*msg_type, msg_dest, ed*/)
{
    new 
szTeam[4]
    if( 
get_msg_arg_string(2szTeamcharsmax(szTeam))) == )
    {
        
set_msg_arg_string(2"TERRORIST")
    }

Is it compatible with Admins as VIP on scoreboard?
If no can you solve it?
__________________
I am a newbie. Don't blame for my stupid question
edward0810 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-20-2010 , 11:35   Re: How to show CT players as T on the scoreboard all the time?
Reply With Quote #5

Admin with which flags/access ?
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
edward0810
Member
Join Date: Mar 2009
Location: H.K.
Old 03-20-2010 , 11:36   Re: How to show CT players as T on the scoreboard all the time?
Reply With Quote #6

Quote:
Originally Posted by ConnorMcLeod View Post
Admin with which flags/access ?
ADMIN_RESERVATION is good enough.
__________________
I am a newbie. Don't blame for my stupid question
edward0810 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-20-2010 , 12:20   Re: How to show CT players as T on the scoreboard all the time?
Reply With Quote #7

This will let admins appear as CT (VIP can't be shown in T)

PHP Code:
#include <amxmodx>

new const VERSION[] = "0.0.1"

public plugin_init()
{
    
register_plugin("CT as T"VERSION"ConnorMcLeod")

    
register_message(get_user_msgid("TeamInfo"), "Message_TeamInfo")
}

public 
Message_TeamInfo(/*msg_type, msg_dest, ed*/)
{
    new 
szTeam[4]
    if(    
get_msg_arg_string(2szTeamcharsmax(szTeam))) == 2
    
&&    ~get_user_flags(get_msg_arg_int(1)) & ADMIN_RESERVATION    )
    {
        
set_msg_arg_string(2"TERRORIST")
    }

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
edward0810
Member
Join Date: Mar 2009
Location: H.K.
Old 03-20-2010 , 21:05   Re: How to show CT players as T on the scoreboard all the time?
Reply With Quote #8

Quote:
Originally Posted by ConnorMcLeod View Post
This will let admins appear as CT (VIP can't be shown in T)

PHP Code:
#include <amxmodx>
 
new const VERSION[] = "0.0.1"
 
public plugin_init()
{
    
register_plugin("CT as T"VERSION"ConnorMcLeod")
 
    
register_message(get_user_msgid("TeamInfo"), "Message_TeamInfo")
}
 
public 
Message_TeamInfo(/*msg_type, msg_dest, ed*/)
{
    new 
szTeam[4]
    if(    
get_msg_arg_string(2szTeamcharsmax(szTeam)) == 2
    
&&    ~get_user_flags(get_msg_arg_int(1) & ADMIN_RESERVATION    )
    {
        
set_msg_arg_string(2"TERRORIST")
    }

Thanks a lot for editing the code
I think I will edit it a bit myself to fit my requirements
__________________
I am a newbie. Don't blame for my stupid question
edward0810 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 08:44.


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