Page 5 of 6

Re: Vrei un plugin VIP? Aici îl găsești

Posted: 12 Sep 2018, 19:49
by mihaela2018
Este o eroare la pluginul acesta de vip. cand arunci flash nu iau nici eu care sunt terorist dar nici ct.. si nici invers. poti sa faci ca sa il ia ct ?
YONTU wrote:
marvel_team wrote:Nick : bRiCk-baZuka
Server Name : MARVEL.CSMANIA.RO
Mod Server : CSGO Remake.
Cerinte : Plugin VIP
Flag : bit
Beneficii VIP :

-HP : 15 la frag normal ,30 la hs + un he free ( sa nu poate detine mai mult de 1he odata )
-AP : 15 la frag normal ,30 la hs
-150 $ bonus la frag normal ,maxim 16000 $
-300 $ bonus la hs
-Parasuta doar pentru membrii VIP
-Doble Jump doar pentru membrii VIP
-Sa nu creasca / depaseasca viata mai mult de 100
-Sa poata sa foloseasca admin chat
-ViP-ul sa fie imun la flash-uri
-AWP-ul sa fie doar pentru vip ,Sa primeasca drop daca un alt jucator ridica awp de jos si nu este vip .gen sa nu poata sa foloseasca awp-ul deloc.
-Menu VIP
1.M4a1 ,Deagle si set grenazi (HE si Flash) fara smoke
2.AK47 ,deagle si set grenazi (HE si Flash) fara smoke
3.AWP ,deagle si set grenazi (HE si Flash) fara smoke
-VIP free event : 20:00 / 08:00
-Comanda cu /vreauvip in chat cu deschidere de motd sau in consola care sa arate beneficiile + un mesaj care sa ruleze la 60 secunde gen ,pentru a vedea beneficiile si pretul pentru vip asteaza : /vreauvip
-Un fel de glow / straluciere sau ceva pentru membrii vip gen sa iasa in evidenta
-Sa apara tag-ul VIP in TAB
-Meniul sa fie disponibil doar dupa runda a 3 a ,eu am warmup ,deci dupa rs sa fie contorizata runda
-VIP-ul incepe runda cu 100HP ,100AP ,1400 $
-Sa se dezactiveze automat pe harta css_bycastor
-Sa arate damge-ul facut in timp real
-Sa isi reseteze doar decesele
-Slot rezervat / Nume rezervat
| Afiseaza codul
/*
CREDITE:
ConnorMcLeod - pentru bullet damage
twistedeuphoria - pentru multi jump
cheap_suit - cateva bucati de cod extrase din biohazard
*/


#include <amxmodx>
#include <hamsandwich>
#include <engine>
#include <cstrike>
#include <fun>
#include <fakemeta>

// --------------------------------------------
//   ------------- DE EDITAT ---------------
// --------------------------------------------
new const TAG[] = "[SERVERUL_TAU]";		// TAGUL IN CHAT CARE APARE
new const CONTACT[] = "O ADRESA DE CONTACT";

#define is_user_vip(%1) (get_user_flags(%1) & read_flags("bit"))
// --------------------------------------------
//   ------------- DE EDITAT ---------------
// --------------------------------------------

#define PLUGIN_NAME "VIP System"
#define PLUGIN_NAME_PAUSED "VIP System [OPRIT]"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "YONTU"

#define is_user_valid(%1) (1 <= %1 <= max_players)

enum cvars
{
	hp_spawn = 0,
	ap_spawn,
	money_spawn,
	hp_kill,
	hp_hs,
	ap_kill,
	ap_hs,
	hp_max,
	money_kill,
	money_hs,
	show_vip_tab,
	show_bullet_dmg,
	multi_jump,
	parachute,
	noflash
}

new cvar[cvars], rounds = 0;
new max_players;
new bool:g_bJump[33] = false, g_JumpNum[33] = 0;
new g_iPlayerPos[33], g_iPlayerCol[33];

// NU SCHIMBA
new const Float:g_flCoords[][] =  
{ 
	{0.50, 0.40}, 
	{0.56, 0.44}, 
	{0.60, 0.50}, 
	{0.56, 0.56}, 
	{0.50, 0.60}, 
	{0.44, 0.56}, 
	{0.40, 0.50}, 
	{0.44, 0.44} 
}

// NU SCHIMBA VALORILE DEJA EXISTENTE. Poti adauga mai multe culori, respectand matricea
new const g_iColors[][] = 
{ 
	{0, 127, 255}, // blue 
	{255, 127, 0}, // orange 
	{127, 0, 255}, // purple 
	{255, 0, 0}, // red 
	{255, 100, 150}, // pink
	{0, 255, 0} // green
}

public plugin_init()
{	
	new path[64];
	get_localinfo("amxx_configsdir", path, charsmax(path));
	formatex(path, charsmax(path), "%s/vip_maps.ini", path);
	
	new file = fopen(path, "r+");
	
	if(!file_exists(path))
	{
		write_file(path, "; VIP-UL ESTE DEZACTIVAT PE URMATOARELE HARTI: ");
		write_file(path, "; Exemplu de adaugare HARTA:^n; ^"harta^"^n^nfy_snow^ncss_bycastor");
	}
	
	new mapname[32];
	get_mapname(mapname, charsmax(mapname));
	
	new text[121], maptext[32], bool:remove_vip = false;
	while(!feof(file))
	{
		fgets(file, text, charsmax(text));
		trim(text);
		
		if(text[0] == ';' || !strlen(text)) 
		{
			continue; 
		}
		
		parse(text, maptext, charsmax(maptext));
		
		if(equal(maptext, mapname))
		{
			log_amx("Am dezactivat pluginul 'VIP' pe harta %s.", maptext);
			remove_vip = true;
			break;
		}
		
	}
	fclose(file);
	
	if(!remove_vip)
	{
		register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);

		register_event("DeathMsg", "event_DeathMsg", "a");
		register_event("Damage", "event_Damage", "b", "2>0", "3=0");
		register_event("CurWeapon", "event_CurWeapon", "be", "1=1");
		register_event("WeapPickup", "event_WeapPickup", "b");
		register_event("HLTV", "event_NewRound", "a", "1=0", "2=0");
		register_event("TextMsg", "event_textmsg", "a", "2=#Game_will_restart_in")

		RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawnPost", 1);
		RegisterHam(Ham_Touch, "weaponbox", "fw_TouchWeapon");

		register_message(get_user_msgid("ScoreAttrib"), "msg_ScoreAttrib");
		register_message(get_user_msgid("ScreenFade"), "msg_ScreenFade");

		register_clcmd("say /vips", "CmdVipsOnline");
		register_clcmd("say_team /vips", "CmdVipsOnline");
		register_clcmd("say vips", "CmdVipsOnline");
		register_clcmd("say_team vips", "CmdVipsOnline");
		
		register_clcmd("say vreauvip", "CmdPrintAttributes");
		register_clcmd("say_team vreauvip", "CmdPrintAttributes");
		register_clcmd("say /vreauvip", "CmdPrintAttributes");
		register_clcmd("say_team /vreauvip", "CmdPrintAttributes");

		register_clcmd("say /rd", "CmdResetDeaths");
		register_clcmd("say_team /rd", "CmdResetDeaths");
		register_clcmd("say rd", "CmdResetDeaths");
		register_clcmd("say_team rd", "CmdResetDeaths");

		register_clcmd("awp", "blockawp");

		cvar[hp_spawn] = register_cvar("vip_hp_spawn", "100");			// 0 = dezactivat
		cvar[ap_spawn] = register_cvar("vip_ap_spawn", "100");			// 0 = dezactivat
		cvar[money_spawn] = register_cvar("vip_money_spawn", "1400");		// 0 = dezactivat
		cvar[show_vip_tab] = register_cvar("vip_show_tab", "1");			// 0 = dezactivat
		cvar[show_bullet_dmg] = register_cvar("vip_show_bullet_dmg", "1");		// 0 = dezactivat
		cvar[multi_jump] = register_cvar("vip_multijump", "1");			// 0 = dezactivat. Daca valoarea cvar-ului este 1, vei sari de 2 ori. Orice valoare pui, va fi +1 jump
		cvar[hp_kill] = register_cvar("vip_hp_kill", "5");				// 0 = dezactivat
		cvar[hp_hs] = register_cvar("vip_hp_hs", "10");				// 0 = dezactivat
		cvar[ap_kill] = register_cvar("vip_ap_kill", "5");				// 0 = dezactivat
		cvar[ap_hs] = register_cvar("vip_ap_hs", "10");				// 0 = dezactivat
		cvar[hp_max] = register_cvar("vip_hp_max", "100");			// 0 = viata infinita
		cvar[money_kill] = register_cvar("vip_money_kill", "150");			// 0 = dezactivat
		cvar[money_hs] = register_cvar("vip_money_hs", "300");			// 0 = dezactivat
		cvar[parachute] = register_cvar("vip_parachute", "1");			// 0 = dezactivat
		cvar[noflash] = register_cvar("vip_noflash", "1");				// 0 = dezactivat

		max_players = get_maxplayers();
	}
	else
	{
		register_plugin(PLUGIN_NAME_PAUSED, PLUGIN_VERSION, PLUGIN_AUTHOR);
		pause("ade");
	}
	
	register_cvar("vip_", PLUGIN_VERSION, FCVAR_SPONLY|FCVAR_SERVER);
	set_cvar_string("vip_", PLUGIN_VERSION);
}

public client_putinserver(id)
{
	g_JumpNum[id] = 0;
	g_bJump[id] = false;
}

public CmdVipsOnline(id)
{
	if(!is_user_connected(id))
		return PLUGIN_CONTINUE;

	new adminnames[33][32], message[256], i, count, len;
	len = format(message, charsmax(message), "!4%s!3 VIPS ONLINE: ", TAG);
	for(i = 1 ; i <= max_players; i++)
	{
		if(is_user_connected(i) && is_user_vip(i))
			get_user_name(i, adminnames[count++], charsmax(adminnames[]));
	}
	
	if(count > 0)
	{
		for(i = 0; i < count; i++)
		{
			len += format(message[len], 255 -len, "!4%s!1%s ", adminnames, i < (count -1) ? " | " : "");
		}
		ColorChat(id, message);
	}
	else
	{
		len += format(message[len], 255 -len, "!4No one !")
		ColorChat(id, message);
	}

	return PLUGIN_CONTINUE;
}

public CmdPrintAttributes(id)
{
	if(!is_user_connected(id)) return;
	show_motd(id, "vip.txt", "Beneficii VIP");
}

public CmdResetDeaths(id)
{
	if(!is_user_vip(id))
	{
		ColorChat(id, "!4%s!1 Doar membri!3 VIP!1 isi pot reseta decesele.", TAG);
		return;
	}
	cs_set_user_deaths(id, 0);
	cs_set_user_deaths(id, 0);
	ColorChat(id, "!4%s!1 Ti-ai resetat cu succes toate decesele.", TAG);
}

