Thread: [Solved] HELP. tool change plugin
View Single Post
Author Message
baskin
Junior Member
Join Date: Feb 2019
Old 02-09-2019 , 06:23   HELP. tool change plugin
Reply With Quote #1

Hi, I'm trying to write my first plugin but I have a problem and couldn't figure it out.

I want to create a main menu and a submenu in my plugin. In this submenu, I would like to list the contacts on the server and make the selection. I couldn't figure it out because the selected user had to switch teams.

The plug-in turns seamlessly into the smx file, but when I load it on the server it gives an error when using the command and the panel doesn't open

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); 

            } 

Last edited by baskin; 02-12-2019 at 11:19. Reason: Restore to previous version. + Solved tag
baskin is offline