Mam problem z VIPem, nie pobierają się specjalnie modele broni dla VIPa (deagle, ak47 i m4a1).
Kod:
#include <amxmodx> #include <cstrike> #include <csx> #include <engine> #include <fun> #include <hamsandwich> #include <stripweapons> forward amxbans_admin_connect(id); new Array:g_Array, CsArmorType:armortype, bool:g_Vip[33], gRound=0, g_Hudmsg, maxPlayers, weapon_id; new const clips[]={0, 13, -0, 10, 1, 7, 0, 30, 30, 1, 30, 20, 25, 30, 35, 25, 12, 20, 10, 30, 100, 8, 30, 30, 20, 2, 7, 30, 30, 0, 50}; new const g_Langcmd[][]={"say /vips","say_team /vips","say /vipy","say_team /vipy"}; public plugin_init(){ register_plugin("VIP Ultimate", "12.3.0.2", "benio101 & speedkill"); RegisterHam(Ham_Spawn, "player", "SpawnedEventPre", 1); register_event("HLTV", "event_new_round", "a", "1=0", "2=0"); register_logevent("GameCommencing", 2, "1=Game_Commencing"); register_event("DeathMsg", "DeathMsg", "a"); g_Array=ArrayCreate(64,32); for(new i;i<sizeof g_Langcmd;i++){ register_clcmd(g_Langcmd[i], "ShowVips"); } register_clcmd("say /vip", "ShowMotd"); g_Hudmsg=CreateHudSyncObj(); register_event("Damage", "damage", "b", "2!0", "3=0", "4!0"); register_logevent("RoundEnd", 2, "1=Round_End"); } public client_authorized(id){ if(get_user_flags(id) & 524288 == 524288){ client_authorized_vip(id); } } public client_authorized_vip(id){ g_Vip[id]=true; new g_Name[64]; get_user_name(id,g_Name,charsmax(g_Name)); new g_Size = ArraySize(g_Array); new szName[64]; for(new i = 0; i < g_Size; i++){ ArrayGetString(g_Array, i, szName, charsmax(szName)); if(equal(g_Name, szName)){ return 0; } } ArrayPushString(g_Array,g_Name); return PLUGIN_CONTINUE; } public client_disconnect(id){ if(g_Vip[id]){ client_disconnect_vip(id); } } public client_disconnect_vip(id){ g_Vip[id]=false; new Name[64]; get_user_name(id,Name,charsmax(Name)); new g_Size = ArraySize(g_Array); new g_Name[64]; for(new i = 0; i < g_Size; i++){ ArrayGetString(g_Array, i, g_Name, charsmax(g_Name)); if(equal(g_Name,Name)){ ArrayDeleteItem(g_Array,i); break; } } } public SpawnedEventPre(id){ if(g_Vip[id]){ if(is_user_alive(id)){ SpawnedEventPreVip(id); } } } public SpawnedEventPreVip(id){ cs_set_user_armor(id, min(cs_get_user_armor(id,armortype)+100, 100), CS_ARMOR_VESTHELM); new henum=(user_has_weapon(id,CSW_HEGRENADE)?cs_get_user_bpammo(id,CSW_HEGRENADE):0); if(!henum && henum<1){ give_item(id, "weapon_hegrenade"); ++henum; } new fbnum=(user_has_weapon(id,CSW_FLASHBANG)?cs_get_user_bpammo(id,CSW_FLASHBANG):0); if(!fbnum && fbnum<2){ give_item(id, "weapon_flashbang"); ++fbnum; } cs_set_user_bpammo(id, CSW_FLASHBANG, min(2, fbnum+2)); new sgnum=(user_has_weapon(id,CSW_SMOKEGRENADE)?cs_get_user_bpammo(id,CSW_SMOKEGRENADE):0); if(!sgnum && sgnum<1){ give_item(id, "weapon_smokegrenade"); ++sgnum; } StripWeapons(id, Secondary); give_item(id, "weapon_deagle"); give_item(id, "ammo_50ae"); weapon_id=find_ent_by_owner(-1, "weapon_deagle", id); if(weapon_id)cs_set_weapon_ammo(weapon_id, 7); cs_set_user_bpammo(id, CSW_DEAGLE, 35); recharge(id); new g_Model[64]; formatex(g_Model,charsmax(g_Model),"%s",get_user_team(id) == 1 ? "VipTT" : "VipCT"); cs_set_user_model(id,g_Model); if(gRound>=2){ cs_set_user_money(id, min(cs_get_user_money(id)+1000, 16000), 1); } if(get_user_team(id)==2){ give_item(id, "item_thighpack"); } } public event_new_round(){ ++gRound; } public GameCommencing(){ gRound=0; } public recharge(id){ new wid=get_user_weapon(id); if(wid){ new weaponname[32], weid; get_weaponname(wid, weaponname, 31); weid=find_ent_by_owner(-1, weaponname, id); if(weid){ cs_set_weapon_ammo(weid, clips[wid]); } } } public DeathMsg(){ new killer=read_data(1); new victim=read_data(2); if(is_user_alive(killer) && g_Vip[killer] && get_user_team(killer) != get_user_team(victim)){ DeathMsgVip(killer,victim,read_data(3)); } } public DeathMsgVip(kid,vid,hs){ set_user_health(kid, min(get_user_health(kid)+(hs?15:10),130)); cs_set_user_money(kid, cs_get_user_money(kid)+(hs?500:300)); } public ShowVips(id){ return PLUGIN_CONTINUE; } public client_infochanged(id){ if(g_Vip[id]){ new szName[64]; get_user_info(id,"name",szName,charsmax(szName)); new Name[64]; get_user_name(id,Name,charsmax(Name)); if(!equal(szName,Name)){ ArrayPushString(g_Array,szName); new g_Size=ArraySize(g_Array); new g_Name[64]; for(new i = 0; i < g_Size; i++){ ArrayGetString(g_Array, i, g_Name, charsmax(g_Name)); if(equal(g_Name,Name)){ ArrayDeleteItem(g_Array,i); break; } } } } } public plugin_end(){ ArrayDestroy(g_Array); } public ShowMotd(id){ show_motd(id, "vip.txt", "Informacje o vipie"); } public damage(id){ new attacker=get_user_attacker(id); new damage=read_data(2); if(g_Vip[id]){ set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1); ShowSyncHudMsg(id, g_Hudmsg, "%i^n", damage); } if(is_user_connected(attacker) && g_Vip[attacker]){ set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1); ShowSyncHudMsg(attacker, g_Hudmsg, "%i^n", damage); } } public bomb_planted(id){ if(is_user_alive(id) && g_Vip[id]){ cs_set_user_money(id,cs_get_user_money(id) + 300); } } public bomb_defused(id){ if(is_user_alive(id) && g_Vip[id]){ cs_set_user_money(id,cs_get_user_money(id) + 300); } } public plugin_precache(){ precache_model("models/player/VipCT/VipCT.mdl"); precache_model("models/player/VipTT/VipTT.mdl"); } public plugin_cfg(){ maxPlayers=get_maxplayers(); } public RoundEnd(){ for(new i = 1; i <= maxPlayers; i++){ if(is_user_alive(i) && g_Vip[i]){ cs_set_user_money(i,cs_get_user_money(i) + 500); } } } public amxbans_admin_connect(id){ client_authorized(id); } public CurWeapon(id) { if(!g_Vip[id]) return PLUGIN_CONTINUE; new weapon = read_data(2); if(weapon == CSW_DEAGLE){ set_pev(id,pev_viewmodel2,"models/BronieVIP/v_deagle.mdl") set_pev(id,pev_weaponmodel2,"models/BronieVIP/p_deagle.mdl") } else if(weapon == CSW_M4A1){ set_pev(id,pev_viewmodel2,"models/BronieVIP/v_m4a1.mdl") set_pev(id,pev_weaponmodel2,"models/BronieVIP/p_m4a1.mdl") } else if(weapon == CSW_AK47){ set_pev(id,pev_viewmodel2,"models/BronieVIP/v_ak47.mdl") set_pev(id,pev_weaponmodel2,"models/BronieVIP/p_ak47.mdl") } return PLUGIN_CONTINUE; } /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1045\\ f0\\ fs16 \n\\ par } */