Тема за споделяне на всякакви AMXX команди

Мястото за намиране и споделяне на всякакви AMXX плъгини.
Отговори
Потребителски аватар

Автор на темата
OciXCrom TM
Администратор
Администратор
Мнения: 4585
Регистриран: 06 окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 38 пъти
Получена благодарност: 366 пъти
Години: 21
Контакти:

Тема за споделяне на всякакви AMXX команди

Мнение от OciXCrom TM » 20 мар 2017, 22:28

Тъй като често виждам заявки за определени команди, реших тук да поставям всички команди, които съм направил, с цел потребители по-лесно да ги намират. Всеки може да ползва един от кодовете по-долу за да направи някоя собствена команда. Ако всичко е наред, ще я добавя в първия пост от темата.

Всеки плъгин съдържа настройки в началото на кода и обяснение за всяка една от тях. Прочетете ги внимателно преди да задавате въпроси. Можете да изключите командата в конзолата или чата като сложите // в началото на реда.
amx_grab & /grab • телепортира играча до администратора
amx_gravity & /gravity • променя гравитацията на играча
amx_revive & /revive • съживява играча

Потребителски аватар

MF1 CS-BG
Потребител
Потребител
Мнения: 292
Регистриран: 12 окт 2016, 21:15
Местоположение: Varna
Получена благодарност: 2 пъти
Контакти:

Re: Тема за споделяне на всякакви AMXX команди

Мнение от MF1 CS-BG » 06 апр 2017, 17:35

Команда: amx_removei / amx_restorei
Описание: Командата amx_removei премахва имунитета на админ , командата amx_restorei връща имунитета на админ
Автор: OciXCrom

Код: Избери всички

#include <amxmodx>
#include <amxmisc>

#define PLUGIN_VERSION "1.0"

new bool:g_bImmune[33]

public plugin_init()
{
    register_plugin("Remove Immunity", PLUGIN_VERSION, "OciXCrom")
    register_concmd("amx_removei", "ToggleImmunity", ADMIN_RCON, "<nick|#userid>")
    register_concmd("amx_restorei", "ToggleImmunity", ADMIN_RCON, "<nick|#userid>")
}

public client_putinserver(id)
    g_bImmune[id] = false

public ToggleImmunity(id, iLevel, iCid)
{
    if(!cmd_access(id, iLevel, iCid, 2))
        return PLUGIN_HANDLED
    
    new szPlayer[32]
    read_argv(1, szPlayer, charsmax(szPlayer))
    
    new iPlayer = cmd_target(id, szPlayer, CMDTARGET_ALLOW_SELF)
    
    if(!iPlayer)
        return PLUGIN_HANDLED
        
    new szName[32]
    get_user_name(iPlayer, szName, charsmax(szName))
    
    new szCommand[8]
    read_argv(0, szCommand, charsmax(szCommand))
    
    switch(szCommand[6])
    {
        case 'm':
        {
            if(is_user_immune(iPlayer))
            {
                remove_user_flags(iPlayer, ADMIN_IMMUNITY)
                console_print(id, "* Removed immunity from %s.", szName)
                g_bImmune[iPlayer] = true
            }
            else
                console_print(id, "* %s doesn't have immunity!", szName)
        }
        case 's':
        {
            if(is_user_immune(iPlayer))
                console_print(id, "* %s already has immunity!", szName)
            else if(!g_bImmune[iPlayer])
                console_print(id, "* %s didn't have immunity, so you can't restore it!", szName)
            else
            {
                set_user_flags(iPlayer, ADMIN_IMMUNITY)
                console_print(id, "* Restored %s's immunity.", szName)
            }
        }
    }
    
    return PLUGIN_HANDLED
}

bool:is_user_immune(id)
    return get_user_flags(id) & ADMIN_IMMUNITY ? true : false
The Best Zombie BaseBuilder server in Bulgaria is online again ! Join now.
93.123.18.54:27018 :bg:

Потребителски аватар

Fr0sTt FTW;
Потребител
Потребител
Мнения: 137
Регистриран: 16 фев 2018, 19:11

Тема за споделяне на всякакви AMXX команди

Мнение от Fr0sTt FTW; » 04 мар 2018, 12:06

На базата на твойте команди направих amx_health и amx_armor

Health Command:

Код: Избери всички

#include <amxmodx>
#include <amxmisc>
#include <cromchat>
#include <fun>

/* The admin flag */
#define ADMIN_FLAG "e"

/* The console command. Put // in front to disable it */
new const CONSOLE_COMMAND[] = "amx_health"

/* The chat command. Put // in front to disable it */
new const CHAT_COMMAND[] = "/health"

