Modificare plugin vip

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
User avatar
Duracell2k19
Membru, skill 0
Membru, skill 0
Posts: 54
Joined: 05 Feb 2019, 20:23
Detinator Steam: Da
CS Status: Inactiv
SteamID: duracell2k20
Fond eXtream: 0

06 Feb 2019, 23:06

Doresc sa imi modificati la aces plugin urmatoarele lucruri.
1. La ct sa dea in loc de ak - famas + deagle
2. La t sa dea in loc de ak47 - galil
3. Sa fie interzis meniul cu arme pe anumite mape cum e awp india , sau 35 hp , etc.
4. Sa scoateti smoke-ul de la inceputul rundei.
| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <fakemeta_util>
#include <hamsandwich>
#include <engine>

#define Keysrod (1<<0)|(1<<1)|(1<<9)
#define ITEM_HE                (1<<0) // "a" 
#define ITEM_FS                (1<<1) // "b" 
#define ITEM_SG                (1<<2) // "c" 
#define ITEM_DG                (1<<3) // "d" 
#define ITEM_VH                (1<<4) // "e"
#define ITEM_DF                (1<<5) // "f"
#define ITEM_NV                (1<<6) // "g"

new jumpnum[33] = 0
new bool:dojump[33] = false
new hk_File4[ 128 ];
new hk_VipsList[ 128 ][ 32 ], hk_TotalLines;
new hk_IsUserVip[ 33 ];
new hk_viplist[ ] = "vips_list.ini";
new hk_Folder[ ] = "Vip";
new hk_cfg[ ] = "vip-config";
new hk_File[ 128 ];
new hk_File1[ 128 ];
new g_type, g_hudmsg
new vip_hud
new maxplayers
new mpd, mkb, mhb
new health_add
new health_hs_add
new health_max
new hk_Killer
new hk_KillerHp
new hk_HpAdd
new hk_HpMax
new jumps, items
new hk_iRoundCount
new bool:hk_IsRestarting
new gun_menu

enum
{
	Primary = 1
	, Secondary
	, Knife
	, Grenades
	, C4
};

new const RMaps [ ] [ ] =
{
	"35hp",
	"35_hp",
	"35hp_2",
	"31hp",
	"1hp",
	"awp_india",
	"100hp"
};

public plugin_init() 
{
	register_plugin("Vip", "2.0", "Hasky")
	
	register_concmd("say /vips", "showAdmin", ADMIN_ALL, "")
	register_concmd("amx_addvips", "addvips", ADMIN_RCON, "<Nume sau SteamID>")
	register_concmd("amx_vips", "vips", ADMIN_RCON, "Lista Vip-urilor")
	register_concmd("say /vip","ShowMotd")
	
	RegisterHam ( Ham_Spawn, "player", "Hook_PlayerSpawn", 1 )
	register_event("Damage", "on_damage", "b", "2!0", "3=0", "4!0")
	register_event("DeathMsg", "hook_death", "a", "1>0")
	register_event("Damage","Damage","b")
	register_event("DeathMsg","death_msg","a")
	register_menucmd(register_menuid("rod"), Keysrod, "Pressedrod")
	register_event("TextMsg", "Event_TextMsg_Restart", "a", "2&#Game_C", "2&#Game_w")
	register_event("HLTV", "Event_HLTV_New_Round", "a", "1=0", "2=0")
	
	register_cvar("vip_maxjumps","1")
	jumps = register_cvar("vip_jumps","1")
	vip_hud = register_cvar("vip_hud","1")
	g_type = register_cvar("vip_bulletdamage","1")
	health_add = register_cvar("vip_hp_kill", "10")
	health_hs_add = register_cvar("vip_hp_hs", "25")
	health_max = register_cvar("vip_hp_max", "100")
	mpd = register_cvar("vip_money_damage","3")
	mkb = register_cvar("vip_money_kill","500")
	mhb = register_cvar("vip_money_hs","1000")
	items = register_cvar("vip_items_round", "abcdefg")
	gun_menu = register_cvar("vip_gun_menu","1")
	g_hudmsg = CreateHudSyncObj()
	maxplayers = get_maxplayers()
	
	
}

public plugin_cfg()
{	
	
	
	new Dir[ 64 ];
	get_configsdir(Dir,charsmax(Dir));
	formatex ( hk_File, charsmax ( hk_File ), "%s/%s", Dir, hk_Folder );
	formatex ( hk_File1, charsmax ( hk_File1 ), "%s/%s.cfg", hk_File, hk_cfg );
	if(!dir_exists(hk_File))
	mkdir(hk_File);

	formatex ( hk_File4, charsmax ( hk_File4 ), "%s/%s", hk_File, hk_viplist );
	
	if (!file_exists(hk_File4))
	write_file(hk_File4,"; -->VIP List<--");
	
	new hk_Buffer[ 192 ], hk_Line, hk_Len;
	while ( ( hk_Line = read_file ( hk_File4, hk_Line, hk_Buffer, charsmax ( hk_Buffer ), hk_Len ) ) )
	{
		if ( ! strlen ( hk_Buffer ) || hk_Buffer[ 0 ] == ';' || ( hk_Buffer[ 0 ] == '/' && hk_Buffer[ 1 ] == '/' ) )
			continue;
			
		copy ( hk_VipsList[ hk_TotalLines++ ], 32, hk_Buffer );

	}	
	
	if(!file_exists(hk_File1))
	{
	write_file(hk_File1,"// Vip Configuration File")
	write_file(hk_File1,"")
	write_file(hk_File1,"")
	write_file(hk_File1,"// BulletDamage - afiseaza dmg-ul facut unui jucator")
	write_file(hk_File1,"// 1 - Activat   0 - Dezactivat")
	write_file(hk_File1,"vip_bulletdamage ^"1^"")
	write_file(hk_File1,"")
	write_file(hk_File1,"// Vips Online")
	write_file(hk_File1,"// Arata Vip-urile online in HUD prin scrierea in chat a comenzii /vips")
	write_file(hk_File1,"// 1 - Activat   0 - Dezactivat")
	write_file(hk_File1,"vip_hud ^"1^"")
	write_file(hk_File1,"")
	write_file(hk_File1,"// Hp primit pe un kill  ")
	write_file(hk_File1,"vip_hp_kill ^"10^"")
	write_file(hk_File1,"")
	write_file(hk_File1,"// Hp primit pe un hs")
	write_file(hk_File1,"vip_hp_hs ^"25^"")
	write_file(hk_File1,"")
	write_file(hk_File1,"// Valoarea maxima a hp-ului pe care o poate avea Vip-ul")
	write_file(hk_File1,"vip_hp_max ^"100^"")
	write_file(hk_File1,"")
	write_file(hk_File1,"// Banii primiti pe un damage")
	write_file(hk_File1,"vip_money_damage ^"3^"")
	write_file(hk_File1,"")
	write_file(hk_File1,"// Banii primiti pe un kill")
	write_file(hk_File1,"vip_money_kill ^"500^"")
	write_file(hk_File1,"")
	write_file(hk_File1,"// Banii primiti pe un hs")
	write_file(hk_File1,"vip_money_hs ^"1000^"")
	write_file(hk_File1,"")
	write_file(hk_File1,"// Guns Menu - afiseaza meniul cu arme")
	write_file(hk_File1,"// Pe hartile de tip AWP, acest meniu va fi automat dezactivat")
	write_file(hk_File1,"// 1 - Activat   0 - Dezactivat")
	write_file(hk_File1,"vip_gun_menu ^"1^"")
	write_file(hk_File1,"")
	write_file(hk_File1,"// Items per round - primiti diverse obiecte la inceputul fiecarei runde")
	write_file(hk_File1,"// a - He Grenade")
	write_file(hk_File1,"// b - Flashbang (x2)")
	write_file(hk_File1,"// c - Smoke Grenade ")
	write_file(hk_File1,"// d - Deagle")
	write_file(hk_File1,"// e - Vest + Helm")
	write_file(hk_File1,"// f - Defuse Kit (Doar CT)")
	write_file(hk_File1,"// g - NightVision")
	write_file(hk_File1,"vip_items_round ^"abcdefg^"")
	write_file(hk_File1,"")
	write_file(hk_File1,"// Jumps - Salturi")
	write_file(hk_File1,"// 1 - Activat   0 - Dezactivat")
	write_file(hk_File1,"vip_jumps ^"1^"")
	write_file(hk_File1,"")
	write_file(hk_File1,"// Cate sarituri in plus poate sa faca deodata")
	write_file(hk_File1,"vip_maxjumps ^"1^"")
	write_file(hk_File1,"")
	
	}
	
	server_cmd("exec %s",hk_File1)
}

public client_putinserver(id)
{
	
	hk_IsUserVip[ id ] = 0;
	jumpnum[id] = 0
	dojump[id] = false
}

public client_disconnect(id)
{
	
	hk_IsUserVip[ id ] = 0;
	jumpnum[id] = 0
	dojump[id] = false
}
public addvips(id, level, cid)
{
	if (!cmd_access(id, level, cid, 2))
		return PLUGIN_HANDLED

	new arg[32]	
	
	read_argv(1, arg, 31)
	
	new szLog[256];
	formatex(szLog,255,"%s",arg);
	write_file(hk_File4,szLog,-1);
	console_print(id, "[REDDDEVIL] Vip-ul a fost adaugat in lista")
	
	return PLUGIN_HANDLED
	
}
public vips(id, level, cid)
{
	if (!cmd_access(id, level, cid, 1))
		return PLUGIN_HANDLED
	
	new s_Name[ 32 ], s_AuthID[ 32 ];
	get_user_name ( id, s_Name, 31 );
	get_user_authid ( id, s_AuthID, 31 );
	
	console_print(id, "===========================")
	for ( new i; i < hk_TotalLines; i++ )
	{
		if (  strcmp ( s_Name, hk_VipsList[ i ] ) || strcmp ( s_AuthID, hk_VipsList[ i ] ) )
		console_print(id, " - %s", hk_VipsList[ i ])	
			
		
	}
	console_print(id, "===========================")
	return PLUGIN_HANDLED
}


public Event_TextMsg_Restart()
{
    hk_IsRestarting = true
}
 
public Event_HLTV_New_Round()
{
    if( hk_IsRestarting )
    {
        hk_IsRestarting = false
        hk_iRoundCount = 0
    }
}

