Заявка за преработка ZP Give Ammo Menu

В този раздел можете да подавате всякакви заявки за намиране, изработка или преработка на плъгини/модове.
Аватар
doide li admina
Извън линия
Потребител
Потребител
Мнения: 4
Регистриран на: 30 Май 2023, 01:46
Се отблагодари: 3 пъти
Обратна връзка:

Заявка за преработка ZP Give Ammo Menu

Мнение от doide li admina » 30 Май 2023, 01:55

Добър вечер на всички! Може ли да се преработи плъгина, както казано да има и Ammo Menu да се показва в екрана този етап когато админ напише примерно "/apmenu или /ammomenu" Както тази снимка

Изображение

1. Give Ammo
2. Take Ammo
3. Set Ammo
4. Reolad Ammo


Ето и кода на който да бъде показан и добавен с cvar

Код за потвърждение: Избери целия код

/* Plugin generated by AMXX-Studio */


#include <amxmodx> 
#include <amxmisc>
#include <zombieplague> 
    
    public plugin_init ()
    {
        register_plugin ( "ZP: Give Ammo", "z1.4", "FaSt3R" );
        register_clcmd ( "zp_giveap", "CmdGiveAP", ADMIN_RCON, "- zp_giveap <name> <amount> : Give Ammo Packs" );
    }
    
    public CmdGiveAP ( id, level, cid )
    {
        if ( !cmd_access ( id, level, cid, 3 ) )
        {
            return PLUGIN_HANDLED;
        }
        
        new s_Name[ 32 ], s_Amount[ 4 ];
        
        read_argv ( 1, s_Name, charsmax ( s_Name ) );
        read_argv ( 2, s_Amount, charsmax ( s_Amount ) );
        
        new i_Target = cmd_target ( id, s_Name, 2 );
        
        if ( !i_Target )
        {
            client_print ( id, print_console, "(!) Player not found" );
            return PLUGIN_HANDLED;
        }
        
        zp_set_user_ammo_packs ( i_Target, max ( 1, str_to_num ( s_Amount ) ) );
        
        return PLUGIN_HANDLED;
}
Благодаря предварително и ще си чакам реда

Аватар
illusion
Извън линия
Модератор
Модератор
Мнения: 1731
Регистриран на: 27 Ное 2016, 17:47
Местоположение: In the Heaven
Се отблагодари: 141 пъти
Получена благодарност: 333 пъти
Обратна връзка:

Re: Заявка за преработка ZP Give Ammo Menu

Мнение от illusion » 30 Май 2023, 13:04

Командата мисля, че е zpammomenu

Код за потвърждение: Избери целия код

#include <amxmodx>

#include <zombieplague>



enum _:PlayerData

{

	g_szName[32],

	g_szSteamID[32],

	g_iOption,

	g_iPlayer,

	g_iChoosen

}



new g_PlayerInfo[33][PlayerData]



new const g_szAmmoMenuItems[][] =

{

	"\yGive Ammo",

	"\yTake Ammo",

	"\ySet Ammo^n",

	"\yReload Ammo"

}



public plugin_init()

{

	register_plugin("Admin Menu", "3.6", "Abed")

	register_concmd("zpammomenu", "AmmoMenu")

	

	register_concmd("ENTER_Ammo_NUMBER", "AmmoEntered")

	register_concmd("ENTER_Ammo_Reset", "AmmoReset")

}



public client_authorized(id)

{

	get_user_name(id, g_PlayerInfo[id][g_szName], charsmax(g_PlayerInfo[][g_szName]))

	get_user_authid(id, g_PlayerInfo[id][g_szSteamID], charsmax(g_PlayerInfo[][g_szSteamID]))

}



public AmmoMenu(id)

{

	new iMenuID = menu_create("\rAmmo Menu \w:", "AmmoMenuHandle")

	for(new i=0; i<sizeof(g_szAmmoMenuItems); i++) menu_additem(iMenuID, g_szAmmoMenuItems[i])

	menu_display(id, iMenuID)

}



public AmmoMenuHandle(id, iMenuID, iItem)

{

	switch(iItem)

	{

		case 0, 1, 2:

		{

			g_PlayerInfo[id][g_iOption] = iItem+1

			ChooseAmmoPlayer(id)

		}

		case 3: client_cmd(id, "messagemode ENTER_Ammo_Reset")

	}

	menu_destroy(iMenuID)

	return 0

}



public ChooseAmmoPlayer(id)

{

	new szItem[64], szName[33], iMenuID = menu_create("\rChoose Target \w:", "ChooseAmmoPlayerHandle")

	for(new i=0, n=0; i<=32; i++)

	{

		if(!is_user_connected(i)) continue

		g_PlayerInfo[n++][g_iPlayer] = i

		get_user_name(i, szName, charsmax(szName))

		formatex(szItem, charsmax(szItem), "\y%s - \d[\r%d\d]", szName, zp_get_user_ammo_packs(i))

		menu_additem(iMenuID, szItem, "0", 0)

	}

	menu_display(id, iMenuID)

}



public ChooseAmmoPlayerHandle(id, iMenuID, iItem)

{

	g_PlayerInfo[id][g_iChoosen] = g_PlayerInfo[iItem][g_iPlayer]

	if(!is_user_connected(g_PlayerInfo[id][g_iChoosen]))

	{

		client_print_color(id, print_team_default, "^4[Admin Menu] ^1Target Not Founded In The Server.")

		return 1

	}

	client_cmd(id, "messagemode ENTER_Ammo_NUMBER")

	menu_destroy(iMenuID)

	return 0

}



public AmmoEntered(id)

{

	new szNumber[32], iNumber, g_aName[33]

	get_user_name(id, g_aName, 32)

	read_argv(1, szNumber, charsmax(szNumber))

	iNumber = str_to_num(szNumber)

	if(!iNumber) return 1

	if(!is_user_connected(g_PlayerInfo[id][g_iChoosen]))

	{

		client_print_color(id, print_team_default, "^4[Admin Menu] ^1Target Not Founded In The Server.")

		return 1

	}

	switch(g_PlayerInfo[id][g_iOption])

	{

		case 1:

		{

			zp_set_user_ammo_packs(g_PlayerInfo[id][g_iChoosen], zp_get_user_ammo_packs(g_PlayerInfo[id][g_iChoosen]) + iNumber)

			client_print_color(0, print_team_default, "^4[Admin Menu] ^1Admin ^3%s ^1have Gaved ^4%i ^1Ammo Packs To ^3%s.", g_aName, iNumber, g_PlayerInfo[g_PlayerInfo[id][g_iChoosen]][g_szName])

			zp_log("ADMIN %s Gaved %i Ammo To %s", g_aName, iNumber, g_PlayerInfo[g_PlayerInfo[id][g_iChoosen]][g_szName])

		}

		case 2:

		{

			zp_set_user_ammo_packs(g_PlayerInfo[id][g_iChoosen], zp_get_user_ammo_packs(g_PlayerInfo[id][g_iChoosen]) - iNumber)

			client_print_color(0, print_team_default, "^4[Admin Menu] ^1Admin ^3%s ^1have Taked ^4%i ^1Ammo Packs From ^3%s.", g_aName, iNumber, g_PlayerInfo[g_PlayerInfo[id][g_iChoosen]][g_szName])

			zp_log("ADMIN %s Taked %i Ammo From %s", g_aName, iNumber, g_PlayerInfo[g_PlayerInfo[id][g_iChoosen]][g_szName])

		}

		case 3:

		{

			zp_set_user_ammo_packs(g_PlayerInfo[id][g_iChoosen], iNumber)

			client_print_color(0, print_team_default, "^4[Admin Menu] ^1Admin ^3%s ^1have Set Ammo Of ^3%s ^1To ^4%i ^1Ammo Packs.", g_aName, g_PlayerInfo[g_PlayerInfo[id][g_iChoosen]][g_szName], iNumber)

			zp_log("ADMIN %s Have Set Ammo Of %s To %i", g_aName, g_PlayerInfo[g_PlayerInfo[id][g_iChoosen]][g_szName], iNumber)

		}

	}

	return 0

}



public AmmoReset(id)

{

	new szNumber[32], iNumber, g_aName[33]

	get_user_name(id, g_aName, 32)

	read_argv(1, szNumber, charsmax(szNumber))

	iNumber = str_to_num(szNumber)

	if(!iNumber) return 1

	new iPlayers[32], iPlayerCount, i, player

	get_players(iPlayers, iPlayerCount, "a") 

	for(i = 0; i < iPlayerCount; i++)

	{

		player = iPlayers[i]

		if(zp_get_user_ammo_packs(player) >= iNumber)

			continue

		zp_set_user_ammo_packs(player, iNumber)

	}

	client_print_color(0, print_team_default, "^4[Admin Menu] ^1Admin ^3%s ^1have Reset Ammo To ^3^%i ^4Ammo Packs.", g_aName, iNumber)

	zp_log("ADMIN %s Have Set Ammo To %i Ammo Packs", g_aName, iNumber)

	return 0

}



stock zp_log(const message_fmt[], any:...)

{

	static message[256], filename[32]

	vformat(message, charsmax(message), message_fmt, 2)

	formatex(filename, charsmax(filename), "zp_Adminmenu.log")

	log_to_file(filename, "%s", message)

}
Изображение

Публикувай отговор
  • Подобни теми
    Отговори
    Преглеждания
     Последно мнение

Обратно към “Заявки за плъгини”

Кой е на линия

Потребители разглеждащи този форум: BluRayTrans Bhop, Semrush [Bot] и 4 госта