Description: This plugin gives three options:
1.) Exchanging 10k coins to 1 Level;
2.) Exchanging 50k coins to 5 Levels;
3.) Exchanging 100k coins to 10 Levels.
Cvars:
Prices
ze_first_price "10000" // default (set's the price of the 1st option.)
ze_second_price "50000" // default (set's the price of the 2nd option.)
ze_third_price "100000" // default (set's the price of the 3rd option.)
Level Increments
ze_first_increase "1" // default (set's +1 Level when you choose first option in menu.)
ze_second_increase "5" // default (set's +5 Levels when you choose second option in menu.)
ze_third_increase "10" // default (set's +10 Levels when you choose third option in menu.)
Code:
- #include <zombie_escape>
- #include <ze_levels>
- /* native ze_save_levels(id) // enable if you connect the native with SaveLevels(id) in level_system plugin */
- new cmenu
- new cost1, cost5, cost10, inc1, inc2, inc3
- public plugin_init() {
- register_plugin("ZE Exchanger", "1.0", "Nevermind")
- register_clcmd("say /exchange", "Exchanger")
- register_clcmd("say_team /exchange", "Exchanger")
- register_dictionary("ze_exchanger.txt")
- cost1 = register_cvar("ze_first_price", "10000") // first option price
- cost5 = register_cvar("ze_second_price", "50000") // seconds option price
- cost10 = register_cvar("ze_third_price", "100000") // third option price
- inc1 = register_cvar("ze_first_increase", "1") // first option level increase
- inc2 = register_cvar("ze_second_increase", "5") // seconds option level increase
- inc3 = register_cvar("ze_third_increase", "10") // third option level increase
- }
- public plugin_natives()
- {
- register_native("ze_exchanger", "native_ze_exchanger", 1)
- }
- public Exchanger(id)
- {
- if (!is_user_connected(id) || !is_user_alive(id))
- return
- cmenu = menu_create("\w[\rZE\w] \rCoins Exchanger", "cmenuHandler")
- menu_additem(cmenu, "\wExchange \y[10000 Coins] \wto \r1 Level", "")
- menu_additem(cmenu, "\wExchange \y[50000 Coins] \wto \r5 Levels", "")
- menu_additem(cmenu, "\wExchange \y[100000 Coins] \wto \r10 Levels", "")
- menu_display(id, cmenu, 0)
- }
- public cmenuHandler(id, exitmenu, chose)
- {
- if (!is_user_connected(id) || !is_user_alive(id))
- return PLUGIN_HANDLED
- if (chose == MENU_EXIT)
- {
- menu_destroy(exitmenu)
- return PLUGIN_HANDLED
- }
- switch(chose)
- {
- case 0:
- {
- if (ze_get_escape_coins(id) < get_pcvar_num(cost1))
- {
- ze_colored_print(id, "%L", LANG_PLAYER, "NOT_ENOUGH_COINS")
- }
- else
- {
- ze_set_escape_coins(id, ze_get_escape_coins(id) - get_pcvar_num(cost1))
- ze_set_user_level(id, ze_get_user_level(id) + get_pcvar_num(inc1))
- ze_colored_print(id, "%L", LANG_PLAYER, "EXCHANGE_ONE")
- //ze_save_levels(id)
- }
- }
- case 1:
- {
- if (ze_get_escape_coins(id) < get_pcvar_num(cost5))
- {
- ze_colored_print(id, "%L", LANG_PLAYER, "NOT_ENOUGH_COINS")
- }
- else
- {
- ze_set_escape_coins(id, ze_get_escape_coins(id) - get_pcvar_num(cost5))
- ze_set_user_level(id, ze_get_user_level(id) + get_pcvar_num(inc2))
- ze_colored_print(id, "%L", LANG_PLAYER, "EXCHANGE_FIVE")
- //ze_save_levels(id)
- }
- }
- case 2:
- {
- if (ze_get_escape_coins(id) < get_pcvar_num(cost10))
- {
- ze_colored_print(id, "%L", LANG_PLAYER, "NOT_ENOUGH_COINS")
- }
- else
- {
- ze_set_escape_coins(id, ze_get_escape_coins(id) - get_pcvar_num(cost10))
- ze_set_user_level(id, ze_get_user_level(id) + get_pcvar_num(inc3))
- ze_colored_print(id, "%L", LANG_PLAYER, "EXCHANGE_TEN")
- //ze_save_levels(id)
- }
- }
- }
- return PLUGIN_HANDLED
- }
- /*public native_ze_exchanger(id)
- {
- if (!is_user_connected(id) || !is_user_alive(id))
- return
- Exchanger(id)
- }*/
Download: http://www.mediafire.com/file/al6s2kyb4 ... r.rar/file