public Hook_PlayerSpawn ( const id )
{
	if ( ! is_user_alive ( id ) )
		return HAM_IGNORED;
	if ( ! is_user_vip ( id ) )
	{
		hk_IsUserVip[ id ] = 0;
		return HAM_IGNORED;
	}
	
	hk_IsUserVip[ id ] = 1;
	hk_iRoundCount++
	new map[32];
	get_mapname(map,31);
	
	if(equali(map, "awp_", 3))
	return HAM_IGNORED;
	
	if (get_pcvar_num(gun_menu) == 1)
	if(hk_iRoundCount>=4)
	Showrod(id);
	
	set_task(0.3, "giveitems", id)
	return HAM_IGNORED;
}

public on_damage(id)
{
	if(get_pcvar_num(g_type))
	{
		static attacker; attacker = get_user_attacker(id)
		static damage; damage = read_data(2)	

		if ( is_user_vip ( attacker ) )
		{
			hk_IsUserVip[ id ] = 1;
		
			if(is_user_connected(attacker))
			{
				if(fm_is_ent_visible(attacker,id))
				{
					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)				
				}
					
				
			}
		}else hk_IsUserVip[ id ] = 0;
	}
}

public ShowMotd(id)
{
 show_motd(id, "vip.txt")
}
public client_authorized(id)
{
 set_task(30.0, "PrintText" ,id)
}
public PrintText(id)
{
 client_print(id, print_chat, "[V.I.P] Scrie /vip pentru a vedea privilegiile V.I.P-ULUI.")
}
public Damage(id)
{
	new weapon, hitpoint, attacker = get_user_attacker(id,weapon,hitpoint)
	if(attacker<=maxplayers && is_user_alive(attacker) && attacker!=id)
	
	if ( is_user_vip ( id ) )
	{
		hk_IsUserVip[ id ] = 1;
		new money = read_data(2) * get_pcvar_num(mpd)
		if(hitpoint==1) money += get_pcvar_num(mhb)
		cs_set_user_money(attacker,cs_get_user_money(attacker) + money)
	}else hk_IsUserVip[ id ] = 0;
}

public death_msg()
{
	if(read_data(1)<=maxplayers && read_data(1) && read_data(1)!=read_data(2)) 
	cs_set_user_money(read_data(1),cs_get_user_money(read_data(1)) + get_pcvar_num(mkb) - 300)
}

public hook_death()
{
	hk_Killer = read_data(1)
   
	if ( (read_data(3) == 1) && (read_data(5) == 0) )
	{
		hk_HpAdd = get_pcvar_num (health_hs_add)
	}
	else
	hk_HpAdd = get_pcvar_num (health_add)
	
	hk_HpMax = get_pcvar_num (health_max)
   
   
	if ( ! is_user_vip ( hk_Killer ) )
	{
		hk_IsUserVip[ hk_Killer ] = 0;
		return;
	}
	hk_IsUserVip[ hk_Killer ] = 1;
	
	hk_KillerHp = get_user_health(hk_Killer)
	hk_KillerHp += hk_HpAdd
   
	if (hk_KillerHp > hk_HpMax) hk_KillerHp = hk_HpMax
	set_user_health(hk_Killer, hk_KillerHp)

	set_hudmessage(0, 255, 0, -1.0, 0.15, 0, 1.0, 1.0, 0.1, 0.1, -1)
	show_hudmessage(hk_Killer, "Healed +%d hp", hk_HpAdd)

}

public showAdmin(id)
{
	if(get_pcvar_num(vip_hud) == 1)
	{
			
		
		new num, iLen, admin
		static pl[32], name[32], szBuff[2048]
	
		get_players(pl, num, "c")
	
		for(new i = 0; i < num; i++)
		{
			if (  is_user_vip ( pl ) )
			{
			hk_IsUserVip[ pl ] = 1;
			get_user_name(pl, name, 31)
			iLen += format(szBuff[iLen], 2048 - iLen, "%d. %s^n", admin + 1, name)
			admin++
			}
			
		}

	
		set_hudmessage(0, 255, 0, 0.02, 0.2, 0, 6.0, 7.0 )
		show_hudmessage(id, " %s online:^n%s", admin > 1 ? "Vips" : "Vips", szBuff)
	
		arrayset(szBuff, 0, 2048)
	}
	return PLUGIN_HANDLED
}

public client_PreThink(id)
{
		if(!is_user_alive(id)) return PLUGIN_CONTINUE
		if(get_pcvar_num(jumps) == 0) return PLUGIN_CONTINUE
	
		if ( ! is_user_vip ( id ) )
		{
			hk_IsUserVip[ id ] = 0;
			return PLUGIN_CONTINUE
		}
	
	
		hk_IsUserVip[ id ] = 1;
		new nbut = get_user_button(id)
		new obut = get_user_oldbutton(id)
		if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
		{
			if(jumpnum[id] < get_cvar_num("vip_maxjumps"))
			{
				dojump[id] = true
				jumpnum[id]++
				return PLUGIN_CONTINUE
			}
		}
		if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
		{
			jumpnum[id] = 0
			return PLUGIN_CONTINUE
		}
	
		return PLUGIN_CONTINUE
}

public client_PostThink(id)
{
	if(!is_user_alive(id)) return PLUGIN_CONTINUE
	if(get_pcvar_num(jumps) == 0) return PLUGIN_CONTINUE
	
	if ( ! is_user_vip ( id ) )
	{
		hk_IsUserVip[ id ] = 0;
		return PLUGIN_CONTINUE
	}
	
	
	hk_IsUserVip[ id ] = 1;
	if(dojump[id] == true)
	{
		new Float:velocity[3]	
		entity_get_vector(id,EV_VEC_velocity,velocity)
		velocity[2] = random_float(265.0,285.0)
		entity_set_vector(id,EV_VEC_velocity,velocity)
		dojump[id] = false
		return PLUGIN_CONTINUE
	}
	
	return PLUGIN_CONTINUE
}

public Showrod(id) 
{
	show_menu(id, Keysrod, "Guns Menu^n\w1. M4a1^n\w2. AK47^n0. Exit^n", -1, "rod")
}

public Pressedrod(id, key) 
{
	
	switch (key) {
		case 0: { 
			StripWeapons(id, Primary)
			give_item(id,"weapon_m4a1")
			cs_set_user_bpammo(id, CSW_M4A1, 90 );
			}

		case 1: { 
			StripWeapons(id, Primary)
			give_item(id,"weapon_ak47")
			cs_set_user_bpammo(id, CSW_AK47, 90);
			}

		case 9: { 			
			}
		     }
	return PLUGIN_CONTINUE
}

public get_item_flags() 
{ 
	new sFlags[24] 
	get_pcvar_string(items,sFlags,23) 
	return read_flags(sFlags) 
} 

public giveitems(id)
{
		new iFlags = get_item_flags()  
		new CsTeams:userTeam = cs_get_user_team(id)
	
		if (iFlags&ITEM_HE)
		fm_give_item(id,"weapon_hegrenade") 
		
             
		if(iFlags&ITEM_FS)
		{
		fm_give_item(id,"weapon_flashbang") 
		fm_give_item(id,"weapon_flashbang") 
		}
		
		if(iFlags&ITEM_SG)
		fm_give_item(id,"weapon_smokegrenade") 
		
		
		if(iFlags&ITEM_DG)
		{
		StripWeapons(id, Secondary);
		fm_give_item(id,"weapon_deagle") 
		cs_set_user_bpammo(id, CSW_DEAGLE, 35 );
		}
		
		if(iFlags&ITEM_VH)
		fm_give_item(id,"item_assaultsuit")
	
		if(userTeam == CS_TEAM_CT && iFlags&ITEM_DF)
		fm_give_item(id,"item_thighpack")
		
		if(iFlags&ITEM_NV)
		cs_set_user_nvg(id, 1)
		
		
}

stock is_user_vip ( id )
{
	new s_Name[ 32 ], s_AuthID[ 32 ];
	get_user_name ( id, s_Name, 31 );
	get_user_authid ( id, s_AuthID, 31 );
	
	for ( new i; i < hk_TotalLines; i++ )
	{
		if ( ! strcmp ( s_Name, hk_VipsList[ i ] ) )
			return 1;
		if ( ! strcmp ( s_AuthID, hk_VipsList[ i ] ) )
			return 1;
	}
	
	return 0;

}

stock StripWeapons(id, Type, bool: bSwitchIfActive = true)
{
	new iReturn;
	
	if(is_user_alive(id))
	{
		new iEntity, iWeapon;
		while((iWeapon = GetWeaponFromSlot(id, Type, iEntity)) > 0)
			iReturn = ham_strip_user_weapon(id, iWeapon, Type, bSwitchIfActive);
	}
	
	return iReturn;
}

stock GetWeaponFromSlot( id , iSlot , &iEntity )
{
	if ( !( 1 <= iSlot <= 5 ) )
		return 0;
	
	iEntity = 0;
	const m_rgpPlayerItems_Slot0 = 367;
	const m_iId = 43;
	const XO_WEAPONS = 4;
	const XO_PLAYER = 5;
		
	iEntity = get_pdata_cbase( id , m_rgpPlayerItems_Slot0 + iSlot , XO_PLAYER );
	
	return ( iEntity > 0 ) ? get_pdata_int( iEntity , m_iId , XO_WEAPONS ) : 0;
}  

