Raised This Month: $ Target: $400
 0% 

help making menus that change skins (ex. knife, defuse kit)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
-=*HQz=-=mAster nOob=-
Junior Member
Join Date: Mar 2006
Old 04-11-2006 , 00:18   help making menus that change skins (ex. knife, defuse kit)
Reply With Quote #1

wow ok really, I must give credit to those who understand this language inside out and can work with this. This language is really pissing me off I understand nothing, and whatever I do, even based off of other scripts, does not work. Can somebody just please make a simple command for me (just to start me off and lead me into the right direction) as to like when you go to console and type in /skinmenu, a menu comes up asking what skin you would like for your "knife" skin. then can you just simply leave the code to changing the knife skin?

what I mean is just have the layout of a code something like this, and I will fill in the rest.
-=*HQz=-=mAster nOob=- is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 04-11-2006 , 09:37  
Reply With Quote #2

Try this. I currently have no way of testing it so I don't know whether it'll work or not:

Code:
#include <amxmodx> #include <amxmisc> #include <engine> #define MAX_SKINS 4 new g_szSkins[MAX_SKINS][] = {     "Skin 1",     "Skin 2",     "Skin 3",     "Skin 4" } new g_szSkinFiles[MAX_SKINS][] = {     "skin_1.mdl",     "skin_2.mdl",     "skin_3.mdl",     "skin_4.mdl" } new g_iKeys = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9 new g_iSkin[33] public plugin_init() {     register_plugin("Skin Knife Menu","1.0","Hawk552")         register_menucmd(register_menuid("mSkinMenu"),g_iKeys,"fnSkinMenuHandle")         register_clcmd("amx_skinmenu","fnSkinMenu")     register_clcmd("say /skinmenu","fnSkinMenu")         register_event("CurWeapon","fnEventCurWeapon","be","1>0") } public plugin_precache()     for(new iCount = 0;iCount < MAX_SKINS;iCount++)         precache_model(g_szSkinFiles[iCount])         public client_disconnect(id)     g_iSkin[id] = 0 public fnSkinMenu(id) {     new szMenu[1024],iPos     iPos += format(szMenu[iPos],1023-iPos,"Select Knife Skin:^n^n")     for(new iCount = 0;iCount < MAX_SKINS;iCount++)         iPos += format(szMenu[iPos],1023-iPos,"%i. %s",iCount + 1,g_szSkins[iCount])             show_menu(id,g_iKeys,szMenu,-1,"mSkinMenu")     return PLUGIN_HANDLED } public fnSkinMenuHandle(id,iKey)     if(iKey < 0 || iKey > MAX_SKINS - 1)         fnSkinMenu(id)     else         g_iSkin[id] = iKey         public fnEventCurWeapon(id) {     new iClip,iAmmo,iWeap = get_user_weapon(id,iClip,iAmmo)     if(iWeap == CSW_KNIFE && g_iSkin[id])         entity_set_string(id,EV_SZ_viewmodel,g_szSkinFiles[g_iSkin[id]]) }
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
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 16:41.


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