Cerere modificare plugin vip

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
HalogekT3Kz
Membru, skill 0
Membru, skill 0
Posts: 10
Joined: 20 Nov 2019, 23:05
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0

27 Nov 2019, 17:32

Salut ,ar putea sa ma ajute cineva sa editez acest plugin?
vreau sa schimb la vip gold din m3 sa fie m4a1 si sa mai adaug un ak47 ,dar nu reusesc nicicum!!!

Code: Select all

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

#define PLUGIN "Vip"
#define VERSION "1.0"
#define AUTHOR "HalogeKT3Kz"

#define ADMIN_GOLD	ADMIN_LEVEL_H
#define ADMIN_SILVER	ADMIN_LEVEL_G

new bool:g_iRunda[ 33 ], bool:g_iRound[ 33 ];

new const GoldTag[] = "[!gGold!teamVip!y]"
new const SilverTag[] = "[!gSilver!teamVip!y]"

public plugin_init () {
	
	register_plugin ("PLUGIN", "VERSION", "AUTHOR");
	register_clcmd ("say /vipgold","Gold");
	register_clcmd ("say /vipsilver","Silver");
	RegisterHam(Ham_Spawn, "player", "cmdSpawn", 1);
	register_logevent("RoundStart", 2, "1=Round_Start")
}

public Gold ( id )
{
	if (get_user_flags(id) & ADMIN_GOLD)
	{
		GoldMenu( id );
		g_iRunda[id] = true
	}
	else
	{
		Chat_Color(id, "%sNu ai acces la aceasta comanda",GoldTag)
		return 1;
	}
	return 0
}

public Silver ( id )
{
	if (get_user_flags(id) & ADMIN_SILVER)
	{
		SilverMenu( id )
		g_iRound[id] = true
	}
	else
	{
		Chat_Color(id, "%sNu ai acces la aceasta comanda",SilverTag)
		return 1;
	}
	return 0
}

public GoldMenu( id )
{	
	if(g_iRunda[id])
	{
		Chat_Color(id, "%sAi folosit deja odata,incearca runda urmatoare",GoldTag)
		return 1
	}
	
	static menu;
	menu = menu_create ("\yVIPMENU\r Gold","menu_gold");
	
	menu_additem ( menu,"\w M3\r +\w Deagle","1", 0 );
	menu_additem ( menu,"\w AWP\r +\w Deagle","2", 0 );
	
	menu_setprop ( menu, MPROP_NUMBER_COLOR,"\y");
	menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL );
	
	menu_display ( id, menu, 0 );
	return 0;
}

public menu_gold ( id, menu, item )
{
	if ( item == MENU_EXIT )
	{
		menu_destroy ( menu );
		return 1;
	}
	
	new data [ 6 ], szName [ 64 ];
	new access, callback;
	
	menu_item_getinfo ( menu, item, access, data, charsmax ( data ), szName, charsmax ( szName ), callback );
	
	new key = str_to_num ( data );
	
	switch ( key )
	{
		case 1:
		{
			give_item ( id,"weapon_deagle" );
			cs_set_user_bpammo( id, CSW_DEAGLE, 35 );
			give_item ( id,"weapon_m3" )
			cs_set_user_bpammo( id, CSW_M3, 32 );
			
		}
		case 2:
		{
			give_item ( id,"weapon_deagle" );
			cs_set_user_bpammo( id, CSW_DEAGLE, 35 );                
			give_item ( id,"weapon_awp" )
			cs_set_user_bpammo( id, CSW_AWP, 30 )
			
		}               
	}
	menu_destroy ( menu );
	return 1;
}

public cmdSpawn(id) {
	if(get_user_flags(id) & ADMIN_GOLD && is_user_alive(id)) {
		
		set_user_armor(id, 180)
		set_user_health(id, 150)
		give_item ( id,"weapon_hegrenade" )
		give_item ( id,"weapon_flashbang" )
		cs_set_user_bpammo(id, CSW_FLASHBANG, 2)
	}
	else if(get_user_flags(id) & ADMIN_SILVER && is_user_alive(id))
	{
		set_user_armor(id, 150)
		set_user_health(id, 120)
		give_item ( id,"weapon_hegrenade" )
	}
} 

