plugin eraore

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
Gangsta*
Membru, skill 0
Membru, skill 0
Posts: 90
Joined: 18 Aug 2013, 19:38
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 11 times
Been thanked: 2 times
Contact:

15 Dec 2013, 20:34

Salut nu mi se porneste plaginu nu stiu ce are poate trebuie sistemul de credite da rnustiu care ajutatima
| Afiseaza codul
#include < amxmodx >
#include < amxmisc>
#include < engine >
#include < cstrike >
#include < hamsandwich >
#include < fakemeta >
#include < fakemeta_util >
#include < fun >
#include < CC_ColorChat >

#define PLUGIN "Furien Shop"
#define VERSION "0.3"
#define AUTHOR "Gabriel"

native get_user_credits (id);
native set_user_credits (id,cantitate);

#define   FL_WATERJUMP   (1<<11)
#define   FL_ONGROUND         (1<<9)

native get_parachute( index );

new bool:UserHaveBhop[33];
new bool:super_knife [ 33 ];
new bool:super_knife2 [ 33 ];
new bool:g_bNoFlash[ 33 ];

new super_knife_v_model [ 66 ] = "models/v_knife_human.mdl";
new super_knife2_v_model [ 66 ] = "models/v_infinity_knife1.mdl";

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR);
	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" );
	RegisterHam ( Ham_Spawn, "player", "Spawn", 1 );
	register_event ( "DeathMsg", "eDeath", "ae" );
	
	register_event( "ScreenFade", "eventFlash", "be", "4=255", "5=255", "6=255", "7>199" );
}

public plugin_precache ( ) {
	precache_model ( super_knife_v_model );
	precache_model ( super_knife2_v_model );
}
public Spawn ( id ) {
	strip_user_weapons ( id );
	give_item ( id, "weapon_knife" );
	super_knife [ id ] = false;
	super_knife2 [ id ] = false;
	g_bNoFlash[ id ] = false
	UserHaveBhop[id] = false;
}
public client_putinserver ( id ) {
	super_knife [ id ] = false;
	super_knife2 [ id ] = false;
	UserHaveBhop[id] = false;
}
public client_disconnect ( id ) {
	client_putinserver ( id );
}
public eDeath ( ) {
	new victim = read_data(2);
	client_putinserver ( victim );
}
public CurrentWeapon ( id ) {
	if ( super_knife [ id ] && get_user_weapon ( id ) == CSW_KNIFE ) {
		set_pev ( id, pev_viewmodel2, super_knife_v_model );
	}
	if ( super_knife2 [ id ] && get_user_weapon ( id ) == CSW_KNIFE ) {
		set_pev ( id, pev_viewmodel2, super_knife2_v_model );
	}
}
public FurienShop ( id ) {
	if (get_user_team(id) == 1 ) {
		set_task( 0.1, "ShowFurien", id );
	}
	if (get_user_team (id ) == 2 ) {
		set_task( 0.1, "ShowAntiFurien", id );
	}
}
public ShowAntiFurien(id, level, cid) {
	new menu = menu_create( "\r Credite\w Shop", "antifurienhandler");
	menu_additem(menu, "\yPachet HP + AP - \r20 \yCredite", "1", 0);
	menu_additem(menu, "Defuse Kit - \r2 \yCredite", "2", 0 );
	menu_additem(menu, "50 HP - \r5 \yCredite", "3", 0);
	menu_additem(menu, "50 AP - \r2 \yCredite", "4", 0);
	menu_additem(menu, "No flash - \r5 \yCredite", "5", 0);
	menu_additem(menu, "Parasuta - \r3 \yCredite", "6", 0);
	menu_additem(menu, "Frost Nade - \r6 \yCredite", "6", 0);
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, menu, 0);
}
public ShowFurien(id, level, cid) {
	new menu = menu_create( "\r Credite\w Shop", "furienhandler");
	menu_additem(menu, "SuperKnife \yX3 - \r10 \yCredite", "1", 0);
	menu_additem(menu, "SuperKnife \yX4 - \r20 \yCredite", "2", 0);
	menu_additem(menu, "HE Grenade - \r6 \yCredite", "3", 0 );
	menu_additem(menu, "50 HP - \r5 \yCredite", "4", 0);
	menu_additem(menu, "50 AP - \r2 \yCredite", "5", 0);
	menu_additem(menu, "Autobhop - \r6 \yCredite", "6", 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 1:
		{
			new iCredits = get_user_credits ( id ) - 10;
			if( iCredits < 0 )
			{
				ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
				return 1;
			}
			else
			{
				super_knife[ id ] = true;
				CurrentWeapon( id );
				set_user_credits( id, iCredits );
				return 1;
			}
		}
		case 2:
		{
			new iCredits = get_user_credits ( id ) - 20;
			if( iCredits < 0 )
			{
				ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
				return 1;
			}
			else
			{
				super_knife2[ id ] = true;
				CurrentWeapon( id );
				set_user_credits( id, iCredits );
				return 1;
			}
		}
		case 3:
		{
			new iCredits = get_user_credits ( id ) - 6;
			if( iCredits < 0 )
			{
				ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
				return 1;
			}
			else
			{
				give_item( id, "weapon_hegrenade" );
				set_user_credits( id, iCredits );
				return 1;
			}
		}
		case 4:
		{
			new iCredits = get_user_credits ( id ) - 5;
			if( iCredits < 0 )
			{
				ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
				return 1;
			}
			else
			{
				new Health = get_user_health ( id );
				if( Health <= 300 )
				{
					fm_set_user_health( id, get_user_health ( id ) + 50 );
					set_user_credits( id, iCredits );
					return 1;
				}
				if( Health > 300 ) {
					ColorChat( id, GREEN, "[Furien]^x01 Trebuie sa ai mai putin de^x03 100 HP^x01 sa poti cumpara inca 50 hp" );
					return 1;
				}
			}
		}
		case 5:
		{
			new iCredits = get_user_credits ( id ) - 2;
			if( iCredits < 0 )
			{
				ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
				return 1;
			}
			else
			{
				new Armor = get_user_armor ( id );
				if ( Armor <= 300 ) {
					fm_set_user_armor( id, get_user_armor ( id ) + 50 );
					set_user_credits ( id, iCredits );
					return 1;
				}
				if ( Armor > 300 ) {
					ColorChat( id, GREEN, "[Furien]^x01 Trebuie sa ai mai putin de^4 300 AP^x01 sa poti cumpara inca 50 AP" );
					return 1;
				}
			}
		}
		case 6:
		{
			new iCredits = get_user_credits ( id ) - 6;
			if( iCredits < 0 )
			{
				ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
				return 1;
			}
			if(UserHaveBhop[id]) {
				ColorChat( id, GREEN, "[Furien]^x01 Tu ai Bhop.");
			}
			else if(!UserHaveBhop[id]) {
				ColorChat( id, GREEN, "[Furien]^x01 Ai luat Bhop.");
				UserHaveBhop[id] = true;
				set_user_credits ( id, iCredits );
				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:
		{
			new iCredits = get_user_credits ( id ) - 20;
			if( iCredits < 0 )
			{
				ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
				return 1;
			}
			else
			{
				new Health = get_user_health ( id );
				if ( Health <= 300 )
				{
					fm_set_user_health ( id, get_user_health ( id ) + 150 );
				}
				new Armor = get_user_armor ( id );
				if ( Armor <= 300 )
				{
					fm_set_user_armor( id, get_user_armor ( id ) + 150 );
				}
				set_user_credits ( id, iCredits );
				return 1;
			}
		}
		case 2:
		{
			new iCredits = get_user_credits ( id ) - 2;
			if( iCredits < 0 )
			{
				ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
				return 1;
			}
			else
			{
				fm_give_item ( id, "item_thighpack" )
				set_user_credits ( id, iCredits );
				return 1;
			}
		}
		case 3:
		{
			new iCredits = get_user_credits ( id ) - 5;
			if( iCredits < 0 )
			{
				ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
				return 1;
			}
			else
			{
				new Health = get_user_health ( id );
				if ( Health <= 300 ) {
					fm_set_user_health ( id, get_user_health ( id ) + 50 );
					set_user_credits ( id, iCredits );
					return 1;
				}
				if ( Health > 300 ) {
					ColorChat ( id, GREEN, "[Furien]^x01 Trebuie sa ai mai putin de^x03 300 HP^x01 sa poti cumpara inca 50 HP" );
					return 1;
				}
			}
		}
		case 4:
		{
			new iCredits = get_user_credits ( id ) - 2;
			if( iCredits < 0 )
			{
				ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
				return 1;
			}
			else
			{
				new Armor = get_user_armor ( id );
				if ( Armor <= 300 ) {
					fm_set_user_armor( id, get_user_armor ( id ) + 50 );
					set_user_credits ( id, iCredits );
					return 1;
				}
				if ( Armor > 300 ) {
					ColorChat( id, GREEN, "[Furien]^x01 Trebuie sa ai mai putin de ^4 300 AP^x01 sa poti cumpara inca 50 AP" );
					return 1;
				}
			}
		}
		case 5:
		{
			new iCredits = get_user_credits ( id ) - 5;
			if( iCredits < 0 )
			{
				ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
				return 1;
			}
			
			else
			{
				if( !g_bNoFlash[ id ] )
					g_bNoFlash[ id ] = true;
			}

		}
		
		case 6:
		{
			new iCredits = get_user_credits ( id ) - 3;
			if( iCredits < 0 )
			{
				ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
				return 1;
			}

			get_parachute( id );
		}
		
		case 7:
		{
			new iCredits = get_user_credits ( id ) - 6;
			if( iCredits < 0 )
			{
				ColorChat( id, GREEN, "[Furien]^x01 Nu ai credite suficiente!");
				return 1;
			}
			else
			{
				give_item( id, "weapon_smokegrenade" );
				set_user_credits( id, iCredits );
				return 1;
			}
		}
	}
	menu_destroy(menu);
	return 1;
}
public client_PreThink(id) {
	if(!UserHaveBhop[id])
		return 0;
	entity_set_float(id, EV_FL_fuser2, 0.0);
	if(entity_get_int(id, EV_INT_button) & 2) {
		new flags = entity_get_int(id, EV_INT_flags);
		if(flags & FL_WATERJUMP)
			return 0;
		if(entity_get_int(id, EV_INT_waterlevel) >= 2)
			return 0;
		if(!(flags & FL_ONGROUND))
			return 0;
		new Float:velocity[3];
		entity_get_vector(id, EV_VEC_velocity, velocity);
		velocity[2] += 250.0;
		entity_set_vector(id, EV_VEC_velocity, velocity);
		entity_set_int(id, EV_INT_gaitsequence, 6);
	}
	return 0;
}
public Player_TakeDamage ( iVictim, iInflictor, iAttacker, Float:fDamage, iDamageBits )
{
	if( iInflictor == iAttacker && super_knife [ iAttacker ] && is_user_alive( iAttacker ) && get_user_weapon( iAttacker ) == CSW_KNIFE &&
	cs_get_user_team( iAttacker ) == CS_TEAM_T )
	{
		SetHamParamFloat( 4, fDamage * 3.0);
		return HAM_HANDLED;
	}
	
	if( iInflictor == iAttacker && super_knife2 [ iAttacker ] && is_user_alive( iAttacker ) && get_user_weapon( iAttacker ) == CSW_KNIFE &&
	cs_get_user_team( iAttacker ) == CS_TEAM_T )
	{
		SetHamParamFloat( 4, fDamage * 4.0);
		return HAM_HANDLED;
	}
	
	return HAM_IGNORED;
}

public eventFlash( id )
{
	if( g_bNoFlash[ id ] )
	{
	  	message_begin(MSG_ONE, get_user_msgid( "ScreenFade" ), {0,0,0}, id)
		write_short(1)
		write_short(1)
		write_short(1)
		write_byte(0)
		write_byte(0)
		write_byte(0)
		write_byte(255)
		message_end()
	}
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
Image
ImageImageImage
Image
Connect Dr.IndunGi.Ro
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 7 guests