public blockawp(id)
{
	if(is_user_alive(id) && !is_user_vip(id))
	{
		ColorChat(id, "!4%s!3 AWP-ul!1 este doar pentru membri VIP.", TAG);
		return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE;
}

public client_PreThink(id)
{
	new cache = get_pcvar_num(cvar[multi_jump]);
	if(is_user_alive(id) && !is_user_vip(id))
		return PLUGIN_CONTINUE;

	new nbut = get_user_button(id);
	new obut = get_user_oldbutton(id);

	if(cache != 0)
	{	
		if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
		{
			if(g_JumpNum[id] < cache)
			{
				g_bJump[id] = true;
				g_JumpNum[id]++;
				return PLUGIN_CONTINUE;
			}
		}
	
		if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
		{
			g_JumpNum[id] = 0;
			return PLUGIN_CONTINUE;
		}
	}

	if(get_pcvar_num(cvar[parachute]))
	{
		new Float:fallspeed = 100.0 * -1.0;
		if(nbut & IN_USE) 
		{
			new Float:velocity[3];
			entity_get_vector(id, EV_VEC_velocity, velocity);
			if(velocity[2] < 0.0) 
			{
				entity_set_int(id, EV_INT_sequence, 3);
				entity_set_int(id, EV_INT_gaitsequence, 1);
				entity_set_float(id, EV_FL_frame, 1.0);
				entity_set_float(id, EV_FL_framerate, 1.0);

				velocity[2] = (velocity[2] + 40.0 < fallspeed) ? velocity[2] + 40.0 : fallspeed;
				entity_set_vector(id, EV_VEC_velocity, velocity);
			}
		}
	}
	return PLUGIN_CONTINUE;
}

public client_PostThink(id)
{
	new jump_num = get_pcvar_num(cvar[multi_jump]);
	if(!jump_num)
		return PLUGIN_CONTINUE;
		
	if(is_user_alive(id) && !is_user_vip(id))
		return PLUGIN_CONTINUE;
	
	if(g_bJump[id])
	{
		new Float:fVelocity[3];
		entity_get_vector(id, EV_VEC_velocity, fVelocity);
		fVelocity[2] = random_float(265.0, 285.0);
		entity_set_vector(id, EV_VEC_velocity, fVelocity);
		
		g_bJump[id] = false;
		return PLUGIN_CONTINUE;
	}
	
	return PLUGIN_CONTINUE;
}

public event_DeathMsg()
{
	new killer = read_data(1), hs = read_data(3);	
	if(is_user_alive(killer) && is_user_vip(killer))
	{
		if(killer == read_data(2)) return PLUGIN_HANDLED;

		if(hs && !user_has_weapon(killer, CSW_HEGRENADE)) give_item(killer, "weapon_hegrenade");

		new cache = hs ? get_pcvar_num(cvar[hp_hs]) : get_pcvar_num(cvar[hp_kill]);
		if(cache != 0) set_user_health(killer, min(get_user_health(killer) + cache, get_pcvar_num(cvar[hp_max])));

		cache = hs ? get_pcvar_num(cvar[ap_hs]) : get_pcvar_num(cvar[ap_kill]);
		if(cache != 0) set_user_armor(killer, min(get_user_armor(killer) + cache, get_pcvar_num(cvar[hp_max])));

		cache = hs ? get_pcvar_num(cvar[money_hs]) : get_pcvar_num(cvar[money_kill]);
		if(cache != 0) cs_set_user_money(killer, min(cs_get_user_money(killer) + cache, 16000));
	}

	return PLUGIN_CONTINUE;
}

public event_Damage(victim)
{
	if(!get_pcvar_num(cvar[show_bullet_dmg]))
		return PLUGIN_CONTINUE;
		
	new id = get_user_attacker(victim);
	if(is_user_valid(id))
	{
		if(is_user_alive(id) && !is_user_vip(id))
			return PLUGIN_HANDLED;
		
		if(read_data(4) || read_data(5) || read_data(6))
		{		
			new iPos = ++g_iPlayerPos[id];
			if(iPos == sizeof(g_flCoords))
				iPos = g_iPlayerPos[id] = 0;
			
			new iCol = ++g_iPlayerCol[id];
			if(iCol == sizeof(g_iColors))
				iCol = g_iPlayerCol[id] = 0;
			
			set_hudmessage(g_iColors[iCol][0], g_iColors[iCol][1], g_iColors[iCol][2], Float:g_flCoords[iPos][0], Float:g_flCoords[iPos][1], 0, 0.1, 2.5, 0.02, 0.02, -1);
			show_hudmessage(id, "%d", read_data(2));
		}
	}
	
	return PLUGIN_CONTINUE;
}

public event_CurWeapon(id)
{
	if(!is_user_alive(id))
		return PLUGIN_HANDLED;

	if(!is_user_vip(id) && (pev(id, pev_weapons) & (1 << CSW_AWP)))
		engclient_cmd(id, "drop", "weapon_awp");

	return PLUGIN_CONTINUE;
}

public event_WeapPickup(id)
{
	if(!is_user_connected(id)) 
		return PLUGIN_CONTINUE;

	if(is_user_vip(id))
		return PLUGIN_CONTINUE;

	if(pev(id, pev_weapons) & (1 << CSW_AWP))
	{
		engclient_cmd(id, "drop", "weapon_awp");
		ColorChat(id, "!4%s!3 AWP-ul!1 este doar pentru membri VIP.", TAG);
		return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE;
}

public event_NewRound()
{
	rounds++;
}

public event_textmsg()
{
	rounds = 0;
}

public fw_PlayerSpawnPost(id)
{
	if(is_user_vip(id) && is_user_alive(id))
	{
		set_task(0.25, "give_items", id + 212);
		return HAM_IGNORED;
	}
	
	return HAM_IGNORED;
}

public give_items(taskid)
{
	new id = taskid - 212;
	if(!is_user_alive(id))
		return;

	new cache = get_pcvar_num(cvar[hp_spawn])
	if(cache != 0) set_user_health(id, cache);

	cache = get_pcvar_num(cvar[ap_spawn]);
	if(cache != 0) cs_set_user_armor(id, cache, CS_ARMOR_VESTHELM);

	cache = get_pcvar_num(cvar[money_spawn]);
	if(cache != 0) cs_set_user_money(id, min(cs_get_user_money(id) + cache, 16000));

	set_user_rendering(id, kRenderFxGlowShell, 0, 130, 0, kRenderNormal, 0);

	if(rounds >= 3) ShowVipMenu(id);
}

public fw_TouchWeapon(ent, id)
{
	if(is_user_alive(id) && !is_user_vip(id))
	{
		static model[128];
		pev(ent, pev_model, model, charsmax(model));

		if(equal(model, "models/w_awp.mdl"))
			return HAM_SUPERCEDE;
	}

	return HAM_IGNORED;
}

public msg_ScoreAttrib(msgid, dest, id)
{
	if(!get_pcvar_num(cvar[show_vip_tab]))
		return PLUGIN_CONTINUE;
		
	new id = get_msg_arg_int(1);
	if(is_user_connected(id) && is_user_vip(id))
		set_msg_arg_int(2, ARG_BYTE, is_user_alive(id) ? (1<<2) : (1<<0));
	
	return PLUGIN_CONTINUE;
}

public msg_ScreenFade(msgid, dest, id)
{
	if(!get_pcvar_num(cvar[noflash]))
		return PLUGIN_HANDLED;

	if(is_user_connected(id) && is_user_vip(id))
	{
		static data[4];
		data[0] = get_msg_arg_int(4);
		data[1] = get_msg_arg_int(5);
		data[2] = get_msg_arg_int(6);
		data[3] = get_msg_arg_int(7);
		
		if(data[0] == 255 && data[1] == 255 && data[2] == 255 && data[3] > 199)
			return PLUGIN_HANDLED;
	}

	return PLUGIN_CONTINUE;
}

public ShowVipMenu(id)
{
	if(!is_user_connected(id))
		return PLUGIN_HANDLED;

	if(!is_user_vip(id))
	{
		ColorChat(id, "!4%s!1 Imi pare rau, dar nu ai acces la meniul pentru!3 membrii VIP!1.", TAG);
		ColorChat(id, "!4%s!1 Poti cumpara VIP, contactand adresa Y!M:!3 %s!1.", TAG, CONTACT);
		return PLUGIN_HANDLED;
	}

	give_item(id, "weapon_hegrenade");
	give_item(id, "weapon_flashbang");
	give_item(id, "weapon_flashbang");
	drop_weapons(id, 2);
	give_item(id, "weapon_deagle");
	cs_set_user_bpammo(id, CSW_DEAGLE, 35);

	new menu = menu_create("\rMeniu VIP", "VipMenuHandler");
	menu_additem(menu, "M4A1 + Echipament", "1");
	menu_additem(menu, "AK-47 + Echipament", "2");
	menu_additem(menu, "AWP + Echipament", "3");
	
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, menu, 0);
	
	return PLUGIN_CONTINUE;
}

public VipMenuHandler(id, menu, item)
{
	if(!is_user_connected(id) || item == MENU_EXIT)
	{
		menu_destroy(menu);
		return PLUGIN_HANDLED;
	}

	new data[6], namei[64], access, CallBack;
	menu_item_getinfo(menu, item, access, data, charsmax(data), namei, charsmax(namei), CallBack);
	new key = str_to_num(data);

	switch(key)
	{
		case 1:
		{
			drop_weapons(id, 1);
			give_item(id, "weapon_m4a1");
			cs_set_user_bpammo(id, CSW_M4A1, 120);
			
			ColorChat(id, "!4%s!1 Ai ales!3 M4A1!1 +!3 Deagle!1 +!3 Set grenade!1 (!31 HE!1 + !32 FB!1).", TAG);
		}

		case 2:
		{
			drop_weapons(id, 1);
			give_item(id, "weapon_ak47");
			cs_set_user_bpammo(id, CSW_AK47, 120);
			
			ColorChat(id, "!4%s!1 Ai ales!3 AK47!1 +!3 Deagle!1 +!3 Set grenade!1 (!31 HE!1 + !32 FB!1).", TAG);
		}

		case 3:
		{
			drop_weapons(id, 1);
			give_item(id, "weapon_awp");
			cs_set_user_bpammo(id, CSW_AWP, 30);
			
			ColorChat(id, "!4%s!1 Ai ales!3 AWP!1 +!3 Deagle!1 +!3 Set grenade!1 (!31 HE!1 + !32 FB!1).", TAG);
		}
	}

	menu_destroy(menu);
	return PLUGIN_HANDLED;
}

const PRIMARY_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);
const SECONDARY_WEAPONS_BIT_SUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE);

// Drop primary/secondary weapons
stock drop_weapons(id, dropwhat)
{
	// Get user weapons
	static weapons[32], num, i, weaponid, wname[32];
	num = 0; // reset passed weapons count (bugfix)
	get_user_weapons(id, weapons, num);
	
	// Loop through them and drop primaries or secondaries
	for (i = 0; i < num; i++)
	{
		// Prevent re-indexing the array
		weaponid = weapons;
		
		if((dropwhat == 1 && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM)) || (dropwhat == 2 && ((1<<weaponid) & SECONDARY_WEAPONS_BIT_SUM)))
		{
			// Get weapon entity
			get_weaponname(weaponid, wname, charsmax(wname));
			engclient_cmd(id, "drop", wname);
		}
	}
}

stock ColorChat(id, String[], any:...) 
{
	static szMesage[192];
	vformat(szMesage, charsmax(szMesage), String, 3);
	
	replace_all(szMesage, charsmax(szMesage), "!1", "^1");
	replace_all(szMesage, charsmax(szMesage), "!3", "^3");
	replace_all(szMesage, charsmax(szMesage), "!4", "^4");
	
	static g_msg_SayText = 0;
	if(!g_msg_SayText)
		g_msg_SayText = get_user_msgid("SayText");
	
	new Players[32], iNum = 1, i;

 	if(id) Players[0] = id;
	else get_players(Players, iNum, "ch");
	
	for(--iNum; iNum >= 0; iNum--) 
	{
		i = Players[iNum];
		
		message_begin(MSG_ONE_UNRELIABLE, g_msg_SayText, _, i);
		write_byte(i);
		write_string(szMesage);
		message_end();
	}
}


Aici ai sursa. Am facut exact cum ai vrut. Are si cvar-uri pluginul.

