Modificare plugin VIP

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori

Post Reply
N3v3rM1nd
Membru, skill 0
Membru, skill 0
Posts: 25
Joined: 06 Oct 2018, 13:41
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Has thanked: 3 times
Contact:

07 Jul 2019, 23:39

| Afiseaza codul
#include amxmodx
#include cstrike
#include fun
#include hamsandwich
#include engine
#include ColorChat

#define VIP_ACCESS ADMIN_LEVEL_H
#define is_vip(%1)	(get_user_flags(%1)&VIP_ACCESS)

#pragma tabsize 0

#define VIP  ( 1 << 2 )
#define DEAD    ( 1 << 0 )

new jumpznum[33] = 0,bool:dozjump[33] = false

public plugin_init() {
	RegisterHam(Ham_Spawn, "player", "PlayerPostSpawn", true);
	
	register_message( get_user_msgid( "ScoreAttrib" ), "MessageScoreAttrib" );
	
	register_clcmd("say /vip","VipMotd")
	register_clcmd("say_team /vip","VipMotd")
	
	register_clcmd("say /vips","VipWHO")
	register_clcmd("say_team /vips","VipWHO")
	
	register_cvar("vip_jumps","1")
}

public VipWHO(user)
{
		new adminnames[33][32];
		new message[256];
		new id, count, x, len;

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

public client_putinserver(id)
{
	jumpznum[id] = 0
	dozjump[id] = false
}
public client_disconnect(id)
{
	jumpznum[id] = 0
	dozjump[id] = false
}
public client_PreThink(id)
{
	if(!is_user_alive(id) || !is_vip(id))	return PLUGIN_CONTINUE
	
	new nzbut = get_user_button(id),ozbut = get_user_oldbutton(id)
	
	if((nzbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(ozbut & IN_JUMP))
	{
		if (jumpznum[id] < get_cvar_num("vip_jumps"))
		{
			dozjump[id] = true
			jumpznum[id]++
			
			return PLUGIN_CONTINUE
		}
	}
	if((nzbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
	{
		jumpznum[id] = 0
		
		return PLUGIN_CONTINUE
	}
	return PLUGIN_CONTINUE
}
public client_PostThink(id)
{
	if(!is_user_alive(id)||!is_vip(id))	return PLUGIN_CONTINUE
	
	if(dozjump[id] == true)
	{
		new Float:vezlocityz[3]    
		entity_get_vector(id,EV_VEC_velocity,vezlocityz)
		vezlocityz[2] = random_float(265.0,285.0)
		entity_set_vector(id,EV_VEC_velocity,vezlocityz)
		dozjump[id] = false
		return PLUGIN_CONTINUE
	}    
	return PLUGIN_CONTINUE
}  

public VipMotd(id)	show_motd(id,"/addons/amxmodx/configs/vips.html","BENEFICII VIP")

public MessageScoreAttrib( iMsgID, iDest, iReceiver ) {
	new id = get_msg_arg_int( 1 );
	
	if(is_user_connected( id ) && is_vip(id) ) {
		set_msg_arg_int( 2, ARG_BYTE, is_user_alive( id ) ? VIP : DEAD );
	}
}

public PlayerPostSpawn(id)
{
	if (!is_user_connected(id) || !is_vip(id))
		return HAM_HANDLED;
	
	new MENU = menu_create ( "\y[\ySTICKS.CSONE.RO \yMENIU \rVIP", "BONUS" );
	
	menu_additem ( MENU, "CLASE", "1" );
	
	menu_setprop ( MENU, MPROP_EXIT, MEXIT_ALL );
	menu_display ( id, MENU );
	return HAM_IGNORED;
}

public BONUS(id,MENU,item)
{
	if (!is_user_alive(id) || item == MENU_EXIT) 
		return PLUGIN_HANDLED;
	
	new data [6], iName [64],access, callback;
	menu_item_getinfo ( MENU, item, access, data,5, iName, 63, callback);
	new key = str_to_num(data);
	switch(key)
	{
		case 1:
		{
			CLASE(id);
			ColorChat (id, GREEN, "^1[^4STICKS.CSONE.RO^1] Ai intrat in lista de ^4clase^1!");
		}
	}
	menu_destroy ( MENU );
	return PLUGIN_HANDLED;
}

public CLASE(id)
{
	new menu = menu_create ("\rMENIU \yCLASE", "ALEGE");
	menu_additem(menu, "\yClasa Guarded [\wDEAGLE + SHIELD\y] ", "1");
	menu_additem(menu, "\yClasa Pionier [\wAK47 + DEAGLE\y]", "2");
	menu_additem(menu, "\yClasa Bombardier [\w5HE + 2FB + 1SG\y]", "3");
	menu_additem(menu, "\yClasa Ghost [\wAWP + FIVESEVEN + SG\y]", "4");
	menu_additem(menu, "\yClasa Bad Boy [\wUMP + DUAL ELITE + 2HE\y]", "5");
	
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, menu );
}
public ALEGE(id, menu, item)
{
	if(item == MENU_EXIT)
	{
		menu_destroy(menu);
		return PLUGIN_HANDLED;
	}
	
	new data [6], szName [64],access, callback;
	menu_item_getinfo (menu, item, access, data,charsmax (data), szName,charsmax (szName), callback);
	new key = str_to_num (data);
	switch (key)
	{
		case 1:
		{
			if( is_user_alive( id ) )   
			{
				strip_user_weapons(id);
				give_item(id, "weapon_knife");
				give_item(id, "weapon_deagle");
				give_item(id, "weapon_shield");
				cs_set_user_bpammo(id, CSW_DEAGLE, 21);
				cs_set_user_bpammo(id, CSW_VESTHELM, 120);
				
				
				ColorChat(id, GREEN, "^x03 Ti-ai luat clasa ^x04 Guarded")
			}
		}
		
		case 2:
		{
			if( is_user_alive( id ) )   
			{
				strip_user_weapons(id);
				give_item(id, "weapon_knife");
				give_item(id, "weapon_deagle");
				give_item(id, "weapon_ak47");
				cs_set_user_bpammo(id, CSW_DEAGLE, 21);
				cs_set_user_bpammo(id, CSW_AK47, 90);
				cs_set_user_bpammo(id, CSW_VESTHELM, 120);
				
				
				ColorChat(id, GREEN, "^x03 Ti-ai luat clasa ^x04 Pionier")
			}
		}
		
		case 3:
		{
			if( is_user_alive( id ) )   
			{
				strip_user_weapons(id);
				give_item(id, "weapon_knife");
				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_SMOKEGRENADE, 1);
				cs_set_user_bpammo(id, CSW_HEGRENADE, 5);
				cs_set_user_bpammo(id, CSW_VESTHELM, 120);
				
				ColorChat(id, GREEN, "^x03 Ti-ai luat clasa ^x04 Bombardier")
			}
		}
		
		case 4:
		{
			if( is_user_alive( id ) )   
			{
				strip_user_weapons(id);
				give_item(id, "weapon_knife");
				give_item(id, "weapon_awp");
				give_item(id, "weapon_fiveseven");
				give_item(id, "weapon_smokegrenade");
				cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 1);
				cs_set_user_bpammo(id, CSW_AWP, 30);
				cs_set_user_bpammo(id, CSW_FIVESEVEN, 30);
				cs_set_user_bpammo(id, CSW_VESTHELM, 120);
				
				ColorChat(id, GREEN, "^x03 Ti-ai luat clasa ^x04 Ghost")
			}
		}
		
		case 5:
		{
			if( is_user_alive( id ) )   
			{
				strip_user_weapons(id);
				give_item(id, "weapon_knife");
				give_item(id, "weapon_ump45");
				give_item(id, "weapon_elite");
				give_item(id, "weapon_hegrenade");
				cs_set_user_bpammo(id, CSW_UMP45, 100);
				cs_set_user_bpammo(id, CSW_ELITE, 120);
				cs_set_user_bpammo(id, CSW_HEGRENADE, 2);
				cs_set_user_bpammo(id, CSW_VESTHELM, 120);
				
				
				ColorChat(id, GREEN, "^x03 Ti-ai luat clasa ^x04Bad Boy")
			}
		}
	}
	
	menu_destroy(menu);
	return PLUGIN_HANDLED;
}



As dori daca se poate :
-faceti ca meniul sa poata sa fie accesat doar odata pe runda si sa apara un mesaj in chat daca cineva il deschide iar (gen : Meniul poate fi folosit doar odata pe runda)
-cand ai bmb la Terro si Iti iei o clasa Iti dispare bomba, desi Iti apare ca o ai! Nici cu bomb transfer nu merge
eXtreamSHOP
User avatar
Laurentiu P.
Fost moderator
Fost moderator
Posts: 2286
Joined: 10 Jul 2013, 20:26
Detinator Steam: Nu
CS Status: Retras
Detinator server CS: Da
Reputatie: Fost super moderator
Fond eXtream: 100
Location: Constanta
Has thanked: 7 times
Been thanked: 25 times

08 Jul 2019, 07:37

  • Adaugat in cod plugin in [sursa-][/sursa]
  • Titlu modificat. Daca ai vreo urgenta suna la 112 nu pe forumul extreamcs. Crezi ca ne intereseaza pe noi de urgenta ta?
Image
Manutza*
Membru, skill 0
Membru, skill 0
Posts: 40
Joined: 10 Nov 2018, 11:47
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

08 Jul 2019, 11:18

incearca cu
| Afiseaza codul
new boll
N3v3rM1nd
Membru, skill 0
Membru, skill 0
Posts: 25
Joined: 06 Oct 2018, 13:41
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Has thanked: 3 times
Contact:

11 Jul 2019, 12:58

Nu merge
User avatar
L E V I N
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2428
Joined: 24 Aug 2011, 11:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Has thanked: 36 times
Been thanked: 372 times
Contact:

11 Jul 2019, 21:42

Code: Select all

#include amxmodx
#include cstrike
#include fun
#include hamsandwich
#include engine
#include ColorChat

#define VIP_ACCESS ADMIN_LEVEL_H
#define is_vip(%1)	(get_user_flags(%1)&VIP_ACCESS)

#pragma tabsize 0

#define VIP  ( 1 << 2 )
#define DEAD    ( 1 << 0 )

new jumpznum[33] = 0,bool:dozjump[33] = false

new bool:a_ales[33]

public plugin_init() {
	RegisterHam(Ham_Spawn, "player", "PlayerPostSpawn", true);
	
	register_message( get_user_msgid( "ScoreAttrib" ), "MessageScoreAttrib" );
	
	register_clcmd("say /vip","VipMotd")
	register_clcmd("say_team /vip","VipMotd")
	
	register_clcmd("say /vips","VipWHO")
	register_clcmd("say_team /vips","VipWHO")
	
	register_cvar("vip_jumps","1")
	
	register_event("HLTV", "event_new_round", "a", "1=0", "2=0")
}

public event_new_round()	for(new id=1;id<=get_maxplayers();id++)	if(is_vip(id))	a_ales[id]=false

public VipWHO(user)
{
		new adminnames[33][32];
		new message[256];
		new id, count, x, len;

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

public client_putinserver(id)
{
	jumpznum[id] = 0
	dozjump[id] = false
}
public client_disconnect(id)
{
	jumpznum[id] = 0
	dozjump[id] = false
}
public client_PreThink(id)
{
	if(!is_user_alive(id) || !is_vip(id))	return PLUGIN_CONTINUE
	
	new nzbut = get_user_button(id),ozbut = get_user_oldbutton(id)
	
	if((nzbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(ozbut & IN_JUMP))
	{
		if (jumpznum[id] < get_cvar_num("vip_jumps"))
		{
			dozjump[id] = true
			jumpznum[id]++
			
			return PLUGIN_CONTINUE
		}
	}
	if((nzbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
	{
		jumpznum[id] = 0
		
		return PLUGIN_CONTINUE
	}
	return PLUGIN_CONTINUE
}
public client_PostThink(id)
{
	if(!is_user_alive(id)||!is_vip(id))	return PLUGIN_CONTINUE
	
	if(dozjump[id] == true)
	{
		new Float:vezlocityz[3]    
		entity_get_vector(id,EV_VEC_velocity,vezlocityz)
		vezlocityz[2] = random_float(265.0,285.0)
		entity_set_vector(id,EV_VEC_velocity,vezlocityz)
		dozjump[id] = false
		return PLUGIN_CONTINUE
	}    
	return PLUGIN_CONTINUE
}  

public VipMotd(id)	show_motd(id,"/addons/amxmodx/configs/vips.html","BENEFICII VIP")

public MessageScoreAttrib( iMsgID, iDest, iReceiver ) {
	new id = get_msg_arg_int( 1 );
	
	if(is_user_connected( id ) && is_vip(id) ) {
		set_msg_arg_int( 2, ARG_BYTE, is_user_alive( id ) ? VIP : DEAD );
	}
}

public PlayerPostSpawn(id)
{
	if (!is_user_connected(id) || !is_vip(id)||a_ales[id])
		return HAM_HANDLED;
	
	new MENU = menu_create ( "\y[\ySTICKS.CSONE.RO \yMENIU \rVIP", "BONUS" );
	menu_additem ( MENU, "CLASE", "1" );
	menu_setprop ( MENU, MPROP_EXIT, MEXIT_ALL );
	menu_display ( id, MENU );
	
	return HAM_IGNORED;
}

public BONUS(id,MENU,item)
{
	if (!is_user_alive(id) || item == MENU_EXIT) 
		return PLUGIN_HANDLED;
	
	new data [6], iName [64],access, callback;
	menu_item_getinfo ( MENU, item, access, data,5, iName, 63, callback);
	new key = str_to_num(data);
	switch(key)
	{
		case 1:
		{
			CLASE(id);
			ColorChat (id, GREEN, "^1[^4STICKS.CSONE.RO^1] Ai intrat in lista de ^4clase^1!");
			ColorChat (id, GREEN, "[^4STICKS.CSONE.RO^1] Meniul poate fi folosit doar odata pe runda!");
			a_ales[id]=true
		}
	}
	menu_destroy ( MENU );
	return PLUGIN_HANDLED;
}

public CLASE(id)
{
	new menu = menu_create ("\rMENIU \yCLASE", "ALEGE");
	menu_additem(menu, "\yClasa Guarded [\wDEAGLE + SHIELD\y] ", "1");
	menu_additem(menu, "\yClasa Pionier [\wAK47 + DEAGLE\y]", "2");
	menu_additem(menu, "\yClasa Bombardier [\w5HE + 2FB + 1SG\y]", "3");
	menu_additem(menu, "\yClasa Ghost [\wAWP + FIVESEVEN + SG\y]", "4");
	menu_additem(menu, "\yClasa Bad Boy [\wUMP + DUAL ELITE + 2HE\y]", "5");
	
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, menu );
}
public ALEGE(id, menu, item)
{
	if(item == MENU_EXIT)
	{
		menu_destroy(menu);
		return PLUGIN_HANDLED;
	}
	
	new data [6], szName [64],access, callback;
	menu_item_getinfo (menu, item, access, data,charsmax (data), szName,charsmax (szName), callback);
	new key = str_to_num (data);
	switch (key)
	{
		case 1:
		{
			if( is_user_alive( id ) )   
			{
				strip_user_weapons(id);
				give_item(id, "weapon_knife");
				give_item(id, "weapon_deagle");
				give_item(id, "weapon_shield");
				if(cs_get_user_team(id)==CS_TEAM_T&&user_has_weapon(id,CSW_C4))	give_item(id,"weapon_c4")
				cs_set_user_bpammo(id, CSW_DEAGLE, 21);
				cs_set_user_bpammo(id, CSW_VESTHELM, 120);
				
				
				ColorChat(id, GREEN, "^x03 Ti-ai luat clasa ^x04 Guarded")
			}
		}
		
		case 2:
		{
			if( is_user_alive( id ) )   
			{
				strip_user_weapons(id);
				give_item(id, "weapon_knife");
				give_item(id, "weapon_deagle");
				give_item(id, "weapon_ak47");
				if(cs_get_user_team(id)==CS_TEAM_T&&user_has_weapon(id,CSW_C4))	give_item(id,"weapon_c4")
				cs_set_user_bpammo(id, CSW_DEAGLE, 21);
				cs_set_user_bpammo(id, CSW_AK47, 90);
				cs_set_user_bpammo(id, CSW_VESTHELM, 120);
				
				
				ColorChat(id, GREEN, "^x03 Ti-ai luat clasa ^x04 Pionier")
			}
		}
		
		case 3:
		{
			if( is_user_alive( id ) )   
			{
				strip_user_weapons(id);
				give_item(id, "weapon_knife");
				give_item(id, "weapon_hegrenade");
				give_item(id, "weapon_flashbang");
				give_item(id, "weapon_smokegrenade");
				if(cs_get_user_team(id)==CS_TEAM_T&&user_has_weapon(id,CSW_C4))	give_item(id,"weapon_c4")
				cs_set_user_bpammo(id, CSW_FLASHBANG, 2);
				cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 1);
				cs_set_user_bpammo(id, CSW_HEGRENADE, 5);
				cs_set_user_bpammo(id, CSW_VESTHELM, 120);
				
				ColorChat(id, GREEN, "^x03 Ti-ai luat clasa ^x04 Bombardier")
			}
		}
		
		case 4:
		{
			if( is_user_alive( id ) )   
			{
				strip_user_weapons(id);
				give_item(id, "weapon_knife");
				give_item(id, "weapon_awp");
				give_item(id, "weapon_fiveseven");
				give_item(id, "weapon_smokegrenade");
				if(cs_get_user_team(id)==CS_TEAM_T&&user_has_weapon(id,CSW_C4))	give_item(id,"weapon_c4")
				cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 1);
				cs_set_user_bpammo(id, CSW_AWP, 30);
				cs_set_user_bpammo(id, CSW_FIVESEVEN, 30);
				cs_set_user_bpammo(id, CSW_VESTHELM, 120);
				
				ColorChat(id, GREEN, "^x03 Ti-ai luat clasa ^x04 Ghost")
			}
		}
		
		case 5:
		{
			if( is_user_alive( id ) )   
			{
				strip_user_weapons(id);
				give_item(id, "weapon_knife");
				give_item(id, "weapon_ump45");
				give_item(id, "weapon_elite");
				give_item(id, "weapon_hegrenade");
				if(cs_get_user_team(id)==CS_TEAM_T&&user_has_weapon(id,CSW_C4))	give_item(id,"weapon_c4")
				cs_set_user_bpammo(id, CSW_UMP45, 100);
				cs_set_user_bpammo(id, CSW_ELITE, 120);
				cs_set_user_bpammo(id, CSW_HEGRENADE, 2);
				cs_set_user_bpammo(id, CSW_VESTHELM, 120);
				
				
				ColorChat(id, GREEN, "^x03 Ti-ai luat clasa ^x04Bad Boy")
			}
		}
	}
	
	menu_destroy(menu);
	return PLUGIN_HANDLED;
}
Nu fac nimic contra cost! Faceți cerere bine detaliată aici, pe forum. Nu-mi mai dați add pe Steam doar pentru a mă avea în lista de prieteni.
Am cont și activez doar aici! Aveți grijă la cei ce încearcă să mă copieze..Puteți lua legătura cu mine dacă aveți o problemă/nelămurire în acest caz.
În cazul în care utilizați ceva din addonsurile postate de mine aici, e bine să fiți la curent cu modificările aduse unor plugine, aici.
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest