Cerere rezolvare erori ShopFurien

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
PigoExtreamCS
Membru, skill 0
Membru, skill 0
Posts: 52
Joined: 18 Dec 2013, 21:24
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 7 times
Been thanked: 1 time
Contact:

20 Dec 2013, 13:19

Salut am gasitu n shop aici pe extream si am vrut sa-i adaug pet ma puteti ajuta cu erorile?
| Afiseaza codul
#include < amxmodx >
#include < amxmisc>
#include < engine >
#include < cstrike >
#include < hamsandwich >
#include < fakemeta >
#include < fakemeta_util >
#include < colorchat >
#include < fun >
#include < fcs >


#define PLUGIN "Furien Shop"
#define VERSION "0.0.4"
#define AUTHOR "-Turbo-"
#define EDITOR "Vlad(vladu888)"

 
#define fm_precache_model(%1)           engfunc(EngFunc_PrecacheModel,%1)
#define fm_precache_sound(%1)           engfunc(EngFunc_PrecacheSound,%1)
#define fm_remove_entity(%1)            engfunc(EngFunc_RemoveEntity, %1)
#define fm_drop_to_floor(%1)            engfunc(EngFunc_DropToFloor,%1)
#define fm_find_ent_by_class(%1,%2)     engfunc(EngFunc_FindEntityByString, %1, "classname", %2)
#define fm_set_user_gravity(%1,%2)      set_pev(%1,pev_gravity,%2)
     
#define PET_FLAG                        pev_flTimeStepSound
#define PET_KILLED                      389

static const pet_model[] = "models/stukabat.mdl"
static const pet_sounds[][] = { "bullchicken/bc_die1.wav", "bullchicken/bc_die2.wav", "bullchicken/bc_die3.wav", "bullchicken/bc_idle1.wav", "bullchicken/bc_pain3.wav" }
static const pet_idle = 13
static const pet_run = 13
static const pet_die = 5
static const Float:pet_idle_speed = 0.3
static const Float:pet_run_speed = 10.0
static const Float:player_gravity = 0.65

new item_pet[33]
new item_have[33]
new item_at_spawn[33]
new Float:item_leaptime[33]
new bool:g_has_speed[33]     
new maxplayers, g_msgSayText


#define ViewMaxModels 4

new ViewModels [ ViewMaxModels + 1 ] [ ] = {
	
	"models/shop/v_super_cutit2.mdl",
	"models/shop/v_stukbat.mdl",
	"models/shop/v_dragonclaws.mdl",
        "models/shop/v_tigerknife.mdl",
	""
};

new iWeapon[33];
public plugin_init() 
{
	register_plugin(PLUGIN, VERSION, AUTHOR);

	register_event("DeathMsg","DeathMsg","a")
        register_event("HLTV","HLTV", "a","1=0", "2=0")

        register_forward(FM_Think,"FM_Think_hook")
        register_forward(FM_PlayerPreThink, "FM_PlayerPreThink_hook")
    
        RegisterHam(Ham_Spawn, "player", "player_spawn", 1)    
	register_clcmd("say /shop", "FurienShop", 0);
	register_clcmd("say shop", "FurienShop", 0);
	register_clcmd("say_team /shop", "FurienShop", 0);
	register_clcmd("say_team shop", "FurienShop", 0);
	register_event ( "CurWeapon", "CurrentWeapon", "be", "1=1" );
	RegisterHam ( Ham_TakeDamage, "player", "Player_TakeDamage" );
	register_event( "DeathMsg" , "DeathMsgEvent" , "a" ); 
        maxplayers = get_maxplayers()
        g_msgSayText = get_user_msgid("SayText")
}
 public plugin_natives()
            register_native("set_user_pet", "native_set_pet", 1)
           
    public native_set_pet(id)
            create_pet(id)
     
    public plugin_precache()
    {
            new i = 0
           
            for(i = 0; i < sizeof pet_sounds; i++)
                    fm_precache_sound(pet_sounds)
           
            fm_precache_model(pet_model)
    }
public HLTV()
    {
            new entid = -1
            while((entid = fm_find_ent_by_class(entid, "zp_bat")))
            {
                    if(pev(entid,PET_FLAG) == PET_KILLED)
                    {
                            fm_remove_entity(entid)
                    }              
    }
public DeathMsg()
    {
            new id = read_data(2)
           
            if(item_have[id])
            {
                    kill_pet(id)
                    item_have[id] = 0
            }
                   
            if(cs_get_user_team(id) == CS_TEAM_T)
                    item_have[id] = 0
           
            if(g_has_speed[id])
                    g_has_speed[id] = false
   }      

public plugin_precache ( ) 
{
	new vmodel;
	for ( vmodel = 0; vmodel < sizeof ( ViewModels ); vmodel++ )
		engfunc ( EngFunc_PrecacheModel, ViewModels [ vmodel ] );
}

public DeathMsgEvent() 
{ 
	new iVictim = read_data( 2 ); 
	iWeapon[iVictim] = 0
}  

public CurrentWeapon ( id ) 
{
	new szWeapon = get_user_weapon( id );
	if(is_user_alive(id))
	{
		switch(iWeapon[id])
		{
			case 1:
			{
				if(szWeapon == CSW_KNIFE && get_user_team(id) == 1)
					set_pev ( id, pev_viewmodel2, ViewModels [ 0 ] );
				
			}
			case 2:
			{
				if(szWeapon == CSW_KNIFE && get_user_team(id) == 1)
					set_pev ( id, pev_viewmodel2, ViewModels [ 2 ] );	
				
			}
                        case 3:
			{
				if(szWeapon == CSW_KNIFE && get_user_team(id) == 1)
					set_pev ( id, pev_viewmodel2, ViewModels [ 3 ] );	
				
			}
		}
	}
}

public FurienShop ( id ) 
{	
	switch(get_user_team(id))
	{
		case 1: set_task( 0.1, "ShowFurien", id );
			
		case 2: set_task( 0.1, "ShowAntiFurien", id );
	}
	
}

public ShowAntiFurien(id, level, cid) 
{   
	new menu = menu_create( "\rAnti\w-\rFurien \yBuying", "antifurienhandler");
        new iCredits = fcs_get_user_credits( id );
        new iMoney = cs_get_user_money(id);
	if( iCredits < 20 ) 
	{
		menu_additem( menu, "\rBuy Pet\y - \dNo Credits", "1", 0 )
	}
	else if( iCredits >= 20 ) 
	{
		menu_additem( menu, "\rBuy Pet\y - \w[ \r20 \wCredite ]", "1", 0 )
	}
	if( iMoney < 300 ) 
	{
		menu_additem( menu, "\rDefuse Kit\y - \dNo Money", "2", 0 )
	}
	else if( iMoney >= 300 ) 
	{
		menu_additem( menu, "\rDefuse Kit\y - \w[ \y300 \w$ ]", "2", 0 )
	}
	if( iMoney < 3000 ) 
	{
		menu_additem( menu, "\r50 Health\y - \dNo Money", "3", 0 )
	}
	else if( iMoney >= 3000 ) 
	{
		menu_additem( menu, "\r50 Health\y - \w[ \y3000 \w$ ]", "3", 0 )
	}
	if( iMoney < 1000 ) 
	{
		menu_additem( menu, "\r100 Armura\y - \dNo Money", "4", 0 )
	}
	else if( iMoney >= 1000 ) 
	{
		menu_additem( menu, "\rSuper Knife\y - \w[ \y1000 \w$ ]", "4", 0 )
	}
	if( iMoney < 2500 ) 
	{
		menu_additem( menu, "\rHe Grenade\y - \dNo Money", "5", 0 )
	}
	else if( iMoney >= 2500 ) 
	{
		menu_additem( menu, "\rHe Grenade\y - \w[ \y2500 \w$ ]", "5", 0 )
	}
	
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, menu, 0);
}