/* Whether the command can be used on yourself (true = yes; false = no) */
new const bool:USE_ON_SELF = true

/* The chat prefix. Put // in front to disable it */
new const COMMAND_PREFIX[] = "&x04[AMXX]"

/* --- End of settings --- */

#define PLUGIN_VERSION "1.0"
new ADMIN_FLAG_BIT

public plugin_init()
{
	register_plugin("Health command", PLUGIN_VERSION, "OciXCrom @ amxx-bg.info")
	register_cvar("CRXCMD_Health", PLUGIN_VERSION, FCVAR_SERVER|FCVAR_SPONLY|FCVAR_UNLOGGED)
	ADMIN_FLAG_BIT = read_flags(ADMIN_FLAG)
	
	#if defined CONSOLE_COMMAND
	register_concmd(CONSOLE_COMMAND, "Cmd_Main", ADMIN_FLAG_BIT, "<nick|#userid> <hp amount>")
	#endif
	
	#if defined CHAT_COMMAND
	register_clcmd("say", "Cmd_Say")
	register_clcmd("say_team", "Cmd_Say")
	#endif
	
	#if defined COMMAND_PREFIX
	CC_SetPrefix(COMMAND_PREFIX)
	#endif
}

#if defined CONSOLE_COMMAND
public Cmd_Main(id, iLevel, iCid)
{
	if(!cmd_access(id, iLevel, iCid, 3))
		return PLUGIN_HANDLED
		
	new szPlayer[32], szAmount[8]
	read_argv(1, szPlayer, charsmax(szPlayer))
	read_argv(2, szAmount, charsmax(szAmount))
	DoAction(id, szPlayer, szAmount)
	return PLUGIN_HANDLED
}
#endif

#if defined CHAT_COMMAND
public Cmd_Say(id)
{
	if(~get_user_flags(id) & ADMIN_FLAG_BIT)
		goto @END
		
	static szArgs[64]
	read_args(szArgs, charsmax(szArgs))
	remove_quotes(szArgs)
	
	if(equali(szArgs[0], CHAT_COMMAND, charsmax(CHAT_COMMAND)))
	{
		new szPlayer[32], szAmount[8]
		parse(szArgs, szArgs, charsmax(szArgs), szPlayer, charsmax(szPlayer), szAmount, charsmax(szAmount))
		DoAction(id, szPlayer, szAmount)
		return PLUGIN_HANDLED
	}
	
	@END:
	return PLUGIN_CONTINUE
}
#endif

DoAction(id, szPlayer[], szAmount[])
{
	new iPlayer = cmd_target(id, szPlayer, CMDTARGET_ONLY_ALIVE)
	
	if(!iPlayer)
		return PLUGIN_HANDLED
	
	if(!is_str_num(szAmount))
	{
		CC_SendMessage(id, "Invalid health amount: &x07%s", szAmount)
		return PLUGIN_HANDLED
	}
	
	new iAmount = str_to_num(szAmount)
		
	if(id == iPlayer && !USE_ON_SELF)
	{
		CC_SendMessage(id, "You can't use this command on yourself!")
		return PLUGIN_HANDLED
	}
	

	
	new szName[2][32]
	get_user_name(id, szName[0], charsmax(szName[]))
	get_user_name(iPlayer, szName[1], charsmax(szName[]))
	SetHealth( iPlayer, iAmount );
	CC_LogMessage(0, _, "ADMIN &x03%s &x01set &x04%i &x01health on &x03%s", szName[0], iAmount, szName[1])
	return PLUGIN_CONTINUE
}

SetHealth( client, iHealth )
{
    if( iHealth <= 0 )
    {
        user_kill( client );
    }
    else
    {
        set_user_health( client, iHealth );
    }
}  
Armor Command:

Код: Избери всички

#include <amxmodx>
#include <amxmisc>
#include <cromchat>
#include <fun>

/* The admin flag */
#define ADMIN_FLAG "e"

/* The console command. Put // in front to disable it */
new const CONSOLE_COMMAND[] = "amx_armor"

/* The chat command. Put // in front to disable it */
new const CHAT_COMMAND[] = "/armor"

/* Whether the command can be used on yourself (true = yes; false = no) */
new const bool:USE_ON_SELF = true

/* The chat prefix. Put // in front to disable it */
new const COMMAND_PREFIX[] = "&x04[AMXX]"

/* --- End of settings --- */

#define PLUGIN_VERSION "1.0"
new ADMIN_FLAG_BIT

