Cerere plugin Vip

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
User avatar
EleCtr0zZz
Membru, skill +1
Membru, skill +1
Posts: 387
Joined: 25 May 2015, 06:27
Detinator Steam: Da
SteamID: =
Fond eXtream: 0
Has thanked: 3 times
Contact:

25 Mar 2020, 19:20

Salut , doresc si eu un plugin V.I.P pentru modul de joc Classic
As dori ca playerii vip sa primeasca un deagle in prima runda , iar din a doua runda sa i se deschida un meniu cu aceste arme :
titlu : MENIU V.I.P
1.M4a1+Deagle+Grenazi
2.Ak47+Deagle+Grenazi
3.Awp+Deagle+Grenazi
As vrea sa fie puse doar He si Flash fara smoke
Sa primeasca +300 $ fata de ceilalti playeri pe fiecare kill
Sa aiba 110 hp si 100 armor , dar sa nu poata avea mai mult de 110 hp si 100 armor , adica sa nu primeasca bonus de hp pe kill-uri
Si daca se poate sa aiba si tag-ul de [VIP] cu verde in chat.
Va multumesc :hands_stretched_upwards:
eXtreamSHOP
User avatar
EleCtr0zZz
Membru, skill +1
Membru, skill +1
Posts: 387
Joined: 25 May 2015, 06:27
Detinator Steam: Da
SteamID: =
Fond eXtream: 0
Has thanked: 3 times
Contact:

26 Mar 2020, 16:16

up,,,
zLowCS
Membru, skill 0
Membru, skill 0
Posts: 24
Joined: 28 Jan 2017, 12:20
Detinator Steam: Da
Fond eXtream: 0
Has thanked: 1 time
Contact:

26 Mar 2020, 18:22

Ce flag sa aiba?
| Afiseaza codul
#include <amxmodx>
#include <cstrike>
#include <amxmisc>
#include <fun>
#include <hamsandwich>
#include <engine>
#include <colorchat>
#include <fakemeta>

#define VIP_LEVEL_ACCES ADMIN_LEVEL_A

#define DAMAGE_RECIEVED

#define SCOREATTRIB_NONE    0
#define SCOREATTRIB_DEAD    ( 1 << 0 )
#define SCOREATTRIB_BOMB    ( 1 << 1 )
#define SCOREATTRIB_VIP  ( 1 << 2 )

#define REMOVE_FLAGS "m"

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

new const g_szBeginning[ ] = "VIP's Online:"
new g_szMessage[ 256 ];

new cvar_vip_maxap, cvar_vip_maxhp, cvar_vip_showC, cvar_vip_showH, cvar_vip_in_out, cvar_tag, cvar_start_hp, cvar_start_ap, cvar_start_money, cvar_vip_jump, cvar_hp_kill, cvar_ap_kill, jumpnum[33], bool: dojump[33], bool:use[33], SyncHudMessage;

//damange
new g_MsgSync, maxplayers, mpd, mhb;

#if defined DAMAGE_RECIEVED
	new g_MsgSync2
#endif

public plugin_init() 
{
	register_plugin("VIP BETA", "0.1", "zLow");
	
	RegisterHam(Ham_Spawn, "player", "Spawn", 1);
	
// comenzi chat / consola

	register_clcmd("say /vmenu", "vip_menu", -1);
	register_clcmd("say /vipmenu", "vip_menu", -1);
	register_clcmd("say /vm", "vip_menu", -1);
	register_clcmd("say /vip", "vip_info");
	register_clcmd("say /wantvip", "vip_info");
	register_clcmd("say", "handle_say");
	register_clcmd("say_team", "handle_say");
	
	
	register_event("DeathMsg", "eDeathMsg", "a");
	register_event("HLTV", "Event_NewRound", "a", "1=0", "2=0");
	register_message(get_user_msgid( "ScoreAttrib" ), "MessageScoreAttrib");	
	register_event("Damage", "on_damage", "b", "2!0", "3=0", "4!0")
	register_event("Damage","Damage","b")
	
// cvar-uri

	cvar_tag = register_cvar("amx_vip_tag", "VIP");
	cvar_start_hp = register_cvar("amx_start_hp", "110");
	cvar_start_ap = register_cvar("amx_start_ap", "100");
	cvar_start_money = register_cvar("amx_start_money", "800");
	cvar_vip_jump = register_cvar("amx_vip_jump", "1" );
	cvar_hp_kill = register_cvar("amx_vip_addhp", "3");	
	cvar_ap_kill = register_cvar("amx_vip_addap", "10");
	cvar_vip_in_out = register_cvar("amx_vip_in_out", "1");
	cvar_vip_showC = register_cvar("amx_vip_show_chat", "1");
	cvar_vip_showH = register_cvar("amx_vip_show_hud", "1");
	cvar_vip_maxhp = register_cvar("amx_vip_maxhp", "110");
	cvar_vip_maxap = register_cvar("amx_vip_maxap", "100");	

	set_task(120.0, "mesaj_info", _, _, _, "b");
	set_task( 1.0, "TaskDisplayVips", _, _, _, "b", 0 );
	SyncHudMessage = CreateHudSyncObj( );
	
//damange
	g_MsgSync = CreateHudSyncObj()
	#if defined DAMAGE_RECIEVED
	g_MsgSync2 = CreateHudSyncObj()
#endif	
		
}

//damange
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 Event_NewRound()
{
	arrayset(use, false, 33);
}

public vip_menu(id) 
{
	new menu
	switch(cs_get_user_team(id))
	{
		case CS_TEAM_CT:
		{
			menu = menu_create("\y[\rVIP\y] \wMeniu \yVIP", "menu_ammunition");
			menu_additem(menu, "M4a1+Deagle+Set grenăzi", "1", VIP_LEVEL_ACCES);
			menu_additem(menu, "AK47+Deagle+Set grenăzi", "2", VIP_LEVEL_ACCES);
			menu_additem(menu, "Awp+Deagle+Set grenăzi", "3", VIP_LEVEL_ACCES);
		}
	
		case CS_TEAM_T:
		{
			menu = menu_create("\y[\rVIP Classic\y] \wMeniu \yVIP", "menu_ammunition");
			menu_additem(menu, "M4a1+Deagle+Set grenăzi", "1", VIP_LEVEL_ACCES);
			menu_additem(menu, "AK47+Deagle+Set grenăzi", "2", VIP_LEVEL_ACCES);
			menu_additem(menu, "Awp+Deagle+Set grenăzi", "3", VIP_LEVEL_ACCES);
		}
	}
	menu_display(id, menu, 0)
	return PLUGIN_HANDLED;
}

public menu_ammunition ( id, menu, item ) 
{
	new tag[32];
	get_pcvar_string(cvar_tag, tag, charsmax(tag));
	
	if(use[id])
	{
		ColorChat(id, GREEN,"^3[%s] ^1Menu can be used one round time!", tag);
		return PLUGIN_HANDLED;
	}
	
	if(item == MENU_EXIT)
	{
		return PLUGIN_HANDLED;
	}

	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);

	if(cs_get_user_team(id) == CS_TEAM_CT)
		switch(key)
	{
		case 1:
	{
			strip_user_weapons(id)
			give_item(id, "weapon_knife");	
			give_item(id, "weapon_m4a1");
			give_item(id, "weapon_deagle");
			give_item(id, "weapon_hegrenade");
			give_item(id, "weapon_flashbang");
			give_item(id, "weapon_smokegrenade");
			cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 1);
			cs_set_user_bpammo(id, CSW_HEGRENADE, 1);
			cs_set_user_bpammo(id, CSW_FLASHBANG, 2);
			cs_set_user_bpammo(id, CSW_M4A1, 90);
			cs_set_user_bpammo(id, CSW_DEAGLE, 35);
			ColorChat(id,GREEN,"^3[%s] ^1Ai ales ^4M4a1^1+^4Deagle^1+^4Set grenazi^1.",tag);
	}
		case 2:
	{
			strip_user_weapons(id)
			give_item(id, "weapon_knife");
			give_item(id, "weapon_ak47");
			give_item(id, "weapon_deagle");
			give_item(id, "weapon_hegrenade");
			give_item(id, "weapon_flashbang");
			cs_set_user_bpammo(id, CSW_HEGRENADE, 1);
			cs_set_user_bpammo(id, CSW_FLASHBANG, 2);
			cs_set_user_bpammo(id, CSW_AK47, 90);
			cs_set_user_bpammo(id, CSW_DEAGLE, 35);
			ColorChat(id,GREEN,"^3[%s] ^1Ai ales ^4Ak47^1+^4Deagle^1+^4Set grenazi^1.",tag);
	} 

		case 3:
	{
			strip_user_weapons(id)
			give_item(id, "weapon_knife");
			give_item(id, "weapon_awp");
			give_item(id, "weapon_deagle");
			give_item(id, "weapon_hegrenade");
			give_item(id, "weapon_flashbang");
			give_item(id, "weapon_smokegrenade");
			cs_set_user_bpammo(id, CSW_FLASHBANG, 2);
			cs_set_user_bpammo(id, CSW_AWP, 30);
			cs_set_user_bpammo(id, CSW_DEAGLE, 35);
			ColorChat(id,GREEN,"^3[%s] ^1Ai ales ^4Awp^1+^4Deagle^1+^4Set grenazi^1.", tag);
			use[id] = true;
	} 
}
	if(cs_get_user_team(id) == CS_TEAM_T)
		switch(key)
	{
		case 1:
	{
			strip_user_weapons(id)
			give_item(id, "weapon_knife");	
			give_item(id, "weapon_m4a1");
			give_item(id, "weapon_deagle");
			give_item(id, "weapon_hegrenade");
			give_item(id, "weapon_flashbang");
			give_item(id, "weapon_smokegrenade");
			cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 1);
			cs_set_user_bpammo(id, CSW_HEGRENADE, 1);
			cs_set_user_bpammo(id, CSW_FLASHBANG, 2);
			cs_set_user_bpammo(id, CSW_M4A1, 90);
			cs_set_user_bpammo(id, CSW_DEAGLE, 35);
			ColorChat(id,GREEN,"^3[%s] ^1Ai ales ^4M4a1^1+^4Deagle^1+^4Set grenazi^1.",tag);
	}
		case 2:
	{
			strip_user_weapons(id)
			give_item(id, "weapon_knife");
			give_item(id, "weapon_ak47");
			give_item(id, "weapon_deagle");
			give_item(id, "weapon_hegrenade");
			give_item(id, "weapon_flashbang");
			cs_set_user_bpammo(id, CSW_HEGRENADE, 1);
			cs_set_user_bpammo(id, CSW_FLASHBANG, 2);
			cs_set_user_bpammo(id, CSW_AK47, 90);
			cs_set_user_bpammo(id, CSW_DEAGLE, 35);
			ColorChat(id,GREEN,"^3[%s] ^1Ai ales ^4Ak47^1+^4Deagle^1+^4Set grenazi^1.",tag);
	} 

		case 3:
	{
			strip_user_weapons(id)
			give_item(id, "weapon_knife");
			give_item(id, "weapon_awp");
			give_item(id, "weapon_deagle");
			give_item(id, "weapon_hegrenade");
			give_item(id, "weapon_flashbang");
			give_item(id, "weapon_smokegrenade");
			cs_set_user_bpammo(id, CSW_FLASHBANG, 2);
			cs_set_user_bpammo(id, CSW_AWP, 30);
			cs_set_user_bpammo(id, CSW_DEAGLE, 35);
			ColorChat(id,GREEN,"^3[%s] ^1Ai ales ^4Awp^1+^4Deagle^1+^4Set grenazi^1.", tag);
			use[id] = true;
	} 
	}
	menu_destroy(menu);
	use[id] = true;
	return PLUGIN_HANDLED;  
}

public Spawn(id) 
{ 
	if(!is_user_alive(id))
		return;
    
	new CsTeams:team = cs_get_user_team(id) 
	if(get_user_flags(id) & VIP_LEVEL_ACCES) 
	{
		switch(team) 
	    {
		case CS_TEAM_T: 
		{
			set_user_health(id, get_pcvar_num(cvar_start_hp));
			set_user_armor(id, get_pcvar_num(cvar_start_ap));
			cs_set_user_money(id, cs_get_user_money(id) + get_pcvar_num(cvar_start_money));
		}
		case CS_TEAM_CT: 
		{
			set_user_health(id, get_pcvar_num( cvar_start_hp ));
			set_user_armor(id, get_pcvar_num( cvar_start_ap ));
			cs_set_user_money(id, cs_get_user_money(id) + get_pcvar_num(cvar_start_money));
		}
	    }
	}
}

public client_putinserver(id) 
{	
	set_task(2.0, "in", id);
	
	jumpnum[id] = 0;
	dojump[id] = false;

	new MapName[32]; get_mapname(MapName, sizeof(MapName));
	
	for (new i = 0; i < sizeof (RMaps); i ++)
	{
		if(equali (MapName, RMaps)) 
		{
			remove_user_flags (id, read_flags(REMOVE_FLAGS));
		}
	}
}

public client_disconnect( id )
{
	set_task(2.0, "out", id);

	jumpnum[id] = 0;
	dojump[id] = false;
}

