[solved]Compiler Crashes
Hello , when I try to compile this code my compiler just crashes .
No errors ore anything my amxmodx studio just shuts down .
Can someone help me with this cause I find it a little strange .
PHP Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fakemeta> #include <fakemeta_util>
#define PLUGIN "Another Vip Plugin" #define VERSION "1.0" #define AUTHOR "Grim"
#define VIP_ACCES ADMIN_LEVEL_B
/* Pcvars */ new HealthBonus; new KillBonus; new HeadshotBonus; new KillMoney; new HeadshotMoney; new MoneyBonus; new KnifeHealth;
/* Vip Extras */ new sniper[33] new money[33] new grenade[33] new armor[33] new spawnhp[33] new hpknife[33] new killmoney[33]
/* Bools */ new bool:noweapon[33] new bool:used_menu[33] new bool:extra_money[33]
public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) /* Log Event */ register_logevent("EndRound",2,"0=World triggered", "1=Round_Draw", "1=Round_End"); /* Player Spawn */ RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1); /* Pcvars */ HealthBonus = register_cvar("amx_viphealthbonus", "50"); KillBonus = register_cvar("amx_vipkillbonus", "15"); HeadshotBonus = register_cvar("amx_vipheadshotbonus", "20"); KillMoney = register_cvar("amx_vipkillmoney", "500"); HeadShotMoney = register_cvar("amx_vipheadshotmoney", "800"); MoneyBonus = register_cvar("amx_vipextramoney", "1000"); KnifeHealth = register_cvar("amx_vipknifehealth", "400"); /* Events */ register_event("DeathMsg", "eDeath", "a"); register_event("CurWeapon", "eWeapon", "be"); /* ConCmds */ register_concmd("vipmenu", "show_vipmenu", VIP_ACCES); /* Menu */ menu = register_menuid("Vip Menu"); register_menucmd(menu, 1023, "vipmenu"); }
public client_connect(id) { noweapon[id] = false used_menu[id] = false }
public client_disconnect(id) { noweapon[id] = false used_menu[id] = false }
/* Vip Joins */ public client_putinserver(id) { if(get_user_flags(id) & VIP_ACCES) { new vipname[33] get_user_name(id, vipname, 32) set_hudmessage(255, 0, 0, -1.0, 0.2, 0, 6.0, 6.0) show_hudmessage(id, "Special Vip %s has Connected", vipname) cs_set_user_vip(id, 0, 0, 1) } } /* Player Spawn */ public fwHamPlayerSpawnPost(id) { if(get_user_flags(id) & VIP_ACCES) { if(spawnhp[id] > 0) { new viphealth = pev(id, pev_health) new viphealthbonus = get_pcvar_num(HealthBonus) set_pev(id, pev_health, viphealth + viphealthbonus) spawnhp[id] = 0 } if(money[id] > 0) { new vipmoney = cs_get_user_money(id) new vipmoneybonus = get_pcvar_num(MoneyBonus) cs_set_user_money(id, vipmoney + vipmoneybonus) money[id] = 0 } if(grenade[id] > 0) { fm_give_item(id, weapon_hegrenade) fm_give_item(id, weapon_flashbang) fm_give_item(id, weapon_flashbang) fm_give_item(id, weapon_smokegrenade) grenade[id] = 0 } if(hpknife[id] > 0) { noweapon[id] = true set_task(0.5, "health_knife", id) client_print(id, print_chat, "Dont buy , You cant do anything with your weapons!") hpknife[id] = 0 } if(killmoney[id] > 0) { extramoney[id] = true killmoney[id] = 0 } } }
/* Round Ends */ public EndRound() { new players[32], pnum get_players(players, pnum) for( new i = 0; i < pnum; i++ ) { noweapon[players[i]] = false used_menu[players[i]] = false } }
public health_knife(id) { fm_strip_user_weapons(id) fm_give_item(id, knife) new health = get_pcvar_num(HealthKnife) set_pev(id, pev_health, health) }
public stripandknife(id) { fm_strip_user_weapons(id) fm_give_item(id, knife) }
/* Someone Died */ public eDeath() { new killer = read_data(1) new victem = read_data(2) new headshot = read_data(3) if(victem = killer) { return PLUGIN HANDLED; } if(get_user_flags(killer) & VIP_ACCES) { if(headshot) { new viphealth = pev(id, pev_health) new vipheadshotbonus = get_pcvar_num(HeadshotBonus) set_pev(id, pev_health, viphealth + vipheadshotbonus) if(extra_money[id]) { new bonusmoney = get_pcvar_num(HeadshotMoney) new vipmoney = cs_get_user_money(id) cs_set_user_money(id, vipmoney + bonusmoney) } } else { new viphealth = pev(id, pev_health) new viphealthbonus = get_pcvar_num(HealthBonus) set_pev(id, pev_health, viphealth + viphealthbonus) if(extra_money[id]) { new bonusmoney = get_pcvar_num(KillMoney) new vipmoney = cs_get_user_money(id) cs_set_user_money(id, vipmoney + bonusmoney) } } } return PLUGIN_HANDLED; }
/* Weapon Event */ public eWeapon(id) { if(noweapon[id]) { new clip, ammo, weapon = get_user_weapon(id, clip, ammo) if(weapon == CSW_KNIFE) { return PLUGIN_HANDLED; } else { set_task(0.1, "stripandknife", id) } } }
/* Menu */ public show_vipmenu(id, level, cid) { if (!cmd_access(id,level,cid,0)) return PLUGIN_HANDLED if(used_menu[id]) { console_print(id, "You already picked somthing from the menu this round") return PLUGIN_HANDLED; } new healthbonus = get_pcvar_num(HealthBonus) new knifehealth = get_pcvar_num(KnifeHealth) new szBuffer[512], iLen; iLen = formatex(szBuffer, sizeof szBuffer - 1, "\rVip Menu\w^n^n"); iLen += formatex(szBuffer[iLen], (sizeof szBuffer - 1) - iLen, "1. Allow Snipers^n"); iLen += formatex(szBuffer[iLen], (sizeof szBuffer - 1) - iLen, "2. Get +1000$ next round^n"); iLen += formatex(szBuffer[iLen], (sizeof szBuffer - 1) - iLen, "3. Free Granades next Round^n"); iLen += formatex(szBuffer[iLen], (sizeof szBuffer - 1) - iLen, "4. %d extra hp next round^n", healthbonus); iLen += formatex(szBuffer[iLen], (sizeof szBuffer - 1) - iLen, "5. %dHp Knife only^n^n", knifehealth); iLen += formatex(szBuffer[iLen], (sizeof szBuffer - 1) - iLen, "6. Extra money for killing^n^n", knifehealth); iLen += formatex(szBuffer[iLen], (sizeof szBuffer - 1) - iLen, "0. Exit"); new iKeys = ( 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<9 ); show_menu(id, iKeys, szBuffer, -1, "Vip Menu"); }
public vipmenu(id, key) { switch(key) { case 0: { /* Allow Sniper */ } case 1: { money[id]++ used_menu[id] = true client_print(id, print_chat, "You will receive ectra money on your next spawn") return PLUGIN_HANDLED } case 2: { grenade[id]++ used_menu[id] = true client_print(id, print_chat, "You will receive free grenades on your next spawn") return PLUGIN_HANDLED } case 3: { spawnhp[id]++ used_menu[id] = true client_print(id, print_chat, "You will receive extra health on your next spawn") return PLUGIN_HANDLED } case 4: { hpknife[id]++ used_menu[id] = true new health = get_pcvar_num(KnifeHealth) client_print(id, print_chat, "Next spawn you will get %d health and only a knife", health) return PLUGIN_HANDLED } case 5: { killmoney[id]++ used_menu[id] = true client_print(id, print_chat, "You will receive extra money for killing on your next spawn") return PLUGIN_HANDLED; } case 9: { return PLUGIN_HANDLED } } return PLUGIN_HANDLED }
|