Raised This Month: $ Target: $400
 0% 

[solved]Compiler Crashes


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 07-17-2008 , 07:36   [solved]Compiler Crashes
Reply With Quote #1

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(PLUGINVERSIONAUTHOR)
    
    
/* 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(menu1023"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(idvipname32)
        
        
set_hudmessage(25500, -1.00.206.06.0)
        
show_hudmessage(id"Special Vip %s has Connected"vipname)
        
        
cs_set_user_vip(id001)
    }
}
        
/* Player Spawn */
public fwHamPlayerSpawnPost(id)
{
    if(
get_user_flags(id) & VIP_ACCES)
    {
        if(
spawnhp[id] > 0)
        {
            new 
viphealth pev(idpev_health)
            new 
viphealthbonus get_pcvar_num(HealthBonus)
            
set_pev(idpev_healthviphealth 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(idvipmoney vipmoneybonus)
            
money[id] = 0
        
}
        
        if(
grenade[id] > 0)
        {
            
fm_give_item(idweapon_hegrenade)
            
fm_give_item(idweapon_flashbang)
            
fm_give_item(idweapon_flashbang)
            
fm_give_item(idweapon_smokegrenade)
            
grenade[id] = 0
        
}
        
        if(
hpknife[id] > 0)
        {
            
noweapon[id] = true
            set_task
(0.5"health_knife"id)
            
client_print(idprint_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
(playerspnum)
    for( new 
0pnumi++ )
    {
        
noweapon[players[i]] = false
        used_menu
[players[i]] = false
    
}    
}


public 
health_knife(id)
{
    
fm_strip_user_weapons(id)
    
fm_give_item(idknife)
    new 
health get_pcvar_num(HealthKnife)
    
set_pev(idpev_healthhealth)
}

public 
stripandknife(id)
{
    
fm_strip_user_weapons(id)
    
fm_give_item(idknife)
}

/* 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(idpev_health)
            new 
vipheadshotbonus get_pcvar_num(HeadshotBonus)
            
set_pev(idpev_healthviphealth vipheadshotbonus)
            
            if(
extra_money[id])
            {
                new 
bonusmoney get_pcvar_num(HeadshotMoney)
                new 
vipmoney cs_get_user_money(id)
                
cs_set_user_money(idvipmoney bonusmoney)
            }    
        }
        else
        {
            new 
viphealth pev(idpev_health)
            new 
viphealthbonus get_pcvar_num(HealthBonus)
            
set_pev(idpev_healthviphealth viphealthbonus)
            
            if(
extra_money[id])
            {
                new 
bonusmoney get_pcvar_num(KillMoney)
                new 
vipmoney cs_get_user_money(id)
                
cs_set_user_money(idvipmoney bonusmoney)
            }
        }
    }
    return 
PLUGIN_HANDLED;
}

/* Weapon Event */
public eWeapon(id)
{
    if(
noweapon[id])
    {
        new 
clipammoweapon get_user_weapon(idclipammo)
        
        if(
weapon == CSW_KNIFE)
        {
            return 
PLUGIN_HANDLED;
        }
        else
        {
            
set_task(0.1"stripandknife"id)
        }
    }
}

/* Menu */
public show_vipmenu(idlevelcid)
{    
    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(szBuffersizeof 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<<1<<1<<1<<1<<1<<1<<);
    
show_menu(idiKeysszBuffer, -1"Vip Menu");
}

public 
vipmenu(idkey
{
    switch(
key
    {
        case 
0:
        {
            
/* Allow Sniper */
        
}
        case 
1:
        {
            
money[id]++
            
used_menu[id] = true
            client_print
(idprint_chat"You will receive ectra money on your next spawn")
            return 
PLUGIN_HANDLED
        
}
        case 
2:
        {
            
grenade[id]++
            
used_menu[id] = true
            client_print
(idprint_chat"You will receive free grenades on your next spawn")
            return 
PLUGIN_HANDLED
        
}
        case 
3:
        {
            
spawnhp[id]++
            
used_menu[id] = true
            client_print
(idprint_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(idprint_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
(idprint_chat"You will receive extra money for killing on your next spawn")
            return 
PLUGIN_HANDLED;
        }
        case 
9:
        {
            return 
PLUGIN_HANDLED
        
}
    }
    return 
PLUGIN_HANDLED

__________________
I am out of order!

Last edited by grimvh2; 07-17-2008 at 08:47.
grimvh2 is offline
 


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 05:36.


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