Page 1 of 4

[ZE] Owner Skin

Posted: 27 Jun 2018, 20:10
by Spir0x
ZE Owner Skin

Description:
  • New simple plugin for only for Owners, this plugin will will give special model for anyone who have flag "l" // ADMIN_RCON & available only for human. Enjoy !! :)
Installation & Instructions:
  • Simply install it like any plugin and Don't forget to put your own model..
Screenshots:
  • Image
Downloads:

Re: [ZE] Owner Skin

Posted: 04 Jul 2018, 13:01
by Rain1153
i saw the code does it work alternately? if the owner gets infected,will he get the same skin( the owner skin) or he'll be changed to a vip/random zombie in the server?

Re: [ZE] Owner Skin

Posted: 04 Jul 2018, 13:05
by Spir0x
Bro read clearly. & available only for human. Enjoy !! :) this plugin give special skin only for human owner. i can make for zombies but i see it useless as the server have 2 default zombies models & special one for vips so owner will have vip skin zombie too.

Re: [ZE] Owner Skin

Posted: 04 Jul 2018, 14:18
by Rain1153
yeah no worries i will modify it according to my needs...btw good plugin mate

Re: [ZE] Owner Skin

Posted: 04 Jul 2018, 14:28
by Spir0x
okey, have fun bro !

Re: [ZE] Owner Skin

Posted: 04 Jul 2018, 14:46
by Rain1153
did you test this?

Re: [ZE] Owner Skin

Posted: 04 Jul 2018, 15:07
by Spir0x
ofc. i'm using this one.

Re: [ZE] Owner Skin

Posted: 04 Jul 2018, 15:20
by Mohamed Alaa
A clean code:

Code: Select all

#include <zombie_escape>

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

#define ADMIN_MODELS_ACCESS ADMIN_RCON

// Default models
new const szAdminHumanModel[][] = 
{
	"human_owner"
}

// Dynamic Arrays: Models
new Array:g_szAdminHumanModel

public plugin_init()
{
	register_plugin("[ZE] Owner Skin", ZE_VERSION, AUTHORS)
}

public plugin_precache()
{
	// Initialize arrays
	g_szAdminHumanModel = ArrayCreate(32, 1)
	
	// Load from external file
	amx_load_setting_string_arr(ZE_SETTING_RESOURCES, "Player Models", "HUMAN OWNER", g_szAdminHumanModel)
	
	// Load our default Values
	new iIndex
	
	if(ArraySize(g_szAdminHumanModel) == 0)
	{
		for(iIndex = 0; iIndex < charsmax(szAdminHumanModel); iIndex++)
			ArrayPushString(g_szAdminHumanModel, szAdminHumanModel[iIndex])
		
		// Save to external file
		amx_save_setting_string_arr(ZE_SETTING_RESOURCES, "Player Models", "HUMAN OWNER", g_szAdminHumanModel)
	}

	// Precache
	new szPlayerModel[32], 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)
	}
}

public ze_user_humanized(id)
{
	if(ze_is_user_zombie(id) || !is_user_alive(id) || !(get_user_flags(id) & ADMIN_MODELS_ACCESS))
		return
		
	new szPlayerModel[32]

	// Set owner model
	ArrayGetString(g_szAdminHumanModel, random_num(0, ArraySize(g_szAdminHumanModel) - 1), szPlayerModel, charsmax(szPlayerModel))
	rg_set_user_model(id, szPlayerModel)
}

Re: [ZE] Owner Skin

Posted: 04 Jul 2018, 16:58
by Spir0x
Yes. more clean code.

Re: [ZE] Owner Skin

Posted: 05 Jul 2018, 14:09
by johnnysins2000
Jack GamePlay wrote:
1 Year Ago
A clean code:

Code: Select all

#include <zombie_escape>

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

#define ADMIN_MODELS_ACCESS ADMIN_RCON

// Default models
new const szAdminHumanModel[][] = 
{
	"human_owner"
}

// Dynamic Arrays: Models
new Array:g_szAdminHumanModel

public plugin_init()
{
	register_plugin("[ZE] Owner Skin", ZE_VERSION, AUTHORS)
}

public plugin_precache()
{
	// Initialize arrays
	g_szAdminHumanModel = ArrayCreate(32, 1)
	
	// Load from external file
	amx_load_setting_string_arr(ZE_SETTING_RESOURCES, "Player Models", "HUMAN OWNER", g_szAdminHumanModel)
	
	// Load our default Values
	new iIndex
	
	if(ArraySize(g_szAdminHumanModel) == 0)
	{
		for(iIndex = 0; iIndex < charsmax(szAdminHumanModel); iIndex++)
			ArrayPushString(g_szAdminHumanModel, szAdminHumanModel[iIndex])
		
		// Save to external file
		amx_save_setting_string_arr(ZE_SETTING_RESOURCES, "Player Models", "HUMAN OWNER", g_szAdminHumanModel)
	}

	// Precache
	new szPlayerModel[32], 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)
	}
}

public ze_user_humanized(id)
{
	if(ze_is_user_zombie(id) || !is_user_alive(id) || !(get_user_flags(id) & ADMIN_MODELS_ACCESS))
		return
		
	new szPlayerModel[32]

	// Set owner model
	ArrayGetString(g_szAdminHumanModel, random_num(0, ArraySize(g_szAdminHumanModel) - 1), szPlayerModel, charsmax(szPlayerModel))
	rg_set_user_model(id, szPlayerModel)
}
jack u can do this in your special model sma ?