This small code makes the client instanly close connection?
#1

This video shows the issue: --

This little code is making the client close the connection?
PHP Code:
case DIALOG_PLAY: {
            if(
response) {
                switch(
listitem) {
                    case 
0: { // Competitive
                        
Player[playerid][pStatus]    = STATUS_COMP;
                        
Player[playerid][pDead]     = true;
                        
                        for(new 
id 0id 19id++)
                            
PlayerTextDrawDestroy(playeridHomeMenuTextdraws[playerid][id]);
                        for(new 
id 0id 10id++)
                            
PlayerTextDrawDestroy(playeridMenuTextdraws[playerid][id]);
                        
CancelSelectTextDraw(playerid);
                        
                        
Player[playerid][pTeam]     = GetCompTeam();
                        
                        if(
IsCompWarmup()) {
                            
SendClientMessage(playerid0xD7D7D7FF"WARMUP: The competitive requires atleast 2 players, so far there'll be a warmup.");
                            
                            
Player[playerid][pDead]     = false;
                            
TogglePlayerSpectating(playeridfalse);
                            
SendClientMessage(playerid0xD7D7D7FF"MAP: The current map is de_dust2 made by JamesT85.");
                            
TogglePlayerControllable(playeridfalse);
                            if(
Player[playerid][pTeam] == TEAM_CT)
                                
SetPlayerPos(playerid, -717.6069332577.695800241.739685);
                            
SetTimerEx("UnfreezePlayer"2000false"i"playerid);
                        }
                    }
                    case 
1: { // Shooting Range
                    
                      
}
                      case 
2: { // Missions
                    
}
                    case 
3: { // Dueling
                    
                    
}
                  }
            }
            else
                
SelectTextDraw(playerid, -673720321);
        } 
Reply
#2

After some debugment, this is the line that shuts the clients connection.
TogglePlayerSpectating(playerid, false);
Reply
#3

Fixed by forcing the player to spawn before letting him load in.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)