Raised This Month: $ Target: $400
 0% 

Menu does only make first thing


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 04-24-2011 , 05:56   Menu does only make first thing
Reply With Quote #1

Hello everybody,
I have a problem with my Glow Menu, I tried to change izzles Glow Menu so you can choose a color, but only first Color works, the others doesnt.

PHP Code:
#include <amxmodx> 
#include <cstrike> 
#include <fun> 
#include <hamsandwich> 
public plugin_init() 

    
register_plugin("JailBreak Glow Menu""1.1""Kia"
    
register_clcmd"say /glow","JBGlowMenu"); 
    
register_clcmd"say_team /glow","JBGlowMenu"); 
    
    
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn_Post"1

public 
fw_PlayerSpawn_Post(id

    
set_user_rendering(id)    

public 
JBGlowMenu(id

    if (
cs_get_user_team(id) != CS_TEAM_CT || !is_user_alive(id)) 
    {  
        return 
PLUGIN_HANDLED
    } 
    new 
menu menu_create("\rGlow Menu:""sub_menu"); 
    
    new 
players[32], pnumtempid
    new 
szName[32], szTempid[10]; 
    
    
get_players(playerspnum"a"); 
    
    for( new 
ii<pnumi++ ) 
    { 
        
tempid players[i]; 
        
        
        
        
get_user_name(tempidszName31); 
        
num_to_str(tempidszTempid9); 
        
menu_additem(menuszNameszTempid0); 
    } 
    
    
menu_display(idmenu); 
    return 
PLUGIN_HANDLED

public 
sub_menu(idmenuitem

    
    new 
data[6], iName[64]; 
    new 
accesscallback
    
menu_item_getinfo(menuitemaccessdata,5iName63callback); 
    
    new 
menu menu_create("Glow Farbe:""farbe_handler")
    
    
menu_additem(menu"Rot""1"0);
    
menu_additem(menu"Gruen""2"0);
    
menu_additem(menu"Blau""3"0);
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu);
    
 
    return 
PLUGIN_HANDLED
}  

public 
farbe_handler(idmenuitem)
{
    new 
data[6], iName[64]; 
    new 
accesscallback
    
menu_item_getinfo(menuitemaccessdata,5iName63callback); 
    
    new 
tempid str_to_num(data); 
    new 
szName[32], szName2[32]; 
    
get_user_name(idszName31); 
    
get_user_name(tempidszName231); 
    
    new 
key str_to_num(data)
    switch(
key)
    {
        case 
1:
        {
            
set_user_rendering(tempidkRenderFxGlowShell25500kRenderNormal20)
            
client_print(0,print_chat,"[JailMod] %s glowte %s^n in Rot"szNameszName2);
        }
        case 
2:
        {
            
set_user_rendering(tempidkRenderFxGlowShell02550kRenderNormal20)
            
client_print(0,print_chat,"[JailMod] %s glowte %s^n in Blau "szNameszName2);
        }
        case 
3:
        {
            
set_user_rendering(tempidkRenderFxGlowShell00255kRenderNormal20)
            
client_print(0,print_chat,"[JailMod] %s glowte %s^n in Gruen"szNameszName2);
        }
    }

Kia is offline
Old 04-24-2011, 06:56
vato loco [GE-S]
This message has been deleted by vato loco [GE-S]. Reason: ....
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 04-24-2011 , 11:46   Re: Menu does only make first thing
Reply With Quote #2

Does work, but where is the menu where you choose the player who gets glowed?
I thought this was the problem.
Kia is offline
Old 04-24-2011, 13:07
vato loco [GE-S]
This message has been deleted by vato loco [GE-S]. Reason: ...
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 04-24-2011 , 13:11   Re: Menu does only make first thing
Reply With Quote #3

Are you kidding me?
I want the Players Menu IN the Glow Menu so the Menu has this Order :

1) Choose Player
2) Choose Color
3) Glow Player
Kia is offline
vato loco [GE-S]
Veteran Member
Join Date: Oct 2006
Location: Germany
Old 04-24-2011 , 13:14   Re: Menu does only make first thing
Reply With Quote #4

i'm kidding you ?
i have try to help you
oh sorry for wasting your time
maybe you should learn to exlpain
a bit better what you want
it seems you are kidding me
i have better things to do...

your're welcome and good luck
__________________

Last edited by vato loco [GE-S]; 04-24-2011 at 13:41.
vato loco [GE-S] is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 04-25-2011 , 04:40   Re: Menu does only make first thing
Reply With Quote #5

Well sorry, I tried to explain at good as I can.
This Menu does work almost perfect, but when I glow someone, he is only one that I can glow. I mean when I glow Player1 and want to glow Player2 after Player1, Player1 gets glow.

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <fun>
#include <cstrike>

#define PLUGIN "Glow Menu"
#define VERSION "1.0"
#define AUTHOR "vl"

#define OFFSET_TEAM 114

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn"1)
    
    
register_clcmd"say /glow","vorGlow")
    
register_clcmd"say_team /glow","vorGlow")
}

