Raised This Month: $73 Target: $400
 18% 

VIP plugin FIX


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Calibru09
Junior Member
Join Date: Jan 2020
Location: Romania
Old 11-05-2020 , 04:26   VIP plugin FIX
Reply With Quote #1

I have a problem with a VIP plugin , everytime I try to access the VIP meniu i had this error :
HTML Code:
Reason: Server shutting down
FATA ERROR (shutting down): Host_Error: PF_setmodel_I: no precache: w_deaglegold.mdl
It's not only the deagle mdl , on my respawn server if try to take a gun from my VIP menu directly
it gives me the normal gun without skin . I have to buy the exactly same gun from my csdm menu and
then I have to buy that gun from my VIP menu also .
any suggestions please ?

PLUGIN :
HTML Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
#include <engine>
#include <cstrike>
#include <fun>

#define PLUGIN "New Plugin"
#define AUTHOR "D3luxe"
#define VERSION "1.0"

#define VIP_FLAG read_flags("abhtu")
#define MAX_WEAPONS 4

enum DETALII
{
NumeArma[128],
GiveWeapon[128],
IndexArma,
WEAPONKEY,
OldW[128],
Model_v[128],
Model_p[128],
Model_w[128],
FireSound[128]
};

new const ModelName[2][] =
{
"model_vipt",
"model_vipct"
};

new const ArmeGold[MAX_WEAPONS+1][DETALII] =
{
{ "None","None",CSW_KNIFE,000,"None","None","None","None","None" },//linia asta nu trebuie completata
//modifici astea de sub, locatiile modelelor si numele soundurilor
{ "Ak47 Gold","weapon_ak47",CSW_AK47,1998,"models/w_ak47.mdl","v_ak47gold.mdl","p_ak47gold.mdl","w_ak47gold.mdl","ak47g_fire.wav" },
{ "M4a1 Gold","weapon_m4a1",CSW_M4A1,1999,"models/w_m4a1.mdl","v_m4a1gold.mdl","p_m4a1gold.mdl","w_m4a1gold.mdl","m4a1g_fire.wav" },
{ "Deagle Gold","weapon_deagle",CSW_DEAGLE,1920,"models/w_deagle.mdl","v_deaglegold.mdl","p_deaglegold.mdl","w_deaglegold.mdl","deagleg_fire.wav" },
{ "AwP Gold","weapon_awp",CSW_AWP,1921,"models/w_awp.mdl","v_awpgold.mdl","p_awpgold.mdl","w_awpgold.mdl","awpg_fire.wav" }
};

new g_jumps[33],g_selectedweapon[33];
new cvar_hp,cvar_armor,cvar_kill_hp,cvar_hs_hp,cvar_max_jumps,cvar_max_hp;

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_clcmd("say /vm","open_goldmenu");
register_forward(FM_PlaybackEvent, "fw_PlaybackEvent");
register_forward(FM_SetModel, "fw_SetModel");
for(new i = 1; i <= MAX_WEAPONS; i++)
RegisterHam(Ham_Item_AddToPlayer,ArmeGold[GiveWeapon], "fw_Item_AddToPlayer_Post", 1);
RegisterHam(Ham_Spawn,"player","give_spawn_hp_armor",1);
RegisterHam(Ham_TakeDamage,"player","show_dmg");
RegisterHam(Ham_Player_Jump, "player", "FW_Player_Jump", 0);
register_event("DeathMsg","ev_deathmsg","a");
register_event("CurWeapon","SetModels", "be", "1=1");