public plugin_init()
{
	register_plugin("Armor command", PLUGIN_VERSION, "OciXCrom @ amxx-bg.info")
	register_cvar("CRXCMD_Armor", PLUGIN_VERSION, FCVAR_SERVER|FCVAR_SPONLY|FCVAR_UNLOGGED)
	ADMIN_FLAG_BIT = read_flags(ADMIN_FLAG)
	
	#if defined CONSOLE_COMMAND
	register_concmd(CONSOLE_COMMAND, "Cmd_Main", ADMIN_FLAG_BIT, "<nick|#userid> <armor amount>")
	#endif
	
	#if defined CHAT_COMMAND
	register_clcmd("say", "Cmd_Say")
	register_clcmd("say_team", "Cmd_Say")
	#endif
	
	#if defined COMMAND_PREFIX
	CC_SetPrefix(COMMAND_PREFIX)
	#endif
}

#if defined CONSOLE_COMMAND
public Cmd_Main(id, iLevel, iCid)
{
	if(!cmd_access(id, iLevel, iCid, 3))
		return PLUGIN_HANDLED
		
	new szPlayer[32], szAmount[8]
	read_argv(1, szPlayer, charsmax(szPlayer))
	read_argv(2, szAmount, charsmax(szAmount))
	DoAction(id, szPlayer, szAmount)
	return PLUGIN_HANDLED
}
#endif

#if defined CHAT_COMMAND
public Cmd_Say(id)
{
	if(~get_user_flags(id) & ADMIN_FLAG_BIT)
		goto @END
		
	static szArgs[64]
	read_args(szArgs, charsmax(szArgs))
	remove_quotes(szArgs)
	
	if(equali(szArgs[0], CHAT_COMMAND, charsmax(CHAT_COMMAND)))
	{
		new szPlayer[32], szAmount[8]
		parse(szArgs, szArgs, charsmax(szArgs), szPlayer, charsmax(szPlayer), szAmount, charsmax(szAmount))
		DoAction(id, szPlayer, szAmount)
		return PLUGIN_HANDLED
	}
	
	@END:
	return PLUGIN_CONTINUE
}
#endif

DoAction(id, szPlayer[], szAmount[])
{
	new iPlayer = cmd_target(id, szPlayer, CMDTARGET_ONLY_ALIVE)
	
	if(!iPlayer)
		return PLUGIN_HANDLED
	
	if(!is_str_num(szAmount))
	{
		CC_SendMessage(id, "Invalid armor amount: &x07%s", szAmount)
		return PLUGIN_HANDLED
	}
	
	new iAmount = str_to_num(szAmount)
		
	if(id == iPlayer && !USE_ON_SELF)
	{
		CC_SendMessage(id, "You can't use this command on yourself!")
		return PLUGIN_HANDLED
	}
	

	
	new szName[2][32]
	get_user_name(id, szName[0], charsmax(szName[]))
	get_user_name(iPlayer, szName[1], charsmax(szName[]))
	SetArmor( iPlayer, iAmount );
	CC_LogMessage(0, _, "ADMIN &x03%s &x01set &x04%i &x01armor on &x03%s", szName[0], iAmount, szName[1])
	return PLUGIN_CONTINUE
}

SetArmor( client, iArmor )
{
    if( iArmor <= 0 )
    {
        user_kill( client );
    }
    else
    {
        set_user_armor( client, iArmor );
    }
}  

Потребителски аватар

Are you Back!
Потребител
Потребител
Мнения: 24
Регистриран: 18 апр 2018, 12:37

Тема за споделяне на всякакви AMXX команди

Мнение от Are you Back! » 25 апр 2018, 23:49

amx_blind - Блиндва даден играч и екрана става черен
amx_unblind - Не блиндва даден играч и ще види нормално.

Код: Избери всички

#include <amxmodx> 
#include <amxmisc> 

#define BLIND		(1<<0)

new PlayerFlags[33]
new gmsgFade

public amx_blind(id, level, cid)
{ 
	if(!cmd_access(id, level, cid, 2))
		return PLUGIN_HANDLED

	new arg[32] 
	read_argv(1, arg, 31) 
	new user = cmd_target(id, arg, 5) 
	if(!user) 
		return PLUGIN_HANDLED

	new authid[16], name2[32], authid2[16], name[32]
	get_user_authid(id, authid, 15)
	get_user_name(id, name, 31)
	get_user_authid(user, authid2, 15)
	get_user_name(user, name2, 31)

	if(PlayerFlags[user] & BLIND)
	{
		console_print(id, "Client ^"%s^" is already blind", name2)
		return PLUGIN_HANDLED
	}
	else
	{
		new bIndex[2]
		bIndex[0] = user
		PlayerFlags[user] += BLIND
		set_task(1.0, "delay_blind", 0, bIndex, 2)
		message_begin(MSG_ONE, gmsgFade, {0,0,0}, user) // use the magic #1 for "one client"  
		write_short(1<<12) // fade lasts this long duration  
		write_short(1<<8) // fade lasts this long hold time  
		write_short(1<<0) // fade type IN 
		write_byte(0) // fade red  
		write_byte(0) // fade green  
		write_byte(0) // fade blue    
		write_byte(255) // fade alpha    
		message_end()
	}
	switch(get_cvar_num("amx_show_activity"))
	{
		case 2:   client_print(0, 3, "ADMIN %s: blinded %s", name, name2)
		case 1:   client_print(0, 3, "ADMIN: blinded %s", name2)
	}
	console_print(id, "Client ^"%s^" blinded", name2) 
	return PLUGIN_HANDLED 
}