public client_PreThink( id )
{
	if(!is_user_alive(id)) 
		return PLUGIN_CONTINUE;

	new BUTON = get_user_button(id)
	new OLDBUTON = get_user_oldbutton(id)
	new JUMP_VIP = get_pcvar_num(cvar_vip_jump) 

	if((BUTON & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(OLDBUTON & IN_JUMP))
	{
		if(((get_user_flags(id) & VIP_LEVEL_ACCES) && (jumpnum[id] < JUMP_VIP)))
		{
			dojump[id] = true
			jumpnum[id]++
		}
	}

	if((BUTON & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
	{
		jumpnum[id] = 0
	}

	return PLUGIN_CONTINUE;
}

public client_PostThink(id) 
{
	if(!is_user_alive(id)) 
		return PLUGIN_CONTINUE;

	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;
}

public eDeathMsg()
{
	new id_Killer = read_data(1);
	new VIP_MAXHP = get_pcvar_num(cvar_vip_maxhp);
	new VIP_MAX_HP = get_user_health(id_Killer);
	new VIP_MAXAP = get_pcvar_num(cvar_vip_maxap);
	new VIP_MAX_AP = get_user_armor(id_Killer);

	if(is_user_alive(id_Killer))
	{
		if(get_user_flags(id_Killer) & VIP_LEVEL_ACCES )
			{
				set_user_health(id_Killer, get_user_health(id_Killer) + get_pcvar_num(cvar_hp_kill));
				set_user_armor(id_Killer, get_user_armor(id_Killer) + get_pcvar_num(cvar_ap_kill));
			}
	}

	if(VIP_MAX_HP >= VIP_MAXHP)
	{
               	set_user_health(id_Killer, get_pcvar_num(cvar_vip_maxhp));
		return PLUGIN_HANDLED;
	}
	
	if(VIP_MAX_AP >= VIP_MAXAP)
	{
               	set_user_armor(id_Killer, get_pcvar_num(cvar_vip_maxap));
		return PLUGIN_HANDLED;
	}

	return PLUGIN_HANDLED;
}

public in(id) 	
{
	if(get_pcvar_num(cvar_vip_in_out))
	{
		new tag[32], name[32];

		get_pcvar_string(cvar_tag, tag, charsmax(tag)); 
		get_user_name(id, name, charsmax(name)); 

		if(get_user_flags(id) & VIP_LEVEL_ACCES)   
		{ 
			ColorChat(0, GREEN, "^3[%s] ^1VIP: ^4%s ^1s-a conectat.", tag, name); 
		}
		return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE;
}

public out(id) 	
{	
	if(get_pcvar_num(cvar_vip_in_out))
	{
		new tag[32], name[32];

		get_pcvar_string(cvar_tag, tag, charsmax(tag)); 
		get_user_name(id, name, charsmax(name)); 

		if(get_user_flags(id) & VIP_LEVEL_ACCES)   
		{ 
			ColorChat(0, GREEN, "^3[%s] ^1VIP: ^4%s ^1s-a deconectat.", tag, name); 
		}
		return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE;
}

public vip_info(id)
{
	show_motd(id, "/addons/amxmodx/configs/vip_info.html");
}

public mesaj_info()	
{
	new tag[32];
	get_pcvar_string(cvar_tag, tag, charsmax(tag));
	
	ColorChat(0, GREEN, "^3[VIP] ^1Acest server foloseste VIP [www.extreamcs.ro] !");
}

public TaskDisplayVips( )
{
	if(get_pcvar_num(cvar_vip_showH))
	{
		static iPlayers[ 32 ];
		static iPlayersNum;
	
		get_players( iPlayers, iPlayersNum, "ch" );
		if( !iPlayersNum )
			return 1;
	
		static iVipsConnected, szVipsNames[ 128 ], szName[ 32 ];
		formatex( szVipsNames, sizeof ( szVipsNames ) -1, "" ); // Is this needed ?
		iVipsConnected = 0;
	
		static id, i;
		for( i = 0; i < iPlayersNum; i++ )
		{
			id = iPlayers[ i ];
			if( get_user_flags( id ) & VIP_LEVEL_ACCES )
			{
				get_user_name( id, szName, sizeof ( szName ) -1 );
			
				add( szVipsNames, sizeof ( szVipsNames ) -1, szName );
				add( szVipsNames, sizeof ( szVipsNames ) -1, "^n" );
			
				iVipsConnected++;
			}
		}
	
		formatex( g_szMessage, sizeof ( g_szMessage ) -1, "%s ( %i )^n%s",
			g_szBeginning, iVipsConnected, szVipsNames );
		
		set_hudmessage( 25, 255, 25, 0.01, 0.25, 0, 0.0, 1.0, 0.1, 0.1, -1 );
		ShowSyncHudMsg( 0, SyncHudMessage, g_szMessage );
	}
	return PLUGIN_CONTINUE;
		
}

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

public print_adminlist(user) 
{
	if(get_pcvar_num(cvar_vip_showC))
	{
		new tag[32];
		get_pcvar_string(cvar_tag, tag, charsmax(tag));
	
		new adminnames[33][32];
		new message[256];
		new id, count, x, len;

		for(id = 1 ; id <= get_maxplayers() ; id++)
			if(is_user_connected(id))
				if(get_user_flags(id) & VIP_LEVEL_ACCES)
					get_user_name(id, adminnames[count++], charsmax(adminnames[ ]));
    
		len = format(message, 255, "^3[%s] ^1VIP-ii online sunt:^4 " ,tag);
		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, " ");
				}
				}
			print_message(user, message);
			}
		else 
		{
			ColorChat(0, GREEN, "^3[%s] ^1Nu sunt ^4VIP^1-i online.", tag);
		} 
	}
	return PLUGIN_CONTINUE;  
}

print_message(id, msg[]) 
{
	message_begin(MSG_ONE, get_user_msgid("SayText"), {0,0,0}, id);
	write_byte(id);
	write_string(msg);
	message_end();
}

public MessageScoreAttrib(iMsgID, iDest, iReceiver) 
{
    	new iPlayer = get_msg_arg_int(1);
    	if(is_user_connected( iPlayer )
    	&& (get_user_flags( iPlayer ) & VIP_LEVEL_ACCES)) 
		{
        		set_msg_arg_int(2, ARG_BYTE, is_user_alive(iPlayer) ? SCOREATTRIB_VIP : SCOREATTRIB_DEAD);
    		}
}   
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/

Editezi flag-ul
#define VIP_LEVEL_ACCES cu https://www.amxmodx.org/api/amxconst
si apoi flag-ul care l-ai pus la
#define REMOVE_FLAGS
User avatar
EleCtr0zZz
Membru, skill +1
Membru, skill +1
Posts: 387
Joined: 25 May 2015, 06:27
Detinator Steam: Da
SteamID: =
Fond eXtream: 0
Has thanked: 3 times
Contact:

26 Mar 2020, 18:41

zLowCS wrote:
26 Mar 2020, 18:22
Ce flag sa aiba?
| Afiseaza codul
#include <amxmodx>
#include <cstrike>
#include <amxmisc>
#include <fun>
#include <hamsandwich>
#include <engine>
#include <colorchat>
#include <fakemeta>

#define VIP_LEVEL_ACCES ADMIN_LEVEL_A

#define DAMAGE_RECIEVED

#define SCOREATTRIB_NONE    0
#define SCOREATTRIB_DEAD    ( 1 << 0 )
#define SCOREATTRIB_BOMB    ( 1 << 1 )
#define SCOREATTRIB_VIP  ( 1 << 2 )

#define REMOVE_FLAGS "m"

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

new const g_szBeginning[ ] = "VIP's Online:"
new g_szMessage[ 256 ];

new cvar_vip_maxap, cvar_vip_maxhp, cvar_vip_showC, cvar_vip_showH, cvar_vip_in_out, cvar_tag, cvar_start_hp, cvar_start_ap, cvar_start_money, cvar_vip_jump, cvar_hp_kill, cvar_ap_kill, jumpnum[33], bool: dojump[33], bool:use[33], SyncHudMessage;

//damange
new g_MsgSync, maxplayers, mpd, mhb;

#if defined DAMAGE_RECIEVED
	new g_MsgSync2
#endif

public plugin_init() 
{
	register_plugin("VIP BETA", "0.1", "zLow");
	
	RegisterHam(Ham_Spawn, "player", "Spawn", 1);
	
// comenzi chat / consola

	register_clcmd("say /vmenu", "vip_menu", -1);
	register_clcmd("say /vipmenu", "vip_menu", -1);
	register_clcmd("say /vm", "vip_menu", -1);
	register_clcmd("say /vip", "vip_info");
	register_clcmd("say /wantvip", "vip_info");
	register_clcmd("say", "handle_say");
	register_clcmd("say_team", "handle_say");
	
	
	register_event("DeathMsg", "eDeathMsg", "a");
	register_event("HLTV", "Event_NewRound", "a", "1=0", "2=0");
	register_message(get_user_msgid( "ScoreAttrib" ), "MessageScoreAttrib");	
	register_event("Damage", "on_damage", "b", "2!0", "3=0", "4!0")
	register_event("Damage","Damage","b")
	
// cvar-uri

	cvar_tag = register_cvar("amx_vip_tag", "VIP");
	cvar_start_hp = register_cvar("amx_start_hp", "110");
	cvar_start_ap = register_cvar("amx_start_ap", "100");
	cvar_start_money = register_cvar("amx_start_money", "800");
	cvar_vip_jump = register_cvar("amx_vip_jump", "1" );
	cvar_hp_kill = register_cvar("amx_vip_addhp", "3");	
	cvar_ap_kill = register_cvar("amx_vip_addap", "10");
	cvar_vip_in_out = register_cvar("amx_vip_in_out", "1");
	cvar_vip_showC = register_cvar("amx_vip_show_chat", "1");
	cvar_vip_showH = register_cvar("amx_vip_show_hud", "1");
	cvar_vip_maxhp = register_cvar("amx_vip_maxhp", "110");
	cvar_vip_maxap = register_cvar("amx_vip_maxap", "100");	

	set_task(120.0, "mesaj_info", _, _, _, "b");
	set_task( 1.0, "TaskDisplayVips", _, _, _, "b", 0 );
	SyncHudMessage = CreateHudSyncObj( );
	
//damange
	g_MsgSync = CreateHudSyncObj()
	#if defined DAMAGE_RECIEVED
	g_MsgSync2 = CreateHudSyncObj()
#endif	
		
}

//damange
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 Event_NewRound()
{
	arrayset(use, false, 33);
}

public vip_menu(id) 
{
	new menu
	switch(cs_get_user_team(id))
	{
		case CS_TEAM_CT:
		{
			menu = menu_create("\y[\rVIP\y] \wMeniu \yVIP", "menu_ammunition");
			menu_additem(menu, "M4a1+Deagle+Set grenăzi", "1", VIP_LEVEL_ACCES);
			menu_additem(menu, "AK47+Deagle+Set grenăzi", "2", VIP_LEVEL_ACCES);
			menu_additem(menu, "Awp+Deagle+Set grenăzi", "3", VIP_LEVEL_ACCES);
		}
	
		case CS_TEAM_T:
		{
			menu = menu_create("\y[\rVIP Classic\y] \wMeniu \yVIP", "menu_ammunition");
			menu_additem(menu, "M4a1+Deagle+Set grenăzi", "1", VIP_LEVEL_ACCES);
			menu_additem(menu, "AK47+Deagle+Set grenăzi", "2", VIP_LEVEL_ACCES);
			menu_additem(menu, "Awp+Deagle+Set grenăzi", "3", VIP_LEVEL_ACCES);
		}
	}
	menu_display(id, menu, 0)
	return PLUGIN_HANDLED;
}

public menu_ammunition ( id, menu, item ) 
{
	new tag[32];
	get_pcvar_string(cvar_tag, tag, charsmax(tag));
	
	if(use[id])
	{
		ColorChat(id, GREEN,"^3[%s] ^1Menu can be used one round time!", tag);
		return PLUGIN_HANDLED;
	}
	
	if(item == MENU_EXIT)
	{
		return PLUGIN_HANDLED;
	}

	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);

	if(cs_get_user_team(id) == CS_TEAM_CT)
		switch(key)
	{
		case 1:
	{
			strip_user_weapons(id)
			give_item(id, "weapon_knife");	
			give_item(id, "weapon_m4a1");
			give_item(id, "weapon_deagle");
			give_item(id, "weapon_hegrenade");
			give_item(id, "weapon_flashbang");
			give_item(id, "weapon_smokegrenade");
			cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 1);
			cs_set_user_bpammo(id, CSW_HEGRENADE, 1);
			cs_set_user_bpammo(id, CSW_FLASHBANG, 2);
			cs_set_user_bpammo(id, CSW_M4A1, 90);
			cs_set_user_bpammo(id, CSW_DEAGLE, 35);
			ColorChat(id,GREEN,"^3[%s] ^1Ai ales ^4M4a1^1+^4Deagle^1+^4Set grenazi^1.",tag);
	}
		case 2:
	{
			strip_user_weapons(id)
			give_item(id, "weapon_knife");
			give_item(id, "weapon_ak47");
			give_item(id, "weapon_deagle");
			give_item(id, "weapon_hegrenade");
			give_item(id, "weapon_flashbang");
			cs_set_user_bpammo(id, CSW_HEGRENADE, 1);
			cs_set_user_bpammo(id, CSW_FLASHBANG, 2);
			cs_set_user_bpammo(id, CSW_AK47, 90);
			cs_set_user_bpammo(id, CSW_DEAGLE, 35);
			ColorChat(id,GREEN,"^3[%s] ^1Ai ales ^4Ak47^1+^4Deagle^1+^4Set grenazi^1.",tag);
	} 

		case 3:
	{
			strip_user_weapons(id)
			give_item(id, "weapon_knife");
			give_item(id, "weapon_awp");
			give_item(id, "weapon_deagle");
			give_item(id, "weapon_hegrenade");
			give_item(id, "weapon_flashbang");
			give_item(id, "weapon_smokegrenade");
			cs_set_user_bpammo(id, CSW_FLASHBANG, 2);
			cs_set_user_bpammo(id, CSW_AWP, 30);
			cs_set_user_bpammo(id, CSW_DEAGLE, 35);
			ColorChat(id,GREEN,"^3[%s] ^1Ai ales ^4Awp^1+^4Deagle^1+^4Set grenazi^1.", tag);
			use[id] = true;
	} 
}
	if(cs_get_user_team(id) == CS_TEAM_T)
		switch(key)
	{
		case 1:
	{
			strip_user_weapons(id)
			give_item(id, "weapon_knife");	
			give_item(id, "weapon_m4a1");
			give_item(id, "weapon_deagle");
			give_item(id, "weapon_hegrenade");
			give_item(id, "weapon_flashbang");
			give_item(id, "weapon_smokegrenade");
			cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 1);
			cs_set_user_bpammo(id, CSW_HEGRENADE, 1);
			cs_set_user_bpammo(id, CSW_FLASHBANG, 2);
			cs_set_user_bpammo(id, CSW_M4A1, 90);
			cs_set_user_bpammo(id, CSW_DEAGLE, 35);
			ColorChat(id,GREEN,"^3[%s] ^1Ai ales ^4M4a1^1+^4Deagle^1+^4Set grenazi^1.",tag);
	}
		case 2:
	{
			strip_user_weapons(id)
			give_item(id, "weapon_knife");
			give_item(id, "weapon_ak47");
			give_item(id, "weapon_deagle");
			give_item(id, "weapon_hegrenade");
			give_item(id, "weapon_flashbang");
			cs_set_user_bpammo(id, CSW_HEGRENADE, 1);
			cs_set_user_bpammo(id, CSW_FLASHBANG, 2);
			cs_set_user_bpammo(id, CSW_AK47, 90);
			cs_set_user_bpammo(id, CSW_DEAGLE, 35);
			ColorChat(id,GREEN,"^3[%s] ^1Ai ales ^4Ak47^1+^4Deagle^1+^4Set grenazi^1.",tag);
	} 

		case 3:
	{
			strip_user_weapons(id)
			give_item(id, "weapon_knife");
			give_item(id, "weapon_awp");
			give_item(id, "weapon_deagle");
			give_item(id, "weapon_hegrenade");
			give_item(id, "weapon_flashbang");
			give_item(id, "weapon_smokegrenade");
			cs_set_user_bpammo(id, CSW_FLASHBANG, 2);
			cs_set_user_bpammo(id, CSW_AWP, 30);
			cs_set_user_bpammo(id, CSW_DEAGLE, 35);
			ColorChat(id,GREEN,"^3[%s] ^1Ai ales ^4Awp^1+^4Deagle^1+^4Set grenazi^1.", tag);
			use[id] = true;
	} 
	}
	menu_destroy(menu);
	use[id] = true;
	return PLUGIN_HANDLED;  
}

