Not working SkinMenu

Coding Help/Re-API Supported
Post Reply
Graphyt
Member
Member
Romania
Posts: 8
Joined: 5 years ago
Contact:

Not working SkinMenu

#1

Post by Graphyt » 5 years ago

So, I edited the entire script (I'm not that good at CS scripting) and I got no error while compiling BUT when I try to put a skin on me, is not working, is setting me the same urban T skin to all of them, I mean the skin changes but to a different model (as I said, urban T model), what can I do to make it work or where I fucked up the code? I want to learn too. Here is the code.

Code: Select all

 #include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <zombie_escape>
#include <ze_vip>


#define PLUGIN "Admin Model Menu"
#define VERSION "1.0"
#define AUTHOR "Dimision"

new g_pCvarUseTimes
new g_iUsedTimes[33]


public plugin_natives()
{
    register_native("ze_open_skin_menu", "native_ze_open_skin_menu", 1)
}

public plugin_init() 
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    g_pCvarUseTimes = register_cvar("ze_skin_menu_used", "1")
}

public plugin_precache() 
{
        precache_model("models/ZE_skznzs/Asasin.mdl")
        precache_model("models/ZE_skznzs/Death.mdl")
        precache_model("models/ZE_skznzs/Dobby.mdl")
        precache_model("models/ZE_skznzs/Sonic.mdl")
        precache_model("models/ZE_skznzs/Skeleton.mdl")
        precache_model("models/ZE_skznzs/Joker.mdl")
        precache_model("models/ZE_skznzs/Iron.mdl")
        precache_model("models/ZE_skznzs/DeadSpace2.mdl")
        precache_model("models/ZE_skznzs/Trump.mdl")
        precache_model("models/ZE_skznzs/trollface.mdl")
        precache_model("models/ZE_skznzs/PokerFace.mdl")
        precache_model("models/ZE_skznzs/ZE_hm_Admin.mdl")
}
public model_menu(id)
{
    if (ze_is_user_zombie(id))
    {
        ze_colored_print(id, "!tYou can't change your skin while zombie!y.")
        return PLUGIN_HANDLED
    }
    if (g_iUsedTimes[id] >= get_pcvar_num(g_pCvarUseTimes))
    {
        ze_colored_print(id, "!tMaximum have been reached !y[!g%d!y]!", get_pcvar_num(g_pCvarUseTimes))
        return PLUGIN_HANDLED
    }
    else
    {
        new menu = menu_create("\r[\wSkin Models\r]\r", "menu_wybierz")
    
        menu_additem(menu, "\wAsasin", "1", 0)
        menu_additem(menu, "\wDeath", "2", 0)
        menu_additem(menu, "\wDobby", "3", 0)
        menu_additem(menu, "\wSonic", "4", 0)
        menu_additem(menu, "\wSkeleton", "5", 0)
        menu_additem(menu, "\wJoker", "6", 0)
        menu_additem(menu, "\wIron", "7", 0)
        menu_additem(menu, "\wDead Space", "8", 0)
        menu_additem(menu, "\wTrump \r[*VIP*]", "9", 0)
        menu_additem(menu, "\wPokerFace \r[*VIP*]", "10", 0)
        menu_additem(menu, "\wTrollFace \r[*VIP*]", "11", 0)
        menu_additem(menu, "\wSkull \r[*ADMIN*]", "12", 0)

    
        menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
        menu_display(id, menu, 0)
    }
    return PLUGIN_HANDLED
}
public menu_wybierz(id, menu, item)
{
    if (item == MENU_EXIT)
    {
        menu_destroy(menu)
        return PLUGIN_HANDLED
    }
    new data[20], iName[500]
    new acces, callback
    menu_item_getinfo(menu, item, acces, data,20, iName, 500, callback)
    
    new key = str_to_num(data)
    
    switch(key)
    { 
       case 1 : {
        cs_set_user_model(id, "Asasin")
        ze_colored_print(id, "You picked the Assassin skin", id)
        g_iUsedTimes[id]++
        }
       case 2 : {
        cs_set_user_model(id, "Death")
        ze_colored_print(id, "You picked the Death skin", id)
        g_iUsedTimes[id]++
        }
       case 3 : {
        cs_set_user_model(id, "Dobby")
        ze_colored_print(id, "You picked the Dobby skin", id)
        g_iUsedTimes[id]++
        }
       case 4 : {
        cs_set_user_model(id, "Sonic")
        ze_colored_print(id, "You picked the Sonic skin", id)
        g_iUsedTimes[id]++
        }
       case 5 : {
        cs_set_user_model(id, "Skeleton")
        ze_colored_print(id, "You picked the Skeleton skin", id)
        g_iUsedTimes[id]++
        }
       case 6 : {
        cs_set_user_model(id, "Joker")
        ze_colored_print(id, "You picked the Joker skin", id)
        g_iUsedTimes[id]++
        }
       case 7 : {
        cs_set_user_model(id, "Iron")
        ze_colored_print(id, "You picked the Iron skin", id)
        g_iUsedTimes[id]++
        }
       case 8 : {
        cs_set_user_model(id, "DeadSpace2")
        ze_colored_print(id, "You picked the Dead Space skin", id)
        g_iUsedTimes[id]++
        } 
       case 9 : 
       if (ze_get_vip_flags(id) & VIP_H)
       {
            cs_set_user_model(id, "Trump")
            ze_colored_print(id, "You picked the Trump skin", id)
            g_iUsedTimes[id]++
       }
       else
       {
            ze_colored_print(id, "You can't use this skin, it's only for VIPS!", id)
       }
       case 10 : 
       if (ze_get_vip_flags(id) & VIP_H)
       {
            cs_set_user_model(id, "PokerFace")
            ze_colored_print(id, "You picked the PokerFace skin", id)
            g_iUsedTimes[id]++
       }
       else
       {
            ze_colored_print(id, "You can't use this skin, it's only for VIPS!", id)
       }
       case 11 : 
       if (ze_get_vip_flags(id) & VIP_H)
       {
            cs_set_user_model(id, "trollface")
            ze_colored_print(id, "You picked the TrollFace skin", id)
            g_iUsedTimes[id]++
       }
       else
       {
            ze_colored_print(id, "You can't use this skin, it's only for VIPS!", id)
       }
       case 12 : 
       if(get_user_flags(id, ADMIN_KICK))
       {
            cs_set_user_model(id, "ZE_hm_Admin")
            ze_colored_print(id, "You picked the Skull skin", id)
            g_iUsedTimes[id]++
       }
       else
       {
            ze_colored_print(id, "You can't use this skin, it's only for ADMINS!", id)
       }
    }
    menu_destroy(menu)
    return PLUGIN_HANDLED
}  
public native_ze_open_skin_menu(id)
{
    model_menu(id)
}
stock ChatColor(const id, const input[], any:...) {
	new count = 1, players[32];
	static msg[191];
	vformat(msg, 190, input, 3);
	
	replace_all(msg, 190, "!g", "^4"); // verde
	replace_all(msg, 190, "!n", "^1"); // galben/alb/negru
	replace_all(msg, 190, "!t", "^3"); // rosu/albastru/gri
	replace_all(msg, 190, "!t2", "^0"); // rosu2/albastru2/gri2
	
	if (id) players[0] = id; else get_players(players, count, "ch");
	{
		for (new i = 0; i < count; i++)
			{
			if (is_user_connected(players[i]))
				{
				message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
				write_byte(players[i]);
				write_string(msg);
				message_end();
			}
		}
	}
}

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#2