public amx_unblind(id, level, cid)
{ 
	if(!cmd_access(id, level, cid, 2)) 
		return PLUGIN_HANDLED

	new arg[32] 
	read_argv(1, arg, 31) 
	new user = cmd_target(id, arg, 5) 
	if(!user)
		return PLUGIN_HANDLED

	new authid[16], name2[32], authid2[16], name[32] 
	get_user_authid(id, authid, 15) 
	get_user_name(id, name, 31) 
	get_user_authid(user, authid2, 15) 
	get_user_name(user, name2, 31)
	
	if(PlayerFlags[user] & BLIND)
	{
		new bIndex[2]
		bIndex[0] = user
		PlayerFlags[user] -= BLIND
		message_begin(MSG_ONE, gmsgFade, {0,0,0}, user) // use the magic #1 for "one client"  
		write_short(1<<12) // fade lasts this long duration  
		write_short(1<<8) // fade lasts this long hold time  
		write_short(1<<1) // fade type OUT 
		write_byte(0) // fade red  
		write_byte(0) // fade green  
		write_byte(0) // fade blue    
		write_byte(255) // fade alpha    
		message_end()
	}
	else
	{
		console_print(id, "Client ^"%s^" is already unblind", name2)
		return PLUGIN_HANDLED
	}
	switch(get_cvar_num("amx_show_activity"))
	{
		case 2:   client_print(0, 3, "ADMIN %s: unblinded %s", name, name2) 
		case 1:   client_print(0, 3, "ADMIN: unblinded %s", name2) 
	}
	console_print(id, "Client ^"%s^" unblinded", name2) 
	return PLUGIN_HANDLED
}

public screen_fade(id) 
{
	new bIndex[2]
	bIndex[0] = id
	set_task(0.5, "delay_blind", 0, bIndex, 2)
	return PLUGIN_CONTINUE
}

public delay_blind(bIndex[])
{
	new id = bIndex[0]
	if(PlayerFlags[id])
	{
		// Blind Bit  
		message_begin(MSG_ONE, gmsgFade, {0,0,0}, id) // use the magic #1 for "one client" 
		write_short(1<<0) // fade lasts this long duration 
		write_short(1<<0) // fade lasts this long hold time 
		write_short(1<<2) // fade type HOLD 
		write_byte(0) // fade red 
		write_byte(0) // fade green 
		write_byte(0) // fade blue  
		write_byte(255) // fade alpha  
		message_end() 
	}
	return PLUGIN_CONTINUE
}

public plugin_init()
{
	register_plugin("AMX Blind","v1.0","T(+)rget")
	
	gmsgFade = get_user_msgid("ScreenFade") 
	register_event("ScreenFade", "screen_fade", "b")

	register_concmd("amx_blind","amx_blind", ADMIN_KICK, "<authid, nick or #userid>") 
	register_concmd("amx_unblind","amx_unblind", ADMIN_KICK, "<authid, nick or #userid>") 
	register_cvar("amx_show_activity","2")

	return PLUGIN_CONTINUE 
}
Не може да се каже, че смятате, че сте лишени от свободата на мисълта

Потребителски аватар

Michaelnut 1111
Foreigner
Foreigner
Мнения: 5
Регистриран: 18 юни 2018, 01:04
Местоположение: Virgin Islands
Години: 40
Контакти:

Тема за споделяне на всякакви AMXX команди

Мнение от Michaelnut 1111 » 04 авг 2018, 05:08

МНЕНИЕТО Е СКРИТО ОТ СТРАНА НА МОДЕРАТОР! ЦЪКНИ ВЪРХУ ЛЕНТАТА ЗА ДА ГО ПРЕГЛЕДАШ.
Последна промяна от OciXCrom TM на 04 авг 2018, 14:45, променено общо 1 път.
Причина: ?!?!?!?!?!??!?!!?

Отговори

Върни се в “Плъгини”

Кой е на линия

Потребители, разглеждащи този форум: Няма регистрирани потребители и 1 гост