Raised This Month: $ Target: $400
 0% 

choosen model on respawn help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
flyeni6
Senior Member
Join Date: Jun 2006
Location: CAli
Old 06-15-2007 , 19:59   choosen model on respawn help
Reply With Quote #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(PLUGINVERSIONAUTHOR);
 
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(idmodels[random_model]);
   
set_hudmessage(3220232, -1.00.8806.012.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(idmodels[random_model]);
   
set_hudmessage(3220232, -1.00.8806.012.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(menuMPROP_EXITMEXIT_ALL)
  
menu_display(idmenu0)
}
public 
menu_handler(idmenuitem)
{
 if (
item == MENU_EXIT)
 {
  
menu_destroy(menu)
  return 
PLUGIN_HANDLED
 
}
 new 
data[6], iName[64]
 new 
accesscallback
 
 menu_item_getinfo
(menuitemaccessdata,5iName63callback)
 new 
key str_to_num(data)
 switch(
key)
 {
  case 
1:
  {
   
cs_set_user_model(id"Halo_Blue")
 
   
set_hudmessage(4242255, -1.00.8806.06.0);
   
show_hudmessage(id"Halo Skin: Blue")
   
client_print(idprint_chat"[Halo Mod] You Now Have A Blue Halo Skin Color")
   
client_print(idprint_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(3220232, -1.00.8806.06.0);
   
show_hudmessage(id"Halo Skin: Green")
   
client_print(idprint_chat"[Halo Mod] You Now Have A Green Halo Skin Color")
   
client_print(idprint_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(1700255, -1.00.8806.06.0);
   
show_hudmessage(id"Halo Skin: Purple")
   
client_print(idprint_chat"[Halo Mod] You Now Have A Purple Halo Skin Color")
   
client_print(idprint_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(0127255, -1.00.8806.06.0);
   
show_hudmessage(id"Halo Skin: Teal")
   
client_print(idprint_chat"[Halo Mod] You Now Have A Teal Halo Skin Color")
   
client_print(idprint_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(2551270, -1.00.8806.06.0);
   
show_hudmessage(id"Halo Skin: Orange")
   
client_print(idprint_chat"[Halo Mod] You Now Have An Orange Halo Skin Color")
   
client_print(idprint_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(255850, -1.00.8806.06.0);
   
show_hudmessage(id"Halo Skin: Dark Orange")
   
client_print(idprint_chat"[Halo Mod] You Now Have A Dark Orange Halo Skin Color")
   
client_print(idprint_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(25500, -1.00.8806.06.0);
   
show_hudmessage(id"Halo Skin: Red")
   
client_print(idprint_chat"[Halo Mod] You Now Have A Red Halo Skin Color")
   
client_print(idprint_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(2552120, -1.00.8806.06.0);
   
show_hudmessage(id"Halo Skin: Yellow")
   
client_print(idprint_chat"[Halo Mod] You Now Have A Yellow Halo Skin Color")
   
client_print(idprint_console"[Halo Mod] You Now Have A Yellow Halo Skin Color")
 
   
menu_destroy(menu)
   return 
PLUGIN_HANDLED
  
}
 }
 
menu_destroy(menu)
 return 
PLUGIN_HANDLED

__________________

flyeni6 is offline
Send a message via AIM to flyeni6
 



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 10:32.


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