| Afiseaza codul
[code=php]vip_hp_spawn 100        // 0 = dezactivat
vip_ap_spawn 100        // 0 = dezactivat
vip_money_spawn 1400    // 0 = dezactivat
vip_show_tab 1        // 0 = dezactivat
vip_show_bullet_dmg 1    // 0 = dezactivat
vip_multijump 1        // 0 = dezactivat. Daca valoarea cvar-ului este 1, vei sari de 2 ori. Orice valoare pui, va fi +1 jump
vip_hp_kill 5        // 0 = dezactivat
vip_hp_hs 10;        // 0 = dezactivat
vip_ap_kill 5        // 0 = dezactivat
vip_ap_hs 10        // 0 = dezactivat
vip_hp_max 100        // 0 = viata infinita
vip_money_kill 150        // 0 = dezactivat
vip_money_hs 300        // 0 = dezactivat
vip_parachute 1        // 0 = dezactivat
vip_noflash 1        // 0 = dezactivat   [/code]
Il poti modifica cum vrei tu.

Parasuta nu are model.
comenzi in chat | Afiseaza codul
[code=php]
/rd sau rd - reseteaza decesele
/vips sau vips - arata vip-ii online
/vreauvip sau vreauvip - deschide un motd in configs cu beneficiile (modt-ul ti-l faci tu in HTML) [/code]
Se va creea un fisier automat in configs, numit vip_maps.ini.
Acolo o sa adaugi hartile una sub ulta. Pe hartile respective, pluginul de vip va fi dezactivat.


Testeaza-l si vino cu replay. Nu l-am testat.

Re: Vrei un plugin VIP? Aici îl găsești

Posted: 15 Sep 2018, 14:42
by RealAlexanderTr
NIck:Alexander.
Cerinte:Sa adaugi un meniu cu arme din runda 3.
1.M4A1 +Deagle+ Echipament
2.AK-47 +Deagle+ Echipament
3.AWP +Deagle+ Echipament
.sma
| Afiseaza codul
plugin privat

Re: Vrei un plugin VIP? Aici îl găsești

Posted: 16 Sep 2018, 18:32
by burlea90
Salutare, as dori un plugin vip free daca se poate sa contina urmatoarele:

La Spawn

Deagle - 1 HE - 100 HP 100 Armura

Meniu vip

1 M4A1 Deagle 1 HE - 100 HP 100 Armura
2 AKA47 Deagle 1 HE - 100 HP 100 Armura
3 FAMAS Deagle 1 HE - 100 HP 100 Armura
4 AWP Deagle 1 HE - 100 HP 100 Armura

si multi jump daca se poate.

Ma ajuta cineva cu pluginul va rog frumos.

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

#define PLUGIN "VIP"
#define VERSION "nu stiu :))"
#define AUTHOR "A k c 3 n 7"

new const restricted_maps[ ][ ] =
{
	"35hp",                // THANK YOU YONTU
	"31hp",                // Poti adauga tu mai multe mape dupa model
	"1hp",                 // Putin asa de plictiseala https://www.youtube.com/watch?v=uv-VWTm0IuY
       	"awp_garden",
	"awp_bycastor32",
	"awp_zigzag",
	"awp_bycastor"
}

const WEAPON_BITSUM = ((1<<CSW_SCOUT) | (1<<CSW_XM1014) | (1<<CSW_MAC10) | (1<<CSW_AUG) | (1<<CSW_UMP45) | (1<<CSW_SG550) | (1<<CSW_P90) | 
(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_GALIL))

enum {
    SCOREATTRIB_ARG_PLAYERID = 1,
    SCOREATTRIB_ARG_FLAGS
}

enum ( <<= 1 ) {
    SCOREATTRIB_FLAG_NONE = 0,
    SCOREATTRIB_FLAG_DEAD = 1,
    SCOREATTRIB_FLAG_BOMB,
    SCOREATTRIB_FLAG_VIP
}

#define VIP_FLAG ADMIN_LEVEL_H

new round[33] = 0;
new cvar_jump
new jumpnum[33]
new bool: dojump[33]

public plugin_init( ) {
	
	register_plugin( PLUGIN, VERSION, AUTHOR )  
        RegisterHam(Ham_Spawn, "player", "PlayerSpawn", 1)
        cvar_jump = register_cvar("vip_jump", "1" )
}

public ShowMenu( id )
{
        new menu = menu_create( "VIP MENU", "menu_handler" )

        menu_additem( menu, "M4A1", "", 0, ADMIN_LEVEL_H )
        menu_additem( menu, "AK47", "", 0, ADMIN_LEVEL_H )

        menu_setprop( menu, MPROP_EXIT, MEXIT_ALL )      
        menu_display( id, menu, 0 )
} 

public client_putinserver( id ) {
 
       new map_name[32], i
       get_mapname(map_name, charsmax(map_name))
	
       for(i = 0; i < sizeof(restricted_maps); i++)
       {
		if(equali(map_name, restricted_maps)) 
		{
			remove_user_flags(id, VIP_FLAG)
		}
       }

       if(is_user_alive(id) && get_user_flags(id) & VIP_FLAG )
             return

       new Name[32]
       get_user_name(id, Name, sizeof ( Name ) -1 )
       ColorChat(0, GREEN, "^x04 %s^x03 VIP-ul^x03 %s^x03 s-a conectat", Name)

}

public PlayerSpawn( id ) {
	
	if( is_user_alive( id ) && get_user_flags( id ) & VIP_FLAG ) {
		
		if( round[id] == 1 ) 
		{    
			fm_give_item(id, "weapon_deagle")
                        cs_set_user_bpammo(id, CSW_DEAGLE, 35)
			
		}
		if( round[id] >= 3 ) 
		{
			ShowMenu( id )       
		}
		else
		{
			round[id]++
		}
	}
}
 
public menu_handler( id, menu, item )
{
	switch( item )
	{
		case 0:
		{
			drop_wpn(id)
			fm_give_item(id, "weapon_m4a1" )
			cs_set_user_bpammo(id, CSW_M4A1, 90 )
		}
		case 1:
		{
			drop_wpn(id)
			fm_give_item(id, "weapon_ak47" )
			cs_set_user_bpammo(id, CSW_AK47, 90 )	
		}	
	}
	
	menu_destroy( menu )
	return PLUGIN_HANDLED
}

drop_wpn(id)
{
	static weapons[32], num 
	get_user_weapons(id, weapons, num)

	for (new i = 0; i < num; i++)
	{
		if (WEAPON_BITSUM & (1<<weapons))
		{
			static wname[32] 
			get_weaponname(weapons, wname, sizeof wname - 1)

			engclient_cmd(id, "drop", wname)
		}
	}
}

