AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Event TeamInfo Problem (https://forums.alliedmods.net/showthread.php?t=147886)

Stylaa 01-15-2011 10:30

Event TeamInfo Problem
 
My Code looks like this

Plugin Init :

PHP Code:

//Get Team
    
register_event"TeamInfo" "fw_EvTeamInfo" "a" ); 

PHP Code:

public fw_EvTeamInfo( )
{
    static 
idid read_data);
    static 
szTeam]; read_dataszTeam );
    
    switch( 
szTeam] )
    {
        case 
'T'
        {
            
//terrorist
            
PlayerInfo[id][p_team] = 1
        
}
        case 
'C'
        {
            
//CT
            
PlayerInfo[id][p_team] = 2
        
}
        case 
'S':
        {
           
//Spectator
           
PlayerInfo[id][p_team] = 3
        
}
        case 
'U':
        {
           
//UNassigned
           
PlayerInfo[id][p_team] = 4
        
}
    }


My Problem :

When im using this Code Players get showed as Spectator Sometimes and sometimes not
i hope anyone knows what i did wrong

ConnorMcLeod 01-15-2011 10:33

Re: Event TeamInfo Problem
 
Show the full code, also 'U' should be 0 and not 4.

Stylaa 01-15-2011 13:41

Re: Event TeamInfo Problem
 
if i comment the Register Event Line the Bug not occurs

The Variables are just for my Menu because i had get_user_team about 150 times in my Plugin.
I defines those Numbers to he Teams so its dont affect this problem i think ;)

and if i uncomment it the Bug happens i realy dont know what this can be


All times are GMT -4. The time now is 02:14.

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