public Spawn(id) 
{ 
	if(!is_user_alive(id))
		return;
    
	new CsTeams:team = cs_get_user_team(id) 
	if(get_user_flags(id) & VIP_LEVEL_ACCES) 
	{
		switch(team) 
	    {
		case CS_TEAM_T: 
		{
			set_user_health(id, get_pcvar_num(cvar_start_hp));
			set_user_armor(id, get_pcvar_num(cvar_start_ap));
			cs_set_user_money(id, cs_get_user_money(id) + get_pcvar_num(cvar_start_money));
		}
		case CS_TEAM_CT: 
		{
			set_user_health(id, get_pcvar_num( cvar_start_hp ));
			set_user_armor(id, get_pcvar_num( cvar_start_ap ));
			cs_set_user_money(id, cs_get_user_money(id) + get_pcvar_num(cvar_start_money));
		}
	    }
	}
}

public client_putinserver(id) 
{	
	set_task(2.0, "in", id);
	
	jumpnum[id] = 0;
	dojump[id] = false;

	new MapName[32]; get_mapname(MapName, sizeof(MapName));
	
	for (new i = 0; i < sizeof (RMaps); i ++)
	{
		if(equali (MapName, RMaps)) 
		{
			remove_user_flags (id, read_flags(REMOVE_FLAGS));
		}
	}
}

public client_disconnect( id )
{
	set_task(2.0, "out", id);

	jumpnum[id] = 0;
	dojump[id] = false;
}

public client_PreThink( id )
{
	if(!is_user_alive(id)) 
		return PLUGIN_CONTINUE;

	new BUTON = get_user_button(id)
	new OLDBUTON = get_user_oldbutton(id)
	new JUMP_VIP = get_pcvar_num(cvar_vip_jump) 

	if((BUTON & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(OLDBUTON & IN_JUMP))
	{
		if(((get_user_flags(id) & VIP_LEVEL_ACCES) && (jumpnum[id] < JUMP_VIP)))
		{
			dojump[id] = true
			jumpnum[id]++
		}
	}

	if((BUTON & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
	{
		jumpnum[id] = 0
	}

	return PLUGIN_CONTINUE;
}

public client_PostThink(id) 
{
	if(!is_user_alive(id)) 
		return PLUGIN_CONTINUE;

	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;
}

public eDeathMsg()
{
	new id_Killer = read_data(1);
	new VIP_MAXHP = get_pcvar_num(cvar_vip_maxhp);
	new VIP_MAX_HP = get_user_health(id_Killer);
	new VIP_MAXAP = get_pcvar_num(cvar_vip_maxap);
	new VIP_MAX_AP = get_user_armor(id_Killer);

	if(is_user_alive(id_Killer))
	{
		if(get_user_flags(id_Killer) & VIP_LEVEL_ACCES )
			{
				set_user_health(id_Killer, get_user_health(id_Killer) + get_pcvar_num(cvar_hp_kill));
				set_user_armor(id_Killer, get_user_armor(id_Killer) + get_pcvar_num(cvar_ap_kill));
			}
	}

	if(VIP_MAX_HP >= VIP_MAXHP)
	{
               	set_user_health(id_Killer, get_pcvar_num(cvar_vip_maxhp));
		return PLUGIN_HANDLED;
	}
	
	if(VIP_MAX_AP >= VIP_MAXAP)
	{
               	set_user_armor(id_Killer, get_pcvar_num(cvar_vip_maxap));
		return PLUGIN_HANDLED;
	}

	return PLUGIN_HANDLED;
}

public in(id) 	
{
	if(get_pcvar_num(cvar_vip_in_out))
	{
		new tag[32], name[32];

		get_pcvar_string(cvar_tag, tag, charsmax(tag)); 
		get_user_name(id, name, charsmax(name)); 

		if(get_user_flags(id) & VIP_LEVEL_ACCES)   
		{ 
			ColorChat(0, GREEN, "^3[%s] ^1VIP: ^4%s ^1s-a conectat.", tag, name); 
		}
		return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE;
}

public out(id) 	
{	
	if(get_pcvar_num(cvar_vip_in_out))
	{
		new tag[32], name[32];

		get_pcvar_string(cvar_tag, tag, charsmax(tag)); 
		get_user_name(id, name, charsmax(name)); 

		if(get_user_flags(id) & VIP_LEVEL_ACCES)   
		{ 
			ColorChat(0, GREEN, "^3[%s] ^1VIP: ^4%s ^1s-a deconectat.", tag, name); 
		}
		return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE;
}

public vip_info(id)
{
	show_motd(id, "/addons/amxmodx/configs/vip_info.html");
}

public mesaj_info()	
{
	new tag[32];
	get_pcvar_string(cvar_tag, tag, charsmax(tag));
	
	ColorChat(0, GREEN, "^3[VIP] ^1Acest server foloseste VIP [www.extreamcs.ro] !");
}

public TaskDisplayVips( )
{
	if(get_pcvar_num(cvar_vip_showH))
	{
		static iPlayers[ 32 ];
		static iPlayersNum;
	
		get_players( iPlayers, iPlayersNum, "ch" );
		if( !iPlayersNum )
			return 1;
	
		static iVipsConnected, szVipsNames[ 128 ], szName[ 32 ];
		formatex( szVipsNames, sizeof ( szVipsNames ) -1, "" ); // Is this needed ?
		iVipsConnected = 0;
	
		static id, i;
		for( i = 0; i < iPlayersNum; i++ )
		{
			id = iPlayers[ i ];
			if( get_user_flags( id ) & VIP_LEVEL_ACCES )
			{
				get_user_name( id, szName, sizeof ( szName ) -1 );
			
				add( szVipsNames, sizeof ( szVipsNames ) -1, szName );
				add( szVipsNames, sizeof ( szVipsNames ) -1, "^n" );
			
				iVipsConnected++;
			}
		}
	
		formatex( g_szMessage, sizeof ( g_szMessage ) -1, "%s ( %i )^n%s",
			g_szBeginning, iVipsConnected, szVipsNames );
		
		set_hudmessage( 25, 255, 25, 0.01, 0.25, 0, 0.0, 1.0, 0.1, 0.1, -1 );
		ShowSyncHudMsg( 0, SyncHudMessage, g_szMessage );
	}
	return PLUGIN_CONTINUE;
		
}

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

public print_adminlist(user) 
{
	if(get_pcvar_num(cvar_vip_showC))
	{
		new tag[32];
		get_pcvar_string(cvar_tag, tag, charsmax(tag));
	
		new adminnames[33][32];
		new message[256];
		new id, count, x, len;

		for(id = 1 ; id <= get_maxplayers() ; id++)
			if(is_user_connected(id))
				if(get_user_flags(id) & VIP_LEVEL_ACCES)
					get_user_name(id, adminnames[count++], charsmax(adminnames[ ]));
    
		len = format(message, 255, "^3[%s] ^1VIP-ii online sunt:^4 " ,tag);
		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, " ");
				}
				}
			print_message(user, message);
			}
		else 
		{
			ColorChat(0, GREEN, "^3[%s] ^1Nu sunt ^4VIP^1-i online.", tag);
		} 
	}
	return PLUGIN_CONTINUE;  
}

print_message(id, msg[]) 
{
	message_begin(MSG_ONE, get_user_msgid("SayText"), {0,0,0}, id);
	write_byte(id);
	write_string(msg);
	message_end();
}

public MessageScoreAttrib(iMsgID, iDest, iReceiver) 
{
    	new iPlayer = get_msg_arg_int(1);
    	if(is_user_connected( iPlayer )
    	&& (get_user_flags( iPlayer ) & VIP_LEVEL_ACCES)) 
		{
        		set_msg_arg_int(2, ARG_BYTE, is_user_alive(iPlayer) ? SCOREATTRIB_VIP : SCOREATTRIB_DEAD);
    		}
}   
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/

Editezi flag-ul
#define VIP_LEVEL_ACCES cu https://www.amxmodx.org/api/amxconst
si apoi flag-ul care l-ai pus la
#define REMOVE_FLAGS


eroare la compilare
| Afiseaza codul
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

include\fakemeta_const.inc(551) : warning 201: redefinition of constant/macro (symbol "TraceResult")
vip.sma(321) : error 048: array dimensions do not match

1 Error.
Could not locate output file vip.amx (compile failed).
User avatar
EnTeR_
Membru, skill +1
Membru, skill +1
Posts: 457
Joined: 13 Sep 2014, 15:36
Detinator Steam: Da
Fond eXtream: 0
Been thanked: 5 times

26 Mar 2020, 20:26

Tag nu ti-am pus deoarce intra in conflict cu ghostchat sau ce plugin folosesti tu
| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>
#include <fun>
#include <fakemeta>

const WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90)|(1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE);


new RoundCount = 0;

public plugin_init (  )
{
	register_plugin ( "Simple VIP", "0.1", "EnTeR_" );

    RegisterHam ( Ham_Spawn, "player", "fwPlayerSpawnPost", 1 );

    register_event ( "HLTV", "evNewRound", "a", "1=0", "2=0" );

    register_logevent ( "leGameCommencing", 2, "1&Game_Commencing" );

    register_event ( "DeathMsg", "EventDeathMsg", "a" );
}

public EventDeathMsg (  )
{
	new Killer = read_data ( 1 );
	
	new Victim = read_data ( 2 );

	if ( !is_user_alive ( Killer ) || Killer == Victim || get_user_team ( Killer ) == get_user_team ( Victim ) ) 

		return 
	
	cs_set_user_money ( Killer, min ( cs_get_user_money ( Killer ) + 300, 16000 ), 1 );
}

public fwPlayerSpawnPost ( id )
{
	if ( is_user_vip ( id ) && is_user_alive ( id ) )
	{
		set_user_health ( id, 110 );

		cs_set_user_armor ( id, 100, CS_ARMOR_VESTHELM );

		if ( RoundCount < 1 )
		{
			drop_weapons ( id );

			give_item ( id, "weapon_deagle" )

			cs_set_user_bpammo ( id, CSW_DEAGLE, 35 );
		}
		else
		{
			new Menu = menu_create ( "\r[VIP]\y Meniu Arme", "WeaponMenuHandler" );

			menu_additem ( Menu, "M4A1 + DEAGLE + GRENAZI", "", 0 );

			menu_additem ( Menu, "AK47 + DEAGLE + GRENAZI", "", 0 )

			menu_additem ( Menu, "AWP + DEAGLE + GRENAZI", "", 0 )

			menu_setprop ( Menu, MPROP_EXIT, MEXIT_ALL );

			menu_display ( id, Menu, 0 );
		}
	}
}

public WeaponMenuHandler ( id, Menu, Item )
{
	if ( Item == MENU_EXIT )
	{
		menu_destroy ( Menu );

		return PLUGIN_CONTINUE;
	}

	if ( !is_user_vip ( id ) || !is_user_alive ( id ) )

		return PLUGIN_CONTINUE;

	switch ( Item )
	{
		case 0:
		{
			drop_weapons ( id );

			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" );

			cs_set_user_bpammo ( id, CSW_FLASHBANG, 2 );
		}
		case 1:
		{
			drop_weapons ( id );

			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" );

			cs_set_user_bpammo ( id, CSW_FLASHBANG, 2 );
		}
		case 2:
		{
			drop_weapons ( id );

			give_item ( id, "weapon_awp" );

			cs_set_user_bpammo ( id, CSW_AWP, 30 );

			give_item ( id, "weapon_deagle" )

			cs_set_user_bpammo ( id, CSW_DEAGLE, 35 );

			give_item ( id, "weapon_hegrenade" );

			give_item ( id, "weapon_flashbang" );

			cs_set_user_bpammo ( id, CSW_FLASHBANG, 2 );
		}
	}

	return PLUGIN_CONTINUE;
}

public evNewRound (  ) RoundCount ++;

public leGameCommencing (  ) RoundCount = 0;

bool: is_user_vip ( id )
{
	if ( get_user_flags ( id ) & ADMIN_LEVEL_H )
	{
		return true;
	}

	return false;
}

stock fwFindEntByOwner ( Entity, const ClassName [ ], Owner )
{
	while ( ( Entity = engfunc ( EngFunc_FindEntityByString, Entity, "classname", ClassName ) ) && pev ( Entity, pev_owner ) != Owner) {  }

	return Entity;
}

stock drop_weapons ( id )
{
	static Weapons [32], Num = 0, WeaponID;
	
	get_user_weapons ( id, Weapons, Num );

	for ( new i = 0; i < Num; i ++ )
	{
		WeaponID = Weapons ;

		if ( ( 1 << WeaponID ) & WEAPONS_BIT_SUM )
		{
			static DropName [32], WeaponEntity;

			get_weaponname ( WeaponID, DropName, charsmax ( DropName ) );
			
			WeaponEntity = fwFindEntByOwner ( -1, DropName, id );
			
			set_pev ( WeaponEntity, pev_iuser1, cs_get_user_bpammo ( id, WeaponID ) );
			
			engclient_cmd ( id, "drop", DropName );
			
			cs_set_user_bpammo ( id, WeaponID, 0 );
		}
	}
}
Discord: EyeKon#3230
User avatar
EleCtr0zZz
Membru, skill +1
Membru, skill +1
Posts: 387
Joined: 25 May 2015, 06:27
Detinator Steam: Da
SteamID: =
Fond eXtream: 0
Has thanked: 3 times
Contact:

26 Mar 2020, 21:10

EnTeR_ wrote:
26 Mar 2020, 20:26
Tag nu ti-am pus deoarce intra in conflict cu ghostchat sau ce plugin folosesti tu
| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>
#include <fun>
#include <fakemeta>

const WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90)|(1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE);


new RoundCount = 0;

public plugin_init (  )
{
	register_plugin ( "Simple VIP", "0.1", "EnTeR_" );

    RegisterHam ( Ham_Spawn, "player", "fwPlayerSpawnPost", 1 );

    register_event ( "HLTV", "evNewRound", "a", "1=0", "2=0" );

    register_logevent ( "leGameCommencing", 2, "1&Game_Commencing" );

    register_event ( "DeathMsg", "EventDeathMsg", "a" );
}

public EventDeathMsg (  )
{
	new Killer = read_data ( 1 );
	
	new Victim = read_data ( 2 );

	if ( !is_user_alive ( Killer ) || Killer == Victim || get_user_team ( Killer ) == get_user_team ( Victim ) ) 

		return 
	
	cs_set_user_money ( Killer, min ( cs_get_user_money ( Killer ) + 300, 16000 ), 1 );
}

public fwPlayerSpawnPost ( id )
{
	if ( is_user_vip ( id ) && is_user_alive ( id ) )
	{
		set_user_health ( id, 110 );

		cs_set_user_armor ( id, 100, CS_ARMOR_VESTHELM );

		if ( RoundCount < 1 )
		{
			drop_weapons ( id );

			give_item ( id, "weapon_deagle" )

			cs_set_user_bpammo ( id, CSW_DEAGLE, 35 );
		}
		else
		{
			new Menu = menu_create ( "\r[VIP]\y Meniu Arme", "WeaponMenuHandler" );

			menu_additem ( Menu, "M4A1 + DEAGLE + GRENAZI", "", 0 );

			menu_additem ( Menu, "AK47 + DEAGLE + GRENAZI", "", 0 )

			menu_additem ( Menu, "AWP + DEAGLE + GRENAZI", "", 0 )

			menu_setprop ( Menu, MPROP_EXIT, MEXIT_ALL );

			menu_display ( id, Menu, 0 );
		}
	}
}

public WeaponMenuHandler ( id, Menu, Item )
{
	if ( Item == MENU_EXIT )
	{
		menu_destroy ( Menu );

		return PLUGIN_CONTINUE;
	}

	if ( !is_user_vip ( id ) || !is_user_alive ( id ) )

		return PLUGIN_CONTINUE;

	switch ( Item )
	{
		case 0:
		{
			drop_weapons ( id );

			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" );

			cs_set_user_bpammo ( id, CSW_FLASHBANG, 2 );
		}
		case 1:
		{
			drop_weapons ( id );

			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" );

			cs_set_user_bpammo ( id, CSW_FLASHBANG, 2 );
		}
		case 2:
		{
			drop_weapons ( id );

			give_item ( id, "weapon_awp" );

			cs_set_user_bpammo ( id, CSW_AWP, 30 );

			give_item ( id, "weapon_deagle" )

			cs_set_user_bpammo ( id, CSW_DEAGLE, 35 );

			give_item ( id, "weapon_hegrenade" );

			give_item ( id, "weapon_flashbang" );

			cs_set_user_bpammo ( id, CSW_FLASHBANG, 2 );
		}
	}

	return PLUGIN_CONTINUE;
}

public evNewRound (  ) RoundCount ++;

public leGameCommencing (  ) RoundCount = 0;

bool: is_user_vip ( id )
{
	if ( get_user_flags ( id ) & ADMIN_LEVEL_H )
	{
		return true;
	}

	return false;
}

stock fwFindEntByOwner ( Entity, const ClassName [ ], Owner )
{
	while ( ( Entity = engfunc ( EngFunc_FindEntityByString, Entity, "classname", ClassName ) ) && pev ( Entity, pev_owner ) != Owner) {  }

	return Entity;
}

stock drop_weapons ( id )
{
	static Weapons [32], Num = 0, WeaponID;
	
	get_user_weapons ( id, Weapons, Num );

	for ( new i = 0; i < Num; i ++ )
	{
		WeaponID = Weapons ;

		if ( ( 1 << WeaponID ) & WEAPONS_BIT_SUM )
		{
			static DropName [32], WeaponEntity;

			get_weaponname ( WeaponID, DropName, charsmax ( DropName ) );
			
			WeaponEntity = fwFindEntByOwner ( -1, DropName, id );
			
			set_pev ( WeaponEntity, pev_iuser1, cs_get_user_bpammo ( id, WeaponID ) );
			
			engclient_cmd ( id, "drop", DropName );
			
			cs_set_user_bpammo ( id, WeaponID, 0 );
		}
	}
}


Eroare la compilare
| Afiseaza codul
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

vip.sma(17) : warning 217: loose indentation
vip.sma(175) : error 006: must be assigned to an array

1 Error.
Could not locate output file vip.amx (compile failed).
User avatar
EnTeR_
Membru, skill +1
Membru, skill +1
Posts: 457
Joined: 13 Sep 2014, 15:36
Detinator Steam: Da
Fond eXtream: 0
Been thanked: 5 times

26 Mar 2020, 21:13

E de la forum. Cauta in plugin stock drop_weapons si inlocuieste WeaponID = Weapons cu WeaponID = Weapons [ i ];
Discord: EyeKon#3230
User avatar
EleCtr0zZz
Membru, skill +1
Membru, skill +1
Posts: 387
Joined: 25 May 2015, 06:27
Detinator Steam: Da
SteamID: =
Fond eXtream: 0
Has thanked: 3 times
Contact:

27 Mar 2020, 11:26

EnTeR_ wrote:
26 Mar 2020, 21:13
E de la forum. Cauta in plugin stock drop_weapons si inlocuieste WeaponID = Weapons cu WeaponID = Weapons [ i ];
Merge perfect , multumesc !
Poti sa te uiti la cererea mea de vip gun models?
-edit-
Poti te rog sa scoti meniul de pe mapa awp_india si fy_snow ?
A si daca se mai poata sa faci sa nu dropeze arma de ex daca eu am un M4a1 si selectez unul din acel meniu sa nu il dropeze , arma sa dispara ( sa nu dropeze arma veche )
User avatar
EnTeR_
Membru, skill +1
Membru, skill +1
Posts: 457
Joined: 13 Sep 2014, 15:36
Detinator Steam: Da
Fond eXtream: 0
Been thanked: 5 times

27 Mar 2020, 19:21

| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>
#include <fun>

new const RMaps [ ] [ ] =
{
        "fy_snow",
        "awp_india"
        // etc...
};

new RoundCount = 0;

public plugin_init (  )
{
    register_plugin ( "Simple VIP", "0.1", "EnTeR_" );

    new MapName [32]; get_mapname ( MapName, sizeof ( MapName ) - 1 );
    
    for ( new i = 0; i < sizeof ( RMaps ); i ++ )
    {
        if ( equali ( MapName, RMaps [ i ]  ) ) 
        {
            pause ( "a" );
        }
    }   

    RegisterHam ( Ham_Spawn, "player", "fwPlayerSpawnPost", 1 );

    register_event ( "HLTV", "evNewRound", "a", "1=0", "2=0" );

    register_logevent ( "leGameCommencing", 2, "1&Game_Commencing" );

    register_event ( "DeathMsg", "EventDeathMsg", "a" );
}

