[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
WeaK.
Membru, skill 0
Membru, skill 0
Posts: 19
Joined: 02 Apr 2017, 14:04
Detinator Steam: Nu
CS Status: csgo.lordstrike.ro
Detinator server CS: csgo.lordstrike.ro
Fond eXtream: 0
Contact:

15 Jun 2020, 14:09

Plugin Cerut: Plugin VIP
Descriere (adica ce face el mai exact): Am nevoie de un plugin care sa indeplineasca urmatoarele:
- vmenu automat(fara sa mai scrii /vmenu) care incepe din a 3-a runda si contine M4A1, AK47 si AWP + deagle + he la toate 3, sa inceapa cu 130hp si 130 AP, la fiecare kill sa primeasca 5hp si la hs 10hp, double jump si sa poti vedea damage-ul dat si luat in timp real.

Serverul impune conditii strict HLDS/REHLDS?: hlds
Ai cautat pluginul?(daca da, precizeaza cum): am cautat, dar nimic nu e ceea ce caut eu.
Necesita mod special?: nu
:fist_pointing_right: csgo.lordstrike.ro :fist_pointing_left:
User avatar
CyBer[N]eTicK
Membru, skill 0
Membru, skill 0
Posts: 18
Joined: 29 May 2020, 04:35
Detinator Steam: Da
CS Status: Citesc & Ajut
Detinator server CS: BB.BlackGames.Ro
SteamID: STEAM_0:1:427987588
Fond eXtream: 0
Location: România(Iaşi)
Has thanked: 2 times
Contact:

26 Jun 2020, 03:53

Poftim un VIP Clasic un pic optimizat de mine, sper sa te ajute.
| Afiseaza codul
#include < amxmodx >
#include < cstrike >
#include < engine >
#include < hamsandwich >
#include < fun >
#include < ColorChat >

#define PLUGIN "Advanced Vip System"
#define VERSION "1.0.1"
#define AUTHOR "A k c 3 n 7"

#define VIP_FLAG ADMIN_LEVEL_H
#define VIP_HEALTH 50
#define VIP_ARMOR 100

#define VIP_FRAG_HP 10
#define VIP_FRAG_HS 15

new round[33] = 0;
new count = 0;

new cvar_jump;
new jumpnum[33];
new bool: dojump[33];

enum {
    SCOREATTRIB_ARG_PLAYERID = 1,
    SCOREATTRIB_ARG_FLAGS
};

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

public plugin_init( ) {
  
       register_plugin("PLUGIN", "VERSION", "AUTHOR")
       RegisterHam(Ham_Spawn, "player", "PlayerSpawn", 1);
       RegisterHam(Ham_Spawn, "player", "HamPlayerSpawn", true);
       register_event("DeathMsg", "death_msg", "a", "1>0");
       register_message( get_user_msgid( "ScoreAttrib" ), "MessageScoreAttrib" );
       cvar_jump = register_cvar("vip_jump", "1" );
}

public client_putinserver(id) 
{

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

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

public PlayerSpawn ( Client ) {

if(is_user_alive( Client ) && get_user_flags( Client ) & VIP_FLAG ) {
   
       if(round[Client]>=2 ) 
       open_menu(Client)
       round[Client]++

       set_user_health(Client, get_user_health( Client ) + VIP_HEALTH );
       set_user_armor(Client, get_user_armor( Client ) + VIP_ARMOR );
       
       if(get_user_team( Client ) == 2 ) {
              
       give_item(Client, "item_thighpack")
     }  
}    return PLUGIN_CONTINUE;
}

public HamPlayerSpawn ( Client ) {
    
if(is_user_alive( Client ) ) {
          
       if ( count < 1 ) {
       count++  
  
       give_item(Client, "weapon_deagle")
       give_item(Client, "weapon_hegrenade")
       give_item(Client, "weapon_flashbang")
       cs_set_user_bpammo(Client, CSW_DEAGLE, 35)
       cs_set_user_bpammo(Client, CSW_FLASHBANG, 2) 
     }     
}    return PLUGIN_CONTINUE;    
}
      
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;
}

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 death_msg( )
{
	new killer = read_data(1);
	new victim = read_data(2);

	if(killer == victim || !is_user_connected(victim) || !is_user_alive(killer))
		return PLUGIN_HANDLED;

	new headshot = read_data(3);

	if(headshot)
	{
			set_user_health(killer, get_user_health(killer) + VIP_FRAG_HS);
	}
	else
	{
			set_user_health(killer, get_user_health(killer) + VIP_FRAG_HP);
	}

	return PLUGIN_CONTINUE;
}

public open_menu( Client ) {

	new menu = menu_create( "\r[Red.BlackGames.Ro] \yVIP Meniu", "menu_handler" );
	menu_additem( menu, "\yM4A1+DEAGLE+GRENADE", "", 1, VIP_FLAG );
	menu_additem( menu, "\yAK47+DEAGLE+GRENADE", "", 1, VIP_FLAG );
	menu_additem( menu, "\rAWP+DEAGLE+GRENADE", "", 1, VIP_FLAG );
	menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
        menu_display( Client, menu, 0 );
}

public menu_handler( Client, menu, item )
{
	switch( item )
	{
		case 0:
		{
				give_item(Client, "weapon_m4a1");
				give_item(Client, "weapon_deagle");
				give_item(Client, "weapon_hegrenade");
				give_item(Client, "weapon_flashbang");
				cs_set_user_bpammo(Client, CSW_DEAGLE, 35);
				cs_set_user_bpammo(Client, CSW_M4A1, 90);
				cs_set_user_bpammo(Client, CSW_FLASHBANG, 2);      
		}
		case 1:
		{
				give_item(Client, "weapon_ak47");
				give_item(Client, "weapon_deagle");
				give_item(Client, "weapon_hegrenade");
				give_item(Client, "weapon_flashbang"); 
				cs_set_user_bpammo(Client, CSW_DEAGLE, 35);
				cs_set_user_bpammo(Client, CSW_AK47, 90);
				cs_set_user_bpammo(Client, CSW_FLASHBANG, 2);  
		}	
                case 2: 
                {
				give_item(Client, "weapon_awp");
				give_item(Client, "weapon_deagle");
				give_item(Client, "weapon_hegrenade");
				give_item(Client, "weapon_flashbang");
				cs_set_user_bpammo(Client, CSW_DEAGLE, 35);
				cs_set_user_bpammo(Client, CSW_AWP, 90);
				cs_set_user_bpammo(Client, CSW_FLASHBANG, 2);  
                }
	}

	return PLUGIN_HANDLED;
}
User avatar
robbencsgo
Membru, skill 0
Membru, skill 0
Posts: 50
Joined: 31 Aug 2019, 18:14
Detinator Steam: Da
CS Status: aimer
SteamID: an prevat
Fond eXtream: 0
Has thanked: 6 times
Been thanked: 5 times
Contact:

26 Jun 2020, 13:48

Code: Select all

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#include <hamsandwich>
#include <engine>
#include <fakemeta_util>

#define PLUGIN "VIP"
#define VERSION "6.9"
#define AUTHOR "*** stie autorul"

#define VIP	ADMIN_LEVEL_H

enum benefits
{
	hp_spawn,
	ap_spawn,
	hp_kill,
	hp_headshot,
	doublejump,
	bulletdamage,
	bulletdamage_received,
	menu_start_round
}

new cvars[benefits];
new rounds = 0;
new g_enabled, bool:g_showrecieved, g_hudmsg1, g_hudmsg2

new jumpnum[33] = 0
new bool:dojump[33] = false

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	register_event("HLTV", "NewRound", "a", "1=0", "2=0");
	register_event("Damage", "on_damage", "b", "2!0", "3=0", "4!0")
	register_event("DeathMsg", "event_DeathMsg", "a");
	register_event("TextMsg", "event_textmsg", "a", "2=#Game_will_restart_in")
	RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawnPost", 1);
	
	cvars[hp_spawn] = register_cvar("vip_hp_spawn","130");
	cvars[ap_spawn] = register_cvar("vip_ap_spawn","130");
	cvars[hp_kill] = register_cvar("vip_hp_kill","5");
	cvars[hp_headshot] = register_cvar("vip_hp_headshot","10");
	cvars[doublejump] = register_cvar("vip_jumps","1")
	cvars[bulletdamage] = register_cvar("vip_bulletdamage","1")
	cvars[bulletdamage_received] = register_cvar("vip_bulletdamage_received","1")
	cvars[menu_start_round] = register_cvar("vip_start_round_menu","3")
	
	g_hudmsg1 = CreateHudSyncObj()	
	g_hudmsg2 = CreateHudSyncObj()
}

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

