Raised This Month: $48 Target: $400
 12% 

HELP. Team Switch Plugin Count Error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
baskin
Junior Member
Join Date: Feb 2019
Old 02-09-2019 , 16:07   HELP. Team Switch Plugin Count Error
Reply With Quote #1

Hi, I'm writing a plugin but I'm stuck at some point.

The plug-in has a main menu (Team switch) and a drop-down menu (User list). The problem is. Server capacity 32, the main menu before the server is full, but the submenu does not open, but when the server is 32 people, please help.


PHP Code:
new Handle:submenu CreateMenu(HDTMenuTakim);
                
SetMenuTitle(submenu"TAKIM DEGIS");
                for(new 
1<= MaxClientsi++){
                    
decl String:TargetName[512];
                    
GetClientName(iTargetNamesizeof(TargetName));
                    
AddMenuItem(submenuTargetNameTargetName);
                }
                
SetMenuExitButton(submenutrue);
                
DisplayMenu(submenuclientMENU_TIME_FOREVER);

------------------------------------------



new 
target = -1;
            new 
String:info[512];
            
GetMenuItem(menuTargetUserinfosizeof(info));
            
            for(new 
1<= MaxClientsi++){
                
                if(!
IsClientInGame(i)){
                    continue;
                }

                
decl String:other[512];
                
GetClientName(iothersizeof(other));

                if(
StrEqual(infoother)){
                    
target i;
                }
            
            }

            if(
GetClientTeam(target) != 2){

                
ChangeClientTeam(target2);

            }else if(
GetClientTeam(target) != 3){

                
ChangeClientTeam(target3);

            } 
baskin is offline
baskin
Junior Member
Join Date: Feb 2019
Old 02-12-2019 , 12:20   Re: HELP. Team Switch Plugin Count Error
Reply With Quote #2

#Solved

PHP Code:
if(!IsClientInGame(i)){ 
                    continue; 
                } 

There was a missing if query in the menu code.
baskin 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 15:28.


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