AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Team Tags wont work when i change my team by M key (https://forums.alliedmods.net/showthread.php?t=125902)

tuty 05-03-2010 11:39

Team Tags wont work when i change my team by M key
 
ok i made this code

PHP Code:


#include < amxmodx >
#include < amxmisc >

#pragma semicolon 1

#define PLUGIN_VERSION    "1.0.0"

new gTagNameTE[ ] = "[T]";
new 
gTagNameCT[ ] = "[CT]";

new 
gLastTag[ ] = "-.-";

public 
plugin_init()
{
    
register_plugin"TAG"PLUGIN_VERSION"tuty" );
    
    
register_event"TeamInfo""Hook_TeamInfo""a" );
}

public 
Hook_TeamInfo()
{
    new 
id read_data);
        
    new 
szTeam];
    
read_data2szTeamcharsmaxszTeam ) ); 
    
    new 
szName32 ];
    
get_user_nameidszNamecharsmaxszName ) );
    
    new 
szFormatName50 ];

    switch( 
szTeam] )
    {    
        case 
'T':
        {
            if( 
equalszNamegTagNameTEcharsmaxgTagNameTE ) ) )
            {
                return;
            }
            
            else if( !
replaceszNamecharsmaxszName ), gTagNameCTgTagNameTE ) )
            {
                
formatszFormatNamecharsmaxszFormatName ), "%s. %s%s"gTagNameTEszNamegLastTag );
            }

            
set_user_infoid"name"szFormatName );
        }

        case 
'C':
        {
            if( 
equalszNamegTagNameCTcharsmaxgTagNameCT ) ) )
            {
                return;
            }
            
            else if( !
replaceszNamecharsmaxszName ), gTagNameTEgTagNameCT ) )
            {
                
formatszFormatNamecharsmaxszFormatName ), "%s. %s%s"gTagNameCTszNamegLastTag );
            }
            
            
set_user_infoid"name"szFormatName );
        }
    }

    return;


everything works fine when i enter the server and when i choose a team, but when i want to change my team again with M key ("jointeam") my name isn't changed with my tags, is changed to unnamed. Why?

tuty 05-05-2010 07:44

Re: Team Tags wont work when i change my team by M key
 
any1?

KadiR 05-05-2010 14:08

Re: Team Tags wont work when i change my team by M key
 
Did you ever read the forum rules? I don't think so, don't bump till 2 weeks passed!

abdul-rehman 05-05-2010 14:25

Re: Team Tags wont work when i change my team by M key
 
Hook the event when a person changes his team..?!

tuty 05-05-2010 14:54

Re: Team Tags wont work when i change my team by M key
 
@kadir - i need the fix now not after 2 weeks
@the other one - are u dumb? that is the event for team changing rofl

minimiller 05-05-2010 15:18

Re: Team Tags wont work when i change my team by M key
 
i believe using your method does the same sort of thing as get_user_team()
it gets their old team until they respawn or something

abdul-rehman 05-05-2010 16:36

Re: Team Tags wont work when i change my team by M key
 
Well i am sorry i didnt know that...
I was just try ing to help...

fysiks 05-05-2010 18:27

Re: Team Tags wont work when i change my team by M key
 
Quote:

Originally Posted by tuty (Post 1171685)
i need the fix now not after 2 weeks

And somehow that makes you exempt from the rules?????

I wrote this plugin once. Search for it. It works.

ConnorMcLeod 05-06-2010 00:30

Re: Team Tags wont work when i change my team by M key
 
Quote:

Originally Posted by tuty (Post 1171685)
@the other one - are u dumb? that is the event for team changing rofl

This is not.
This is event for Team Information that is also sent by player each time a player spawn, and is sent to player when player enter the server.

Zombiezzz 05-11-2010 16:51

Re: Team Tags wont work when i change my team by M key
 
oo he got banned! BURN!


All times are GMT -4. The time now is 03:33.

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