public client_disconnect(id)
{
	jumpnum[id] = 0
	dojump[id] = false
}

public NewRound()
{
	g_enabled = get_pcvar_num(cvars[bulletdamage])
	if(get_pcvar_num(cvars[bulletdamage_received])) g_showrecieved = true	
	
	rounds++;
}

public event_textmsg()
{
	rounds = 0;
}

public on_damage(id)
{
	if(g_enabled)
	{		
		static attacker; attacker = get_user_attacker(id)
		static damage; damage = read_data(2)		
		if(g_showrecieved)
		{			
			set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1)
			ShowSyncHudMsg(id, g_hudmsg2, "- %i^n", damage)		
		}
		if(is_user_connected(attacker) && is_user_vip(attacker))
		{
			switch(g_enabled)
			{
				case 1: {
					set_hudmessage(0, 255, 0, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1)
					ShowSyncHudMsg(attacker, g_hudmsg1, "+ %i^n", damage)				
				}
				case 2: {
					if(fm_is_ent_visible(attacker,id))
					{
						set_hudmessage(0, 255, 0, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1)
						ShowSyncHudMsg(attacker, g_hudmsg1, "+ %i^n", damage)				
					}
				}
			}
		}
	}
}

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

		new cache = hs ? get_pcvar_num(cvars[hp_headshot]) : get_pcvar_num(cvars[hp_kill]);
		if(cache != 0) set_user_health(killer, min(get_user_health(killer) + cache, get_pcvar_num(cvars[hp_spawn])));
	}

	return PLUGIN_CONTINUE;
}

