AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Why don't work this? (https://forums.alliedmods.net/showthread.php?t=232712)

matthew16 01-03-2014 17:26

Why don't work this?
 
PHP Code:

public ChooseTeamidmenuitem )
{
    switch( 
item )
    {
        case 
1:
        {
            
cs_set_user_team(idCS_TEAM_T)
            
user_kill(id1)
            
        }
        case 
2:
        {        
            
cs_set_user_team(idCS_TEAM_CT)
            
user_kill(id1)        
        }
        case 
3:
        {
            
cs_set_user_team(idCS_TEAM_SPECTATOR)
            
user_kill(id1)    
        }    
    }
    
menu_destroymenu );
    return 
PLUGIN_HANDLED;


and

PHP Code:

public HookCmdChooseTeam(id){
        
Menu(id);
    return 
PLUGIN_HANDLED;    
        
//dont show a menu..: (



YamiKaitou 01-03-2014 17:49

Re: Why don't work this?
 
What are you trying to do and where is the rest of your code?

fysiks 01-03-2014 17:54

Re: Why don't work this?
 
Show the full code (attach your plugin).

matthew16 01-03-2014 19:43

Re: Why don't work this?
 
if i sent private message? u need me?

Jhob94 01-03-2014 19:53

Re: Why don't work this?
 
Quote:

Originally Posted by matthew16 (Post 2080702)
PHP Code:

public ChooseTeamidmenuitem )
{
    switch( 
item )
    {
        case 
1:
        {
            
cs_set_user_team(idCS_TEAM_T)
            
user_kill(id1)
            
        }
        case 
2:
        {        
            
cs_set_user_team(idCS_TEAM_CT)
            
user_kill(id1)        
        }
        case 
3:
        {
            
cs_set_user_team(idCS_TEAM_SPECTATOR)
            
user_kill(id1)    
        }    
    }
    
menu_destroymenu );
    return 
PLUGIN_HANDLED;



Try this:
PHP Code:

public ChooseTeam(idmenuitem)
{
    if(
item == MENU_EXIT)
        return 
PLUGIN_HANDLED
    
    
new info[3]
    new 
accesscallback
    menu_item_getinfo
(menuitemaccessinfo2__callback)
    new 
key str_to_num(info)
    
    switch(
key)
    {
        case 
1:
        {
            
cs_set_user_team(idCS_TEAM_T)
            
user_kill(id1)
        }
        
        case 
2:
        {
            
cs_set_user_team(idCS_TEAM_CT)
            
user_kill(id1)
        }
        
        case 
3:
        {
            
cs_set_user_team(idCS_TEAM_SPECTATOR)
            
user_kill(id1)
        }
    }
    
    
menu_destroy(menu)
    return 
PLUGIN_HANDLED



Quote:

Originally Posted by matthew16 (Post 2080702)
[PHP]
PHP Code:

public HookCmdChooseTeam(id){
        
Menu(id);
    return 
PLUGIN_HANDLED;    
        
//dont show a menu..: (



If you dont show Menu(id) function, we cant tell you the problem.


All times are GMT -4. The time now is 10:08.

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