public MessageScoreAttrib(iMsgId, iDest, iReceiver)
{
	new iPlayer = get_msg_arg_int(SCOREATTRIB_ARG_PLAYERID)
	
	if(get_user_flags(iPlayer) & VIP_FLAG )
		set_msg_arg_int(SCOREATTRIB_ARG_FLAGS, ARG_BYTE, SCOREATTRIB_FLAG_VIP)
}

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

	if((BUTON & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(OLDBUTON & IN_JUMP))
	{
		if(((get_user_flags(id) & VIP_FLAG) && (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
}[/code]

Re: Vrei un plugin VIP? Aici îl găsești

Posted: 19 Sep 2018, 18:04
by kaZzy Cs
YONTU wrote:Plugin VIP EVENT FUNCTIONAL
vip_event_v2.sma | Afiseaza codul
#include <amxmodx>

/*
ADMIN_IMMUNITY = flag "a"
ADMIN_RESERVATION = flag "b"
ADMIN_KICK = flag "c"
ADMIN_BAN = flag "d"
ADMIN_SLAY = flag "e"
ADMIN_MAP = flag "f"
ADMIN_CVAR = flag "g"
ADMIN_CFG = flag "h"
ADMIN_CHAT = flag "i"
ADMIN_VOTE = flag "j"
ADMIN_PASSWORD = flag "k"
ADMIN_RCON = flag "l"
ADMIN_LEVEL_A = flag "m"
ADMIN_LEVEL_B = flag "n"
ADMIN_LEVEL_C = flag "o"
ADMIN_LEVEL_D = flag "p"
ADMIN_LEVEL_E = flag "q"
ADMIN_LEVEL_F = flag "r"
ADMIN_LEVEL_G = flag "s"
ADMIN_LEVEL_H = flag "t"
ADMIN_MENU = flag "u"
ADMIN_ADMIN = flag "y"
*/

new ora = -1, bool:event_on, bool:prima_data, este_conectat[33] = {0}, are_vip[33] = {0}, are_vip2[33] = {0}, g_sync_hudmsg;

#define PLUGIN_NAME "VIP EVENT"
#define PLUGIN_VERSION "2.0"
#define PLUGIN_AUTHOR "YONTU"
#define TASK_VERIFICARE	129891


// --------------------------------------------
//   ------------- DE EDITAT ---------------
// --------------------------------------------
#define VIP_FLAG	"t"		// FLAGUL VIPULUI (vezi mai sus lista flagurilor)
#define ORA_INCEPUT	21	// INTERVALUL ORAR (INCEPUT)
#define ORA_SFARSIT	23	// INTERVALUL ORAR (SFARSIT)
// --------------------------------------------
//   ------------- DE EDITAT ---------------
// --------------------------------------------


public plugin_init()
{
	register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
	register_cvar("vipfree_", PLUGIN_VERSION, FCVAR_SPONLY|FCVAR_SERVER);
	set_cvar_string("vipfree_", PLUGIN_VERSION);

	time(ora, _, _);
	event_on = (ora >= ORA_INCEPUT && ora < ORA_SFARSIT) ? true : false;
	prima_data = true;
	arrayset(este_conectat, 0, 33);
	arrayset(are_vip, 0, 33);
	arrayset(are_vip2, 0, 33);

	g_sync_hudmsg = CreateHudSyncObj();

	set_task(60.0, "verifica_ora", TASK_VERIFICARE);
	set_task(3.0, "anunta_jucatori", TASK_VERIFICARE/random_num(2, 10));
}

public verifica_ora(task)
{
	time(ora, _, _);
	event_on = (ora >= ORA_INCEPUT && ora < ORA_SFARSIT) ? true : false;

	new jucatori[32], numar = 0, i, id;
	if(event_on)
	{
		if(prima_data)
		{
			ColorChat(id, "!4--------------------------------------------------------");
			ColorChat(id, "!4***!1 EVENTUL!3 VIP FREE!1 A FOST ACTIVAT.");
			ColorChat(id, "!4***!1 Acesta va fi dezactivat la ora!4 %d!1.", ORA_SFARSIT);
			ColorChat(id, "!4--------------------------------------------------------");

			prima_data = false;
		}

		get_players(jucatori, numar);
		for(i = 0; i < numar; i++)
		{
			id = jucatori;
			if(!este_conectat[id])
				continue;
			if(are_vip[id])
				continue;
			if(are_vip2[id])
				continue;

			are_vip2[id] = 1;
			set_user_flags(id, read_flags(VIP_FLAG));
		}
	}
	else
	{
		if(!prima_data)
		{
			get_players(jucatori, numar);
			for(i = 0; i < numar; i++)
			{
				id = jucatori;
				if(!este_conectat[id])
					continue;

				remove_user_flags(id, read_flags(VIP_FLAG));
				ColorChat(id, "!4-------------------------------------------------------------");
				ColorChat(id, "!4***!1 EVENTUL!3 VIP FREE!1 A FOST DEZACTIVAT.");
				ColorChat(id, "!4***!1 Acesta va reincepe la ora!4 %d!1.", ORA_INCEPUT);
				ColorChat(id, "!4-------------------------------------------------------------");
			}
			server_cmd("amx_default_access ^"z^"");
			server_cmd("amx_reloadadmins");
			arrayset(are_vip, 0, 33);
			arrayset(are_vip2, 0, 33);
			prima_data = true;
		}
	}

	set_task(60.0, "verifica_ora", TASK_VERIFICARE);
}

public client_disconnect(id)
{
	if(event_on)
		remove_user_flags(id, read_flags(VIP_FLAG));
}

public client_putinserver(id)
{
	este_conectat[id]++;
	set_task(3.0, "verifica_event", id);
}

public verifica_event(id)
{
	if(!event_on)
		return;

	if(este_conectat[id] == 1)
		client_print(id, print_center, "AI NIMERIT FIX LA TANC!  ESTE EVENT VIP FREE.");

	if(get_user_flags(id) & read_flags(VIP_FLAG))
		are_vip[id] = true;
	else
	{
		are_vip2[id] = true;
		set_user_flags(id, read_flags(VIP_FLAG));
	}
}

public anunta_jucatori()
{
	if(!event_on)
		return;

	set_hudmessage(0, random(256), 0, -1.0, 0.12, 1, 3.0, 3.0);
	ShowSyncHudMsg(0, g_sync_hudmsg, "~~ Event VIP ON ~~");

	set_task(3.0, "anunta_jucatori", TASK_VERIFICARE/random_num(2, 10));
}

stock ColorChat(id, String[], any:...)
{
	static szMesage[192];
	vformat(szMesage, charsmax(szMesage), String, 3);
	
	replace_all(szMesage, charsmax(szMesage), "!1", "^1");
	replace_all(szMesage, charsmax(szMesage), "!3", "^3");
	replace_all(szMesage, charsmax(szMesage), "!4", "^4");
	
	static g_msg_SayText = 0;
	if(!g_msg_SayText)
		g_msg_SayText = get_user_msgid("SayText");
	
	new Players[32], iNum = 1, i;

 	if(id) Players[0] = id;
	else get_players(Players, iNum, "ch");
	
	for(--iNum; iNum >= 0; iNum--)
	{
		i = Players[iNum];
		
		message_begin(MSG_ONE_UNRELIABLE, g_msg_SayText, _, i);
		write_byte(i);
		write_string(szMesage);
		message_end();
	}
}


Timp estimativ de lucru: 2 ore + teste
Orele se modifica din sursa, de asemenea si flagul vip-ului.
Sa va explic cum functioneaza. Intre orele setate de voi, pluginul va aplica flagul setat de asemenea de voi tuturor jucatorilor. La fiecare minut se verifica daca jucatorul respectiv a primit flagul. Daca nu, i se va seta.
Pluginul este facut de la 0, nu foloseste resurse prea multe, conditiile sunt verificate si testate.
Multi m-au rugat sa fac unul asa ca sper sa-l folositi.
Orice nelamurire provocata de plugin va rog sa mi-o spuneti.
Daca apar erori in consola, postati-le aici.

EDIT:
Au fost aduse modificari pluginului, permitand tuturor jucatorilor, inclusiv userilor din fisierul users.ini care au acces de vip sa primeasca vip in timpul eventului.
Folositi cu incredere.


@NeedlessDM: compileaza pluginul local, nu pe un site anume.


Functioneaza perfect.
Dar nu are cvar ca sal setez de acolo la ce ora si fie free si la ce ora sa se opreasca?

Re: Vrei un plugin VIP? Aici îl găsești

Posted: 20 Sep 2018, 06:15
by kaZzy Cs
YONTU wrote:Plugin VIP EVENT FUNCTIONAL
vip_event_v2.sma | Afiseaza codul
#include <amxmodx>

/*
ADMIN_IMMUNITY = flag "a"
ADMIN_RESERVATION = flag "b"
ADMIN_KICK = flag "c"
ADMIN_BAN = flag "d"
ADMIN_SLAY = flag "e"
ADMIN_MAP = flag "f"
ADMIN_CVAR = flag "g"
ADMIN_CFG = flag "h"
ADMIN_CHAT = flag "i"
ADMIN_VOTE = flag "j"
ADMIN_PASSWORD = flag "k"
ADMIN_RCON = flag "l"
ADMIN_LEVEL_A = flag "m"
ADMIN_LEVEL_B = flag "n"
ADMIN_LEVEL_C = flag "o"
ADMIN_LEVEL_D = flag "p"
ADMIN_LEVEL_E = flag "q"
ADMIN_LEVEL_F = flag "r"
ADMIN_LEVEL_G = flag "s"
ADMIN_LEVEL_H = flag "t"
ADMIN_MENU = flag "u"
ADMIN_ADMIN = flag "y"
*/

new ora = -1, bool:event_on, bool:prima_data, este_conectat[33] = {0}, are_vip[33] = {0}, are_vip2[33] = {0}, g_sync_hudmsg;

#define PLUGIN_NAME "VIP EVENT"
#define PLUGIN_VERSION "2.0"
#define PLUGIN_AUTHOR "YONTU"
#define TASK_VERIFICARE	129891


// --------------------------------------------
//   ------------- DE EDITAT ---------------
// --------------------------------------------
#define VIP_FLAG	"t"		// FLAGUL VIPULUI (vezi mai sus lista flagurilor)
#define ORA_INCEPUT	21	// INTERVALUL ORAR (INCEPUT)
#define ORA_SFARSIT	23	// INTERVALUL ORAR (SFARSIT)
// --------------------------------------------
//   ------------- DE EDITAT ---------------
// --------------------------------------------


public plugin_init()
{
	register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
	register_cvar("vipfree_", PLUGIN_VERSION, FCVAR_SPONLY|FCVAR_SERVER);
	set_cvar_string("vipfree_", PLUGIN_VERSION);

	time(ora, _, _);
	event_on = (ora >= ORA_INCEPUT && ora < ORA_SFARSIT) ? true : false;
	prima_data = true;
	arrayset(este_conectat, 0, 33);
	arrayset(are_vip, 0, 33);
	arrayset(are_vip2, 0, 33);

	g_sync_hudmsg = CreateHudSyncObj();

	set_task(60.0, "verifica_ora", TASK_VERIFICARE);
	set_task(3.0, "anunta_jucatori", TASK_VERIFICARE/random_num(2, 10));
}

public verifica_ora(task)
{
	time(ora, _, _);
	event_on = (ora >= ORA_INCEPUT && ora < ORA_SFARSIT) ? true : false;

	new jucatori[32], numar = 0, i, id;
	if(event_on)
	{
		if(prima_data)
		{
			ColorChat(id, "!4--------------------------------------------------------");
			ColorChat(id, "!4***!1 EVENTUL!3 VIP FREE!1 A FOST ACTIVAT.");
			ColorChat(id, "!4***!1 Acesta va fi dezactivat la ora!4 %d!1.", ORA_SFARSIT);
			ColorChat(id, "!4--------------------------------------------------------");

			prima_data = false;
		}

		get_players(jucatori, numar);
		for(i = 0; i < numar; i++)
		{
			id = jucatori;
			if(!este_conectat[id])
				continue;
			if(are_vip[id])
				continue;
			if(are_vip2[id])
				continue;

			are_vip2[id] = 1;
			set_user_flags(id, read_flags(VIP_FLAG));
		}
	}
	else
	{
		if(!prima_data)
		{
			get_players(jucatori, numar);
			for(i = 0; i < numar; i++)
			{
				id = jucatori;
				if(!este_conectat[id])
					continue;

				remove_user_flags(id, read_flags(VIP_FLAG));
				ColorChat(id, "!4-------------------------------------------------------------");
				ColorChat(id, "!4***!1 EVENTUL!3 VIP FREE!1 A FOST DEZACTIVAT.");
				ColorChat(id, "!4***!1 Acesta va reincepe la ora!4 %d!1.", ORA_INCEPUT);
				ColorChat(id, "!4-------------------------------------------------------------");
			}
			server_cmd("amx_default_access ^"z^"");
			server_cmd("amx_reloadadmins");
			arrayset(are_vip, 0, 33);
			arrayset(are_vip2, 0, 33);
			prima_data = true;
		}
	}

	set_task(60.0, "verifica_ora", TASK_VERIFICARE);
}

public client_disconnect(id)
{
	if(event_on)
		remove_user_flags(id, read_flags(VIP_FLAG));
}

public client_putinserver(id)
{
	este_conectat[id]++;
	set_task(3.0, "verifica_event", id);
}

public verifica_event(id)
{
	if(!event_on)
		return;

	if(este_conectat[id] == 1)
		client_print(id, print_center, "AI NIMERIT FIX LA TANC!  ESTE EVENT VIP FREE.");

	if(get_user_flags(id) & read_flags(VIP_FLAG))
		are_vip[id] = true;
	else
	{
		are_vip2[id] = true;
		set_user_flags(id, read_flags(VIP_FLAG));
	}
}

public anunta_jucatori()
{
	if(!event_on)
		return;

	set_hudmessage(0, random(256), 0, -1.0, 0.12, 1, 3.0, 3.0);
	ShowSyncHudMsg(0, g_sync_hudmsg, "~~ Event VIP ON ~~");

	set_task(3.0, "anunta_jucatori", TASK_VERIFICARE/random_num(2, 10));
}

stock ColorChat(id, String[], any:...)
{
	static szMesage[192];
	vformat(szMesage, charsmax(szMesage), String, 3);
	
	replace_all(szMesage, charsmax(szMesage), "!1", "^1");
	replace_all(szMesage, charsmax(szMesage), "!3", "^3");
	replace_all(szMesage, charsmax(szMesage), "!4", "^4");
	
	static g_msg_SayText = 0;
	if(!g_msg_SayText)
		g_msg_SayText = get_user_msgid("SayText");
	
	new Players[32], iNum = 1, i;

 	if(id) Players[0] = id;
	else get_players(Players, iNum, "ch");
	
	for(--iNum; iNum >= 0; iNum--)
	{
		i = Players[iNum];
		
		message_begin(MSG_ONE_UNRELIABLE, g_msg_SayText, _, i);
		write_byte(i);
		write_string(szMesage);
		message_end();
	}
}


Timp estimativ de lucru: 2 ore + teste
Orele se modifica din sursa, de asemenea si flagul vip-ului.
Sa va explic cum functioneaza. Intre orele setate de voi, pluginul va aplica flagul setat de asemenea de voi tuturor jucatorilor. La fiecare minut se verifica daca jucatorul respectiv a primit flagul. Daca nu, i se va seta.
Pluginul este facut de la 0, nu foloseste resurse prea multe, conditiile sunt verificate si testate.
Multi m-au rugat sa fac unul asa ca sper sa-l folositi.
Orice nelamurire provocata de plugin va rog sa mi-o spuneti.
Daca apar erori in consola, postati-le aici.

EDIT:
Au fost aduse modificari pluginului, permitand tuturor jucatorilor, inclusiv userilor din fisierul users.ini care au acces de vip sa primeasca vip in timpul eventului.
Folositi cu incredere.


@NeedlessDM: compileaza pluginul local, nu pe un site anume.


Dc nu mi se activeaza de la orele 21 pana la ora 10 dimineata

Re: Vrei un plugin VIP? Aici îl găsești

Posted: 20 Sep 2018, 11:19
by Laurentiu P.
Verifica in sursa daca ai setat bine orele si flagul vipului.

Re: Vrei un plugin VIP? Aici îl găsești

Posted: 20 Sep 2018, 18:09
by kaZzy Cs
da le-am setat am pus si flagul vipului si uite ce imi arata in consola
ML_NOTFOUND: PREFIX_LOAD_FLAG
ML_NOTFOUND: PREFIX_LOAD_STEAMID
ML_NOTFOUND: PREFIX_LOAD_STEAMID
ML_NOTFOUND: PREFIX_LOAD_NAME
ML_NOTFOUND: PREFIX_LOAD_FLAG
ML_NOTFOUND: PREFIX_LOAD_FLAG
ML_NOTFOUND: PREFIX_LOAD_FLAG
ML_NOTFOUND: PREFIX_LOAD_FLAG
ML_NOTFOUND: PREFIX_LOAD_FLAG
ML_NOTFOUND: PREFIX_LOAD_FLAG
ML_NOTFOUND: PREFIX_LOAD_FLAG
ML_NOTFOUND: PREFIX_LOAD_FLAG
ML_NOTFOUND: PREFIX_LOAD_FLAG
ML_NOTFOUND: PREFIX_LOAD_FLAG
ML_NOTFOUND: PREFIX_LOAD_FLAG
ML_NOTFOUND: PREFIX_LOAD_FLAG
ML_NOTFOUND: PREFIX_LOAD_FLAG
ML_NOTFOUND: PREFIX_LOAD_NAME
ML_NOTFOUND: PREFIX_LOAD_NAME
ML_NOTFOUND: PREFIX_LOAD_FLAG
ML_NOTFOUND: PREFIX_LOAD_STEAMID
ML_NOTFOUND: PREFIX_LOAD_NAME
ML_NOTFOUND: PREFIX_LOAD_NAME
ML_NOTFOUND: PREFIX_LOAD_NAME
ML_NOTFOUND: PREFIX_LOAD_NAME
ML_NOTFOUND: PREFIX_LOAD_NAME
ML_NOTFOUND: PREFIX_LOAD_FLAG
ML_NOTFOUND: PREFIX_LOAD_FLAG
ML_NOTFOUND: PREFIX_LOAD_FLAG
ML_NOTFOUND: PREFIX_LOAD_FLAG
ML_NOTFOUND: PREFIX_LOAD_FLAG
ML_NOTFOUND: PREFIX_LOADED_BY
ML_NOTFOUND: PREFIX_LOADED
************************************************
ML_NOTFOUND: BADP_OFF
Executing AMX Mod X Configuration File

Re: Vrei un plugin VIP? Aici îl găsești

Posted: 22 Sep 2018, 17:16
by luciann1tap
Nick:luciann1tap
Flag:bit
Cerinte VIP:
1.Acces la ADMIN CHAT
2.Cand scriu /vreauvip sa apara un meniu cu ce ofera pluginul si de unde l pot cumpara!
3.Sa primesc 1HE, 2FB si ARMURA FULL in fiecare runda.
4.Sa apara in TAB, VIP
5.Vreau maxim HP si AP sa fie 100!
6.Double jump si bullet dmg dat cu albastru si cand iau dmg sa fie cu rosu (daca se poate)
7.10HP pe kill si 20 pe HS
8.Cand scriu /vips sa arate vipii online!
9.Daca se poate si meniul cu AK47+DEAGLE si M4A1+DEAGLE
10.Sa fie dezactivat pe mapele tip AWP

Re: Vrei un plugin VIP? Aici îl găsești

Posted: 23 Sep 2018, 14:16
by hellboynv
Am luat un plugin de vip de la tine YONTU, si imi place foarte mult, mai ales cum l-ai creat, totul i se potriveste...
Insa, ai putea sa-i mai adaugi in .sma-ul acela, niste linii care sa creeze un vip-list.ini in care, pluginul sa nu mai depinda de flag-uri ci de vip-list.ini, iar pe cine adaug in acea fila, sa primeasca vip..
Si daca ai putea sa adaugi si comanda "amx_addvip" care atunci cand o scriu pe server, sa pot sa aleg gen "amx_addvip <name | userid> cu parola sau fara, este oricum ok.
Iar dupa ce am adaugat gen "amx_addvip yontu" sa te redirectioneze in vip-list.ini..

Aici este sursa ta. =>
| Afiseaza codul
#include <amxmodx>
#include <hamsandwich>
#include <engine>
#include <cstrike>
#include <fun>
#include <fakemeta>


new const TAG[] = "[SERVERUL.TAU.RO";		// TAGUL IN CHAT CARE APARE
new const CONTACT[] = "skype ---------- sau steam --------";

#define is_user_vip(%1) (get_user_flags(%1) & read_flags("y"))

#define PLUGIN_NAME "VIP System "
#define PLUGIN_NAME_PAUSED "VIP System [OPRIT]"
#define PLUGIN_VERSION "1.4"
#define PLUGIN_AUTHOR "YONTU"

#define is_user_valid(%1) (1 <= %1 <= max_players)

enum cvars
{
	hp_spawn = 0,
	ap_spawn,
	money_spawn,
	hp_kill,
	hp_hs,
	ap_kill,
	ap_hs,
	hp_max,
	money_kill,
	money_hs,
	show_vip_tab,
	show_bullet_dmg,
	multi_jump,
	noflash
}

new cvar[cvars], rounds = 0;
new max_players;
new bool:g_bJump[33] = false, g_JumpNum[33] = 0;
new g_iPlayerPos[33], g_iPlayerCol[33];

// NU SCHIMBA
new const Float:g_flCoords[][] =  
{ 
	{0.50, 0.40}, 
	{0.56, 0.44}, 
	{0.60, 0.50}, 
	{0.56, 0.56}, 
	{0.50, 0.60}, 
	{0.44, 0.56}, 
	{0.40, 0.50}, 
	{0.44, 0.44} 
}

// NU SCHIMBA VALORILE DEJA EXISTENTE. Poti adauga mai multe culori, respectand matricea
new const g_iColors[][] = 
{ 
	{0, 127, 255}, // blue 
	{255, 127, 0}, // orange 
	{127, 0, 255}, // purple 
	{255, 0, 0}, // red 
	{255, 100, 150}, // pink
	{0, 255, 0} // green
}

public plugin_init()
{	
	new path[64];
	get_localinfo("amxx_configsdir", path, charsmax(path));
	formatex(path, charsmax(path), "%s/vip_maps.ini", path);
	
	new file = fopen(path, "r+");
	
	if(!file_exists(path))
	{
		write_file(path, "; VIP-UL ESTE DEZACTIVAT PE URMATOARELE HARTI: ");
		write_file(path, "; Exemplu de adaugare HARTA:^n; ^"harta^"^n^nfy_snow^ncss_bycastor");
	}
	
	new mapname[32];
	get_mapname(mapname, charsmax(mapname));
	
	new text[121], maptext[32], bool:remove_vip = false;
	while(!feof(file))
	{
		fgets(file, text, charsmax(text));
		trim(text);
		
		if(text[0] == ';' || !strlen(text)) 
		{
			continue; 
		}
		
		parse(text, maptext, charsmax(maptext));
		
		if(equal(maptext, mapname))
		{
			log_amx("Am dezactivat pluginul 'VIP' pe harta %s.", maptext);
			remove_vip = true;
			break;
		}
		
	}
	
	
	fclose(file);
	
	if(!remove_vip)
	{
		register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);

		register_event("DeathMsg", "event_DeathMsg", "a");
		register_event("Damage", "event_Damage", "b", "2>0", "3=0");
		register_event("HLTV", "event_NewRound", "a", "1=0", "2=0");
		register_event("TextMsg", "event_textmsg", "a", "2=#Game_will_restart_in")

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

		register_message(get_user_msgid("ScoreAttrib"), "msg_ScoreAttrib");
		register_message(get_user_msgid("ScreenFade"), "msg_ScreenFade");

		register_clcmd("say /vips", "CmdVipsOnline");
		register_clcmd("say_team /vips", "CmdVipsOnline");
		register_clcmd("say vips", "CmdVipsOnline");
		register_clcmd("say_team vips", "CmdVipsOnline");
		
		register_clcmd("say vreauvip", "CmdPrintAttributes");
		register_clcmd("say_team vreauvip", "CmdPrintAttributes");
		register_clcmd("say /vreauvip", "CmdPrintAttributes");
		register_clcmd("say_team /vreauvip", "CmdPrintAttributes");

		cvar[hp_spawn] = register_cvar("vip_hp_spawn", "100");			// 0 = dezactivat
		cvar[ap_spawn] = register_cvar("vip_ap_spawn", "100");			// 0 = dezactivat
		cvar[money_spawn] = register_cvar("vip_money_spawn", "1400");		// 0 = dezactivat
		cvar[show_vip_tab] = register_cvar("vip_show_tab", "1");			// 0 = dezactivat
		cvar[show_bullet_dmg] = register_cvar("vip_show_bullet_dmg", "1");		// 0 = dezactivat
		cvar[multi_jump] = register_cvar("vip_multijump", "1");			// 0 = dezactivat. Daca valoarea cvar-ului este 1, vei sari de 2 ori. Orice valoare pui, va fi +1 jump
		cvar[hp_kill] = register_cvar("vip_hp_kill", "5");				// 0 = dezactivat
		cvar[hp_hs] = register_cvar("vip_hp_hs", "10");				// 0 = dezactivat
		cvar[ap_kill] = register_cvar("vip_ap_kill", "5");				// 0 = dezactivat
		cvar[ap_hs] = register_cvar("vip_ap_hs", "10");				// 0 = dezactivat
		cvar[hp_max] = register_cvar("vip_hp_max", "100");			// 0 = viata infinita
		cvar[money_kill] = register_cvar("vip_money_kill", "150");			// 0 = dezactivat
		cvar[money_hs] = register_cvar("vip_money_hs", "300");			// 0 = dezactivat
		cvar[noflash] = register_cvar("vip_noflash", "1");				// 0 = dezactivat

		max_players = get_maxplayers();
	}
	else
	{
		register_plugin(PLUGIN_NAME_PAUSED, PLUGIN_VERSION, PLUGIN_AUTHOR);
		pause("ade");
	}
	
	register_cvar("vip_", PLUGIN_VERSION, FCVAR_SPONLY|FCVAR_SERVER);
	set_cvar_string("vip_", PLUGIN_VERSION);
}

public client_putinserver(id)
{
	g_JumpNum[id] = 0;
	g_bJump[id] = false;
}

public CmdVipsOnline(id)
{
	if(!is_user_connected(id))
		return PLUGIN_CONTINUE;

	new adminnames[33][32], message[256], i, count, len;
	len = format(message, charsmax(message), "!4%s!3 VIPS ONLINE: ", TAG);
	for(i = 1 ; i <= max_players; i++)
	{
		if(is_user_connected(i) && is_user_vip(i))
			get_user_name(i, adminnames[count++], charsmax(adminnames[]));
	}
	
	if(count > 0)
	{
		for(i = 0; i < count; i++)
		{
			len += format(message[len], 255 -len, "!4%s!1%s ", adminnames, i < (count -1) ? " | " : "");
		}
		ColorChat(id, message);
	}
	else
	{
		len += format(message[len], 255 -len, "!4No one !")
		ColorChat(id, message);
	}

	return PLUGIN_CONTINUE;
}

public CmdPrintAttributes(id)
{
	if(!is_user_connected(id)) return;
	show_motd(id, "vip.txt", "Beneficii VIP");
}

public client_PreThink(id)
{
	new cache = get_pcvar_num(cvar[multi_jump]);
	if(is_user_alive(id) && !is_user_vip(id))
		return PLUGIN_CONTINUE;

	new nbut = get_user_button(id);
	new obut = get_user_oldbutton(id);

	if(cache != 0)
	{	
		if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
		{
			if(g_JumpNum[id] < cache)
			{
				g_bJump[id] = true;
				g_JumpNum[id]++;
				return PLUGIN_CONTINUE;
			}
		}
	
		if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
		{
			g_JumpNum[id] = 0;
			return PLUGIN_CONTINUE;
		}
	}
	return PLUGIN_CONTINUE;
}

public client_PostThink(id)
{
	new jump_num = get_pcvar_num(cvar[multi_jump]);
	if(!jump_num)
		return PLUGIN_CONTINUE;
		
	if(is_user_alive(id) && !is_user_vip(id))
		return PLUGIN_CONTINUE;
	
	if(g_bJump[id])
	{
		new Float:fVelocity[3];
		entity_get_vector(id, EV_VEC_velocity, fVelocity);
		fVelocity[2] = random_float(265.0, 285.0);
		entity_set_vector(id, EV_VEC_velocity, fVelocity);
		
		g_bJump[id] = false;
		return PLUGIN_CONTINUE;
	}
	
	return PLUGIN_CONTINUE;
}

public event_DeathMsg()
{
	new killer = read_data(1), hs = read_data(3);	
	if(is_user_alive(killer) && is_user_vip(killer))
	{
		if(killer == read_data(2)) return PLUGIN_HANDLED;

		if(hs && !user_has_weapon(killer, CSW_HEGRENADE)) give_item(killer, "weapon_hegrenade");

		new cache = hs ? get_pcvar_num(cvar[hp_hs]) : get_pcvar_num(cvar[hp_kill]);
		if(cache != 0) set_user_health(killer, min(get_user_health(killer) + cache, get_pcvar_num(cvar[hp_max])));

		cache = hs ? get_pcvar_num(cvar[ap_hs]) : get_pcvar_num(cvar[ap_kill]);
		if(cache != 0) set_user_armor(killer, min(get_user_armor(killer) + cache, get_pcvar_num(cvar[hp_max])));

		cache = hs ? get_pcvar_num(cvar[money_hs]) : get_pcvar_num(cvar[money_kill]);
		if(cache != 0) cs_set_user_money(killer, min(cs_get_user_money(killer) + cache, 16000));
	}

	return PLUGIN_CONTINUE;
}

public event_Damage(victim)
{
	if(!get_pcvar_num(cvar[show_bullet_dmg]))
		return PLUGIN_CONTINUE;
		
	new id = get_user_attacker(victim);
	if(is_user_valid(id))
	{
		if(is_user_alive(id) && !is_user_vip(id))
			return PLUGIN_HANDLED;
		
		if(read_data(4) || read_data(5) || read_data(6))
		{		
			new iPos = ++g_iPlayerPos[id];
			if(iPos == sizeof(g_flCoords))
				iPos = g_iPlayerPos[id] = 0;
			
			new iCol = ++g_iPlayerCol[id];
			if(iCol == sizeof(g_iColors))
				iCol = g_iPlayerCol[id] = 0;
			
			set_hudmessage(g_iColors[iCol][0], g_iColors[iCol][1], g_iColors[iCol][2], Float:g_flCoords[iPos][0], Float:g_flCoords[iPos][1], 0, 0.1, 2.5, 0.02, 0.02, -1);
			show_hudmessage(id, "%d", read_data(2));
		}
	}
	
	return PLUGIN_CONTINUE;
}

public event_NewRound()
{
	rounds++;
}

public event_textmsg()
{
	rounds = 0;
}

public fw_PlayerSpawnPost(id)
{
	if(is_user_vip(id) && is_user_alive(id))
	{
		set_task(0.25, "give_items", id + 212);
		return HAM_IGNORED;
	}
	
	return HAM_IGNORED;
}

public give_items(taskid)
{
	new id = taskid - 212;
	if(!is_user_alive(id))
		return;

	new cache = get_pcvar_num(cvar[hp_spawn])
	if(cache != 0) set_user_health(id, cache);

	cache = get_pcvar_num(cvar[ap_spawn]);
	if(cache != 0) cs_set_user_armor(id, cache, CS_ARMOR_VESTHELM);

	cache = get_pcvar_num(cvar[money_spawn]);
	if(cache != 0) cs_set_user_money(id, min(cs_get_user_money(id) + cache, 16000));

	if(rounds >= 3) ShowVipMenu(id);
}

public msg_ScoreAttrib(msgid, dest, id)
{
	if(!get_pcvar_num(cvar[show_vip_tab]))
		return PLUGIN_CONTINUE;
		
	new id = get_msg_arg_int(1);
	if(is_user_connected(id) && is_user_vip(id))
		set_msg_arg_int(2, ARG_BYTE, is_user_alive(id) ? (1<<2) : (1<<0));
	
	return PLUGIN_CONTINUE;
}

public msg_ScreenFade(msgid, dest, id)
{
	if(!get_pcvar_num(cvar[noflash]))
		return PLUGIN_HANDLED;

	if(is_user_connected(id) && is_user_vip(id))
	{
		static data[4];
		data[0] = get_msg_arg_int(4);
		data[1] = get_msg_arg_int(5);
		data[2] = get_msg_arg_int(6);
		data[3] = get_msg_arg_int(7);
		
		if(data[0] == 255 && data[1] == 255 && data[2] == 255 && data[3] > 199)
			return PLUGIN_HANDLED;
	}

	return PLUGIN_CONTINUE;
}

public ShowVipMenu(id)
{
	if(!is_user_connected(id))
		return PLUGIN_HANDLED;

	if(!is_user_vip(id))
	{
		ColorChat(id, "!4%s!1 Imi pare rau, dar nu ai acces la meniul pentru!3 membrii VIP!1.", TAG);
		ColorChat(id, "!4%s!1 Poti cumpara VIP, contactand adresa Y!M:!3 %s!1.", TAG, CONTACT);
		return PLUGIN_HANDLED;
	}

	give_item(id, "weapon_hegrenade");
	give_item(id, "weapon_flashbang");
	give_item(id, "weapon_flashbang");
	drop_weapons(id, 2);
	give_item(id, "weapon_deagle");
	cs_set_user_bpammo(id, CSW_DEAGLE, 35);

	new menu = menu_create("\rMeniu VIP", "VipMenuHandler");
	menu_additem(menu, "M4A1 + Echipament", "1");
	menu_additem(menu, "AK-47 + Echipament", "2");
	menu_additem(menu, "AWP + Echipament", "3");
	
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, menu, 0);
	
	return PLUGIN_CONTINUE;
}

public VipMenuHandler(id, menu, item)
{
	if(!is_user_connected(id) || item == MENU_EXIT)
	{
		menu_destroy(menu);
		return PLUGIN_HANDLED;
	}

	switch(item)
	{
		case 0:
		{
			drop_weapons(id, 1);
			give_item(id, "weapon_m4a1");
			cs_set_user_bpammo(id, CSW_M4A1, 120);
			
			ColorChat(id, "!4%s!1 Ai ales!3 M4A1!1 +!3 Deagle!1 +!3 Set grenade!1 (!31 HE!1 + !32 FB!1).", TAG);
		}

		case 1:
		{
			drop_weapons(id, 1);
			give_item(id, "weapon_ak47");
			cs_set_user_bpammo(id, CSW_AK47, 120);
			
			ColorChat(id, "!4%s!1 Ai ales!3 AK47!1 +!3 Deagle!1 +!3 Set grenade!1 (!31 HE!1 + !32 FB!1).", TAG);
		}

		case 2:
		{
			drop_weapons(id, 1);
			give_item(id, "weapon_awp");
			cs_set_user_bpammo(id, CSW_AWP, 30);
			
			ColorChat(id, "!4%s!1 Ai ales!3 AWP!1 +!3 Deagle!1 +!3 Set grenade!1 (!31 HE!1 + !32 FB!1).", TAG);
		}
	}

	menu_destroy(menu);
	return PLUGIN_HANDLED;
}

const PRIMARY_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);
const SECONDARY_WEAPONS_BIT_SUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE);