public client_PreThink(id)
{
	if(!is_user_alive(id)) return PLUGIN_CONTINUE
	
	new nbut = get_user_button(id)
	new obut = get_user_oldbutton(id)
	
	if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
	{
		if(is_user_vip(id))
		{
			if(jumpnum[id] < get_pcvar_num(cvars[doublejump]))
			{
				dojump[id] = true
				jumpnum[id]++
				return PLUGIN_CONTINUE
			}
		}
	}
	
	if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
	{
		jumpnum[id] = 0
		return PLUGIN_CONTINUE
	}
	
	return PLUGIN_CONTINUE
}

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

public fw_PlayerSpawnPost(id)
{
	if(is_user_vip(id) && is_user_alive(id))
	{
		set_user_armor(id, get_pcvar_num(cvars[ap_spawn]))
		set_user_health(id, get_pcvar_num(cvars[hp_spawn]))
		if(rounds >= get_pcvar_num(cvars[menu_start_round]))
		{
			ShowVIPMenu(id);
		}
		return HAM_IGNORED;
	}
	
	return HAM_IGNORED;
}	

public ShowVIPMenu(id)
{
	if(!is_user_connected(id))
		return PLUGIN_HANDLED;
	
	new menu = menu_create("\rMeniu VIP", "VipMenuHandler");
	menu_additem(menu, "AK47 + Deagle + HE", "1");
	menu_additem(menu, "M4A1 + Deagle + HE", "2");
	menu_additem(menu, "AWP + DEAGLE + HE", "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))
		return PLUGIN_HANDLED;
		
	switch(item)
	{
		case 0:
		{
			drop_weapons(id, 1);
			drop_weapons(id, 2);
			
			give_item(id, "weapon_hegrenade");
			give_item(id, "weapon_deagle");
			give_item(id, "weapon_ak47");
			
			cs_set_user_bpammo(id, CSW_DEAGLE, 35);
			cs_set_user_bpammo(id, CSW_AK47, 90);
		}
		
		case 1:
		{
			drop_weapons(id, 1);
			drop_weapons(id, 2);
			
			give_item(id, "weapon_hegrenade");
			give_item(id, "weapon_deagle");
			give_item(id, "weapon_m4a1");
			
			cs_set_user_bpammo(id, CSW_DEAGLE, 35);
			cs_set_user_bpammo(id, CSW_M4A1, 90);
		}
		
		case 2:
		{
			drop_weapons(id, 1);
			drop_weapons(id, 2);
			
			give_item(id, "weapon_hegrenade");
			give_item(id, "weapon_deagle");
			give_item(id, "weapon_awp");
			
			cs_set_user_bpammo(id, CSW_DEAGLE, 35);
			cs_set_user_bpammo(id, CSW_AWP, 30);
		}
	}
	
	return PLUGIN_CONTINUE;
}

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

stock drop_weapons(id, dropwhat)
{
	static weapons[32], num, i, weaponid, wname[32];
	num = 0;
	get_user_weapons(id, weapons, num);
	
	for (i = 0; i < num; i++)
	{
		weaponid = weapons[i];
		
		if((dropwhat == 1 && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM)) || (dropwhat == 2 && ((1<<weaponid) & SECONDARY_WEAPONS_BIT_SUM)))
		{
			get_weaponname(weaponid, wname, charsmax(wname));
			engclient_cmd(id, "drop", wname);
		}
	}
}

stock bool:is_user_vip(id)
{
	if(get_user_flags(id) & VIP)
	{
		return true;
	}
	else
	{
		return false;
	}
		
	return;
}
Ai aici tot ce ti-ai dorit
VIP-ul este pe flagul "t"
Daca te-am ajutat, lasa si tu un +1
Post Reply

Return to “Cereri”

  • Information