public EventDeathMsg (  )
{
    new Killer = read_data ( 1 );
    
    new Victim = read_data ( 2 );

    if ( !is_user_alive ( Killer ) || Killer == Victim || get_user_team ( Killer ) == get_user_team ( Victim ) ) 

        return 
    
    cs_set_user_money ( Killer, min ( cs_get_user_money ( Killer ) + 300, 16000 ), 1 );
}

public fwPlayerSpawnPost ( id )
{
    if ( is_user_vip ( id ) && is_user_alive ( id ) )
    {
        set_user_health ( id, 110 );

        cs_set_user_armor ( id, 100, CS_ARMOR_VESTHELM );

        if ( RoundCount < 1 )
        {
            give_item ( id, "weapon_deagle" )

            cs_set_user_bpammo ( id, CSW_DEAGLE, 35 );
        }
        else
        {
            new Menu = menu_create ( "\r[VIP]\y Meniu Arme", "WeaponMenuHandler" );

            menu_additem ( Menu, "M4A1 + DEAGLE + GRENAZI", "", 0 );

            menu_additem ( Menu, "AK47 + DEAGLE + GRENAZI", "", 0 )

            menu_additem ( Menu, "AWP + DEAGLE + GRENAZI", "", 0 )

            menu_setprop ( Menu, MPROP_EXIT, MEXIT_ALL );

            menu_display ( id, Menu, 0 );
        }
    }
}

public WeaponMenuHandler ( id, Menu, Item )
{
    if ( Item == MENU_EXIT )
    {
        menu_destroy ( Menu );

        return PLUGIN_CONTINUE;
    }

    if ( !is_user_vip ( id ) || !is_user_alive ( id ) )

        return PLUGIN_CONTINUE;

    switch ( Item )
    {
        case 0:
        {
            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" );

            cs_set_user_bpammo ( id, CSW_FLASHBANG, 2 );
        }
        case 1:
        {
            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" );

            cs_set_user_bpammo ( id, CSW_FLASHBANG, 2 );
        }
        case 2:
        {
            give_item ( id, "weapon_awp" );

            cs_set_user_bpammo ( id, CSW_AWP, 30 );

            give_item ( id, "weapon_deagle" )

            cs_set_user_bpammo ( id, CSW_DEAGLE, 35 );

            give_item ( id, "weapon_hegrenade" );

            give_item ( id, "weapon_flashbang" );

            cs_set_user_bpammo ( id, CSW_FLASHBANG, 2 );
        }
    }

    return PLUGIN_CONTINUE;
}

public evNewRound (  ) RoundCount ++;

public leGameCommencing (  ) RoundCount = 0;

bool: is_user_vip ( id )
{
    if ( get_user_flags ( id ) & ADMIN_LEVEL_H )
    {
        return true;
    }

    return false;
}
Discord: EyeKon#3230
User avatar
EleCtr0zZz
Membru, skill +1
Membru, skill +1
Posts: 387
Joined: 25 May 2015, 06:27
Detinator Steam: Da
SteamID: =
Fond eXtream: 0
Has thanked: 3 times
Contact:

28 Mar 2020, 12:54

EnTeR_ wrote:
27 Mar 2020, 19:21
| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>
#include <fun>

new const RMaps [ ] [ ] =
{
        "fy_snow",
        "awp_india"
        // etc...
};

new RoundCount = 0;

public plugin_init (  )
{
    register_plugin ( "Simple VIP", "0.1", "EnTeR_" );

    new MapName [32]; get_mapname ( MapName, sizeof ( MapName ) - 1 );
    
    for ( new i = 0; i < sizeof ( RMaps ); i ++ )
    {
        if ( equali ( MapName, RMaps [ i ]  ) ) 
        {
            pause ( "a" );
        }
    }   

    RegisterHam ( Ham_Spawn, "player", "fwPlayerSpawnPost", 1 );

    register_event ( "HLTV", "evNewRound", "a", "1=0", "2=0" );

    register_logevent ( "leGameCommencing", 2, "1&Game_Commencing" );

    register_event ( "DeathMsg", "EventDeathMsg", "a" );
}

public EventDeathMsg (  )
{
    new Killer = read_data ( 1 );
    
    new Victim = read_data ( 2 );

    if ( !is_user_alive ( Killer ) || Killer == Victim || get_user_team ( Killer ) == get_user_team ( Victim ) ) 

        return 
    
    cs_set_user_money ( Killer, min ( cs_get_user_money ( Killer ) + 300, 16000 ), 1 );
}

public fwPlayerSpawnPost ( id )
{
    if ( is_user_vip ( id ) && is_user_alive ( id ) )
    {
        set_user_health ( id, 110 );

        cs_set_user_armor ( id, 100, CS_ARMOR_VESTHELM );

        if ( RoundCount < 1 )
        {
            give_item ( id, "weapon_deagle" )

            cs_set_user_bpammo ( id, CSW_DEAGLE, 35 );
        }
        else
        {
            new Menu = menu_create ( "\r[VIP]\y Meniu Arme", "WeaponMenuHandler" );

            menu_additem ( Menu, "M4A1 + DEAGLE + GRENAZI", "", 0 );

            menu_additem ( Menu, "AK47 + DEAGLE + GRENAZI", "", 0 )

            menu_additem ( Menu, "AWP + DEAGLE + GRENAZI", "", 0 )

            menu_setprop ( Menu, MPROP_EXIT, MEXIT_ALL );

            menu_display ( id, Menu, 0 );
        }
    }
}

public WeaponMenuHandler ( id, Menu, Item )
{
    if ( Item == MENU_EXIT )
    {
        menu_destroy ( Menu );

        return PLUGIN_CONTINUE;
    }

    if ( !is_user_vip ( id ) || !is_user_alive ( id ) )

        return PLUGIN_CONTINUE;

    switch ( Item )
    {
        case 0:
        {
            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" );

            cs_set_user_bpammo ( id, CSW_FLASHBANG, 2 );
        }
        case 1:
        {
            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" );

            cs_set_user_bpammo ( id, CSW_FLASHBANG, 2 );
        }
        case 2:
        {
            give_item ( id, "weapon_awp" );

            cs_set_user_bpammo ( id, CSW_AWP, 30 );

            give_item ( id, "weapon_deagle" )

            cs_set_user_bpammo ( id, CSW_DEAGLE, 35 );

            give_item ( id, "weapon_hegrenade" );

            give_item ( id, "weapon_flashbang" );

            cs_set_user_bpammo ( id, CSW_FLASHBANG, 2 );
        }
    }

    return PLUGIN_CONTINUE;
}

public evNewRound (  ) RoundCount ++;

public leGameCommencing (  ) RoundCount = 0;

bool: is_user_vip ( id )
{
    if ( get_user_flags ( id ) & ADMIN_LEVEL_H )
    {
        return true;
    }

    return false;
}
Multumesc ! +1
T/C
Post Reply

Return to “Cereri”

  • Information