Post by Raheem » 5 years ago

Player models should be in player folder, also you should create folder name with name of the model but without .mdl extension.

So you should change:
  • Code: Select all

            precache_model("models/ZE_skznzs/Asasin.mdl")
            precache_model("models/ZE_skznzs/Death.mdl")
            precache_model("models/ZE_skznzs/Dobby.mdl")
            precache_model("models/ZE_skznzs/Sonic.mdl")
            precache_model("models/ZE_skznzs/Skeleton.mdl")
            precache_model("models/ZE_skznzs/Joker.mdl")
            precache_model("models/ZE_skznzs/Iron.mdl")
            precache_model("models/ZE_skznzs/DeadSpace2.mdl")
            precache_model("models/ZE_skznzs/Trump.mdl")
            precache_model("models/ZE_skznzs/trollface.mdl")
            precache_model("models/ZE_skznzs/PokerFace.mdl")
            precache_model("models/ZE_skznzs/ZE_hm_Admin.mdl")
To:
  • Code: Select all

            precache_model("models/player/Asasin/Asasin.mdl")
            precache_model("models/player/Death/Death.mdl")
            precache_model("models/player/Dobby/Dobby.mdl")
            precache_model("models/player/Sonic/Sonic.mdl")
            precache_model("models/player/Skeleton/Skeleton.mdl")
            precache_model("models/player/Joker/Joker.mdl")
            precache_model("models/player/Iron/Iron.mdl")
            precache_model("models/player/DeadSpace2/DeadSpace2.mdl")
            precache_model("models/player/Trump/Trump.mdl")
            precache_model("models/player/trollface/trollface.mdl")
            precache_model("models/player/PokerFace/PokerFace.mdl")
            precache_model("models/player/ZE_hm_Admin/ZE_hm_Admin.mdl")
And to make sure that you create for example in player folder another folder with name Asasin and in this folder place the Asasin.mdl
One thing for you, you can use reapi function for setting the model better than amxx one. Just replace cs_set_user_model with rg_set_user_model