// Drop primary/secondary weapons
stock drop_weapons(id, dropwhat)
{
	// Get user weapons
	static weapons[32], num, i, weaponid, wname[32];
	num = 0; // reset passed weapons count (bugfix)
	get_user_weapons(id, weapons, num);
	
	// Loop through them and drop primaries or secondaries
	for (i = 0; i < num; i++)
	{
		// Prevent re-indexing the array
		weaponid = weapons;
		
		if((dropwhat == 1 && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM)) || (dropwhat == 2 && ((1<<weaponid) & SECONDARY_WEAPONS_BIT_SUM)))
		{
			// Get weapon entity
			get_weaponname(weaponid, wname, charsmax(wname));
			engclient_cmd(id, "drop", wname);
		}
	}
}

stock ColorChat(id, String[], any:...) 
{
	static szMesage[192];
	vformat(szMesage, charsmax(szMesage), String, 3);
	
	replace_all(szMesage, charsmax(szMesage), "!1", "^1");
	replace_all(szMesage, charsmax(szMesage), "!3", "^3");
	replace_all(szMesage, charsmax(szMesage), "!4", "^4");
	
	static g_msg_SayText = 0;
	if(!g_msg_SayText)
		g_msg_SayText = get_user_msgid("SayText");
	
	new Players[32], iNum = 1, i;

 	if(id) Players[0] = id;
	else get_players(Players, iNum, "ch");
	
	for(--iNum; iNum >= 0; iNum--) 
	{
		i = Players[iNum];
		
		message_begin(MSG_ONE_UNRELIABLE, g_msg_SayText, _, i);
		write_byte(i);
		write_string(szMesage);
		message_end();
	}
}