//cvar's
cvar_hp = register_cvar("hp_vip_spawn","150");
cvar_armor = register_cvar("armor_vip_spawn","150");
cvar_max_hp = register_cvar("vip_max_hp","200");
cvar_kill_hp = register_cvar("vip_kill_hp","15");
cvar_hs_hp = register_cvar("vip_hs_hp","25");
cvar_max_jumps = register_cvar("vip_max_jumps","3");
}
public client_putinserver(id)
{
g_selectedweapon[id] = 0;
}
public client_disconnect(id)
{
g_selectedweapon[id] = 0;
}
public plugin_precache()
{
new Txt[128];
for(new i = 0; i < sizeof(ModelName); i++)
{
formatex(Txt,charsmax(Txt),"models/player/%s/%s.mdl",ModelName,ModelName);
precache_model(Txt);
}
for(new i = 1; i <= MAX_WEAPONS; i++)
{
formatex(Txt,charsmax(Txt),"models/armegold/%s",ArmeGold[Model_v]);
precache_model(Txt);
}
for(new i = 1; i <= MAX_WEAPONS; i++)
{
formatex(Txt,charsmax(Txt),"models/armegold/%s",ArmeGold[Model_p]);
precache_model(Txt);
}
for(new i = 1; i <= MAX_WEAPONS; i++)
{
formatex(Txt,charsmax(Txt),"models/armegold/%s",ArmeGold[Model_w]);
precache_model(Txt);
}
for(new i = 1; i <= MAX_WEAPONS; i++)
{
formatex(Txt,charsmax(Txt),"armegold/%s",ArmeGold[FireSound]);
precache_sound(Txt);
}
}
//models arme gold
public SetModels(id)
{
if(get_user_flags(id) & VIP_FLAG)
{
if(!is_user_alive(id) || !is_user_connected(id))
return PLUGIN_HANDLED;

if(g_selectedweapon[id] > 0 && get_user_weapon(id) == ArmeGold[g_selectedweapon[id]][IndexArma])
{
new Weapon[128];
formatex(Weapon,charsmax(Weapon),"models/armegold/%s",ArmeGold[g_selectedweapon[id]][Model_v]);
set_pev(id,pev_viewmodel2,Weapon);
formatex(Weapon,charsmax(Weapon),"models/armegold/%s",ArmeGold[g_selectedweapon[id]][Model_p]);
set_pev(id,pev_weaponmodel2,Weapon);
}
}
return PLUGIN_HANDLED;
}
public fw_PlaybackEvent(flags, invoker, eventid, Float:delay, Float:origin[3], Float:angles[3], Float:fparam1, Float:fparam2, iParam1, iParam2, bParam1, bParam2)
{
if(!is_user_connected(invoker))
return FMRES_IGNORED;

if(!is_user_alive(invoker))
return FMRES_IGNORED;

if( get_user_flags( invoker ) & VIP_FLAG && g_selectedweapon[invoker] > 0)
{
if(get_user_weapon(invoker) == ArmeGold[g_selectedweapon[invoker]][IndexArma])
{
new FireWeap[128];
format(FireWeap,charsmax(FireWeap),"armegold/%s",ArmeGold[g_selectedweapon[invoker]][FireSound]);
emit_sound(invoker, CHAN_WEAPON,FireWeap, 1.0, ATTN_NORM, 0, PITCH_NORM)
return FMRES_HANDLED;
}
}
return FMRES_IGNORED;
}
public fw_SetModel(entity, model[])
{
if(!pev_valid(entity))
return FMRES_IGNORED

static Classname[32]
pev(entity, pev_classname, Classname, sizeof(Classname))

if(!equal(Classname, "weaponbox"))
return FMRES_IGNORED

static iOwner
iOwner = pev(entity, pev_owner)

if(equal(model,ArmeGold[g_selectedweapon[iOwner]][OldW]))
{
static weapon; weapon = fm_find_ent_by_owner(-1,ArmeGold[g_selectedweapon[iOwner]][GiveWeapon], entity)
if(!pev_valid(weapon))
return FMRES_IGNORED;

if(g_selectedweapon[iOwner] > 0)
{
set_pev(weapon, pev_impulse, ArmeGold[g_selectedweapon[iOwner]][WEAPONKEY])
engfunc(EngFunc_SetModel, entity,ArmeGold[g_selectedweapon[iOwner]][Model_w])
g_selectedweapon[iOwner] = 0;
return FMRES_SUPERCEDE;
}
}
return FMRES_IGNORED;
}
public fw_Item_AddToPlayer_Post(ent, id)
{
if(!pev_valid(ent))
return HAM_IGNORED;

for(new i = 1 ; i <= MAX_WEAPONS ; i++)
if(entity_get_int(ent, EV_INT_impulse) == ArmeGold[WEAPONKEY])
{
g_selectedweapon[id] = i;
set_pev(ent,pev_impulse, 0)
message_begin(MSG_ONE,get_user_msgid("WeaponList"), {0,0,0}, id)
write_string(ArmeGold[g_selectedweapon[id]][GiveWeapon])
write_byte(2)
write_byte(90)
write_byte(-1)
write_byte(-1)
write_byte(0)
write_byte(1)
write_byte(ArmeGold[g_selectedweapon[id]][IndexArma])
write_byte(0)
message_end()
entity_set_int(ent,EV_INT_impulse, 0)
break;
}
return HAM_HANDLED
}
stock fm_find_ent_by_owner(index, const classname[], owner, jghgtype = 0) {
new strtype[11] = "classname", ent = index;
switch (jghgtype) {
case 1: strtype = "target";
case 2: strtype = "targetname";
}
while ((ent = engfunc(EngFunc_FindEntityByString, ent, strtype, classname)) && pev(ent, pev_owner) != owner) {}
return ent;
}
public open_goldmenu(id)
{
if(!is_user_alive(id))
return PLUGIN_HANDLED;
if(!(get_user_flags(id) & VIP_FLAG))
return PLUGIN_HANDLED;

new szNumber[10];
new menu = menu_create("\wArme \rVIP \wGOLD \y:", "gold_handler");
for(new i = 1; i <= MAX_WEAPONS; i++)
{
num_to_str(i, szNumber, charsmax( szNumber ));
menu_additem(menu,ArmeGold[NumeArma],szNumber,0);
}
menu_setprop( menu, MPROP_EXITNAME, "Exit")
menu_display( id, menu, 0);
return PLUGIN_HANDLED;
}
public gold_handler(id, menu, item)
{
if(item == MENU_EXIT || !is_user_alive(id) || !(get_user_flags(id) & VIP_FLAG))
{
menu_destroy(menu);
return PLUGIN_HANDLED;
}
static data[6], name[64], acs, cllbck;
menu_item_getinfo(menu, item, acs, data, 5, name, 63, cllbck);
g_selectedweapon[id] = str_to_num(data)
give_item(id,ArmeGold[g_selectedweapon[id]][GiveWeapon]);
cs_set_user_bpammo(id,ArmeGold[g_selectedweapon[id]][IndexArma],200);
SetModels(id);
menu_destroy(menu);
return PLUGIN_HANDLED;
}
//event-uri(e doar 1 haha)
public ev_deathmsg()
{
//citim cine e killer-ul,victima si daca a fost sau nu headshot
new killer = read_data(1);
new victim = read_data(2);
new hs = read_data(3);

//verificam daca e vip sau daca e event on
if(get_user_flags(killer) & VIP_FLAG)
{
/*verificam ca victima sa nu fie egala cu killerul (slay/kill in consola/drop de sus ,etc + daca killerul si victima sunt conectate*/
if(killer != victim && is_user_connected(killer) && is_user_connected(victim))
{
//verific daca e hs sau nu
if(hs)
{
//folosesc clamp pentru ca e o metoda ma usoara de a seta maximul / minimul a ceva
set_user_health(killer,clamp(get_user_health(killer)+get_pcvar_num(cvar_hs_hp),0,get_pcvar_num(cvar_max_hp)));
}else{
if(get_user_weapon(killer) == CSW_KNIFE)
set_user_health(killer,clamp(get_user_health(killer)+get_pcvar_num(cvar_kill_hp)+5,0,get_pcvar_num(cvar_max_hp)));
else
set_user_health(killer,clamp(get_user_health(killer)+get_pcvar_num(cvar_kill_hp),0,get_pcvar_num(cvar_max_hp)));
}
}
}
}
//ham-uri
public give_spawn_hp_armor(id)
{
//verificam daca e vip sau daca e event on
if(get_user_flags(id) & VIP_FLAG)
{
//verifica daca useru e viu & conected
if(is_user_alive(id))
{
switch(get_user_team(id))
{
case 1 : cs_set_user_model(id, ModelName[0]);
case 2 : cs_set_user_model(id, ModelName[1]);
}
//setam armura si hp-ul vip-ului + he & flash
set_user_health(id,get_pcvar_num(cvar_hp));
set_user_armor(id,get_pcvar_num(cvar_armor));
give_item(id,"weapon_flashbang");
give_item(id,"weapon_hegrenade");
g_selectedweapon[id] = 0;
}
}
return HAM_IGNORED;
}
//idkn daca e cea mai buna idee sa folosesc take_damage dar la asta m-am gandit prima data xD
public show_dmg(victim,inflictor,attacker,Float:Damage,dmg_type,dmgbits)
{
//verificam daca e vip sau daca e event on
if(get_user_flags(attacker) & VIP_FLAG)
{
//verific daca e viu attacker-ul & victima conectata si sa nu fie victima aceasi cu attacker-ul
if(attacker != victim && is_user_alive(attacker) && is_user_connected(victim) && is_user_connected(attacker))
{
//afisam dmg-ul cu un hud
set_hudmessage(0,255,0,-1.0,0.55,0,6.0,1.5) //sper ca ala e centrul
show_hudmessage(attacker,"%d",Damage);
SetHamParamFloat(4, Damage*2);
}
}
return HAM_IGNORED;
}
//double jump
public FW_Player_Jump(id)
{
if(get_user_flags(id) & VIP_FLAG)
{
new Flags = pev(id, pev_flags)
if( Flags & FL_WATERJUMP || pev(id, pev_waterlevel) >= 2 || !(get_pdata_int(id, 246) & IN_JUMP) )
{
return HAM_IGNORED
}

if( Flags & FL_ONGROUND )
{

// Jump Count Is Set To 0
g_jumps[id] = 0

// Return Ham Ignore.
return HAM_IGNORED
}

// If Private Data From Fall Velocity Is Lower Then 500.
if( get_pdata_float(id, 251) < 500 && ++ g_jumps[id] <= get_pcvar_num(cvar_max_jumps) )
{
// Set Velocity.
new Float:fVelocity[ 3 ];
pev( id, pev_velocity, fVelocity )
fVelocity[ 2 ] = 268.328157
set_pev( id, pev_velocity, fVelocity )

// Return Ham Ignore.
return HAM_HANDLED
}
}
return HAM_IGNORED
}
//vip tag
public VipStatus(const MsgId, const MsgType, const MsgDest)
{
static id;
id = get_msg_arg_int(1);

if((get_user_flags(id) & VIP_FLAG) && !get_msg_arg_int(2))
set_msg_arg_int(2, ARG_BYTE, (1 << 2 ));
}