stock ham_strip_user_weapon(id, iCswId, iSlot = 0, bool:bSwitchIfActive = true)
{
	new iWeapon
	if( !iSlot )
	{
		static const iWeaponsSlots[] = {
			-1,
			2, //CSW_P228
			-1,
			1, //CSW_SCOUT
			4, //CSW_HEGRENADE
			1, //CSW_XM1014
			5, //CSW_C4
			1, //CSW_MAC10
			1, //CSW_AUG
			4, //CSW_SMOKEGRENADE
			2, //CSW_ELITE
			2, //CSW_FIVESEVEN
			1, //CSW_UMP45
			1, //CSW_SG550
			1, //CSW_GALIL
			1, //CSW_FAMAS
			2, //CSW_USP
			2, //CSW_GLOCK18
			1, //CSW_AWP
			1, //CSW_MP5NAVY
			1, //CSW_M249
			1, //CSW_M3
			1, //CSW_M4A1
			1, //CSW_TMP
			1, //CSW_G3SG1
			4, //CSW_FLASHBANG
			2, //CSW_DEAGLE
			1, //CSW_SG552
			1, //CSW_AK47
			3, //CSW_KNIFE
			1 //CSW_P90
		}
		iSlot = iWeaponsSlots[iCswId]
	}

	const XTRA_OFS_PLAYER = 5
	const m_rgpPlayerItems_Slot0 = 367

	iWeapon = get_pdata_cbase(id, m_rgpPlayerItems_Slot0 + iSlot, XTRA_OFS_PLAYER)

	const XTRA_OFS_WEAPON = 4
	const m_pNext = 42
	const m_iId = 43

	while( iWeapon > 0 )
	{
		if( get_pdata_int(iWeapon, m_iId, XTRA_OFS_WEAPON) == iCswId )
		{
			break
		}
		iWeapon = get_pdata_cbase(iWeapon, m_pNext, XTRA_OFS_WEAPON)
	}

	if( iWeapon > 0 )
	{
		const m_pActiveItem = 373
		if( bSwitchIfActive && get_pdata_cbase(id, m_pActiveItem, XTRA_OFS_PLAYER) == iWeapon )
		{
			ExecuteHamB(Ham_Weapon_RetireWeapon, iWeapon)
		}

		if( ExecuteHamB(Ham_RemovePlayerItem, id, iWeapon) )
		{
			user_has_weapon(id, iCswId, 0)
			ExecuteHamB(Ham_Item_Kill, iWeapon)
			return 1
		}
	}

	return 0
}
RoyalServer
User avatar
levin
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 3844
Joined: 24 Aug 2011, 12:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Discord: devilclass
Has thanked: 36 times
Been thanked: 594 times
Contact:

06 Feb 2019, 23:28

| Afiseaza codul
[code]
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <fakemeta_util>
#include <hamsandwich>
#include <engine>

#define Keysrod (1<<0)|(1<<1)|(1<<9)
#define ITEM_HE                (1<<0) // "a" 
#define ITEM_FS                (1<<1) // "b" 
#define ITEM_SG                (1<<2) // "c" 
#define ITEM_DG                (1<<3) // "d" 
#define ITEM_VH                (1<<4) // "e"
#define ITEM_DF                (1<<5) // "f"
#define ITEM_NV                (1<<6) // "g"

new jumpnum[33] = 0
new bool:dojump[33] = false
new hk_File4[ 128 ];
new hk_VipsList[ 128 ][ 32 ], hk_TotalLines;
new hk_IsUserVip[ 33 ];
new hk_viplist[ ] = "vips_list.ini";
new hk_Folder[ ] = "Vip";
new hk_cfg[ ] = "vip-config";
new hk_File[ 128 ];
new hk_File1[ 128 ];
new g_type, g_hudmsg
new vip_hud
new maxplayers
new mpd, mkb, mhb
new health_add
new health_hs_add
new health_max
new hk_Killer
new hk_KillerHp
new hk_HpAdd
new hk_HpMax
new jumps, items
new hk_iRoundCount
new bool:hk_IsRestarting
new gun_menu

enum
{
	Primary = 1
	, Secondary
	, Knife
	, Grenades
	, C4
};

new const RMaps [ ] [ ] =
{
	"hp",
	"awp"
};

new mapname[65],bool:on=true

public plugin_init() 
{
	register_plugin("Vip", "2.0", "Hasky")
	
	register_concmd("say /vips", "showAdmin", ADMIN_ALL, "")
	register_concmd("amx_addvips", "addvips", ADMIN_RCON, "<Nume sau SteamID>")
	register_concmd("amx_vips", "vips", ADMIN_RCON, "Lista Vip-urilor")
	register_concmd("say /vip","ShowMotd")
	
	RegisterHam ( Ham_Spawn, "player", "Hook_PlayerSpawn", 1 )
	register_event("Damage", "on_damage", "b", "2!0", "3=0", "4!0")
	register_event("DeathMsg", "hook_death", "a", "1>0")
	register_event("Damage","Damage","b")
	register_event("DeathMsg","death_msg","a")
	register_menucmd(register_menuid("rod"), Keysrod, "Pressedrod")
	register_event("TextMsg", "Event_TextMsg_Restart", "a", "2&#Game_C", "2&#Game_w")
	register_event("HLTV", "Event_HLTV_New_Round", "a", "1=0", "2=0")
	
	register_cvar("vip_maxjumps","1")
	jumps = register_cvar("vip_jumps","1")
	vip_hud = register_cvar("vip_hud","1")
	g_type = register_cvar("vip_bulletdamage","1")
	health_add = register_cvar("vip_hp_kill", "10")
	health_hs_add = register_cvar("vip_hp_hs", "25")
	health_max = register_cvar("vip_hp_max", "100")
	mpd = register_cvar("vip_money_damage","3")
	mkb = register_cvar("vip_money_kill","500")
	mhb = register_cvar("vip_money_hs","1000")
	items = register_cvar("vip_items_round", "abdefg")
	gun_menu = register_cvar("vip_gun_menu","1")
	g_hudmsg = CreateHudSyncObj()
	maxplayers = get_maxplayers()
}

public plugin_cfg()
{
	new Dir[ 64 ];
	get_configsdir(Dir,charsmax(Dir));
	formatex ( hk_File, charsmax ( hk_File ), "%s/%s", Dir, hk_Folder );
	formatex ( hk_File1, charsmax ( hk_File1 ), "%s/%s.cfg", hk_File, hk_cfg );
	if(!dir_exists(hk_File))
	mkdir(hk_File);

	formatex ( hk_File4, charsmax ( hk_File4 ), "%s/%s", hk_File, hk_viplist );
	
	if (!file_exists(hk_File4))
	write_file(hk_File4,"; -->VIP List<--");
	
	new hk_Buffer[ 192 ], hk_Line, hk_Len;
	while ( ( hk_Line = read_file ( hk_File4, hk_Line, hk_Buffer, charsmax ( hk_Buffer ), hk_Len ) ) )
	{
		if ( ! strlen ( hk_Buffer ) || hk_Buffer[ 0 ] == ';' || ( hk_Buffer[ 0 ] == '/' && hk_Buffer[ 1 ] == '/' ) )
			continue;
			
		copy ( hk_VipsList[ hk_TotalLines++ ], 32, hk_Buffer );

	}	
	
	if(!file_exists(hk_File1))
	{
	write_file(hk_File1,"// Vip Configuration File")
	write_file(hk_File1,"")
	write_file(hk_File1,"")
	write_file(hk_File1,"// BulletDamage - afiseaza dmg-ul facut unui jucator")
	write_file(hk_File1,"// 1 - Activat   0 - Dezactivat")
	write_file(hk_File1,"vip_bulletdamage ^"1^"")
	write_file(hk_File1,"")
	write_file(hk_File1,"// Vips Online")
	write_file(hk_File1,"// Arata Vip-urile online in HUD prin scrierea in chat a comenzii /vips")
	write_file(hk_File1,"// 1 - Activat   0 - Dezactivat")
	write_file(hk_File1,"vip_hud ^"1^"")
	write_file(hk_File1,"")
	write_file(hk_File1,"// Hp primit pe un kill  ")
	write_file(hk_File1,"vip_hp_kill ^"10^"")
	write_file(hk_File1,"")
	write_file(hk_File1,"// Hp primit pe un hs")
	write_file(hk_File1,"vip_hp_hs ^"25^"")
	write_file(hk_File1,"")
	write_file(hk_File1,"// Valoarea maxima a hp-ului pe care o poate avea Vip-ul")
	write_file(hk_File1,"vip_hp_max ^"100^"")
	write_file(hk_File1,"")
	write_file(hk_File1,"// Banii primiti pe un damage")
	write_file(hk_File1,"vip_money_damage ^"3^"")
	write_file(hk_File1,"")
	write_file(hk_File1,"// Banii primiti pe un kill")
	write_file(hk_File1,"vip_money_kill ^"500^"")
	write_file(hk_File1,"")
	write_file(hk_File1,"// Banii primiti pe un hs")
	write_file(hk_File1,"vip_money_hs ^"1000^"")
	write_file(hk_File1,"")
	write_file(hk_File1,"// Guns Menu - afiseaza meniul cu arme")
	write_file(hk_File1,"// Pe hartile de tip AWP, acest meniu va fi automat dezactivat")
	write_file(hk_File1,"// 1 - Activat   0 - Dezactivat")
	write_file(hk_File1,"vip_gun_menu ^"1^"")
	write_file(hk_File1,"")
	write_file(hk_File1,"// Items per round - primiti diverse obiecte la inceputul fiecarei runde")
	write_file(hk_File1,"// a - He Grenade")
	write_file(hk_File1,"// b - Flashbang (x2)")
	write_file(hk_File1,"// c - Smoke Grenade ")
	write_file(hk_File1,"// d - Deagle")
	write_file(hk_File1,"// e - Vest + Helm")
	write_file(hk_File1,"// f - Defuse Kit (Doar CT)")
	write_file(hk_File1,"// g - NightVision")
	write_file(hk_File1,"vip_items_round ^"abdefg^"")
	write_file(hk_File1,"")
	write_file(hk_File1,"// Jumps - Salturi")
	write_file(hk_File1,"// 1 - Activat   0 - Dezactivat")
	write_file(hk_File1,"vip_jumps ^"1^"")
	write_file(hk_File1,"")
	write_file(hk_File1,"// Cate sarituri in plus poate sa faca deodata")
	write_file(hk_File1,"vip_maxjumps ^"1^"")
	write_file(hk_File1,"")
	
	}
	
	server_cmd("exec %s",hk_File1)
}

public client_putinserver(id)
{
	
	hk_IsUserVip[ id ] = 0;
	jumpnum[id] = 0
	dojump[id] = false
}

public client_disconnect(id)
{
	
	hk_IsUserVip[ id ] = 0;
	jumpnum[id] = 0
	dojump[id] = false
}
public addvips(id, level, cid)
{
	if (!cmd_access(id, level, cid, 2))
		return PLUGIN_HANDLED

	new arg[32]	
	
	read_argv(1, arg, 31)
	
	new szLog[256];
	formatex(szLog,255,"%s",arg);
	write_file(hk_File4,szLog,-1);
	console_print(id, "[REDDDEVIL] Vip-ul a fost adaugat in lista")
	
	return PLUGIN_HANDLED
	
}
public vips(id, level, cid)
{
	if (!cmd_access(id, level, cid, 1))
		return PLUGIN_HANDLED
	
	new s_Name[ 32 ], s_AuthID[ 32 ];
	get_user_name ( id, s_Name, 31 );
	get_user_authid ( id, s_AuthID, 31 );
	
	console_print(id, "===========================")
	for ( new i; i < hk_TotalLines; i++ )
	{
		if (  strcmp ( s_Name, hk_VipsList[ i ] ) || strcmp ( s_AuthID, hk_VipsList[ i ] ) )
		console_print(id, " - %s", hk_VipsList[ i ])	
			
		
	}
	console_print(id, "===========================")
	return PLUGIN_HANDLED
}