Re: Vrei un plugin VIP? Aici îl găsești

Posted: 24 Sep 2018, 18:44
by Jucks
Nick : Jucks
Cerere plugin vip

Detali despre beneficii:
- viteza extra, gen 1000 unitati/secunda
- gravitatie mai mica sau un knife cu ea
- ar merge un knife cu viteza 1000 + gravitatie 350
- acces rope/hook all time
- imunitate/nume rezervat/acces comanzi amxx - le faci din flaguri
- acces la o comanda de teleport ar merge
- double jump
- VIP in tabscore
- glowmenu cu diferite culori
- skin special pentru VIP http://www.mediafire.com/file/x0bqcaloej39b9m/Cat.mdl
- ar merge umblat si pe la timer putin, gen la fiecare cursa sa i se scada 10% din timpul pe care la facut initial.
Mersi

Re: Vrei un plugin VIP? Aici îl găsești

Posted: 02 Oct 2018, 03:44
by NemeSyS17
YONTU wrote:
marvel_team wrote:Nick : bRiCk-baZuka
Server Name : MARVEL.CSMANIA.RO
Mod Server : CSGO Remake.
Cerinte : Plugin VIP
Flag : bit
Beneficii VIP :

-HP : 15 la frag normal ,30 la hs + un he free ( sa nu poate detine mai mult de 1he odata )
-AP : 15 la frag normal ,30 la hs
-150 $ bonus la frag normal ,maxim 16000 $
-300 $ bonus la hs
-Parasuta doar pentru membrii VIP
-Doble Jump doar pentru membrii VIP
-Sa nu creasca / depaseasca viata mai mult de 100
-Sa poata sa foloseasca admin chat
-ViP-ul sa fie imun la flash-uri
-AWP-ul sa fie doar pentru vip ,Sa primeasca drop daca un alt jucator ridica awp de jos si nu este vip .gen sa nu poata sa foloseasca awp-ul deloc.
-Menu VIP
1.M4a1 ,Deagle si set grenazi (HE si Flash) fara smoke
2.AK47 ,deagle si set grenazi (HE si Flash) fara smoke
3.AWP ,deagle si set grenazi (HE si Flash) fara smoke
-VIP free event : 20:00 / 08:00
-Comanda cu /vreauvip in chat cu deschidere de motd sau in consola care sa arate beneficiile + un mesaj care sa ruleze la 60 secunde gen ,pentru a vedea beneficiile si pretul pentru vip asteaza : /vreauvip
-Un fel de glow / straluciere sau ceva pentru membrii vip gen sa iasa in evidenta
-Sa apara tag-ul VIP in TAB
-Meniul sa fie disponibil doar dupa runda a 3 a ,eu am warmup ,deci dupa rs sa fie contorizata runda
-VIP-ul incepe runda cu 100HP ,100AP ,1400 $
-Sa se dezactiveze automat pe harta css_bycastor
-Sa arate damge-ul facut in timp real
-Sa isi reseteze doar decesele
-Slot rezervat / Nume rezervat
| Afiseaza codul
/*
CREDITE:
ConnorMcLeod - pentru bullet damage
twistedeuphoria - pentru multi jump
cheap_suit - cateva bucati de cod extrase din biohazard
*/


