|
Senior Member
Join Date: Jun 2006
Location: CAli
|

06-15-2007
, 19:59
choosen model on respawn help
|
#1
|
ok, in this code, there is a random model seceter(gives players random player models on respawn). When someone types "/haloskin" in chat a menu will come up and the player can select his/her skin color.
After they select their skin, the skin color turns the ways that they selected, which is good.
but when they respawn the the random model selector gives them a diff model.
can someone help
thx in advance
PHP Code:
#include <amxmodx> #include <cstrike> #define MAXMODELS 8 new models[MAXMODELS][] = { "Halo_Blue", "Halo_Green", "Halo_Purple", "Halo_Teal", "Halo_Orange", "Halo_Dark_Orange", "Halo_Red", "Halo_Yellow" };
#define PLUGIN "omg models!" #define VERSION "1.1" #define AUTHOR "flyeni" public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR); register_cvar("amx_randmodels", "1"); register_event("ResetHUD","model","b"); register_clcmd( "say /haloskin","halo_skin_menu") } public plugin_precache() { precache_model("models/player/Halo_Blue/Halo_Blue.mdl") precache_model("models/player/Halo_Green/Halo_Green.mdl") precache_model("models/player/Halo_Purple/Halo_Purple.mdl") precache_model("models/player/Halo_Teal/Halo_Teal.mdl") precache_model("models/player/Halo_Orange/Halo_Orange.mdl") precache_model("models/player/Halo_Dark_Orange/Halo_Dark_Orange.mdl") precache_model("models/player/Halo_Red/Halo_Red.mdl") precache_model("models/player/Halo_Yellow/Halo_Yellow.mdl") } public model(id) { new random_model if(cs_get_user_team(id) == CS_TEAM_CT) { random_model = random_num(0,MAXMODELS-1); cs_set_user_model(id, models[random_model]); set_hudmessage(32, 202, 32, -1.0, 0.88, 0, 6.0, 12.0); show_hudmessage(id, "Random Skin: %s", models[random_model]); } else if(cs_get_user_team(id) == CS_TEAM_T) { random_model = random_num(0,MAXMODELS-1); cs_set_user_model(id, models[random_model]); set_hudmessage(32, 202, 32, -1.0, 0.88, 0, 6.0, 12.0); show_hudmessage(id, "Random Skin: %s", models[random_model]); } } public halo_skin_menu(id) { new menu = menu_create("\rHalo Slayer Skins:", "menu_handler") menu_additem(menu, "\wBlue", "1", 0) menu_additem(menu, "\wGreen", "2", 0) menu_additem(menu, "\wPurple", "3", 0) menu_additem(menu, "\wTeal", "4", 0) menu_additem(menu, "\wOrange", "5", 0) menu_additem(menu, "\wDark Orange", "6", 0) menu_additem(menu, "\wRed", "7", 0) menu_additem(menu, "\wYellow", "8", 0) menu_setprop(menu, MPROP_EXIT, MEXIT_ALL) menu_display(id, menu, 0) } public menu_handler(id, menu, item) { if (item == MENU_EXIT) { menu_destroy(menu) return PLUGIN_HANDLED } new data[6], iName[64] new access, callback menu_item_getinfo(menu, item, access, data,5, iName, 63, callback) new key = str_to_num(data) switch(key) { case 1: { cs_set_user_model(id, "Halo_Blue") set_hudmessage(42, 42, 255, -1.0, 0.88, 0, 6.0, 6.0); show_hudmessage(id, "Halo Skin: Blue") client_print(id, print_chat, "[Halo Mod] You Now Have A Blue Halo Skin Color") client_print(id, print_console, "[Halo Mod] You Now Have A Blue Halo Skin Color") menu_destroy(menu) return PLUGIN_HANDLED } case 2: { cs_set_user_model(id, "Halo_Green") set_hudmessage(32, 202, 32, -1.0, 0.88, 0, 6.0, 6.0); show_hudmessage(id, "Halo Skin: Green") client_print(id, print_chat, "[Halo Mod] You Now Have A Green Halo Skin Color") client_print(id, print_console, "[Halo Mod] You Now Have A Green Halo Skin Color") menu_destroy(menu) return PLUGIN_HANDLED } case 3: { cs_set_user_model(id, "Halo_Purple") set_hudmessage(170, 0, 255, -1.0, 0.88, 0, 6.0, 6.0); show_hudmessage(id, "Halo Skin: Purple") client_print(id, print_chat, "[Halo Mod] You Now Have A Purple Halo Skin Color") client_print(id, print_console, "[Halo Mod] You Now Have A Purple Halo Skin Color") menu_destroy(menu) return PLUGIN_HANDLED } case 4: { cs_set_user_model(id, "Halo_Teal") set_hudmessage(0, 127, 255, -1.0, 0.88, 0, 6.0, 6.0); show_hudmessage(id, "Halo Skin: Teal") client_print(id, print_chat, "[Halo Mod] You Now Have A Teal Halo Skin Color") client_print(id, print_console, "[Halo Mod] You Now Have A Teal Halo Skin Color") menu_destroy(menu) return PLUGIN_HANDLED } case 5: { cs_set_user_model(id, "Halo_Orange") set_hudmessage(255, 127, 0, -1.0, 0.88, 0, 6.0, 6.0); show_hudmessage(id, "Halo Skin: Orange") client_print(id, print_chat, "[Halo Mod] You Now Have An Orange Halo Skin Color") client_print(id, print_console, "[Halo Mod] You Now Have An Orange Halo Skin Color") menu_destroy(menu) return PLUGIN_HANDLED } case 6: { cs_set_user_model(id, "Halo_Dark_Orange") set_hudmessage(255, 85, 0, -1.0, 0.88, 0, 6.0, 6.0); show_hudmessage(id, "Halo Skin: Dark Orange") client_print(id, print_chat, "[Halo Mod] You Now Have A Dark Orange Halo Skin Color") client_print(id, print_console, "[Halo Mod] You Now Have A Dark Orange Halo Skin Color") menu_destroy(menu) return PLUGIN_HANDLED } case 7: { cs_set_user_model(id, "Halo_Red") set_hudmessage(255, 0, 0, -1.0, 0.88, 0, 6.0, 6.0); show_hudmessage(id, "Halo Skin: Red") client_print(id, print_chat, "[Halo Mod] You Now Have A Red Halo Skin Color") client_print(id, print_console, "[Halo Mod] You Now Have A Red Halo Skin Color") menu_destroy(menu) return PLUGIN_HANDLED } case 8: { cs_set_user_model(id, "Halo_Yellow") set_hudmessage(255, 212, 0, -1.0, 0.88, 0, 6.0, 6.0); show_hudmessage(id, "Halo Skin: Yellow") client_print(id, print_chat, "[Halo Mod] You Now Have A Yellow Halo Skin Color") client_print(id, print_console, "[Halo Mod] You Now Have A Yellow Halo Skin Color") menu_destroy(menu) return PLUGIN_HANDLED } } menu_destroy(menu) return PLUGIN_HANDLED }
__________________
|
|