public ShowFurien(id, level, cid) 
{    
	new menu = menu_create( "\rFurien \yBuying", "furienhandler");
        new iCredits = fcs_get_user_credits( id );
        new iMoney = cs_get_user_money(id);
	if( iMoney < 12000 ) 
	{
		menu_additem( menu, "\rSuper Knife\y - \dNo Money", "0", 0 )
	}
	else if( iMoney >= 12000 ) 
	{
		menu_additem( menu, "\rSuper Knife\y - \w[ \y12000 \w$ ]", "0", 0 )
	}
        if( iCredits < 10 ) 
	{
		menu_additem( menu, "\rTiger Knife\y - \dNo Credits", "1", 0 )
	}
	else if( iCredits >= 10 ) 
	{
		menu_additem( menu, "\rTiger Knife\y - \w[ \y10 \wCredits ]", "1", 0 )
	}
	if( iMoney < 2500 ) 
	{
		menu_additem( menu, "\rHe Grenade\y - \dNo Money", "2", 0 )
	}
	else if( iMoney >= 2500 ) 
	{
		menu_additem( menu, "\rHe Grenade\y - \w[ \y2500 \w$ ]", "2", 0 )
	}
	if( iMoney < 3000 ) 
	{
		menu_additem( menu, "\r50 Health\y - \dNo Money", "3", 0 )
	}
	else if( iMoney >= 3000 ) 
	{
		menu_additem( menu, "\r50 Health\y - \w[ \y3000 \w$ ]", "3", 0 )
	}
	if( iMoney < 1000 ) 
	{
		menu_additem( menu, "\r100 Armor\y - \dNo Money", "4", 0 )
	}
	else if( iMoney >= 1000 ) 
	{
		menu_additem( menu, "\r100 Armor\y - \w[ \y1000 \w$ ]", "4", 0 )
	}
        if( iCredits < 20 )
	{
		menu_additem( menu, "\rElf Potion\y - \dNo Credits", "5", 0 )
	}
	else if( iCredits >= 20 ) 
	{
		menu_additem( menu, "\rElf Potion\y - \w[ \y20 \wCredits ]", "5", 0 )
	}
	
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, menu, 0);
}

public furienhandler (id, menu, item, level, cid) 
{
	if( item == MENU_EXIT )
	{
		return 1;
	}
	
	new data[6], szName[64];
	new access, callback;
	menu_item_getinfo(menu, item, access, data,charsmax(data), szName,charsmax(szName), callback);
	new key = str_to_num(data);
	
	switch(key)
	{  
		case 0:
		{	
			new iMoney = cs_get_user_money ( id ) - 12000;
			if( iMoney < 0 )
			{
				ColorChat( id, GREEN, "^x01[ ^x04 FurienShop ^x01 ]^x03 Nu ai destui bani!");
				return 1;
				
			}
			else
			{ 
				iWeapon[id] = 1;
				CurrentWeapon( id );
				cs_set_user_money(id, cs_get_user_money(id) - 12000);
				ColorChat( id, GREEN, "^x01[ ^x04 FurienShop ^x01 ]^x03 Ai cumparat ^x01 SuperKnife!");
				return 1;
			}
		}
        case 1:
		{
			new iCredits = fcs_get_user_credits ( id ) - 10;
			if( iCredits < 0 )
			{
				ColorChat( id, GREEN, "^x01[ ^x04 FurienShop ^x01 ]^x03 Nu ai destui bani!");
				return 1;
				
			}
			else
			{ 
				iWeapon[id] = 4;
				CurrentWeapon( id );
				fcs_set_user_credits( id, iCredits );
				ColorChat( id, GREEN, "^x01[ ^x04 FurienShop ^x01 ]^x03 Ai cumparat ^x01 Tiger Knife!");
				return 1;
			}
                        
		}
		case 2:
		{	
			new iMoney = cs_get_user_money ( id ) - 2500;
			if( iMoney < 0 )
			{
				ColorChat( id, GREEN, "^x01[ ^x04 FurienShop ^x01 ]^x03 Nu ai destui bani!");
				return 1;
				
			}
			else
			{ 
				give_item ( id, "weapon_hegrenade" );
				cs_set_user_money(id, cs_get_user_money(id) - 2500);
				ColorChat( id, GREEN, "^x01[ ^x04 FurienShop ^x01 ]^x03 Ai cumparat ^x01HeGrenade!");
				return 1;
			}
		}
		
		case 3:
		{
			new iMoney = cs_get_user_money ( id ) - 3000;
			if( iMoney < 0 )
			{
				ColorChat( id, GREEN, "^x01[ ^x04 FurienShop ^x01 ]^x03 Nu ai destui bani !");
				return 1;
				
			}
			else
			{
				new Health = get_user_health ( id );
				if ( Health <= 300 ) 
				{
					set_user_health ( id, get_user_health ( id ) + 50 );
					cs_set_user_money(id, cs_get_user_money(id) - 3000);
					ColorChat( id, GREEN, "^x01[ ^x04 FurienShop ^x01 ]^x03 Ai cumparat 50 HP!");
					return 1;
				}
                                if( Health > 300 ) {
               
                                ColorChat( id, GREEN, "[FURIEN]^x01 You can't buy more^x03 300 HP^x01." );
                                return 1;
			        }
			}
		}
		case 4:
		{
			new iMoney = cs_get_user_money ( id ) - 1000;
			if( iMoney < 0 )
			{
				ColorChat( id, GREEN, "^x01[ ^x04 FurienShop ^x01 ]^x03 Nu ai destui bani");
				return 1;
				
			}
			else
			{
				new Armor = get_user_armor ( id );
				if ( Armor <= 200 ) 
				{
					set_user_armor( id, get_user_armor ( id ) + 100 );
					cs_set_user_money(id, cs_get_user_money(id) - 1000);
					ColorChat( id, GREEN, "^x01[ ^x04 FurienShop ^x01 ]^x03 Ai cumparat 100 AP!");
					return 1;
				}
			}
		}
		
		case 5:
		{
			new iCredits = fcs_get_user_credits ( id ) - 20;
			if( iCredits < 0 )
			{
				ColorChat( id, GREEN, "^x01[ ^x04 FurienShop ^x01 ]^x03 Nu ai destui bani!");
				return 1;
				
			}
			else
			{
				new Health = get_user_health ( id );
				if ( Health <= 300 ) 
				{
					set_user_health( id, get_user_health ( id ) + 250 );
					set_user_armor( id, get_user_armor ( id ) + 250 );
					iWeapon[id] = 3;
                                        CurrentWeapon( id );
					fcs_set_user_credits( id, iCredits );
					ColorChat( id, GREEN, "^x01[ ^x04 FurienShop ^x01 ]^x03 Ai cumparat ^x01 Elf Potion!");
					return 1;
				}
                                if( Health > 300 ) {
               
                                ColorChat( id, GREEN, "[FURIEN]^x01 You can't buy more^x03 300 HP^x01." );
                                return 1;
			        }
			}
		}
	}
	menu_destroy(menu);
	return 1;
}

public antifurienhandler(id, menu, item, level, cid) 
{
	if( item == MENU_EXIT )
	{
		return 1;
	}
	
	new data[6], szName[64];
	new access, callback;
	menu_item_getinfo(menu, item, access, data,charsmax(data), szName,charsmax(szName), callback);
	new key = str_to_num(data);
	
	switch(key)
	{ 
	    case 1:
            {	
            if (!is_user_alive(id))
            {
                    client_printcolor(id, "^4[Furien Pet]^1 Nu poti cumpara pet cand esti mort.");
                    return PLUGIN_HANDLED;
            }
     
            if (cs_get_user_team(id) != CS_TEAM_CT)
            {
                    client_printcolor(id, "^4[Furien Pet]^1 Numai^3 Anti-furienii^1 pot cumpara pet.");
                    return PLUGIN_HANDLED;
            }
           
            if (!item_have[id])
            {      
                    if (fcs_get_user_credits(id) >= 30)
                    {
                            fcs_set_user_credits(id, fcs_get_user_credits(id) - 30);
                            client_printcolor(id, "^4[Furien Pet]^1 Ai cumparat^3 PET.");
                            create_pet(id)
                    }else
                            client_printcolor(id, "^4[Furien Pet]^1 Nu ai destule^3 credite.");
                    }else
                            client_printcolor(id, "^4[Furien Pet]^1 Detii deja un pet!");

                   return PLUGIN_CONTINUE;
		}
                public kill_pet(id)
    {
            if(pev_valid(item_pet[id]))
            {
                    set_pev(item_pet[id],pev_sequence,pet_die)
                    set_pev(item_pet[id],pev_gaitsequence,pet_die)
                    set_pev(item_pet[id],pev_framerate,1.0)
                   
                    set_pev(item_pet[id],PET_FLAG,PET_KILLED)
                   
                    fm_drop_to_floor(item_pet[id])
                   
                    item_have[id] = 0
                    g_has_speed[id] = false
            }      
            item_pet[id] = 0
    }
     
    public player_spawn(player)
    {
            if(is_user_alive(player))
            {
                    if (cs_get_user_team(player) != CS_TEAM_CT)
                    {
                            kill_pet(player)
                            item_have[player] = 0
                    }
                    if(item_have[player])
                    {
                            fm_set_user_gravity(player, player_gravity)
                            set_user_health(player, get_user_health(player) + 250)
                            set_user_armor(player, get_user_armor(player) + 350)
                            g_has_speed[player] = true
                    }
                    else if(item_at_spawn[player])
                    {
                            create_pet(player)
                            item_at_spawn[player] = 0
                            g_has_speed[player] = true
                    }
            }
    }
     
    public create_pet(id)
    {
            if(item_have[id])
            {
                    client_printcolor(id, "^4[Furien Pet]^1 Detii deja un^3 pet.")
                    return PLUGIN_HANDLED
            }
            else if(!is_user_alive(id))
            {
                    client_printcolor(id, "^4[Furien Pet]^1 Petul iti va aparea runda viitoare.")
                    item_at_spawn[id] = 1
                    return PLUGIN_HANDLED
            }      
            else
            {
                    item_pet[id] = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString,"info_target"))
                    set_pev(item_pet[id],pev_classname,"zp_bat")
                   
                    engfunc(EngFunc_SetModel,item_pet[id],pet_model)
                   
                    new Float:origin[3]
                    pev(id,pev_origin,origin)                      
                   
                    set_pev(item_pet[id],pev_origin,origin)
                    set_pev(item_pet[id],pev_solid,SOLID_TRIGGER)
                    set_pev(item_pet[id],pev_movetype,MOVETYPE_FLY)
                    set_pev(item_pet[id],pev_owner,33)
                    set_pev(item_pet[id],pev_nextthink,1.0)
                    set_pev(item_pet[id],pev_sequence,0)
                    set_pev(item_pet[id],pev_gaitsequence,0)
                    set_pev(item_pet[id],pev_framerate,1.0)
                   
                    set_pev(item_pet[id], pev_renderfx, kRenderFxGlowShell)
                    set_pev(item_pet[id], pev_rendercolor, Float:{0.0, 0.0, 200.0})
                   
                    fm_set_user_gravity(id,player_gravity)
                   
                    set_user_health(id, get_user_health(id) + 250)
                    set_user_armor(id, get_user_armor(id) + 350)
                   
                    engfunc(EngFunc_EmitSound,item_pet[id],CHAN_AUTO,pet_sounds[random_num(0,sizeof pet_sounds - 1)],1.0, 1.2, 0, PITCH_NORM)              
                   
                    item_have[id] = 1
                    g_has_speed[id] = true
            }
            return PLUGIN_HANDLED
    }
     
    public FM_Think_hook(ent)
    {
            for(new i = 0; i <= maxplayers; i++)
            {
                    if(ent == item_pet)
                    {
                            static Float:origin[3]
                            static Float:origin2[3]
                            static Float:velocity[3]
                            pev(ent,pev_origin,origin2)
                            get_offset_origin_body(i,Float:{50.0,0.0,0.0},origin)
                           
                            if(get_distance_f(origin,origin2) > 300.0)
                            {
                                    set_pev(ent,pev_origin,origin)
                            }
                           
                            else if(get_distance_f(origin,origin2) > 80.0)
                            {
                                    get_speed_vector(origin2,origin,250.0,velocity)
                                    set_pev(ent,pev_velocity,velocity)
                                    if(pev(ent,pev_sequence) != pet_run || pev(ent,pev_framerate) != pet_run_speed)
                                    {
                                            set_pev(ent,pev_sequence,pet_run)
                                            set_pev(ent,pev_gaitsequence,pet_run)
                                            set_pev(ent,pev_framerate,pet_run_speed)
                                    }
                            }
                           
                            else if(get_distance_f(origin,origin2) < 75.0)
                            {
                                    if(pev(ent,pev_sequence) != pet_idle || pev(ent,pev_framerate) != pet_idle_speed)
                                    {
                                            set_pev(ent,pev_sequence,pet_idle)
                                            set_pev(ent,pev_gaitsequence,pet_idle)
                                            set_pev(ent,pev_framerate,pet_idle_speed)
                                    }
                                    set_pev(ent,pev_velocity,Float:{0.0,0.0,0.0})
                            }
                            pev(i,pev_origin,origin)
                            origin[2] = origin2[2]
                            entity_set_aim(ent,origin)                     
                            set_pev(ent,pev_nextthink,1.0)
                            break
                    }
            }
    }
     
    public FM_PlayerPreThink_hook(id)
    {
            if (!is_user_alive(id))
                    return
           
            if(allowed_leap(id))
            {
                    static Float:velocity[3]
                    velocity_by_aim(id, 500, velocity)
                   
                    velocity[2] = 300.0
                   
                    set_pev(id, pev_velocity, velocity)
                   
                    item_leaptime[id] = get_gametime()
            }
    }
     
    public allowed_leap(id)
    {      
            if(!item_have[id])
                    return false
           
            if (!(pev(id, pev_flags) & FL_ONGROUND) || fm_get_speed(id) < 80)
                    return false
           
            static buttons
            buttons = pev(id, pev_button)
           
            if (!is_user_bot(id) && (!(buttons & IN_JUMP) || !(buttons & IN_DUCK)))
                    return false
           
            if (get_gametime() - item_leaptime[id] < 3)
                    return false
           
            return true
    }
     
    public is_a_player(ent)
    {
            if(ent > 0 && ent < 33)
                    return true
           
            return false
    }
     
    public remove_pet(ent)
    {
            if(pev_valid(ent))
                    fm_remove_entity(ent)
    }
     
    // Get entity's speed (from fakemeta_util)
    stock fm_get_speed(entity)
    {
            static Float:velocity[3]
            pev(entity, pev_velocity, velocity)
           
            return floatround(vector_length(velocity));
    }
    stock get_offset_origin_body(ent,const Float:offset[3],Float:origin[3])
    {
            if(!pev_valid(ent))
                    return 0;
           
            new Float:angle[3]
            pev(ent,pev_angles,angle)
           
            pev(ent,pev_origin,origin)
           
            origin[0] += floatcos(angle[1],degrees) * offset[0]
            origin[1] += floatsin(angle[1],degrees) * offset[0]
           
            origin[1] += floatcos(angle[1],degrees) * offset[1]
            origin[0] += floatsin(angle[1],degrees) * offset[1]
           
            return 1;
    }
     
    stock get_speed_vector(const Float:origin1[3],const Float:origin2[3],Float:speed, Float:new_velocity[3])
    {
            new_velocity[0] = origin2[0] - origin1[0]
            new_velocity[1] = origin2[1] - origin1[1]
            new_velocity[2] = origin2[2] - origin1[2]
            new Float:num = floatsqroot(speed*speed / (new_velocity[0]*new_velocity[0] + new_velocity[1]*new_velocity[1] + new_velocity[2]*new_velocity[2]))
            new_velocity[0] *= num
            new_velocity[1] *= num
            new_velocity[2] *= num
           
            return 1;
    }
     
    stock entity_set_aim(ent,const Float:origin2[3],bone=0)
    {
            if(!pev_valid(ent))
                    return 0;
           
            static Float:origin[3]
            origin[0] = origin2[0]
            origin[1] = origin2[1]
            origin[2] = origin2[2]
           
            static Float:ent_origin[3], Float:angles[3]
           
            if(bone)
                    engfunc(EngFunc_GetBonePosition,ent,bone,ent_origin,angles)
            else
                    pev(ent,pev_origin,ent_origin)
           
            origin[0] -= ent_origin[0]
            origin[1] -= ent_origin[1]
            origin[2] -= ent_origin[2]
           
            static Float:v_length
            v_length = vector_length(origin)
           
            static Float:aim_vector[3]
            aim_vector[0] = origin[0] / v_length
            aim_vector[1] = origin[1] / v_length
            aim_vector[2] = origin[2] / v_length
           
            static Float:new_angles[3]
            vector_to_angle(aim_vector,new_angles)
           
            new_angles[0] *= -1
           
            if(new_angles[1]>180.0) new_angles[1] -= 360
            if(new_angles[1]<-180.0) new_angles[1] += 360
            if(new_angles[1]==180.0 || new_angles[1]==-180.0) new_angles[1]=-179.999999
           
            set_pev(ent,pev_angles,new_angles)
            set_pev(ent,pev_fixangle,1)
           
            return 1;
                }		
		case 2:
		{
			new iMoney = cs_get_user_money ( id ) - 300;
			if( iMoney < 0 )
			{
				ColorChat( id, GREEN, "^x01[ ^x04FurienShop^x01 ]^x03 Nu ai destui bani!");
				return 1;
				
			}
			else
			{ 
				fm_give_item ( id, "item_thighpack" );
				cs_set_user_money(id, cs_get_user_money(id) - 300);
				ColorChat( id, GREEN, "^x01[ ^x04 FurienShop ^x01 ]^x03 Ai cumparat ^x01 DefuseKit!");
				return 1;
			}
		}
		
		case 3:
		{
			new iMoney = cs_get_user_money ( id ) - 3000;
			if( iMoney < 0 )
			{
				ColorChat( id, GREEN, "^x01[ ^x04 FurienShop ^x01 ]^x03 Nu ai destui bani !");
				return 1;
				
			}
			else
			{
				new Health = get_user_health ( id );
				if ( Health <= 300 ) 
				{
					fm_set_user_health ( id, get_user_health ( id ) + 50 );
					cs_set_user_money(id, cs_get_user_money(id) - 3000);
					ColorChat( id, GREEN, "^x01[ ^x04 FurienShop ^x01 ]^x03 Ai cumparat ^x01 50 HP!");
					return 1;
				}
                                if( Health > 300 ) {
               
                                ColorChat( id, GREEN, "[FURIEN]^x01 You can't buy more^x03 300 HP^x01." );
                                return 1;
				}
			}
		}
		case 4:
		{
			new iMoney = cs_get_user_money ( id ) - 1000;
			if( iMoney < 0 )
			{
				ColorChat( id, GREEN, "^x01[ ^x04 FurienShop ^x01 ]^x03 Nu ai destui bani");
				return 1;
				
			}
			else
			{
				new Armor = get_user_armor ( id );
				if ( Armor <= 300 ) 
				{
					fm_set_user_armor( id, get_user_armor ( id ) + 50 );
					cs_set_user_money(id, cs_get_user_money(id) - 1000);
					ColorChat( id, GREEN, "^x01[ ^x04 FurienShop ^x01 ]^x03 Ai cumparat 50 AP!");
					return 1;
				}
			}
		}
		
		case 5:
		{	
			new iMoney = cs_get_user_money ( id ) - 2500;
			if( iMoney < 0 )
			{
				ColorChat( id, GREEN, "^x01[ ^x04 FurienShop ^x01 ]^x03 Nu ai destui bani!");
				return 1;
				
			}
			else
			{ 
				give_item ( id, "weapon_hegrenade" );
				cs_set_user_money(id, cs_get_user_money(id) - 2500);
				ColorChat( id, GREEN, "^x01[ ^x04 FurienShop ^x01 ]^x03 Ai cumparat ^x01 HeGrenade!");
				return 1;
			}
                        
 }       
                         
	}
	
	menu_destroy(menu);
	return 1;
}

public Player_TakeDamage ( iVictim, iInflictor, iAttacker, Float:fDamage, iDamageBits )
{
	if(is_user_alive(iAttacker))
	{
		switch(iWeapon[iAttacker])
		{
			
			case 1:
			{
				if(iInflictor == iAttacker && get_user_weapon(iAttacker) == CSW_KNIFE && get_user_team(iAttacker) == 1)
					SetHamParamFloat( 4, fDamage * 2);
				
			}
			case 2:
			{
				if(iInflictor == iAttacker && get_user_weapon(iAttacker) == CSW_KNIFE && get_user_team(iAttacker) == 1)
					SetHamParamFloat( 4, fDamage * 3);
				
			}
                         case 3:
			{
				if(iInflictor == iAttacker && get_user_weapon(iAttacker) == CSW_KNIFE && get_user_team(iAttacker) == 1)
					SetHamParamFloat( 4, fDamage * 4);
				
			}
		}
	}
	return HAM_HANDLED;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0\\ deflang1033{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 15 guests