Solved VIP skin models

Unpaid Requests, Public Plugins
Post Reply
neverminddw
Member
Member
Posts: 32
Joined: 6 years ago
Contact:

VIP skin models

#1

Post by neverminddw » 5 years ago

Hey there.
I request some help... if someone knows how to totally remove glow from VIP.
And instead of setting glow to vip, I request someone write a code that will set special skin model to vip with flag "A".
VIP user is human, gets "vip_human.mdl".
VIP user is zombie (or gets infected), gets "vip_zombie.mdl".


Thank you.

Note: I tried to modify the Owner skin model, (to this what I explained) but it had the glow as well... so I guess I don't have knowledge enough to modify it as I prefer.

User avatar
sPe3doN
Senior Member
Senior Member
Algeria
Posts: 258
Joined: 7 years ago
Contact:

#2

Post by sPe3doN » 5 years ago

Try this

Code: Select all

#include <zombie_escape>
#include <ze_vip>

// Setting File
new const ZE_SETTING_RESOURCES[] = "zombie_escape.ini"

// Defines
#define MODEL_MAX_LENGTH 64
#define PLAYERMODEL_MAX_LENGTH 32
#define ACCESS_MAX_LENGTH 32

// Default Models
new const szAdminHumanModel[][] = 
{
	"Vip_human"
}

new const szAdminZombieModel[][] = 
{
	"Vip_zombie"
}

new const v_szAdminHumanKnifeModel[][] = 
{
	"models/v_knife_vip.mdl"
}

new const v_szAdminZombieKnifeModel[][] = 
{
	"models/zombie_escape/v_knife_zombie_vip.mdl"
}

// Dynamic Arrays: Models
new Array:g_szAdminHumanModel, Array:g_szAdminZombieModel, Array:g_v_szAdminHumanKnifeModel, Array:g_v_szAdminZombieKnifeModel

public plugin_init()
{
	register_plugin("[ZE] Vip Model", AMX_VERSION, AUTHORS)
}

public plugin_precache()
{
	// Initialize Arrays
	g_szAdminHumanModel = ArrayCreate(PLAYERMODEL_MAX_LENGTH, 1)
	g_szAdminZombieModel = ArrayCreate(PLAYERMODEL_MAX_LENGTH, 1)
	g_v_szAdminHumanKnifeModel = ArrayCreate(MODEL_MAX_LENGTH, 0)
	g_v_szAdminZombieKnifeModel = ArrayCreate(MODEL_MAX_LENGTH, 1)
	
	// Load From External File
	amx_load_setting_string_arr(ZE_SETTING_RESOURCES, "Player Models", "HUMAN VIP", g_szAdminHumanModel)
	amx_load_setting_string_arr(ZE_SETTING_RESOURCES, "Player Models", "ZOMBIE VIP", g_szAdminZombieModel)
	amx_load_setting_string_arr(ZE_SETTING_RESOURCES, "Weapon Models", "V_KNIFE HUMAN VIP", g_v_szAdminHumanKnifeModel)
	amx_load_setting_string_arr(ZE_SETTING_RESOURCES, "Weapon Models", "V_KNIFE ZOMBIE VIP", g_v_szAdminZombieKnifeModel)
	
	// Load our Default Values
	new iIndex
	
	if(ArraySize(g_szAdminHumanModel) == 0)
	{
		for(iIndex = 0; iIndex < sizeof szAdminHumanModel; iIndex++)
			ArrayPushString(g_szAdminHumanModel, szAdminHumanModel[iIndex])
		
		// Save to external file
		amx_save_setting_string_arr(ZE_SETTING_RESOURCES, "Player Models", "HUMAN VIP", g_szAdminHumanModel)
	}
	
	if(ArraySize(g_szAdminZombieModel) == 0)
	{
		for(iIndex = 0; iIndex < sizeof szAdminZombieModel; iIndex++)
			ArrayPushString(g_szAdminZombieModel, szAdminZombieModel[iIndex])
		
		// Save to external file
		amx_save_setting_string_arr(ZE_SETTING_RESOURCES, "Player Models", "ZOMBIE VIP", g_szAdminZombieModel)
	}
	
	if(ArraySize(g_v_szAdminHumanKnifeModel) == 1)
	{
		for(iIndex = 0; iIndex < sizeof v_szAdminHumanKnifeModel; iIndex++)
			ArrayPushString(g_v_szAdminHumanKnifeModel, v_szAdminHumanKnifeModel[iIndex])
		
		// Save to external file
		amx_save_setting_string_arr(ZE_SETTING_RESOURCES, "Weapon Models", "V_KNIFE HUMAN VIP", g_v_szAdminHumanKnifeModel)
	}
	
	if(ArraySize(g_v_szAdminZombieKnifeModel) == 0)
	{
		for(iIndex = 0; iIndex < sizeof v_szAdminZombieKnifeModel; iIndex++)
			ArrayPushString(g_v_szAdminZombieKnifeModel, v_szAdminZombieKnifeModel[iIndex])
		
		// Save to external file
		amx_save_setting_string_arr(ZE_SETTING_RESOURCES, "Weapon Models", "V_KNIFE ZOMBIE VIP", g_v_szAdminZombieKnifeModel)
	}
	
	// Precache
	new szPlayerModel[PLAYERMODEL_MAX_LENGTH], szModel[MODEL_MAX_LENGTH], szModelPath[128]
	
	for (iIndex = 0; iIndex < ArraySize(g_szAdminHumanModel); iIndex++)
	{
		ArrayGetString(g_szAdminHumanModel, iIndex, szPlayerModel, charsmax(szPlayerModel))
		formatex(szModelPath, charsmax(szModelPath), "models/player/%s/%s.mdl", szPlayerModel, szPlayerModel)
		precache_model(szModelPath)
	}
	
	for (iIndex = 0; iIndex < ArraySize(g_szAdminZombieModel); iIndex++)
	{
		ArrayGetString(g_szAdminZombieModel, iIndex, szPlayerModel, charsmax(szPlayerModel))
		formatex(szModelPath, charsmax(szModelPath), "models/player/%s/%s.mdl", szPlayerModel, szPlayerModel)
		precache_model(szModelPath)
	}
	
	
	for (iIndex = 0; iIndex < ArraySize(g_v_szAdminHumanKnifeModel); iIndex++)
	{
		ArrayGetString(g_v_szAdminHumanKnifeModel, iIndex, szModel, charsmax(szModel))
		precache_model(szModel)
	}
	
	for (iIndex = 0; iIndex < ArraySize(g_v_szAdminZombieKnifeModel); iIndex++)
	{
		ArrayGetString(g_v_szAdminZombieKnifeModel, iIndex, szModel, charsmax(szModel))
		precache_model(szModel)
	}
}

public ze_user_humanized(id)
{
	if(ze_is_user_zombie(id) || !is_user_alive(id))
		return
		
	new szPlayerModel[PLAYERMODEL_MAX_LENGTH], szModel[MODEL_MAX_LENGTH]

	// Player Admin?
	if (ze_get_vip_flags(id) & VIP_A)
	{
		// Set Admin Human Model
		ArrayGetString(g_szAdminHumanModel, random_num(0, ArraySize(g_szAdminHumanModel) - 1), szPlayerModel, charsmax(szPlayerModel))
		rg_set_user_model(id, szPlayerModel)
		
		// Set Admin Human Knife Model
		ArrayGetString(g_v_szAdminHumanKnifeModel, random_num(0, ArraySize(g_v_szAdminHumanKnifeModel) - 0), szModel, charsmax(szModel))
		cs_set_player_view_model(id, CSW_KNIFE, szModel)
	}
}

public ze_user_infected(iVictim, iInfector)
{
	if(!is_user_alive(iVictim))
		return
		
	// Set Zombie Models
	new szPlayerModel[PLAYERMODEL_MAX_LENGTH], szModel[MODEL_MAX_LENGTH]
	
	// Player Admin?
	if (ze_get_vip_flags(id) & VIP_A)
	{
		// Set Zombie Admin Model
		ArrayGetString(g_szAdminZombieModel, random_num(0, ArraySize(g_szAdminZombieModel) - 1), szPlayerModel, charsmax(szPlayerModel))
		rg_set_user_model(iVictim, szPlayerModel)
		
		// Set Admin Zombie Knife Model
		ArrayGetString(g_v_szAdminZombieKnifeModel, random_num(0, ArraySize(g_v_szAdminZombieKnifeModel) - 1), szModel, charsmax(szModel))
		cs_set_player_view_model(iVictim, CSW_KNIFE, szModel)
		cs_set_player_weap_model(iVictim, CSW_KNIFE, "") // Leave Blank so knife not appear with zombies
	}
}[code]
Image

neverminddw
Member
Member
Posts: 32
Joined: 6 years ago
Contact:

#3

Post by neverminddw » 5 years ago

Compiled, tested, and it doesn't work.

Raheem, do u have 2 minutes to code it?
Hey there.
I request some help... if someone knows how to totally remove glow from VIP.
And instead of setting glow to vip, I request someone write a code that will set special skin model to vip with flag "A".
VIP user is human, gets "vip_human.mdl".
VIP user is zombie / gets infected, gets "vip_zombie.mdl".

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

#4

Post by Raheem » 5 years ago

neverminddw wrote: 5 years agoHey there.
Hey.
neverminddw wrote: 5 years agoI request some help... if someone knows how to totally remove glow from VIP.
For sure if glow is there you will find CVAR to disable this.

neverminddw wrote: 5 years ago And instead of setting glow to vip, I request someone write a code that will set special skin model to vip with flag "A".
VIP user is human, gets "vip_human.mdl".
VIP user is zombie (or gets infected), gets "vip_zombie.mdl".


Thank you.

Note: I tried to modify the Owner skin model, (to this what I explained) but it had the glow as well... so I guess I don't have knowledge enough to modify it as I prefer.
Try code that sPe3doN posted but make sure that this plugin is placed under ze_resources.amxx in plugins-zombie_escape.ini, best thing is to place this plugin name at the end of the plugins list and try.
He who fails to plan is planning to fail

neverminddw
Member
Member
Posts: 32
Joined: 6 years ago
Contact:

#5

Post by neverminddw » 5 years ago

I added it at the end of the plugin list and it works, thank you.

Anyway, see this viewtopic.php?f=12&t=3580...

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 2 guests