Last edited by Calibru09; 11-05-2020 at 04:27.
Calibru09 is offline
Send a message via AIM to Calibru09 Send a message via Yahoo to Calibru09 Send a message via Skype™ to Calibru09
GaBy96
Member
Join Date: Oct 2012
Location: Romania
Old 11-05-2020 , 13:31   Re: VIP plugin FIX
Reply With Quote #2

Quote:
Reason: Server shutting down
FATA ERROR (shutting down): Host_Error: PF_setmodel_I: no precache: w_deaglegold.mdl
you don't have this models:
PHP Code:
new const ArmeGold[MAX_WEAPONS+1][DETALII] =
{
"None","None",CSW_KNIFE,000,"None","None","None","None","None" },//linia asta nu trebuie completata
//modifici astea de sub, locatiile modelelor si numele soundurilor
"Ak47 Gold","weapon_ak47",CSW_AK47,1998,"models/w_ak47.mdl","v_ak47gold.mdl","p_ak47gold.mdl","w_ak47gold.mdl","ak47g_fire.wav" },
"M4a1 Gold","weapon_m4a1",CSW_M4A1,1999,"models/w_m4a1.mdl","v_m4a1gold.mdl","p_m4a1gold.mdl","w_m4a1gold.mdl","m4a1g_fire.wav" },
"Deagle Gold","weapon_deagle",CSW_DEAGLE,1920,"models/w_deagle.mdl","v_deaglegold.mdl","p_deaglegold.mdl","w_deaglegold.mdl","deagleg_fire.wav" },
"AwP Gold","weapon_awp",CSW_AWP,1921,"models/w_awp.mdl","v_awpgold.mdl","p_awpgold.mdl","w_awpgold.mdl","awpg_fire.wav" }
}; 
__________________

We have over 1200 skins on weapons!
Costumes for players!
Jackpot, roulette, etc!
And many more are waiting for you to play!
GaBy96 is offline
Send a message via AIM to GaBy96 Send a message via Yahoo to GaBy96 Send a message via Skype™ to GaBy96
Calibru09
Junior Member
Join Date: Jan 2020
Location: Romania
Old 11-06-2020 , 05:07   Re: VIP plugin FIX
Reply With Quote #3

i do have them , lol .
Calibru09 is offline
Send a message via AIM to Calibru09 Send a message via Yahoo to Calibru09 Send a message via Skype™ to Calibru09
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:11.


Powered by vBulletin®
Copyright ©2000 - 2022, vBulletin Solutions, Inc.
Theme made by Freecode