I create nemesis plugin but not work [Help]

Coding Help/Re-API Supported
karan
Mod Tester
Mod Tester
India
Posts: 58
Joined: 2 Years Ago
Location: India
Has thanked: 1 time
Been thanked: 3 times
Age: 22
Contact:

Re: I create nemesis plugin but not work [Help]

#21

Post by karan » 1 Week Ago

jack now plugin is working but there are some problems; starting countdown is not working also round ambience is not working and when players is becoming nemesis his skin is not resetting(it stays nemesis skin even when he is zombie and also when he is human)
NeVeR DiE | Zombie Escape
IP : 139.59.90.127:40000
Image

User avatar
Mohamed Alaa
Mod Developer
Mod Developer
Egypt
Posts: 622
Joined: 2 Years Ago
Location: Egypt
Has thanked: 34 times
Been thanked: 48 times
Age: 19
Contact:

#22

Post by Mohamed Alaa » 1 Week Ago

For the menu try:

Code: Select all

#include <zombie_escape>

native ze_is_user_nemesis(id)
native ze_set_user_nemesis(id, bool:set)

// Access to start nemesis menu
#define NEMESISMENU_ACCESS ADMIN_LEVEL_H
#define MENU_PAGE_PLAYERS g_menu_data[id]

const OFFSET_CSMENUCODE = 205

new g_menu_data[33]

public plugin_natives()
{
	register_native("ze_open_nemesis_menu", "native_ze_open_nemesis_menu", 1)
}

public plugin_init()
{
	register_plugin("[ZE] Nemesis Menu", "1.0", "Jack")
	register_concmd("ze_nemmenu", "cmd_nemmenu", NEMESISMENU_ACCESS)
}

public cmd_nemmenu(id, level, cid)
{
	if (!cmd_access(id, NEMESISMENU_ACCESS, cid, 0))
	{
		client_print(id, print_console, "You don't have access.")
		return PLUGIN_HANDLED
	}
	
	open_nemesis_menu(id)
	return PLUGIN_HANDLED
}

public open_nemesis_menu(id)
{
	static szMenu[250], szName[32]
	new iMenuID, index, buffer[2]

	iMenuID = menu_create("Make nemesis", "menu_player_list")

	for (index = 0; index <= get_member_game(m_nMaxPlayers); index++)
	{
		if (!is_user_alive(index))
			continue
		
		get_user_name(index, szName, charsmax(szName))
		formatex(szMenu, charsmax(szMenu), "%s \r[%s]", szName, ze_is_user_zombie(index) ? "Zombie" : "Human")

		buffer[0] = index
		buffer[1] = 0
		menu_additem(iMenuID, szMenu, buffer)
	}

	// Back - Next - Exit
	formatex(szMenu, charsmax(szMenu), "%L", id, "MENU_BACK")
	menu_setprop(iMenuID, MPROP_BACKNAME, szMenu)
	formatex(szMenu, charsmax(szMenu), "%L", id, "MENU_NEXT")
	menu_setprop(iMenuID, MPROP_NEXTNAME, szMenu)
	formatex(szMenu, charsmax(szMenu), "%L", id, "MENU_EXIT")
	menu_setprop(iMenuID, MPROP_EXITNAME, szMenu)
	
	MENU_PAGE_PLAYERS = min(MENU_PAGE_PLAYERS, menu_pages(iMenuID) - 1)
	set_pdata_int(id, OFFSET_CSMENUCODE, 0)
	menu_display(id, iMenuID, MENU_PAGE_PLAYERS)
}

public menu_player_list(id, menuid, item)
{
	if (item == MENU_EXIT)
	{
		MENU_PAGE_PLAYERS = 0
		menu_destroy(menuid)
		open_nemesis_menu(id)
		return PLUGIN_HANDLED
	}
	
	// Remember player's menu page
	MENU_PAGE_PLAYERS = item / 7
	
	// Retrieve player id
	new buffer[2], dummy, player
	menu_item_getinfo(menuid, item, dummy, buffer, charsmax(buffer), _, _, dummy)
	player = buffer[0]
	
	if (is_user_alive(player))
	{
		new szName[2][32]
		get_user_name(id, szName[0], charsmax(szName))
		get_user_name(player, szName[1], charsmax(szName))
		ze_set_user_nemesis(player, !ze_is_user_nemesis(player))
		ze_colored_print(0, "!tAdmin !g%s!n: !g%s !tturned into %s!n.", szName[0], szName[1], ze_is_user_nemesis(player) ? "zombie" : "nemesis")
	}
	else
		ze_colored_print(id, "Player isn't alive.")
	
	menu_destroy(menuid)
	open_nemesis_menu(id)
	return PLUGIN_HANDLED
}

public native_ze_open_nemesis_menu(id)
{
	if (!is_user_connected(id))
	{
		log_error(AMX_ERR_NATIVE, "[ZE] Invalid Player id (%d)", id)
		return -1
	}

	open_nemesis_menu(id)
	return true
}
What do you mean by external skin?
Want your own mod edition? PM me.
Accepting web projects.
CS 1.6 hosting: powergamingtech.com

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests