Com esse sma você vai poder colocar seus vips com skins novas.
Código:
/*================================================================================
-------------------------
-*- [ZP] Vip Models -*-
-------------------------
This plugin is part of Zombie Plague Mod and is distributed under the
terms of the GNU General Public License. Check ZP_ReadMe.txt for details.
================================================================================*/
#include
#include
#include
#include
#include
#include
#define LIBRARY_SURVIVOR "zp50_class_survivor"
#include
// Settings file
new const ZP_SETTINGS_FILE[] = "zombieplague.ini"
// Default models
new const models_vip_human_player[][] = { "vip" }
#define PLAYERMODEL_MAX_LENGTH 32
#define ACCESSFLAG_MAX_LENGTH 2
// Access flags
new g_access_vip_models[ACCESSFLAG_MAX_LENGTH] = "t"
// Custom models
new Array:g_models_vip_human_player
new cvar_vip_models_human_player
public plugin_init()
{
register_plugin("[ZP] Vip Models", ZP_VERSION_STRING, "ZP Dev Team")
cvar_vip_models_human_player = register_cvar("zp_vip_models_human_player", "1")
}
public plugin_precache()
{
// Initialize arrays
g_models_vip_human_player = ArrayCreate(PLAYERMODEL_MAX_LENGTH, 1)
// Load from external file
amx_load_setting_string_arr(ZP_SETTINGS_FILE, "Player Models", "VIP HUMAN", g_models_vip_human_player)
// If we couldn't load from file, use and save default ones
new index
if (ArraySize(g_models_vip_human_player) == 0)
{
for (index = 0; index < sizeof models_vip_human_player; index++)
ArrayPushString(g_models_vip_human_player, models_vip_human_player[index])
// Save to external file
amx_save_setting_string_arr(ZP_SETTINGS_FILE, "Player Models", "VIP HUMAN", g_models_vip_human_player)
}
// Load from external file, save if not found
if (!amx_load_setting_string(ZP_SETTINGS_FILE, "Access Flags", "VIP
MODELS", g_access_vip_models, charsmax(g_access_vip_models)))
amx_save_setting_string(ZP_SETTINGS_FILE, "Access Flags", "VIP MODELS", g_access_vip_models)
// Precache models
new player_model[PLAYERMODEL_MAX_LENGTH], model_path[128]
for (index = 0; index < ArraySize(g_models_vip_human_player); index++)
{
ArrayGetString(g_models_vip_human_player, index, player_model, charsmax(player_model))
formatex(model_path, charsmax(model_path), "models/player/%s/%s.mdl", player_model, player_model)
precache_model(model_path)
// Support modelT.mdl files
formatex(model_path, charsmax(model_path), "models/player/%s/%sT.mdl", player_model, player_model)
if (file_exists(model_path)) precache_model(model_path)
}
}
public plugin_natives()
{
set_module_filter("module_filter")
set_native_filter("native_filter")
}
public module_filter(const module[])
{
if (equal(module, LIBRARY_SURVIVOR))
return PLUGIN_HANDLED;
return PLUGIN_CONTINUE;
}
public native_filter(const name[], index, trap)
{
if (!trap)
return PLUGIN_HANDLED;
return PLUGIN_CONTINUE;
}
public zp_fw_core_cure_post(id, attacker)
{
// Skip if player doesn't have required vip flags
if (!(get_user_flags(id) & read_flags(g_access_vip_models)))
return;
// Skip for Survivor
if (LibraryExists(LIBRARY_SURVIVOR, LibType_Library) && zp_class_survivor_get(id))
return;
// Apply vip player model?
if (get_pcvar_num(cvar_vip_models_human_player))
{
new player_model[PLAYERMODEL_MAX_LENGTH]
ArrayGetString(g_models_vip_human_player, random_num(0,
ArraySize(g_models_vip_human_player) - 1), player_model,
charsmax(player_model))
cs_set_player_model(id, player_model)
set_pev(id, pev_body, random_num(0, 6));
}
}
MEGA
Instalação :
Instale normalmente como qualquer outro plugin
para adicionar as novas Skins abra o arquivo zombieplague.ini
procure
Código:
ADMIN HUMAN =
e adicione abaixo
Código:
VIP HUMAN =
colocando apos o = o nome de sua Skin.
Feito isso só salvar ^_^
Última edição por Junin em 30/7/2012, 11:11 am, editado 1 vez(es)