public Event_TextMsg_Restart()
{
    hk_IsRestarting = true
}
 
public Event_HLTV_New_Round()
{
    if( hk_IsRestarting )
    {
        hk_IsRestarting = false
        hk_iRoundCount = 0
    }
}

public Hook_PlayerSpawn ( const id )
{
	if ( ! is_user_alive ( id ) )
		return HAM_IGNORED;
	if ( ! is_user_vip ( id ) )
	{
		hk_IsUserVip[ id ] = 0;
		return HAM_IGNORED;
	}
	
	hk_IsUserVip[ id ] = 1;
	
	get_mapname(mapname,charsmax(mapname))
	
	for(new i;i<sizeof RMaps;i++)	if(equali(RMaps,mapname))	on=false
	
	if(on)
	{
	hk_iRoundCount++
	if (get_pcvar_num(gun_menu) == 1)	if(hk_iRoundCount>=4)	Showrod(id);
	}
	
	set_task(0.3, "giveitems", id)
	return HAM_IGNORED;
}

public on_damage(id)
{
	if(get_pcvar_num(g_type))
	{
		static attacker; attacker = get_user_attacker(id)
		static damage; damage = read_data(2)	

		if ( is_user_vip ( attacker ) )
		{
			hk_IsUserVip[ id ] = 1;
		
			if(is_user_connected(attacker))
			{
				if(fm_is_ent_visible(attacker,id))
				{
					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)				
				}
					
				
			}
		}else hk_IsUserVip[ id ] = 0;
	}
}

public ShowMotd(id)
{
 show_motd(id, "vip.txt")
}
public client_authorized(id)
{
 set_task(30.0, "PrintText" ,id)
}
public PrintText(id)
{
 client_print(id, print_chat, "[V.I.P] Scrie /vip pentru a vedea privilegiile V.I.P-ULUI.")
}
public Damage(id)
{
	new weapon, hitpoint, attacker = get_user_attacker(id,weapon,hitpoint)
	if(attacker<=maxplayers && is_user_alive(attacker) && attacker!=id)
	
	if ( is_user_vip ( id ) )
	{
		hk_IsUserVip[ id ] = 1;
		new money = read_data(2) * get_pcvar_num(mpd)
		if(hitpoint==1) money += get_pcvar_num(mhb)
		cs_set_user_money(attacker,cs_get_user_money(attacker) + money)
	}else hk_IsUserVip[ id ] = 0;
}

public death_msg()
{
	if(read_data(1)<=maxplayers && read_data(1) && read_data(1)!=read_data(2)) 
	cs_set_user_money(read_data(1),cs_get_user_money(read_data(1)) + get_pcvar_num(mkb) - 300)
}

public hook_death()
{
	hk_Killer = read_data(1)
   
	if ( (read_data(3) == 1) && (read_data(5) == 0) )
	{
		hk_HpAdd = get_pcvar_num (health_hs_add)
	}
	else
	hk_HpAdd = get_pcvar_num (health_add)
	
	hk_HpMax = get_pcvar_num (health_max)
   
   
	if ( ! is_user_vip ( hk_Killer ) )
	{
		hk_IsUserVip[ hk_Killer ] = 0;
		return;
	}
	hk_IsUserVip[ hk_Killer ] = 1;
	
	hk_KillerHp = get_user_health(hk_Killer)
	hk_KillerHp += hk_HpAdd
   
	if (hk_KillerHp > hk_HpMax) hk_KillerHp = hk_HpMax
	set_user_health(hk_Killer, hk_KillerHp)

	set_hudmessage(0, 255, 0, -1.0, 0.15, 0, 1.0, 1.0, 0.1, 0.1, -1)
	show_hudmessage(hk_Killer, "Healed +%d hp", hk_HpAdd)

}

public showAdmin(id)
{
	if(get_pcvar_num(vip_hud) == 1)
	{
			
		
		new num, iLen, admin
		static pl[32], name[32], szBuff[2048]
	
		get_players(pl, num, "c")
	
		for(new i = 0; i < num; i++)
		{
			if (  is_user_vip ( pl ) )
			{
			hk_IsUserVip[ pl ] = 1;
			get_user_name(pl, name, 31)
			iLen += format(szBuff[iLen], 2048 - iLen, "%d. %s^n", admin + 1, name)
			admin++
			}
			
		}

	
		set_hudmessage(0, 255, 0, 0.02, 0.2, 0, 6.0, 7.0 )
		show_hudmessage(id, " %s online:^n%s", admin > 1 ? "Vips" : "Vips", szBuff)
	
		arrayset(szBuff, 0, 2048)
	}
	return PLUGIN_HANDLED
}

public client_PreThink(id)
{
		if(!is_user_alive(id)) return PLUGIN_CONTINUE
		if(get_pcvar_num(jumps) == 0) return PLUGIN_CONTINUE
	
		if ( ! is_user_vip ( id ) )
		{
			hk_IsUserVip[ id ] = 0;
			return PLUGIN_CONTINUE
		}
	
	
		hk_IsUserVip[ id ] = 1;
		new nbut = get_user_button(id)
		new obut = get_user_oldbutton(id)
		if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
		{
			if(jumpnum[id] < get_cvar_num("vip_maxjumps"))
			{
				dojump[id] = true
				jumpnum[id]++
				return PLUGIN_CONTINUE
			}
		}
		if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
		{
			jumpnum[id] = 0
			return PLUGIN_CONTINUE
		}
	
		return PLUGIN_CONTINUE
}

public client_PostThink(id)
{
	if(!is_user_alive(id)) return PLUGIN_CONTINUE
	if(get_pcvar_num(jumps) == 0) return PLUGIN_CONTINUE
	
	if ( ! is_user_vip ( id ) )
	{
		hk_IsUserVip[ id ] = 0;
		return PLUGIN_CONTINUE
	}
	
	
	hk_IsUserVip[ id ] = 1;
	if(dojump[id] == true)
	{
		new Float:velocity[3]	
		entity_get_vector(id,EV_VEC_velocity,velocity)
		velocity[2] = random_float(265.0,285.0)
		entity_set_vector(id,EV_VEC_velocity,velocity)
		dojump[id] = false
		return PLUGIN_CONTINUE
	}
	
	return PLUGIN_CONTINUE
}

public Showrod(id) 
{
	show_menu(id, Keysrod, "Guns Menu^n\w1. Famas+Deagle^n\w2. Galil^n0. Exit^n", -1, "rod")
}

public Pressedrod(id, key) 
{
	
	switch (key) {
		case 0: {
			if(cs_get_user_team(id)==CS_TEAM_CT)
			{
			StripWeapons(id, Primary)
			give_item(id,"weapon_famas")
			cs_set_user_bpammo(id, CSW_FAMAS, 90 );
			give_item(id,"weapon_deagle")
			cs_set_user_bpammo(id, CSW_DEAGLE, 35 );
			}
			}

		case 1: { 
			if(cs_get_user_team(id)==CS_TEAM_T)
			{
			StripWeapons(id, Primary)
			give_item(id,"weapon_galil")
			cs_set_user_bpammo(id, CSW_GALIL, 90 );
			}
			}

		case 9: { 			
			}
		     }
	return PLUGIN_CONTINUE
}

public get_item_flags() 
{ 
	new sFlags[24] 
	get_pcvar_string(items,sFlags,23) 
	return read_flags(sFlags) 
} 

public giveitems(id)
{
		new iFlags = get_item_flags()  
		new CsTeams:userTeam = cs_get_user_team(id)
	
		if (iFlags&ITEM_HE)
		fm_give_item(id,"weapon_hegrenade") 
		
             
		if(iFlags&ITEM_FS)
		{
		fm_give_item(id,"weapon_flashbang") 
		fm_give_item(id,"weapon_flashbang") 
		}
		
		if(iFlags&ITEM_SG)
		fm_give_item(id,"weapon_smokegrenade") 
		
		
		if(iFlags&ITEM_DG)
		{
		StripWeapons(id, Secondary);
		fm_give_item(id,"weapon_deagle") 
		cs_set_user_bpammo(id, CSW_DEAGLE, 35 );
		}
		
		if(iFlags&ITEM_VH)
		fm_give_item(id,"item_assaultsuit")
	
		if(userTeam == CS_TEAM_CT && iFlags&ITEM_DF)
		fm_give_item(id,"item_thighpack")
		
		if(iFlags&ITEM_NV)
		cs_set_user_nvg(id, 1)
		
		
}

stock is_user_vip ( id )
{
	new s_Name[ 32 ], s_AuthID[ 32 ];
	get_user_name ( id, s_Name, 31 );
	get_user_authid ( id, s_AuthID, 31 );
	
	for ( new i; i < hk_TotalLines; i++ )
	{
		if ( ! strcmp ( s_Name, hk_VipsList[ i ] ) )
			return 1;
		if ( ! strcmp ( s_AuthID, hk_VipsList[ i ] ) )
			return 1;
	}
	
	return 0;

}

stock StripWeapons(id, Type, bool: bSwitchIfActive = true)
{
	new iReturn;
	
	if(is_user_alive(id))
	{
		new iEntity, iWeapon;
		while((iWeapon = GetWeaponFromSlot(id, Type, iEntity)) > 0)
			iReturn = ham_strip_user_weapon(id, iWeapon, Type, bSwitchIfActive);
	}
	
	return iReturn;
}

stock GetWeaponFromSlot( id , iSlot , &iEntity )
{
	if ( !( 1 <= iSlot <= 5 ) )
		return 0;
	
	iEntity = 0;
	const m_rgpPlayerItems_Slot0 = 367;
	const m_iId = 43;
	const XO_WEAPONS = 4;
	const XO_PLAYER = 5;
		
	iEntity = get_pdata_cbase( id , m_rgpPlayerItems_Slot0 + iSlot , XO_PLAYER );
	
	return ( iEntity > 0 ) ? get_pdata_int( iEntity , m_iId , XO_WEAPONS ) : 0;
}  

stock ham_strip_user_weapon(id, iCswId, iSlot = 0, bool:bSwitchIfActive = true)
{
	new iWeapon
	if( !iSlot )
	{
		static const iWeaponsSlots[] = {
			-1,
			2, //CSW_P228
			-1,
			1, //CSW_SCOUT
			4, //CSW_HEGRENADE
			1, //CSW_XM1014
			5, //CSW_C4
			1, //CSW_MAC10
			1, //CSW_AUG
			4, //CSW_SMOKEGRENADE
			2, //CSW_ELITE
			2, //CSW_FIVESEVEN
			1, //CSW_UMP45
			1, //CSW_SG550
			1, //CSW_GALIL
			1, //CSW_FAMAS
			2, //CSW_USP
			2, //CSW_GLOCK18
			1, //CSW_AWP
			1, //CSW_MP5NAVY
			1, //CSW_M249
			1, //CSW_M3
			1, //CSW_M4A1
			1, //CSW_TMP
			1, //CSW_G3SG1
			4, //CSW_FLASHBANG
			2, //CSW_DEAGLE
			1, //CSW_SG552
			1, //CSW_AK47
			3, //CSW_KNIFE
			1 //CSW_P90
		}
		iSlot = iWeaponsSlots[iCswId]
	}

	const XTRA_OFS_PLAYER = 5
	const m_rgpPlayerItems_Slot0 = 367

	iWeapon = get_pdata_cbase(id, m_rgpPlayerItems_Slot0 + iSlot, XTRA_OFS_PLAYER)

	const XTRA_OFS_WEAPON = 4
	const m_pNext = 42
	const m_iId = 43

	while( iWeapon > 0 )
	{
		if( get_pdata_int(iWeapon, m_iId, XTRA_OFS_WEAPON) == iCswId )
		{
			break
		}
		iWeapon = get_pdata_cbase(iWeapon, m_pNext, XTRA_OFS_WEAPON)
	}

	if( iWeapon > 0 )
	{
		const m_pActiveItem = 373
		if( bSwitchIfActive && get_pdata_cbase(id, m_pActiveItem, XTRA_OFS_PLAYER) == iWeapon )
		{
			ExecuteHamB(Ham_Weapon_RetireWeapon, iWeapon)
		}

		if( ExecuteHamB(Ham_RemovePlayerItem, id, iWeapon) )
		{
			user_has_weapon(id, iCswId, 0)
			ExecuteHamB(Ham_Item_Kill, iWeapon)
			return 1
		}
	}

	return 0
}[/code]
Pentru ajutor, faceți cerere bine detaliată, completând și respectând modelul corespunzător.
Nu-mi mai dați cereri doar pentru a mă avea în lista de prieteni.
Dacă te ajut, și mă ignori/etc > te adaug în „foe”.
Aveți grijă la cei ce încearcă să mă copieze sau să dea drept mine..Puteți lua legătura cu mine prin STEAM dacă aveți o problemă/nelămurire în acest caz! Cont de forum am doar aici.
În cazul în care utilizați ceva din ce am postat(ex: aici), e bine să fiți la curent cu modificările aduse și de aici, iar dacă sunt ceva probleme nu ezitați să luați legătura cu mine. Actualizarea unor coduri nu se vor afișa public, doar dacă se găsește ceva critic/urgent de remediat, unele fiind coduri vechi iar unele refăcute chiar recent dar private.
* Nume pe cs1.6: eVoLuTiOn \ Nume vechi: eVo
* Atelierul meu - post2819572.html#p2819572 (închis, click link ca să vedeți de ce)
User avatar
Duracell2k19
Membru, skill 0
Membru, skill 0
Posts: 54
Joined: 05 Feb 2019, 20:23
Detinator Steam: Da
CS Status: Inactiv
SteamID: duracell2k20
Fond eXtream: 0

06 Feb 2019, 23:32

| Afiseaza codul
#define DAMAGE_RECIEVED
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

static const COLOR[] = "^x04" //green
static const CONTACT[] = ""
new maxplayers
new gmsgSayText
new mpd, mkb, mhb
new g_MsgSync
new health_add
new health_hs_add
new health_max
new nKiller
new nKiller_hp
new nHp_add
new nHp_max
new g_awp_active
new g_menu_active
new CurrentRound
new bool:HasC4[33]
#define Keysrod (1<<0)|(1<<1)|(1<<9) // Keys: 1234567890
#if defined DAMAGE_RECIEVED
	new g_MsgSync2
#endif

public plugin_init()
{
	register_plugin("VIP Eng Version", "3.0", "Dunno")
	mpd = register_cvar("money_per_damage","3")
	mkb = register_cvar("money_kill_bonus","200")
	mhb = register_cvar("money_hs_bonus","500")
	health_add = register_cvar("amx_vip_hp", "15")
	health_hs_add = register_cvar("amx_vip_hp_hs", "30")
	health_max = register_cvar("amx_vip_max_hp", "150")
	g_awp_active = register_cvar("awp_active", "1")
	g_menu_active = register_cvar("menu_active", "1")
	register_event("Damage","Damage","b")
	register_event("DeathMsg","death_msg","a")
	register_menucmd(register_menuid("rod"), Keysrod, "Pressedrod")
	register_clcmd("awp","HandleCmd")
    	register_clcmd("sg550","HandleCmd")
    	register_clcmd("g3sg1","HandleCmd")
	register_clcmd("say /vip","ShowMotd")
	maxplayers = get_maxplayers()
	gmsgSayText = get_user_msgid("SayText")
	register_clcmd("say", "handle_say")
	register_cvar("amx_contactinfo", CONTACT, FCVAR_SERVER)
	register_logevent("LogEvent_RoundStart", 2, "1=Round_Start" );
	register_event("TextMsg","Event_RoundRestart","a","2&#Game_w")
	register_event("TextMsg","Event_RoundRestart","a","2&#Game_C");
	register_event("DeathMsg", "hook_death", "a", "1>0")
	register_event("Damage", "on_damage", "b", "2!0", "3=0", "4!0")
	g_MsgSync = CreateHudSyncObj()
#if defined DAMAGE_RECIEVED
	g_MsgSync2 = CreateHudSyncObj()
#endif	
}

public on_damage(id)
{
	new attacker = get_user_attacker(id)

#if defined DAMAGE_RECIEVED
	// id should be connected if this message is sent, but lets check anyway
	if ( is_user_connected(id) && is_user_connected(attacker) )
	if (get_user_flags(attacker) & ADMIN_LEVEL_H)
	{
		new damage = read_data(2)

		set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1)
		ShowSyncHudMsg(id, g_MsgSync2, "%i^n", damage)
#else
	if ( is_user_connected(attacker) && if (get_user_flags(attacker) & ADMIN_LEVEL_H) )
	{
		new damage = read_data(2)
#endif
		set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1)
		ShowSyncHudMsg(attacker, g_MsgSync, "%i^n", damage)
	}
}

public Damage(id)
{
	new weapon, hitpoint, attacker = get_user_attacker(id,weapon,hitpoint)
	if(attacker<=maxplayers && is_user_alive(attacker) && attacker!=id)
	if (get_user_flags(attacker) & ADMIN_LEVEL_H) 
	{
		new money = read_data(2) * get_pcvar_num(mpd)
		if(hitpoint==1) money += get_pcvar_num(mhb)
		cs_set_user_money(attacker,cs_get_user_money(attacker) + money)
	}
}

public death_msg()
{
	if(read_data(1)<=maxplayers && read_data(1) && read_data(1)!=read_data(2)) cs_set_user_money(read_data(1),cs_get_user_money(read_data(1)) + get_pcvar_num(mkb) - 300)
}

public LogEvent_RoundStart()
{
	CurrentRound++;
	new players[32], player, pnum;
	get_players(players, pnum, "a");
	for(new i = 0; i < pnum; i++)
	{
		player = players;
		if(is_user_alive(player) && get_user_flags(player) & ADMIN_LEVEL_H)
		{
			give_item(player, "weapon_hegrenade")
			give_item(player, "weapon_flashbang")
			give_item(player, "weapon_flashbang")
			give_item(player, "weapon_smokegrenade")
			give_item(player, "item_assaultsuit")
			give_item(player, "item_thighpack")
			
			if (!get_pcvar_num(g_menu_active))
				return PLUGIN_CONTINUE
			
			if(CurrentRound >= 3)
			{
				Showrod(player);
			}
		}
	}
	return PLUGIN_HANDLED
}

public Event_RoundRestart()
{
	CurrentRound=0;
}

public hook_death()
{
   // Killer id
   nKiller = read_data(1)
   
   if ( (read_data(3) == 1) && (read_data(5) == 0) )
   {
      nHp_add = get_pcvar_num (health_hs_add)
   }
   else
      nHp_add = get_pcvar_num (health_add)
   nHp_max = get_pcvar_num (health_max)
   // Updating Killer HP
   if(!(get_user_flags(nKiller) & ADMIN_LEVEL_H))
   return;

   nKiller_hp = get_user_health(nKiller)
   nKiller_hp += nHp_add
   // Maximum HP check
   if (nKiller_hp > nHp_max) nKiller_hp = nHp_max
   set_user_health(nKiller, nKiller_hp)
   // Hud message "Healed +15/+30 hp"
   set_hudmessage(0, 255, 0, -1.0, 0.15, 0, 1.0, 1.0, 0.1, 0.1, -1)
   show_hudmessage(nKiller, "Healed +%d hp", nHp_add)
   // Screen fading
   message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, nKiller)
   write_short(1<<10)
   write_short(1<<10)
   write_short(0x0000)
   write_byte(0)
   write_byte(0)
   write_byte(200)
   write_byte(75)
   message_end()
 
}

public Showrod(id) {
	show_menu(id, Keysrod, "Free VIP Guns^n\w1. Get M4A1+Deagle ^n\w2. Get AK47+Deagle^n0. Exit^n", -1, "rod") // Display menu
}
public Pressedrod(id, key) {
	/* Menu:
	* VIP Menu
	* 1. Get M4A1+Deagle
	* 2. Get AK47+Deagle
	* 0. Exit
	*/
	switch (key) {
		case 0: { 
			if (user_has_weapon(id, CSW_C4) && get_user_team(id) == 1)
				HasC4[id] = true;
			else
				HasC4[id] = false;
            
			strip_user_weapons (id)
			give_item(id,"weapon_m4a1")
			give_item(id,"ammo_556nato")
			give_item(id,"ammo_556nato")
			give_item(id,"ammo_556nato")
			give_item(id,"weapon_deagle")
			give_item(id,"ammo_50ae")
			give_item(id,"ammo_50ae")
			give_item(id,"ammo_50ae")
			give_item(id,"ammo_50ae")
			give_item(id,"ammo_50ae")
			give_item(id,"ammo_50ae")
			give_item(id,"ammo_50ae")
			give_item(id,"weapon_knife")
			give_item(id,"weapon_hegrenade")
			give_item(id, "weapon_flashbang");
			give_item(id, "weapon_flashbang");
			give_item(id, "weapon_smokegrenade");
			give_item(id, "item_assaultsuit");
			give_item(id, "item_thighpack");
			client_print(id, print_center, "You Taked Free M4A1 and Deagle")
			
			if (HasC4[id])
			{
				give_item(id, "weapon_c4");
				cs_set_user_plant( id );
			}
			}
		case 1: { 
			if (user_has_weapon(id, CSW_C4) && get_user_team(id) == 1)
				HasC4[id] = true;
			else
				HasC4[id] = false;
            
			strip_user_weapons (id)
			give_item(id,"weapon_ak47")
			give_item(id,"ammo_762nato")
			give_item(id,"ammo_762nato")
			give_item(id,"ammo_762nato")
			give_item(id,"weapon_deagle")
			give_item(id,"ammo_50ae")
			give_item(id,"ammo_50ae")
			give_item(id,"ammo_50ae")
			give_item(id,"ammo_50ae")
			give_item(id,"ammo_50ae")
			give_item(id,"ammo_50ae")
			give_item(id,"ammo_50ae")
			give_item(id,"weapon_knife")
			give_item(id,"weapon_hegrenade")
			give_item(id, "weapon_flashbang");
			give_item(id, "weapon_flashbang");
			give_item(id, "weapon_smokegrenade");
			give_item(id, "item_assaultsuit");
			give_item(id, "item_thighpack");
			client_print(id, print_center, "You Taked Free AK47 and Deagle")
			
			if (HasC4[id])
			{
				give_item(id, "weapon_c4");
				cs_set_user_plant( id );
			}
			}
		case 9: { 			
		}
	}
	return PLUGIN_CONTINUE
}

public HandleCmd(id){
	if (!get_pcvar_num(g_awp_active))
      return PLUGIN_CONTINUE
	if(get_user_flags(id) & ADMIN_LEVEL_H) 
		return PLUGIN_CONTINUE
	client_print(id, print_center, "Sniper's Only For VIP's")
	return PLUGIN_HANDLED
}

public ShowMotd(id)
{
 show_motd(id, "vip.txt")
}
public client_authorized(id)
{
 set_task(30.0, "PrintText" ,id)
}
public PrintText(id)
{
 client_print(id, print_chat, "[VIP] Write /vip and u will see how get VIP and VIP privilegies.")
}

public handle_say(id) {
	new said[192]
	read_args(said,192)
	if( ( containi(said, "who") != -1 && containi(said, "admin") != -1 ) || contain(said, "/vips") != -1 )
		set_task(0.1,"print_adminlist",id)
	return PLUGIN_CONTINUE
}

public print_adminlist(user) 
{
	new adminnames[33][32]
	new message[256]
	new contactinfo[256], contact[112]
	new id, count, x, len
	
	for(id = 1 ; id <= maxplayers ; id++)
		if(is_user_connected(id))
			if(get_user_flags(id) & ADMIN_LEVEL_H)
				get_user_name(id, adminnames[count++], 31)

	len = format(message, 255, "%s VIP's ONLINE: ",COLOR)
	if(count > 0) {
		for(x = 0 ; x < count ; x++) {
			len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"")
			if(len > 96 ) {
				print_message(user, message)
				len = format(message, 255, "%s ",COLOR)
			}
		}
		print_message(user, message)
	}
	else {
		len += format(message[len], 255-len, "No VIP online.")
		print_message(user, message)
	}
	
	get_cvar_string("amx_contactinfo", contact, 63)
	if(contact[0])  {
		format(contactinfo, 111, "%s Contact Server Admin -- %s", COLOR, contact)
		print_message(user, contactinfo)
	}
}

print_message(id, msg[]) {
	message_begin(MSG_ONE, gmsgSayText, {0,0,0}, id)
	write_byte(id)
	write_string(msg)
	message_end()
}

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1063\\ f0\\ fs16 \n\\ par }
*/
User avatar
levin
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 3844
Joined: 24 Aug 2011, 12:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Discord: devilclass
Has thanked: 36 times
Been thanked: 594 times
Contact:

07 Feb 2019, 00:12

| Afiseaza codul
[code]
#define DAMAGE_RECIEVED
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

#pragma tabsize 0

static const COLOR[] = "^x04" //green
static const CONTACT[] = ""
new maxplayers
new gmsgSayText
new mpd, mkb, mhb
new g_MsgSync
new health_add
new health_hs_add
new health_max
new nKiller
new nKiller_hp
new nHp_add
new nHp_max
new g_awp_active
new g_menu_active
new CurrentRound
new bool:HasC4[33]
#define Keysrod (1<<0)|(1<<1)|(1<<9) // Keys: 1234567890
#if defined DAMAGE_RECIEVED
	new g_MsgSync2
#endif

new const RMaps [ ] [ ] =
{
   "hp",
   "awp"
};

new mapname[65],bool:on=true

public plugin_init()
{
	register_plugin("VIP Eng Version", "3.0", "Dunno")
	mpd = register_cvar("money_per_damage","3")
	mkb = register_cvar("money_kill_bonus","200")
	mhb = register_cvar("money_hs_bonus","500")
	health_add = register_cvar("amx_vip_hp", "15")
	health_hs_add = register_cvar("amx_vip_hp_hs", "30")
	health_max = register_cvar("amx_vip_max_hp", "150")
	g_awp_active = register_cvar("awp_active", "1")
	g_menu_active = register_cvar("menu_active", "1")
	register_event("Damage","Damage","b")
	register_event("DeathMsg","death_msg","a")
	register_menucmd(register_menuid("rod"), Keysrod, "Pressedrod")
	register_clcmd("awp","HandleCmd")
    	register_clcmd("sg550","HandleCmd")
    	register_clcmd("g3sg1","HandleCmd")
	register_clcmd("say /vip","ShowMotd")
	maxplayers = get_maxplayers()
	gmsgSayText = get_user_msgid("SayText")
	register_clcmd("say", "handle_say")
	register_cvar("amx_contactinfo", CONTACT, FCVAR_SERVER)
	register_logevent("LogEvent_RoundStart", 2, "1=Round_Start" );
	register_event("TextMsg","Event_RoundRestart","a","2&#Game_w")
	register_event("TextMsg","Event_RoundRestart","a","2&#Game_C");
	register_event("DeathMsg", "hook_death", "a", "1>0")
	register_event("Damage", "on_damage", "b", "2!0", "3=0", "4!0")
	g_MsgSync = CreateHudSyncObj()
#if defined DAMAGE_RECIEVED
	g_MsgSync2 = CreateHudSyncObj()
#endif	
}

public on_damage(id)
{
	new attacker = get_user_attacker(id)

#if defined DAMAGE_RECIEVED
	// id should be connected if this message is sent, but lets check anyway
	if ( is_user_connected(id) && is_user_connected(attacker) )
	if (get_user_flags(attacker) & ADMIN_LEVEL_H)
	{
		new damage = read_data(2)

		set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1)
		ShowSyncHudMsg(id, g_MsgSync2, "%i^n", damage)
#else
	if ( is_user_connected(attacker) && if (get_user_flags(attacker) & ADMIN_LEVEL_H) )
	{
		new damage = read_data(2)
#endif
		set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1)
		ShowSyncHudMsg(attacker, g_MsgSync, "%i^n", damage)
	}
}

public Damage(id)
{
	new weapon, hitpoint, attacker = get_user_attacker(id,weapon,hitpoint)
	if(attacker<=maxplayers && is_user_alive(attacker) && attacker!=id)
	if (get_user_flags(attacker) & ADMIN_LEVEL_H) 
	{
		new money = read_data(2) * get_pcvar_num(mpd)
		if(hitpoint==1) money += get_pcvar_num(mhb)
		cs_set_user_money(attacker,cs_get_user_money(attacker) + money)
	}
}

public death_msg()
{
	if(read_data(1)<=maxplayers && read_data(1) && read_data(1)!=read_data(2)) cs_set_user_money(read_data(1),cs_get_user_money(read_data(1)) + get_pcvar_num(mkb) - 300)
}

public LogEvent_RoundStart()
{
	get_mapname(mapname,charsmax(mapname))
	for(new i;i<sizeof RMaps;i++)   if(equali(RMaps,mapname))   on=false
	
	if(on&&get_pcvar_num(g_menu_active)==1)	CurrentRound++;
	new players[32], player, pnum;
	get_players(players, pnum, "a");
	for(new i = 0; i < pnum; i++)
	{
		player = players;
		if(is_user_alive(player) && get_user_flags(player) & ADMIN_LEVEL_H)
		{
			give_item(player, "weapon_hegrenade")
			give_item(player, "weapon_flashbang")
			give_item(player, "weapon_flashbang")
			give_item(player, "item_assaultsuit")
			give_item(player, "item_thighpack")
			
			if(CurrentRound >= 3)	Showrod(player);
		}
	}
	return PLUGIN_HANDLED
}

public Event_RoundRestart()
{
	CurrentRound=0;
}

public hook_death()
{
   // Killer id
   nKiller = read_data(1)
   
   if ( (read_data(3) == 1) && (read_data(5) == 0) )
   {
      nHp_add = get_pcvar_num (health_hs_add)
   }
   else
      nHp_add = get_pcvar_num (health_add)
   nHp_max = get_pcvar_num (health_max)
   // Updating Killer HP
   if(!(get_user_flags(nKiller) & ADMIN_LEVEL_H))
   return;

   nKiller_hp = get_user_health(nKiller)
   nKiller_hp += nHp_add
   // Maximum HP check
   if (nKiller_hp > nHp_max) nKiller_hp = nHp_max
   set_user_health(nKiller, nKiller_hp)
   // Hud message "Healed +15/+30 hp"
   set_hudmessage(0, 255, 0, -1.0, 0.15, 0, 1.0, 1.0, 0.1, 0.1, -1)
   show_hudmessage(nKiller, "Healed +%d hp", nHp_add)
   // Screen fading
   message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, nKiller)
   write_short(1<<10)
   write_short(1<<10)
   write_short(0x0000)
   write_byte(0)
   write_byte(0)
   write_byte(200)
   write_byte(75)
   message_end()
 
}

public Showrod(id)	show_menu(id, Keysrod, "Free VIP Guns^n^n\w1. Get Famas+Deagle(CT)^n\w2. Get Galil(T)^n0. Exit", -1, "rod") // Display menu
public Pressedrod(id, key) {
	/* Menu:
	* VIP Menu
	* 1. Get M4A1+Deagle
	* 2. Get AK47+Deagle
	* 0. Exit
	*/
	switch (key) {
		case 0: { 
         if(cs_get_user_team(id)==CS_TEAM_CT)
         {
         strip_user_weapons (id)
	 give_item(id,"weapon_knife")
         give_item(id,"weapon_famas")
         cs_set_user_bpammo(id, CSW_FAMAS, 90 );
         give_item(id,"weapon_deagle")
         cs_set_user_bpammo(id, CSW_DEAGLE, 35 );
         }
			client_print(id, print_center, "You Taked Free Famas and Deagle")
			}
		case 1: {
			if (user_has_weapon(id, CSW_C4) && get_user_team(id) == 1)
				HasC4[id] = true;
			else
				HasC4[id] = false;
				
         if(cs_get_user_team(id)==CS_TEAM_T)
         {
         strip_user_weapons (id)
	 give_item(id,"weapon_knife")
         give_item(id,"weapon_galil")
         cs_set_user_bpammo(id, CSW_GALIL, 90 );
         }
	 
	 			if (HasC4[id])
			{
				give_item(id, "weapon_c4");
				cs_set_user_plant( id );
			}
			
			client_print(id, print_center, "You Taked Free Galil")
		}
		case 9: { 			
		}
	}
	return PLUGIN_CONTINUE
}

public HandleCmd(id){
	if (!get_pcvar_num(g_awp_active))
      return PLUGIN_CONTINUE
	if(get_user_flags(id) & ADMIN_LEVEL_H) 
		return PLUGIN_CONTINUE
	client_print(id, print_center, "Sniper's Only For VIP's")
	return PLUGIN_HANDLED
}

public ShowMotd(id)
{
 show_motd(id, "vip.txt")
}
public client_authorized(id)
{
 set_task(30.0, "PrintText" ,id)
}
public PrintText(id)
{
 client_print(id, print_chat, "[VIP] Write /vip and u will see how get VIP and VIP privilegies.")
}

public handle_say(id) {
	new said[192]
	read_args(said,192)
	if( ( containi(said, "who") != -1 && containi(said, "admin") != -1 ) || contain(said, "/vips") != -1 )
		set_task(0.1,"print_adminlist",id)
	return PLUGIN_CONTINUE
}

public print_adminlist(user) 
{
	new adminnames[33][32]
	new message[256]
	new contactinfo[256], contact[112]
	new id, count, x, len
	
	for(id = 1 ; id <= maxplayers ; id++)
		if(is_user_connected(id))
			if(get_user_flags(id) & ADMIN_LEVEL_H)
				get_user_name(id, adminnames[count++], 31)

	len = format(message, 255, "%s VIP's ONLINE: ",COLOR)
	if(count > 0) {
		for(x = 0 ; x < count ; x++) {
			len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"")
			if(len > 96 ) {
				print_message(user, message)
				len = format(message, 255, "%s ",COLOR)
			}
		}
		print_message(user, message)
	}
	else {
		len += format(message[len], 255-len, "No VIP online.")
		print_message(user, message)
	}
	
	get_cvar_string("amx_contactinfo", contact, 63)
	if(contact[0])  {
		format(contactinfo, 111, "%s Contact Server Admin -- %s", COLOR, contact)
		print_message(user, contactinfo)
	}
}

print_message(id, msg[]) {
	message_begin(MSG_ONE, gmsgSayText, {0,0,0}, id)
	write_byte(id)
	write_string(msg)
	message_end()
}

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1063\\ f0\\ fs16 \n\\ par }
*/[/code]
Pentru ajutor, faceți cerere bine detaliată, completând și respectând modelul corespunzător.
Nu-mi mai dați cereri doar pentru a mă avea în lista de prieteni.
Dacă te ajut, și mă ignori/etc > te adaug în „foe”.
Aveți grijă la cei ce încearcă să mă copieze sau să dea drept mine..Puteți lua legătura cu mine prin STEAM dacă aveți o problemă/nelămurire în acest caz! Cont de forum am doar aici.
În cazul în care utilizați ceva din ce am postat(ex: aici), e bine să fiți la curent cu modificările aduse și de aici, iar dacă sunt ceva probleme nu ezitați să luați legătura cu mine. Actualizarea unor coduri nu se vor afișa public, doar dacă se găsește ceva critic/urgent de remediat, unele fiind coduri vechi iar unele refăcute chiar recent dar private.
* Nume pe cs1.6: eVoLuTiOn \ Nume vechi: eVo
* Atelierul meu - post2819572.html#p2819572 (închis, click link ca să vedeți de ce)
User avatar
Duracell2k19
Membru, skill 0
Membru, skill 0
Posts: 54
Joined: 05 Feb 2019, 20:23
Detinator Steam: Da
CS Status: Inactiv
SteamID: duracell2k20
Fond eXtream: 0

07 Feb 2019, 00:48

Mda... Nu merge meniul pe mape... Pe awp_india unde nu trebuia sa mearga ... fix acolo merge...
Vreau meniul la ct : M4A1+DEAGLE grande [ mai putin smoke]
Famas + Dagle grande [ mai putin smoke]

t : AK47+DEAGLE + grande [ mai putin smoke]
Galil + deagle grande [ mai putin smoke]
Meniul sa se activeze la a 3 runda inafara pe mapa : 35hp / awp_india
User avatar
YONTU
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2466
Joined: 10 May 2013, 14:25
Detinator Steam: Nu
CS Status: Everyone is looking at ur shoes
Reputatie: Moderator ajutator
Fost scripter eXtreamCS
Location: Gura Humorului
Has thanked: 256 times
Been thanked: 288 times
Contact:

07 Feb 2019, 19:17

Mutat din

Board index » eXtream - Counter-Strike 1.6 » Programarea CS-ului » Scripting

In categoria Scripting se posteaza doar nelamuriri legate de bucăți de cod, cereri sfaturi despre functii, orice legat de mentenata pluginului, tutoriale scripting etc
„Peste douăzeci de ani vei fi dezamăgit din cauza lucrurilor pe care nu le-ai făcut, nu din cauza celor pe care le-ai făcut.” - Mark Twain
„Asa e si in viata, hotii castiga, prostii care invata pierd.” - Mihai Nemeș


Bio.LeagueCs.Ro - Biohazard v4.4 Xmas Edition
discord: IonutC#5114

Experinta in: Java/Spring boot/Angular/C/C++/C#/Javascript/Python/HTML/CSS/Pawn/SQL
Ai nevoie de ajutorul meu? Ma poti gasi doar la adresa de discord de mai sus.
User avatar
levin
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 3844
Joined: 24 Aug 2011, 12:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Discord: devilclass
Has thanked: 36 times
Been thanked: 594 times
Contact:

07 Feb 2019, 20:52

| Afiseaza codul
[code]
#define DAMAGE_RECIEVED
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

#pragma tabsize 0

static const COLOR[] = "^x04" //green
static const CONTACT[] = ""
new maxplayers
new gmsgSayText
new mpd, mkb, mhb
new g_MsgSync
new health_add
new health_hs_add
new health_max
new nKiller
new nKiller_hp
new nHp_add
new nHp_max
new g_awp_active
new g_menu_active
new CurrentRound
new bool:HasC4[33]

#if defined DAMAGE_RECIEVED
   new g_MsgSync2
#endif

new const RMaps [ ] [ ] =
{
   "hp",
   "awp"
};

new mapname[65],bool:on=true

public plugin_init()
{
   register_plugin("VIP Eng Version", "3.0", "Dunno")
   mpd = register_cvar("money_per_damage","3")
   mkb = register_cvar("money_kill_bonus","200")
   mhb = register_cvar("money_hs_bonus","500")
   health_add = register_cvar("amx_vip_hp", "15")
   health_hs_add = register_cvar("amx_vip_hp_hs", "30")
   health_max = register_cvar("amx_vip_max_hp", "150")
   g_awp_active = register_cvar("awp_active", "1")
   g_menu_active = register_cvar("menu_active", "1")
   register_event("Damage","Damage","b")
   register_event("DeathMsg","death_msg","a")
   register_clcmd("awp","HandleCmd")
       register_clcmd("sg550","HandleCmd")
       register_clcmd("g3sg1","HandleCmd")
   register_clcmd("say /vip","ShowMotd")
   maxplayers = get_maxplayers()
   gmsgSayText = get_user_msgid("SayText")
   register_clcmd("say", "handle_say")
   register_cvar("amx_contactinfo", CONTACT, FCVAR_SERVER)
   register_logevent("LogEvent_RoundStart", 2, "1=Round_Start" );
   register_event("TextMsg","Event_RoundRestart","a","2&#Game_w")
   register_event("TextMsg","Event_RoundRestart","a","2&#Game_C");
   register_event("DeathMsg", "hook_death", "a", "1>0")
   register_event("Damage", "on_damage", "b", "2!0", "3=0", "4!0")
   g_MsgSync = CreateHudSyncObj()
#if defined DAMAGE_RECIEVED
   g_MsgSync2 = CreateHudSyncObj()
#endif   
}

public on_damage(id)
{
   new attacker = get_user_attacker(id)

#if defined DAMAGE_RECIEVED
   // id should be connected if this message is sent, but lets check anyway
   if ( is_user_connected(id) && is_user_connected(attacker) )
   if (get_user_flags(attacker) & ADMIN_LEVEL_H)
   {
      new damage = read_data(2)

      set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1)
      ShowSyncHudMsg(id, g_MsgSync2, "%i^n", damage)
#else
   if ( is_user_connected(attacker) && if (get_user_flags(attacker) & ADMIN_LEVEL_H) )
   {
      new damage = read_data(2)
#endif
      set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1)
      ShowSyncHudMsg(attacker, g_MsgSync, "%i^n", damage)
   }
}

public Damage(id)
{
   new weapon, hitpoint, attacker = get_user_attacker(id,weapon,hitpoint)
   if(attacker<=maxplayers && is_user_alive(attacker) && attacker!=id)
   if (get_user_flags(attacker) & ADMIN_LEVEL_H) 
   {
      new money = read_data(2) * get_pcvar_num(mpd)
      if(hitpoint==1) money += get_pcvar_num(mhb)
      cs_set_user_money(attacker,cs_get_user_money(attacker) + money)
   }
}

public death_msg()
{
   if(read_data(1)<=maxplayers && read_data(1) && read_data(1)!=read_data(2)) cs_set_user_money(read_data(1),cs_get_user_money(read_data(1)) + get_pcvar_num(mkb) - 300)
}

public LogEvent_RoundStart()
{
   get_mapname(mapname,charsmax(mapname))
   for(new i;i<sizeof RMaps;i++)   if(containi(RMaps,mapname)!=-1)   on=false
   
   if(on&&get_pcvar_num(g_menu_active)==1)   CurrentRound++;
   new players[32], player, pnum;
   get_players(players, pnum, "a");
   for(new i = 0; i < pnum; i++)
   {
      player = players;
      if(is_user_alive(player) && get_user_flags(player) & ADMIN_LEVEL_H)
      {
         give_item(player, "weapon_hegrenade")
         give_item(player, "weapon_flashbang")
         give_item(player, "weapon_flashbang")
         give_item(player, "item_assaultsuit")
         give_item(player, "item_thighpack")
         
         if(CurrentRound >= 3)   Showrod(player);
      }
   }
   return PLUGIN_HANDLED
}

public Event_RoundRestart()
{
   CurrentRound=0;
}

public hook_death()
{
   // Killer id
   nKiller = read_data(1)
   
   if ( (read_data(3) == 1) && (read_data(5) == 0) )
   {
      nHp_add = get_pcvar_num (health_hs_add)
   }
   else
      nHp_add = get_pcvar_num (health_add)
   nHp_max = get_pcvar_num (health_max)
   // Updating Killer HP
   if(!(get_user_flags(nKiller) & ADMIN_LEVEL_H))
   return;

   nKiller_hp = get_user_health(nKiller)
   nKiller_hp += nHp_add
   // Maximum HP check
   if (nKiller_hp > nHp_max) nKiller_hp = nHp_max
   set_user_health(nKiller, nKiller_hp)
   // Hud message "Healed +15/+30 hp"
   set_hudmessage(0, 255, 0, -1.0, 0.15, 0, 1.0, 1.0, 0.1, 0.1, -1)
   show_hudmessage(nKiller, "Healed +%d hp", nHp_add)
   // Screen fading
   message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, nKiller)
   write_short(1<<10)
   write_short(1<<10)
   write_short(0x0000)
   write_byte(0)
   write_byte(0)
   write_byte(200)
   write_byte(75)
   message_end()
 
}

public Showrod(id)
{
	new gMenu = menu_create( "Arme vere", "thisContent" );

	switch(cs_get_user_team(id))
	{
		case CS_TEAM_CT:
		{
	menu_additem( gMenu, "M4A1+DEAGLE grande", "1" );
	menu_additem( gMenu, "Famas + Dagle grande", "2" );
		}
		case CS_TEAM_T:
		{
	menu_additem( gMenu, "AK47+DEAGLE + grande", "1" );
	menu_additem( gMenu, "Galil + deagle grande", "2" );
		}
	}

	menu_setprop( gMenu, MPROP_EXIT, MEXIT_ALL );
	menu_display( id, gMenu );
}
public thisContent( id, Menu, Item )
{
	if( Item < 0 )
	{
		return 0;
	}

	new Key[ 3 ];
	new Access, CallBack;

	menu_item_getinfo( Menu, Item, Access, Key, 2, _, _, CallBack );

	new isKey = str_to_num( Key );

	switch( isKey )
	{
	
	case 2:
	{
		switch(cs_get_user_team(id))
		{
		case CS_TEAM_CT:
		{

         strip_user_weapons (id)
    give_item(id,"weapon_knife")
         give_item(id,"weapon_famas")
         cs_set_user_bpammo(id, CSW_FAMAS, 90 );
         give_item(id,"weapon_deagle")
         cs_set_user_bpammo(id, CSW_DEAGLE, 35 );
	 
	  give_item(id,"weapon_hegrenade")
	   give_item(id,"weapon_flashbang")
	    give_item(id,"weapon_flashbang")

         client_print(id, print_center, "You Taked Free Famas and Deagle and grenade")
		}
		
		case CS_TEAM_T:
		{
         if (user_has_weapon(id, CSW_C4) && get_user_team(id) == 1)
            HasC4[id] = true;
         else
            HasC4[id] = false;
            
         strip_user_weapons (id)
    give_item(id,"weapon_knife")
         give_item(id,"weapon_galil")
         cs_set_user_bpammo(id, CSW_GALIL, 90 );
	          give_item(id,"weapon_deagle")
         cs_set_user_bpammo(id, CSW_DEAGLE, 35 );
	 
	 	  give_item(id,"weapon_hegrenade")
	   give_item(id,"weapon_flashbang")
	    give_item(id,"weapon_flashbang")

    
             if (HasC4[id])
         {
            give_item(id, "weapon_c4");
            cs_set_user_plant( id );
         }
         
         client_print(id, print_center, "You Taked Free Galil + Deagle + grenade")
		}
		}
		}
		case 1:
		{
		switch(cs_get_user_team(id))
		{
		
		case CS_TEAM_CT:
		{

         strip_user_weapons (id)
    give_item(id,"weapon_knife")
         give_item(id,"weapon_m4a1")
         cs_set_user_bpammo(id, CSW_M4A1, 90 );
         give_item(id,"weapon_deagle")
         cs_set_user_bpammo(id, CSW_DEAGLE, 35 );
	 
	 	  give_item(id,"weapon_hegrenade")
	   give_item(id,"weapon_flashbang")
	    give_item(id,"weapon_flashbang")

         client_print(id, print_center, "You Taked Free M4a1 and Deagle and grenade")
		}


		case CS_TEAM_T:
		{
         if (user_has_weapon(id, CSW_C4) && get_user_team(id) == 1)
            HasC4[id] = true;
         else
            HasC4[id] = false;
            

         strip_user_weapons (id)
    give_item(id,"weapon_knife")
         give_item(id,"weapon_ak47")
         cs_set_user_bpammo(id, CSW_AK47, 90 );
	          give_item(id,"weapon_deagle")
         cs_set_user_bpammo(id, CSW_DEAGLE, 35 );
	 
	 	  give_item(id,"weapon_hegrenade")
	   give_item(id,"weapon_flashbang")
	    give_item(id,"weapon_flashbang")

    
             if (HasC4[id])
         {
            give_item(id, "weapon_c4");
            cs_set_user_plant( id );
         }
         
         client_print(id, print_center, "You Taked Free Ak74+Deagle+grenade")
	 }
	 }
	 }
	 }

   	return 1;
}

public HandleCmd(id){
   if (!get_pcvar_num(g_awp_active))
      return PLUGIN_CONTINUE
   if(get_user_flags(id) & ADMIN_LEVEL_H) 
      return PLUGIN_CONTINUE
   client_print(id, print_center, "Sniper's Only For VIP's")
   return PLUGIN_HANDLED
}

public ShowMotd(id)
{
 show_motd(id, "vip.txt")
}
public client_authorized(id)
{
 set_task(30.0, "PrintText" ,id)
}
public PrintText(id)
{
 client_print(id, print_chat, "[VIP] Write /vip and u will see how get VIP and VIP privilegies.")
}

public handle_say(id) {
   new said[192]
   read_args(said,192)
   if( ( containi(said, "who") != -1 && containi(said, "admin") != -1 ) || contain(said, "/vips") != -1 )
      set_task(0.1,"print_adminlist",id)
   return PLUGIN_CONTINUE
}

public print_adminlist(user) 
{
   new adminnames[33][32]
   new message[256]
   new contactinfo[256], contact[112]
   new id, count, x, len
   
   for(id = 1 ; id <= maxplayers ; id++)
      if(is_user_connected(id))
         if(get_user_flags(id) & ADMIN_LEVEL_H)
            get_user_name(id, adminnames[count++], 31)

   len = format(message, 255, "%s VIP's ONLINE: ",COLOR)
   if(count > 0) {
      for(x = 0 ; x < count ; x++) {
         len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"")
         if(len > 96 ) {
            print_message(user, message)
            len = format(message, 255, "%s ",COLOR)
         }
      }
      print_message(user, message)
   }
   else {
      len += format(message[len], 255-len, "No VIP online.")
      print_message(user, message)
   }
   
   get_cvar_string("amx_contactinfo", contact, 63)
   if(contact[0])  {
      format(contactinfo, 111, "%s Contact Server Admin -- %s", COLOR, contact)
      print_message(user, contactinfo)
   }
}

print_message(id, msg[]) {
   message_begin(MSG_ONE, gmsgSayText, {0,0,0}, id)
   write_byte(id)
   write_string(msg)
   message_end()
}

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1063\\ f0\\ fs16 \n\\ par }
*/[/code]
Pentru ajutor, faceți cerere bine detaliată, completând și respectând modelul corespunzător.
Nu-mi mai dați cereri doar pentru a mă avea în lista de prieteni.
Dacă te ajut, și mă ignori/etc > te adaug în „foe”.
Aveți grijă la cei ce încearcă să mă copieze sau să dea drept mine..Puteți lua legătura cu mine prin STEAM dacă aveți o problemă/nelămurire în acest caz! Cont de forum am doar aici.
În cazul în care utilizați ceva din ce am postat(ex: aici), e bine să fiți la curent cu modificările aduse și de aici, iar dacă sunt ceva probleme nu ezitați să luați legătura cu mine. Actualizarea unor coduri nu se vor afișa public, doar dacă se găsește ceva critic/urgent de remediat, unele fiind coduri vechi iar unele refăcute chiar recent dar private.
* Nume pe cs1.6: eVoLuTiOn \ Nume vechi: eVo
* Atelierul meu - post2819572.html#p2819572 (închis, click link ca să vedeți de ce)
User avatar
Duracell2k19
Membru, skill 0
Membru, skill 0
Posts: 54
Joined: 05 Feb 2019, 20:23
Detinator Steam: Da
CS Status: Inactiv
SteamID: duracell2k20
Fond eXtream: 0

08 Feb 2019, 00:25

Multumesc mult
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 8 guests