public 
fw_PlayerSpawn(id)
{
    if(
is_user_alive(id))
    {
        
set_user_rendering(id)
    }
}

public 
vorGlow(id)
{
    
    if (
cs_get_user_team(id) != CS_TEAM_CT || !is_user_alive(id)) 
    {  
        return 
PLUGIN_HANDLED
    } 
    
    new 
menu menu_create("Glow Menu:""GlowMenu"); 
    
    new 
players[32], pnumtempid
    new 
szName[32], szTempid[10]; 
    
    
get_players(playerspnum"a"); 
    
    for( new 
ii<pnumi++ ) 
    { 
        
tempid players[i]; 
        
        
get_user_name(tempidszName31); 
        
num_to_str(tempidszTempid9); 
        
menu_additem(menuszNameszTempid0); 
    } 
    
    
menu_display(idmenu); 
    return 
PLUGIN_HANDLED


public 
GlowMenu(id)
{
    
    
    if(!
is_user_alive(id) || get_pdata_int(idOFFSET_TEAM) != 2
    {  
        return 
PLUGIN_HANDLED
    
}
    new 
menu menu_create("Glow Menu:""GlowHandler")
    
    
menu_additem(menu"Rot""1"0)
    
menu_additem(menu"Blau""2"0)
    
menu_additem(menu"Gruen""3"0)
    
menu_additem(menu"UnGlow""4"0)
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL)
    
menu_display(idmenu0)
    return 
PLUGIN_HANDLED
}

public 
GlowHandler(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED
    
}
    new 
data[6]
    new 
accesscallback
    
new szName[32], szTempid[10];
    new 
players[32], pnumtempid;
    
menu_item_getinfo(menuitemaccessdatacharsmax(data), szNamecharsmax(szName), callback)
    
    
    
    
get_players(playerspnum"a"); 
    for( new 
ii<pnumi++ ) 
    { 
        
tempid players[i]; 
        
get_user_name(tempidszName31); 
        
num_to_str(tempidszTempid9); 
    }
    new 
key str_to_num(data)
    switch(
key)
    {
        case 
1:
        {
            
set_user_rendering(tempidkRenderFxGlowShell25500kRenderNormal20)
            
client_print(0print_chat"[JailMod] %s leuchtet jetzt Rot."tempid)
        }
        case 
2:
        {
            
set_user_rendering(tempidkRenderFxGlowShell00255kRenderNormal20)
            
client_print(0print_chat"[JailMod] %s leuchtet jetzt Blau."tempid)
        }
        case 
3:
        {
            
set_user_rendering(tempidkRenderFxGlowShell02550kRenderNormal20)
            
client_print(0print_chat"[JailMod] %s leuchtet jetzt Gruen."tempid)
        }
        case 
4:
        {
            
set_user_rendering(tempidkRenderFxGlowShell000kRenderNormal20)
            
client_print(0print_chat"[JailMod] %s leuchtet nun nicht mehr."tempid)
        }
    }
    
menu_destroy(menu)
    return 
PLUGIN_HANDLED

Kia is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 04-25-2011 , 04:47   Re: Menu does only make first thing
Reply With Quote #6

So you don't want the menu with players list to disappear after you pick someone ?
__________________
Hunter-Digital is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 04-25-2011 , 04:53   Re: Menu does only make first thing
Reply With Quote #7

No, I wan't to glow Players which have been chosen in the menu before.
In the Code above, you can choose all players, but the first Person who gets glowed, is the only who gets a glow, even when I choose another player, like this :

1) Choosed Player X
2) Glowed Player X

3) Open Menu again, and choose Player Y
4) Want to glow Player Y but Player X get glowed.

Last edited by Kia; 04-25-2011 at 05:04.
Kia is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 04-25-2011 , 05:00   Re: Menu does only make first thing
Reply With Quote #8

You need to store selected players into an global array and then loop through it when you set the glow, also clear it when you trigger the glow so it won't glitch on the second use.

But your 1/2/3/3 thing explains a different thing... (I wasn't talking about your miscount)

I can't help you with the code because I never used "new menu" functions.
__________________

Last edited by Hunter-Digital; 04-25-2011 at 05:07.
Hunter-Digital is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 04-25-2011 , 05:05   Re: Menu does only make first thing
Reply With Quote #9

I mean 1,2,3,4 sorry. ^^

Ok, thanks for help.
Kia is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-25-2011 , 18:47   Re: Menu does only make first thing
Reply With Quote #10

This:

PHP Code:
    get_players(playerspnum"a");
    for( new 
ii<pnumi++ )
    {
        
tempid players[i];
        
get_user_name(tempidszName31);
        
num_to_str(tempidszTempid9);
    } 
should not be in GlowHandler(). It will just get the last player in the entity list and set their rendering.

First, you should make an actual handler for your first menu that will cache the selected player's entity number into a global array and then call the second menu to be shown.

PHP Code:
new g_iTarget[33]

// ....

    
g_iTarget[id] = str_to_num(data// data is from menu_item_getinfo()
// ....

    
set_user_rendering(g_iTarget[id], ...) 
__________________
fysiks is offline
Reply



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 20:11.


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