And i'm not sure how you compiled but includes should be:
  • Code: Select all

    #include <zombie_escape>
    #include <ze_vip>
Also you may remove this stock as it's useless:
  • Code: Select all

    stock ChatColor(const id, const input[], any:...) {
    	new count = 1, players[32];
    	static msg[191];
    	vformat(msg, 190, input, 3);
    	
    	replace_all(msg, 190, "!g", "^4"); // verde
    	replace_all(msg, 190, "!n", "^1"); // galben/alb/negru
    	replace_all(msg, 190, "!t", "^3"); // rosu/albastru/gri
    	replace_all(msg, 190, "!t2", "^0"); // rosu2/albastru2/gri2
    	
    	if (id) players[0] = id; else get_players(players, count, "ch");
    	{
    		for (new i = 0; i < count; i++)
    			{
    			if (is_user_connected(players[i]))
    				{
    				message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
    				write_byte(players[i]);
    				write_string(msg);
    				message_end();
    			}
    		}
    	}
    }
He who fails to plan is planning to fail

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 641
Joined: 7 years ago
Location: Tunisia
Contact:

#3

Post by Spir0x » 5 years ago

Look at this code bro and it's bugged i can see only arctic terrorist skin. and what about blocking it to VIP cuz he already have his own skin Block it with VIP flag "A"

Code:

Code: Select all

#include <zombie_escape>
 
 
new g_pCvarUseTimes
new g_iUsedTimes[33]
 
public plugin_natives()
{
    register_native("ze_open_skin_menu", "native_ze_open_skin_menu", 1)
}
 
public plugin_init()
{
    register_plugin("[ZE] Skins", "1.1", "Spi")
    g_pCvarUseTimes = register_cvar("ze_skin_menu_used", "1")
}
public plugin_precache()
{
        precache_model("models/player/Halo_O/Halo_O.mdl")
        precache_model("models/player/Halo_W/Halo_W.mdl")
        precache_model("models/player/Halo_B/Halo_B.mdl")
        precache_model("models/player/Halo_R/Halo_R.mdl")
}
 
public ze_user_humanized(id)
{
  g_iUsedTimes[id] = 0
}
 
public model_menu(id)
{
    if (ze_is_user_zombie(id))
    {
        ze_colored_print(id, "!tYou can't change your skin while you are zombie!y.")
        return PLUGIN_HANDLED
    }
    if (g_iUsedTimes[id] >= get_pcvar_num(g_pCvarUseTimes))
    {
        ze_colored_print(id, "!tYou have already changed your !gskin!y!")
        return PLUGIN_HANDLED
    }
    else
    {
        new menu = menu_create("\r[\wSkins Menu\r]\r", "menu_wybierz")
   
        menu_additem(menu, "\wHalo \y| \rOrange", "1", 0)
        menu_additem(menu, "\wHalo \y| \rWhite", "2", 0)
        menu_additem(menu, "\wHalo \y| \rBlue", "3", 0)
        menu_additem(menu, "\wHalo \y| \rRed", "4", 0)
 
   
        menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
        menu_display(id, menu, 0)
    }
    return PLUGIN_HANDLED
}
public menu_wybierz(id, menu, item)
{
    if (item == MENU_EXIT)
    {
        menu_destroy(menu)
        return PLUGIN_HANDLED
    }
    new data[20], iName[500]
    new acces, callback
    menu_item_getinfo(menu, item, acces, data,20, iName, 500, callback)
   
    new key = str_to_num(data)
   
    switch(key)
    {
       case 1 : {
        rg_set_user_model(id, "Halo Orange")
        ze_colored_print(id, "!tYou picked the !gOrange Halo Skin!y!", id)
        g_iUsedTimes[id]++
        }
       case 2 : {
        rg_set_user_model(id, "Halo White")
        ze_colored_print(id, "!tYou picked the !gWhite Halo Skin!y!", id)
        g_iUsedTimes[id]++
        }
       case 3 : {
        rg_set_user_model(id, "Halo Blue")
        ze_colored_print(id, "!tYou picked the !gBlue Halo Skin!y!", id)
        g_iUsedTimes[id]++
        }
       case 4 : {
        rg_set_user_model(id, "Halo Red")
        ze_colored_print(id, "!tYou picked the !gRed Halo Skin!y!", id)
        g_iUsedTimes[id]++
        }
    }
    g_iUsedTimes[id]++
    menu_destroy(menu)
    return PLUGIN_HANDLED
}  
public native_ze_open_skin_menu(id)
{
    model_menu(id)
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1036\\ f0\\ fs16 \n\\ par }
*/
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0\\ deflang1036{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/

Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Who is online

Users browsing this forum: No registered users and 1 guest