AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   help making menus that change skins (ex. knife, defuse kit) (https://forums.alliedmods.net/showthread.php?t=26909)

-=*HQz=-=mAster nOob=- 04-11-2006 00:18

help making menus that change skins (ex. knife, defuse kit)
 
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.

Hawk552 04-11-2006 09:37

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]]) }


All times are GMT -4. The time now is 16:41.

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