#include <amxmodx>
#include <hamsandwich>
#include <engine>
#include <cstrike>
#include <fun>
#include <fakemeta>

// --------------------------------------------
//   ------------- DE EDITAT ---------------
// --------------------------------------------
new const TAG[] = "[SERVERUL_TAU]";		// TAGUL IN CHAT CARE APARE
new const CONTACT[] = "O ADRESA DE CONTACT";

#define is_user_vip(%1) (get_user_flags(%1) & read_flags("bit"))
// --------------------------------------------
//   ------------- DE EDITAT ---------------
// --------------------------------------------

#define PLUGIN_NAME "VIP System"
#define PLUGIN_NAME_PAUSED "VIP System [OPRIT]"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "YONTU"

#define is_user_valid(%1) (1 <= %1 <= max_players)

enum cvars
{
	hp_spawn = 0,
	ap_spawn,
	money_spawn,
	hp_kill,
	hp_hs,
	ap_kill,
	ap_hs,
	hp_max,
	money_kill,
	money_hs,
	show_vip_tab,
	show_bullet_dmg,
	multi_jump,
	parachute,
	noflash
}

new cvar[cvars], rounds = 0;
new max_players;
new bool:g_bJump[33] = false, g_JumpNum[33] = 0;
new g_iPlayerPos[33], g_iPlayerCol[33];

// NU SCHIMBA
new const Float:g_flCoords[][] =  
{ 
	{0.50, 0.40}, 
	{0.56, 0.44}, 
	{0.60, 0.50}, 
	{0.56, 0.56}, 
	{0.50, 0.60}, 
	{0.44, 0.56}, 
	{0.40, 0.50}, 
	{0.44, 0.44} 
}

// NU SCHIMBA VALORILE DEJA EXISTENTE. Poti adauga mai multe culori, respectand matricea
new const g_iColors[][] = 
{ 
	{0, 127, 255}, // blue 
	{255, 127, 0}, // orange 
	{127, 0, 255}, // purple 
	{255, 0, 0}, // red 
	{255, 100, 150}, // pink
	{0, 255, 0} // green
}

public plugin_init()
{	
	new path[64];
	get_localinfo("amxx_configsdir", path, charsmax(path));
	formatex(path, charsmax(path), "%s/vip_maps.ini", path);
	
	new file = fopen(path, "r+");
	
	if(!file_exists(path))
	{
		write_file(path, "; VIP-UL ESTE DEZACTIVAT PE URMATOARELE HARTI: ");
		write_file(path, "; Exemplu de adaugare HARTA:^n; ^"harta^"^n^nfy_snow^ncss_bycastor");
	}
	
	new mapname[32];
	get_mapname(mapname, charsmax(mapname));
	
	new text[121], maptext[32], bool:remove_vip = false;
	while(!feof(file))
	{
		fgets(file, text, charsmax(text));
		trim(text);
		
		if(text[0] == ';' || !strlen(text)) 
		{
			continue; 
		}
		
		parse(text, maptext, charsmax(maptext));
		
		if(equal(maptext, mapname))
		{
			log_amx("Am dezactivat pluginul 'VIP' pe harta %s.", maptext);
			remove_vip = true;
			break;
		}
		
	}
	fclose(file);
	
	if(!remove_vip)
	{
		register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);

		register_event("DeathMsg", "event_DeathMsg", "a");
		register_event("Damage", "event_Damage", "b", "2>0", "3=0");
		register_event("CurWeapon", "event_CurWeapon", "be", "1=1");
		register_event("WeapPickup", "event_WeapPickup", "b");
		register_event("HLTV", "event_NewRound", "a", "1=0", "2=0");
		register_event("TextMsg", "event_textmsg", "a", "2=#Game_will_restart_in")

		RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawnPost", 1);
		RegisterHam(Ham_Touch, "weaponbox", "fw_TouchWeapon");

		register_message(get_user_msgid("ScoreAttrib"), "msg_ScoreAttrib");
		register_message(get_user_msgid("ScreenFade"), "msg_ScreenFade");

		register_clcmd("say /vips", "CmdVipsOnline");
		register_clcmd("say_team /vips", "CmdVipsOnline");
		register_clcmd("say vips", "CmdVipsOnline");
		register_clcmd("say_team vips", "CmdVipsOnline");
		
		register_clcmd("say vreauvip", "CmdPrintAttributes");
		register_clcmd("say_team vreauvip", "CmdPrintAttributes");
		register_clcmd("say /vreauvip", "CmdPrintAttributes");
		register_clcmd("say_team /vreauvip", "CmdPrintAttributes");

		register_clcmd("say /rd", "CmdResetDeaths");
		register_clcmd("say_team /rd", "CmdResetDeaths");
		register_clcmd("say rd", "CmdResetDeaths");
		register_clcmd("say_team rd", "CmdResetDeaths");

		register_clcmd("awp", "blockawp");

		cvar[hp_spawn] = register_cvar("vip_hp_spawn", "100");			// 0 = dezactivat
		cvar[ap_spawn] = register_cvar("vip_ap_spawn", "100");			// 0 = dezactivat
		cvar[money_spawn] = register_cvar("vip_money_spawn", "1400");		// 0 = dezactivat
		cvar[show_vip_tab] = register_cvar("vip_show_tab", "1");			// 0 = dezactivat
		cvar[show_bullet_dmg] = register_cvar("vip_show_bullet_dmg", "1");		// 0 = dezactivat
		cvar[multi_jump] = register_cvar("vip_multijump", "1");			// 0 = dezactivat. Daca valoarea cvar-ului este 1, vei sari de 2 ori. Orice valoare pui, va fi +1 jump
		cvar[hp_kill] = register_cvar("vip_hp_kill", "5");				// 0 = dezactivat
		cvar[hp_hs] = register_cvar("vip_hp_hs", "10");				// 0 = dezactivat
		cvar[ap_kill] = register_cvar("vip_ap_kill", "5");				// 0 = dezactivat
		cvar[ap_hs] = register_cvar("vip_ap_hs", "10");				// 0 = dezactivat
		cvar[hp_max] = register_cvar("vip_hp_max", "100");			// 0 = viata infinita
		cvar[money_kill] = register_cvar("vip_money_kill", "150");			// 0 = dezactivat
		cvar[money_hs] = register_cvar("vip_money_hs", "300");			// 0 = dezactivat
		cvar[parachute] = register_cvar("vip_parachute", "1");			// 0 = dezactivat
		cvar[noflash] = register_cvar("vip_noflash", "1");				// 0 = dezactivat

		max_players = get_maxplayers();
	}
	else
	{
		register_plugin(PLUGIN_NAME_PAUSED, PLUGIN_VERSION, PLUGIN_AUTHOR);
		pause("ade");
	}
	
	register_cvar("vip_", PLUGIN_VERSION, FCVAR_SPONLY|FCVAR_SERVER);
	set_cvar_string("vip_", PLUGIN_VERSION);
}

public client_putinserver(id)
{
	g_JumpNum[id] = 0;
	g_bJump[id] = false;
}

public CmdVipsOnline(id)
{
	if(!is_user_connected(id))
		return PLUGIN_CONTINUE;

	new adminnames[33][32], message[256], i, count, len;
	len = format(message, charsmax(message), "!4%s!3 VIPS ONLINE: ", TAG);
	for(i = 1 ; i <= max_players; i++)
	{
		if(is_user_connected(i) && is_user_vip(i))
			get_user_name(i, adminnames[count++], charsmax(adminnames[]));
	}
	
	if(count > 0)
	{
		for(i = 0; i < count; i++)
		{
			len += format(message[len], 255 -len, "!4%s!1%s ", adminnames, i < (count -1) ? " | " : "");
		}
		ColorChat(id, message);
	}
	else
	{
		len += format(message[len], 255 -len, "!4No one !")
		ColorChat(id, message);
	}

	return PLUGIN_CONTINUE;
}

public CmdPrintAttributes(id)
{
	if(!is_user_connected(id)) return;
	show_motd(id, "vip.txt", "Beneficii VIP");
}

public CmdResetDeaths(id)
{
	if(!is_user_vip(id))
	{
		ColorChat(id, "!4%s!1 Doar membri!3 VIP!1 isi pot reseta decesele.", TAG);
		return;
	}
	cs_set_user_deaths(id, 0);
	cs_set_user_deaths(id, 0);
	ColorChat(id, "!4%s!1 Ti-ai resetat cu succes toate decesele.", TAG);
}

