AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to show CT players as T on the scoreboard all the time? (https://forums.alliedmods.net/showthread.php?t=120981)

edward0810 03-10-2010 09:05

How to show CT players as T on the scoreboard all the time?
 
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!!:mrgreen:
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() }

edward0810 03-20-2010 11:10

Re: How to show CT players as T on the scoreboard all the time?
 
Should I use MSG_ONE or MSG_BROADCAST for this issue?
And can someone give me a table showing how these things work?

ConnorMcLeod 03-20-2010 11:27

Re: How to show CT players as T on the scoreboard all the time?
 
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")
    }



edward0810 03-20-2010 11:33

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

Originally Posted by ConnorMcLeod (Post 1123360)
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?

ConnorMcLeod 03-20-2010 11:35

Re: How to show CT players as T on the scoreboard all the time?
 
Admin with which flags/access ?

edward0810 03-20-2010 11:36

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

Originally Posted by ConnorMcLeod (Post 1123369)
Admin with which flags/access ?

ADMIN_RESERVATION is good enough.

ConnorMcLeod 03-20-2010 12:20

Re: How to show CT players as T on the scoreboard all the time?
 
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")
    }



edward0810 03-20-2010 21:05

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

Originally Posted by ConnorMcLeod (Post 1123408)
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:wink:
I think I will edit it a bit myself to fit my requirements:)


All times are GMT -4. The time now is 08:44.

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