Available Escape Leader (NEW IDEA)

Unpaid Requests, Public Plugins
Post Reply
User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 641
Joined: 7 years ago
Location: Tunisia
Contact:

Escape Leader (NEW IDEA)

#1

Post by Spir0x » 6 years ago

Hi, i'm here with a nice idea guys !!

i'm going to request a simple and nice plugin who give Escape coins to the leader when he press the escape button.

[Zombie Escape] You have got +10 escape coins for being first runner.

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#2

Post by Raheem » 6 years ago

Give Escape Coins to who press escape button or the first leader if he pressed escape button?
He who fails to plan is planning to fail

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 641
Joined: 7 years ago
Location: Tunisia
Contact:

#3

Post by Spir0x » 6 years ago

are you kidding me ? yeah sure the first player who press escape button
not anyone touch it he get ec.

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#4

Post by Raheem » 6 years ago

I'm not kidding you, Just review your words you used in the topic and try to understand them you will be confused. OK here it's:
  • Code: Select all

    #include <zombie_escape>
    
    // Setting File
    new const ZE_SETTING_RESOURCES[] = "zombie_escape.ini"
    
    // Variables
    new bool:g_bButtonUsed = false
    
    // Cvars
    new g_pCvarEscapeCoins
    
    // Default Values
    new const szButtonEnt[][] = 
    {
    	"grescate_amazonas",
    	"tren_escape",
    	"escape_assault",
    	"tetikleme",
    	"gemoroy",
    	"a1",
    	"llamado_escape",
    	"carrex",
    	"manager",
    	"rescate_jp",
    	"mario_escape_final_001",
    	"ascensor_escape",
    	"multi",
    	"escape_final",
    	"heli",
    	"msilo",
    	"trem_ati",
    	"heli_escape",
    	"heli1",
    	"final",
    	"tren"
    }
    
    new Array:g_szButtonName
    
    public plugin_init ()
    {
    	register_plugin("[ZE] Escape Button Message", "1.1", "Raheem")
    	
    	// Hams
    	RegisterHam(Ham_Use, "func_button", "Fw_ButtonUsed_Post", 1)
    	
    	// Cvars
    	g_pCvarEscapeCoins = register_cvar("ze_button_escape_coins", "30")
    }
    
    public plugin_precache()
    {
    	// Initialize arrays
    	g_szButtonName = ArrayCreate(51, 1)
    	
    	// Load from external file
    	amx_load_setting_string_arr(ZE_SETTING_RESOURCES, "Escape Button Message", "Button Names", g_szButtonName)
    	
    	// If we couldn't load from file, use and save default ones
    	new iIndex
    
    	if (ArraySize(g_szButtonName) == 0)
    	{
    		for (iIndex = 0; iIndex < sizeof szButtonEnt; iIndex++)
    			ArrayPushString(g_szButtonName, szButtonEnt[iIndex])
    		
    		// If not found .ini File Create it and save default values in it
    		amx_save_setting_string_arr(ZE_SETTING_RESOURCES, "Escape Button Message", "Button Names", g_szButtonName)
    	}
    }
    
    public Fw_ButtonUsed_Post(iEnt, iCallerID)
    {
    	new szTargetName[51], szCallerName[32]
    	
    	pev(iEnt, pev_target, szTargetName, charsmax(szTargetName))
    	
    	for (new iIndex = 0; iIndex < ArraySize(g_szButtonName); iIndex++)
    	{
    		new szButtonName[51]
    		ArrayGetString(g_szButtonName, iIndex, szButtonName, charsmax(szButtonName))
    		
    		if (equal(szTargetName, szButtonName) && !g_bButtonUsed)
    		{
    			get_user_name(iCallerID, szCallerName, charsmax(szCallerName))
    			ze_colored_print(0, "!tEscape Button Used by!y:!g %s", szCallerName)
    			ze_set_escape_coins(iCallerID, ze_get_escape_coins(iCallerID) + get_pcvar_num(g_pCvarEscapeCoins))
    			ze_colored_print(iCallerID, "!t+%d Escape Coins For Pressing Escape Button!y!", get_pcvar_num(g_pCvarEscapeCoins))
    			g_bButtonUsed = true
    			break;
    		}
    	}
    }
    
    public ze_game_started()
    {
    	g_bButtonUsed = false
    }
This CVAR: ze_button_escape_coins 30 set value player will take when he press the escape button.
He who fails to plan is planning to fail

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 641
Joined: 7 years ago
Location: Tunisia
Contact:

#5

Post by Spir0x » 6 years ago

ok thank you bro :)

johnnysins2000
Veteran Member
Veteran Member
Paraguay
Posts: 678
Joined: 7 years ago
Location: Paraguay
Contact:

#6

Post by johnnysins2000 » 6 years ago

Nice Idea !
Nobody Is That Busy If They Make Time :roll:

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 641
Joined: 7 years ago
Location: Tunisia
Contact:

#7

Post by Spir0x » 6 years ago

:)

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 641
Joined: 7 years ago
Location: Tunisia
Contact:

#8

Post by Spir0x » 5 years ago

@Raheem this one need to be updated ?

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#9

Post by Raheem » 5 years ago

No.
He who fails to plan is planning to fail

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 0 guests