public blockawp(id)
{
	if(is_user_alive(id) && !is_user_vip(id))
	{
		ColorChat(id, "!4%s!3 AWP-ul!1 este doar pentru membri VIP.", TAG);
		return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE;
}

public client_PreThink(id)
{
	new cache = get_pcvar_num(cvar[multi_jump]);
	if(is_user_alive(id) && !is_user_vip(id))
		return PLUGIN_CONTINUE;

	new nbut = get_user_button(id);
	new obut = get_user_oldbutton(id);

	if(cache != 0)
	{	
		if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
		{
			if(g_JumpNum[id] < cache)
			{
				g_bJump[id] = true;
				g_JumpNum[id]++;
				return PLUGIN_CONTINUE;
			}
		}
	
		if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
		{
			g_JumpNum[id] = 0;
			return PLUGIN_CONTINUE;
		}
	}

	if(get_pcvar_num(cvar[parachute]))
	{
		new Float:fallspeed = 100.0 * -1.0;
		if(nbut & IN_USE) 
		{
			new Float:velocity[3];
			entity_get_vector(id, EV_VEC_velocity, velocity);
			if(velocity[2] < 0.0) 
			{
				entity_set_int(id, EV_INT_sequence, 3);
				entity_set_int(id, EV_INT_gaitsequence, 1);
				entity_set_float(id, EV_FL_frame, 1.0);
				entity_set_float(id, EV_FL_framerate, 1.0);

				velocity[2] = (velocity[2] + 40.0 < fallspeed) ? velocity[2] + 40.0 : fallspeed;
				entity_set_vector(id, EV_VEC_velocity, velocity);
			}
		}
	}
	return PLUGIN_CONTINUE;
}

public client_PostThink(id)
{
	new jump_num = get_pcvar_num(cvar[multi_jump]);
	if(!jump_num)
		return PLUGIN_CONTINUE;
		
	if(is_user_alive(id) && !is_user_vip(id))
		return PLUGIN_CONTINUE;
	
	if(g_bJump[id])
	{
		new Float:fVelocity[3];
		entity_get_vector(id, EV_VEC_velocity, fVelocity);
		fVelocity[2] = random_float(265.0, 285.0);
		entity_set_vector(id, EV_VEC_velocity, fVelocity);
		
		g_bJump[id] = false;
		return PLUGIN_CONTINUE;
	}
	
	return PLUGIN_CONTINUE;
}

public event_DeathMsg()
{
	new killer = read_data(1), hs = read_data(3);	
	if(is_user_alive(killer) && is_user_vip(killer))
	{
		if(killer == read_data(2)) return PLUGIN_HANDLED;

		if(hs && !user_has_weapon(killer, CSW_HEGRENADE)) give_item(killer, "weapon_hegrenade");

		new cache = hs ? get_pcvar_num(cvar[hp_hs]) : get_pcvar_num(cvar[hp_kill]);
		if(cache != 0) set_user_health(killer, min(get_user_health(killer) + cache, get_pcvar_num(cvar[hp_max])));

		cache = hs ? get_pcvar_num(cvar[ap_hs]) : get_pcvar_num(cvar[ap_kill]);
		if(cache != 0) set_user_armor(killer, min(get_user_armor(killer) + cache, get_pcvar_num(cvar[hp_max])));

		cache = hs ? get_pcvar_num(cvar[money_hs]) : get_pcvar_num(cvar[money_kill]);
		if(cache != 0) cs_set_user_money(killer, min(cs_get_user_money(killer) + cache, 16000));
	}

	return PLUGIN_CONTINUE;
}

public event_Damage(victim)
{
	if(!get_pcvar_num(cvar[show_bullet_dmg]))
		return PLUGIN_CONTINUE;
		
	new id = get_user_attacker(victim);
	if(is_user_valid(id))
	{
		if(is_user_alive(id) && !is_user_vip(id))
			return PLUGIN_HANDLED;
		
		if(read_data(4) || read_data(5) || read_data(6))
		{		
			new iPos = ++g_iPlayerPos[id];
			if(iPos == sizeof(g_flCoords))
				iPos = g_iPlayerPos[id] = 0;
			
			new iCol = ++g_iPlayerCol[id];
			if(iCol == sizeof(g_iColors))
				iCol = g_iPlayerCol[id] = 0;
			
			set_hudmessage(g_iColors[iCol][0], g_iColors[iCol][1], g_iColors[iCol][2], Float:g_flCoords[iPos][0], Float:g_flCoords[iPos][1], 0, 0.1, 2.5, 0.02, 0.02, -1);
			show_hudmessage(id, "%d", read_data(2));
		}
	}
	
	return PLUGIN_CONTINUE;
}

public event_CurWeapon(id)
{
	if(!is_user_alive(id))
		return PLUGIN_HANDLED;

	if(!is_user_vip(id) && (pev(id, pev_weapons) & (1 << CSW_AWP)))
		engclient_cmd(id, "drop", "weapon_awp");

	return PLUGIN_CONTINUE;
}

public event_WeapPickup(id)
{
	if(!is_user_connected(id)) 
		return PLUGIN_CONTINUE;

	if(is_user_vip(id))
		return PLUGIN_CONTINUE;

	if(pev(id, pev_weapons) & (1 << CSW_AWP))
	{
		engclient_cmd(id, "drop", "weapon_awp");
		ColorChat(id, "!4%s!3 AWP-ul!1 este doar pentru membri VIP.", TAG);
		return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE;
}

public event_NewRound()
{
	rounds++;
}

public event_textmsg()
{
	rounds = 0;
}

public fw_PlayerSpawnPost(id)
{
	if(is_user_vip(id) && is_user_alive(id))
	{
		set_task(0.25, "give_items", id + 212);
		return HAM_IGNORED;
	}
	
	return HAM_IGNORED;
}

public give_items(taskid)
{
	new id = taskid - 212;
	if(!is_user_alive(id))
		return;

	new cache = get_pcvar_num(cvar[hp_spawn])
	if(cache != 0) set_user_health(id, cache);

	cache = get_pcvar_num(cvar[ap_spawn]);
	if(cache != 0) cs_set_user_armor(id, cache, CS_ARMOR_VESTHELM);

	cache = get_pcvar_num(cvar[money_spawn]);
	if(cache != 0) cs_set_user_money(id, min(cs_get_user_money(id) + cache, 16000));

	set_user_rendering(id, kRenderFxGlowShell, 0, 130, 0, kRenderNormal, 0);

	if(rounds >= 3) ShowVipMenu(id);
}

public fw_TouchWeapon(ent, id)
{
	if(is_user_alive(id) && !is_user_vip(id))
	{
		static model[128];
		pev(ent, pev_model, model, charsmax(model));

		if(equal(model, "models/w_awp.mdl"))
			return HAM_SUPERCEDE;
	}

	return HAM_IGNORED;
}

public msg_ScoreAttrib(msgid, dest, id)
{
	if(!get_pcvar_num(cvar[show_vip_tab]))
		return PLUGIN_CONTINUE;
		
	new id = get_msg_arg_int(1);
	if(is_user_connected(id) && is_user_vip(id))
		set_msg_arg_int(2, ARG_BYTE, is_user_alive(id) ? (1<<2) : (1<<0));
	
	return PLUGIN_CONTINUE;
}

public msg_ScreenFade(msgid, dest, id)
{
	if(!get_pcvar_num(cvar[noflash]))
		return PLUGIN_HANDLED;

	if(is_user_connected(id) && is_user_vip(id))
	{
		static data[4];
		data[0] = get_msg_arg_int(4);
		data[1] = get_msg_arg_int(5);
		data[2] = get_msg_arg_int(6);
		data[3] = get_msg_arg_int(7);
		
		if(data[0] == 255 && data[1] == 255 && data[2] == 255 && data[3] > 199)
			return PLUGIN_HANDLED;
	}

	return PLUGIN_CONTINUE;
}

public ShowVipMenu(id)
{
	if(!is_user_connected(id))
		return PLUGIN_HANDLED;

	if(!is_user_vip(id))
	{
		ColorChat(id, "!4%s!1 Imi pare rau, dar nu ai acces la meniul pentru!3 membrii VIP!1.", TAG);
		ColorChat(id, "!4%s!1 Poti cumpara VIP, contactand adresa Y!M:!3 %s!1.", TAG, CONTACT);
		return PLUGIN_HANDLED;
	}

	give_item(id, "weapon_hegrenade");
	give_item(id, "weapon_flashbang");
	give_item(id, "weapon_flashbang");
	drop_weapons(id, 2);
	give_item(id, "weapon_deagle");
	cs_set_user_bpammo(id, CSW_DEAGLE, 35);

	new menu = menu_create("\rMeniu VIP", "VipMenuHandler");
	menu_additem(menu, "M4A1 + Echipament", "1");
	menu_additem(menu, "AK-47 + Echipament", "2");
	menu_additem(menu, "AWP + Echipament", "3");
	
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, menu, 0);
	
	return PLUGIN_CONTINUE;
}

public VipMenuHandler(id, menu, item)
{
	if(!is_user_connected(id) || item == MENU_EXIT)
	{
		menu_destroy(menu);
		return PLUGIN_HANDLED;
	}

	new data[6], namei[64], access, CallBack;
	menu_item_getinfo(menu, item, access, data, charsmax(data), namei, charsmax(namei), CallBack);
	new key = str_to_num(data);

	switch(key)
	{
		case 1:
		{
			drop_weapons(id, 1);
			give_item(id, "weapon_m4a1");
			cs_set_user_bpammo(id, CSW_M4A1, 120);
			
			ColorChat(id, "!4%s!1 Ai ales!3 M4A1!1 +!3 Deagle!1 +!3 Set grenade!1 (!31 HE!1 + !32 FB!1).", TAG);
		}

		case 2:
		{
			drop_weapons(id, 1);
			give_item(id, "weapon_ak47");
			cs_set_user_bpammo(id, CSW_AK47, 120);
			
			ColorChat(id, "!4%s!1 Ai ales!3 AK47!1 +!3 Deagle!1 +!3 Set grenade!1 (!31 HE!1 + !32 FB!1).", TAG);
		}

		case 3:
		{
			drop_weapons(id, 1);
			give_item(id, "weapon_awp");
			cs_set_user_bpammo(id, CSW_AWP, 30);
			
			ColorChat(id, "!4%s!1 Ai ales!3 AWP!1 +!3 Deagle!1 +!3 Set grenade!1 (!31 HE!1 + !32 FB!1).", TAG);
		}
	}

	menu_destroy(menu);
	return PLUGIN_HANDLED;
}

const PRIMARY_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);
const SECONDARY_WEAPONS_BIT_SUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE);

// Drop primary/secondary weapons
stock drop_weapons(id, dropwhat)
{
	// Get user weapons
	static weapons[32], num, i, weaponid, wname[32];
	num = 0; // reset passed weapons count (bugfix)
	get_user_weapons(id, weapons, num);
	
	// Loop through them and drop primaries or secondaries
	for (i = 0; i < num; i++)
	{
		// Prevent re-indexing the array
		weaponid = weapons;
		
		if((dropwhat == 1 && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM)) || (dropwhat == 2 && ((1<<weaponid) & SECONDARY_WEAPONS_BIT_SUM)))
		{
			// Get weapon entity
			get_weaponname(weaponid, wname, charsmax(wname));
			engclient_cmd(id, "drop", wname);
		}
	}
}

stock ColorChat(id, String[], any:...) 
{
	static szMesage[192];
	vformat(szMesage, charsmax(szMesage), String, 3);
	
	replace_all(szMesage, charsmax(szMesage), "!1", "^1");
	replace_all(szMesage, charsmax(szMesage), "!3", "^3");
	replace_all(szMesage, charsmax(szMesage), "!4", "^4");
	
	static g_msg_SayText = 0;
	if(!g_msg_SayText)
		g_msg_SayText = get_user_msgid("SayText");
	
	new Players[32], iNum = 1, i;

 	if(id) Players[0] = id;
	else get_players(Players, iNum, "ch");
	
	for(--iNum; iNum >= 0; iNum--) 
	{
		i = Players[iNum];
		
		message_begin(MSG_ONE_UNRELIABLE, g_msg_SayText, _, i);
		write_byte(i);
		write_string(szMesage);
		message_end();
	}
}


Aici ai sursa. Am facut exact cum ai vrut. Are si cvar-uri pluginul.

| Afiseaza codul
[code=php]vip_hp_spawn 100        // 0 = dezactivat
vip_ap_spawn 100        // 0 = dezactivat
vip_money_spawn 1400    // 0 = dezactivat
vip_show_tab 1        // 0 = dezactivat
vip_show_bullet_dmg 1    // 0 = dezactivat
vip_multijump 1        // 0 = dezactivat. Daca valoarea cvar-ului este 1, vei sari de 2 ori. Orice valoare pui, va fi +1 jump
vip_hp_kill 5        // 0 = dezactivat
vip_hp_hs 10;        // 0 = dezactivat
vip_ap_kill 5        // 0 = dezactivat
vip_ap_hs 10        // 0 = dezactivat
vip_hp_max 100        // 0 = viata infinita
vip_money_kill 150        // 0 = dezactivat
vip_money_hs 300        // 0 = dezactivat
vip_parachute 1        // 0 = dezactivat
vip_noflash 1        // 0 = dezactivat  [/code]
Il poti modifica cum vrei tu.

Parasuta nu are model.
comenzi in chat | Afiseaza codul
[code=php]
/rd sau rd - reseteaza decesele
/vips sau vips - arata vip-ii online
/vreauvip sau vreauvip - deschide un motd in configs cu beneficiile (modt-ul ti-l faci tu in HTML)[/code]
Se va creea un fisier automat in configs, numit vip_maps.ini.
Acolo o sa adaugi hartile una sub ulta. Pe hartile respective, pluginul de vip va fi dezactivat.


Testeaza-l si vino cu replay. Nu l-am testat.
Poti te rog sa faci sursa astfel in cat pe armele din meniu sa pun un anumit model ?
si cand arma e in mana vipului sa se vada modelul ,c and arma e jos sa se vada modelul !
si armele din meniu luate de VIP sa nu poata fi luata de jos de playeri fara vip

Re: Vrei un plugin VIP? Aici îl găsești

Posted: 02 Oct 2018, 14:16
by YONTU
O sa activez mai rar pentru ca am inceput cursurile