|
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
|

04-24-2011
, 05:56
Menu does only make first thing
|
#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], pnum, tempid; new szName[32], szTempid[10]; get_players(players, pnum, "a"); for( new i; i<pnum; i++ ) { tempid = players[i]; get_user_name(tempid, szName, 31); num_to_str(tempid, szTempid, 9); menu_additem(menu, szName, szTempid, 0); } menu_display(id, menu); return PLUGIN_HANDLED; } public sub_menu(id, menu, item) { new data[6], iName[64]; new access, callback; menu_item_getinfo(menu, item, access, data,5, iName, 63, callback); 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(menu, MPROP_EXIT, MEXIT_ALL); menu_display(id, menu); return PLUGIN_HANDLED; }
public farbe_handler(id, menu, item) { new data[6], iName[64]; new access, callback; menu_item_getinfo(menu, item, access, data,5, iName, 63, callback); new tempid = str_to_num(data); new szName[32], szName2[32]; get_user_name(id, szName, 31); get_user_name(tempid, szName2, 31); new key = str_to_num(data) switch(key) { case 1: { set_user_rendering(tempid, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 20) client_print(0,print_chat,"[JailMod] %s glowte %s^n in Rot", szName, szName2); } case 2: { set_user_rendering(tempid, kRenderFxGlowShell, 0, 255, 0, kRenderNormal, 20) client_print(0,print_chat,"[JailMod] %s glowte %s^n in Blau ", szName, szName2); } case 3: { set_user_rendering(tempid, kRenderFxGlowShell, 0, 0, 255, kRenderNormal, 20) client_print(0,print_chat,"[JailMod] %s glowte %s^n in Gruen", szName, szName2); } } }
|
|