Menu for flag P only

Unpaid Requests, Public Plugins
Post Reply
doicshoot
Member
Member
Posts: 1
Joined: 4 years ago
Contact:

Menu for flag P only

#1

Post by doicshoot » 4 years ago

Can someone help me with a menu wich u get

250 xp + everymap.
Stealth.
Antidode once a map.

Thanks.

User avatar
z0h1r-LK
Mod Developer
Mod Developer
Morocco
Posts: 473
Joined: 5 years ago
Location: The Red City ❤
Contact:

#2

Post by z0h1r-LK » 4 years ago

you want menu like menu vip
ok

User avatar
z0h1r-LK
Mod Developer
Mod Developer
Morocco
Posts: 473
Joined: 5 years ago
Location: The Red City ❤
Contact:

#3

Post by z0h1r-LK » 4 years ago

test it

copy it, and paste in zombie_escape.txt

Code: Select all

P_TITLE_MENU = \r[ZE] Menu P
P_EXP = +250 Exp 
P_SEALTH = Stealth
P_ANTIDOTE = Antidote \r[1 Round]
this plugin

Code: Select all

// Escaper Zone
// Escaper Zone

#include <zombie_escape>
#include <ze_levels>
#include <fun>

#define MP_EXP 250
#define STEALTH 150

new bool:iAntidote[33] = true
new bool:iExp[33] = true

public plugin_init() 
{
	register_plugin("[ZE] Menu Flag P", "0.1", "LiZou Mapper")
	
	register_event("HLTV", "EventNewRound", "a", "1=0", "2=0")
	
	register_clcmd("say /menup", "menu_fp")
	register_clcmd("say_team /menup", "menu_fp")

	register_clcmd("say /mp", "menu_fp")
	register_clcmd("say_team /mp", "menu_fp")
}

public EventNewRound(id)
{
	iAntidote[id] = true
}

public menu_fp(id)
{
	static Lang[64]
	
	// Create menu and give menu name 
	formatex(Lang, charsmax(Lang), "%L", LANG_PLAYER, "P_TITLE_MENU")
	new menu = menu_create(Lang, "handler_fp")
	
	// item 1: +250 exp
	formatex(Lang, charsmax(Lang), "%L", LANG_PLAYER, "P_EXP")
	
	// item 2: stealth
	formatex(Lang, charsmax(Lang), "%L", LANG_PLAYER, "P_SEALTH")

	// item 3: antidote
	formatex(Lang, charsmax(Lang), "%L", LANG_PLAYER, "P_ANTIDOTE")
	
	// set prop menu and display menu 
	menu_setprop(menu, MPROP_EXIT, "%L", LANG_PLAYER, "EXIT")
	menu_display(id, menu, 0)
}

public handler_fp(id, menu, item)
{
	switch(item)
	{
		case 0:
		{
			// item 1
			if(iExp[id])
			{
				ze_set_user_xp(id, ze_get_user_xp(id) + MP_EXP)
				iExp[id] = false
			}
		}
		
		case 1:
		{
			// item 2
			set_user_health(id, get_user_health(id) + STEALTH)
		}
		
		case 2:
		{
			// item 3
			if(iAntidote[id])
			{
				if(!ze_is_user_zombie(id))
				{
					ze_set_user_human(id)
					iAntidote[id] = false
				}
				
				else
				{
					ze_colored_print(id, "Antidote is once time in round, wait new round !")
				}
			}
		}
	}
	
	menu_destroy(menu)
	return PLUGIN_HANDLED
}	

Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Who is online

Users browsing this forum: No registered users and 2 guests