public SilverMenu ( id )
{
	if(g_iRound[id])
	{
		Chat_Color(id, "%sAi folosit deja odata,incearca runda urmatoare",SilverTag)
		return 1;
	}
	
	static menu;
	menu = menu_create ("\yVIPMENU\r Silver","menu_silver");
	
	menu_additem ( menu,"\w M4A1","1", 0 );
	menu_additem ( menu,"\w AK47","2", 0 );
	
	menu_setprop ( menu, MPROP_NUMBER_COLOR,"\y");
	menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL );
	
	menu_display ( id, menu, 0 );
	return 0;
}

public menu_silver ( id, menu, item )
{
	if ( item == MENU_EXIT )
	{
		menu_destroy ( menu );
		return 1;
	}
	
	new data [ 6 ], szName [ 64 ];
	new access, callback;
	
	menu_item_getinfo ( menu, item, access, data, charsmax ( data ), szName, charsmax ( szName ), callback );
	
	new key = str_to_num ( data );
	
	switch ( key )
	{
		case 1:
		{
			give_item ( id,"weapon_m4a1" )
			cs_set_user_bpammo( id, CSW_M4A1, 90 );
			
		}
		case 2:
		{
			give_item ( id,"weapon_ak47" )
			cs_set_user_bpammo( id, CSW_AK47, 90 );
		}               
	}
	menu_destroy ( menu );
	return 1;
}

public RoundStart( )
{
	new iPlayers[32], iNum;
	get_players( iPlayers, iNum)
	for( new i = 0; i < iNum;i++ )
	{
		g_iRunda[ iPlayers[ i ] ] = false;
		g_iRound[ iPlayers[ i ] ] = false;
	}
}
stock Chat_Color(const id, const input[], any:...)
{
	new count = 1, players[32]
	static msg[191]
	vformat(msg, 190, input, 3)
	
	replace_all(msg, 190, "!g", "^4")
	replace_all(msg, 190, "!y", "^1")
	replace_all(msg, 190, "!team", "^3")
	
	if (id) players[0] = id; else get_players(players, count, "ch")
	{
	for (new i = 0; i < count; i++)
	{
		if (is_user_connected(players[i]))
		{
			message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
			write_byte(players[i]);
			write_string(msg);
			message_end();
		}
	}
}
}
eXtreamSHOP
User avatar
Laurentiu P.
Fost moderator
Fost moderator
Posts: 2243
Joined: 10 Jul 2013, 20:26
Detinator Steam: Nu
Reputatie: Fost super moderator
Fond eXtream: 100
Has thanked: 12 times
Been thanked: 31 times

27 Nov 2019, 17:59

Code: Select all

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

#define PLUGIN "Vip"
#define VERSION "1.0"
#define AUTHOR "Respecta drepturile de autor ;)"

#define ADMIN_GOLD	ADMIN_LEVEL_H
#define ADMIN_SILVER	ADMIN_LEVEL_G

new bool:g_iRunda[ 33 ], bool:g_iRound[ 33 ];

new const GoldTag[] = "[!gGold!teamVip!y]"
new const SilverTag[] = "[!gSilver!teamVip!y]"

public plugin_init () {
	
	register_plugin ("PLUGIN", "VERSION", "AUTHOR");
	register_clcmd ("say /vipgold","Gold");
	register_clcmd ("say /vipsilver","Silver");
	RegisterHam(Ham_Spawn, "player", "cmdSpawn", 1);
	register_logevent("RoundStart", 2, "1=Round_Start")
}

public Gold ( id )
{
	if (get_user_flags(id) & ADMIN_GOLD)
	{
		GoldMenu( id );
		g_iRunda[id] = true
	}
	else
	{
		Chat_Color(id, "%sNu ai acces la aceasta comanda",GoldTag)
		return 1;
	}
	return 0
}

public Silver ( id )
{
	if (get_user_flags(id) & ADMIN_SILVER)
	{
		SilverMenu( id )
		g_iRound[id] = true
	}
	else
	{
		Chat_Color(id, "%sNu ai acces la aceasta comanda",SilverTag)
		return 1;
	}
	return 0
}

public GoldMenu( id )
{	
	if(g_iRunda[id])
	{
		Chat_Color(id, "%sAi folosit deja odata,incearca runda urmatoare",GoldTag)
		return 1
	}
	static menu;
	menu = menu_create ("\yVIPMENU\r Gold","menu_gold");
	
	menu_additem ( menu,"\w M4A1\r +\w Deagle","1", 0 );
	menu_additem ( menu,"\w AWP\r +\w Deagle","2", 0 );
	menu_additem ( menu,"\w Ak47\r +\w Deagle","3", 0 );
	
	menu_setprop ( menu, MPROP_NUMBER_COLOR,"\y");
	menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL );
	
	menu_display ( id, menu, 0 );
	return 0;
}

public menu_gold ( id, menu, item )
{
	if ( item == MENU_EXIT )
	{
		menu_destroy ( menu );
		return 1;
	}
	
	new data [ 6 ], szName [ 64 ];
	new access, callback;
	
	menu_item_getinfo ( menu, item, access, data, charsmax ( data ), szName, charsmax ( szName ), callback );
	
	new key = str_to_num ( data );
	
	switch ( key )
	{
		case 1:
		{
			give_item ( id,"weapon_deagle" );
			cs_set_user_bpammo( id, CSW_DEAGLE, 35 );
			give_item ( id,"weapon_m4a1" );
			cs_set_user_bpammo( id, CSW_M4A1, 90 );	
		}
		case 2:
		{
			give_item ( id,"weapon_deagle" );
			cs_set_user_bpammo( id, CSW_DEAGLE, 35 );                
			give_item ( id,"weapon_awp" );
			cs_set_user_bpammo( id, CSW_AWP, 30 );
		}
		case 3:
		{
			give_item ( id,"weapon_deagle" );
			cs_set_user_bpammo( id, CSW_DEAGLE, 35 );                
			give_item ( id,"weapon_ak47" );
			cs_set_user_bpammo( id, CSW_AK47, 90 );
		} 		
	}
	menu_destroy ( menu );
	return 1;
}

public cmdSpawn(id) {
	if(get_user_flags(id) & ADMIN_GOLD && is_user_alive(id)) {
		
		set_user_armor(id, 180)
		set_user_health(id, 150)
		give_item ( id,"weapon_hegrenade" )
		give_item ( id,"weapon_flashbang" )
		cs_set_user_bpammo(id, CSW_FLASHBANG, 2)
	}
	else if(get_user_flags(id) & ADMIN_SILVER && is_user_alive(id))
	{
		set_user_armor(id, 150)
		set_user_health(id, 120)
		give_item ( id,"weapon_hegrenade" )
	}
} 

public SilverMenu ( id )
{
	if(g_iRound[id])
	{
		Chat_Color(id, "%sAi folosit deja odata,incearca runda urmatoare",SilverTag)
		return 1;
	}
	
	static menu;
	menu = menu_create ("\yVIPMENU\r Silver","menu_silver");
	
	menu_additem ( menu,"\w M4A1","1", 0 );
	menu_additem ( menu,"\w AK47","2", 0 );
	
	menu_setprop ( menu, MPROP_NUMBER_COLOR,"\y");
	menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL );
	
	menu_display ( id, menu, 0 );
	return 0;
}

public menu_silver ( id, menu, item )
{
	if ( item == MENU_EXIT )
	{
		menu_destroy ( menu );
		return 1;
	}
	
	new data [ 6 ], szName [ 64 ];
	new access, callback;
	
	menu_item_getinfo ( menu, item, access, data, charsmax ( data ), szName, charsmax ( szName ), callback );
	
	new key = str_to_num ( data );
	
	switch ( key )
	{
		case 1:
		{
			give_item ( id,"weapon_m4a1" )
			cs_set_user_bpammo( id, CSW_M4A1, 90 );
		}
		case 2:
		{
			give_item ( id,"weapon_ak47" )
			cs_set_user_bpammo( id, CSW_AK47, 90 );
		}               
	}
	menu_destroy ( menu );
	return 1;
}

public RoundStart( )
{
	new iPlayers[32], iNum;
	get_players( iPlayers, iNum)
	for( new i = 0; i < iNum;i++ )
	{
		g_iRunda[ iPlayers[ i ] ] = false;
		g_iRound[ iPlayers[ i ] ] = false;
	}
}
stock Chat_Color(const id, const input[], any:...)
{
	new count = 1, players[32]
	static msg[191]
	vformat(msg, 190, input, 3)
	
	replace_all(msg, 190, "!g", "^4")
	replace_all(msg, 190, "!y", "^1")
	replace_all(msg, 190, "!team", "^3")
	
	if (id) players[0] = id; else get_players(players, count, "ch")
	{
	for (new i = 0; i < count; i++)
	{
		if (is_user_connected(players[i]))
		{
			message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
			write_byte(players[i]);
			write_string(msg);
			message_end();
		}
	}
}
}

Code: Select all

#define AUTHOR "HalogeKT3Kz"
Mdea, habar n-ai sa adaugi un item intr-un meniu banal si te dai autor .. :hand_to_chin:
Image
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests