Plugin Available Vip extra Item Discounts

Unpaid Requests, Public Plugins
User avatar
Mark
Senior Member
Senior Member
United States of America
Posts: 258
Joined: 3 Months Ago
Location: Des Moines/USA
Donation: 1x donated in total €10.00
Has thanked: 6 times
Been thanked: 19 times
Age: 33
Contact:

Re: Vip extra Item Discounts

#41

Post by Mark » 2 Months Ago

Raheem wrote:
2 Months Ago
No, i tested it and working for me. But there is issue in numbers but not all these errors.
I think this is the answer
  1. #include <zombie_escape>
  2. #include <ze_vip>
  3.  
  4. native ze_has_vip_discount(iItemid)
  5.  
  6. new g_iCurrentEC,
  7.     g_iRequiredEC
  8.  
  9. public plugin_init()
  10. {
  11.     register_plugin("[ZE] Items Manager: Escape Coins", ZE_VERSION, AUTHORS)
  12. }
  13.  
  14. public ze_select_item_pre(id, itemid, ignorecost)
  15. {
  16.     if (ignorecost)
  17.         return ZE_ITEM_AVAILABLE
  18.    
  19.     g_iCurrentEC = ze_get_escape_coins(id)
  20.    
  21.     if ((ze_get_vip_flags(id) & VIP_E) && ze_has_vip_discount(itemid))
  22.     {
  23.         g_iRequiredEC = floatround(ze_get_item_cost(itemid) * (1.0 - 0.1))
  24.        
  25.         new szText[32]
  26.         formatex(szText, charsmax(szText), " \w(\r10 %% OFF\w)")
  27.         ze_add_text_to_item(szText)
  28.     }
  29.     else if ((ze_get_vip_flags(id) & VIP_F) && ze_has_vip_discount(itemid))
  30.     {
  31.         g_iRequiredEC = floatround(ze_get_item_cost(itemid) * (1.0 - 0.2))
  32.        
  33.         new szText[32]
  34.         formatex(szText, charsmax(szText), " \w(\r20 %% OFF\w)")
  35.         ze_add_text_to_item(szText)
  36.     }
  37.     else if ((ze_get_vip_flags(id) & VIP_G) && ze_has_vip_discount(itemid))
  38.     {
  39.         g_iRequiredEC = floatround(ze_get_item_cost(itemid) * (1.0 - 0.3))
  40.        
  41.         new szText[32]
  42.         formatex(szText, charsmax(szText), " \w(\r30 %% OFF\w)")
  43.         ze_add_text_to_item(szText)
  44.     }
  45.     else
  46.     {
  47.         g_iRequiredEC = ze_get_item_cost(itemid)
  48.     }
  49.    
  50.     if (g_iCurrentEC < g_iRequiredEC)
  51.         return ZE_ITEM_UNAVAILABLE
  52.    
  53.     return ZE_ITEM_AVAILABLE
  54. }
  55.  
  56. public ze_select_item_post(id, itemid, ignorecost)
  57. {
  58.     if (ignorecost)
  59.         return
  60.    
  61.     g_iCurrentEC = ze_get_escape_coins(id)
  62.    
  63.     if ((ze_get_vip_flags(id) & VIP_E) && ze_has_vip_discount(itemid))
  64.     {
  65.         g_iRequiredEC = floatround(ze_get_item_cost(itemid) * 0.9)
  66.     }
  67.     else if ((ze_get_vip_flags(id) & VIP_F) && ze_has_vip_discount(itemid))
  68.     {
  69.         g_iRequiredEC = floatround(ze_get_item_cost(itemid) * 0.8)
  70.     }
  71.     else if ((ze_get_vip_flags(id) & VIP_G) && ze_has_vip_discount(itemid))
  72.     {
  73.         g_iRequiredEC = floatround(ze_get_item_cost(itemid) * 0.7)
  74.     }
  75.     else
  76.     {
  77.         g_iRequiredEC = ze_get_item_cost(itemid)
  78.     }
  79.    
  80.     ze_set_escape_coins(id, g_iCurrentEC - g_iRequiredEC)
  81. }

User avatar
Mark
Senior Member
Senior Member
United States of America
Posts: 258
Joined: 3 Months Ago
Location: Des Moines/USA
Donation: 1x donated in total €10.00
Has thanked: 6 times
Been thanked: 19 times
Age: 33
Contact:

#42

Post by Mark » 2 Months Ago

Raheem wrote:
2 Months Ago
No, i tested it and working for me. But there is issue in numbers but not all these errors.
Like this so i only use 3 flags for everything.
  1. #include <zombie_escape>
  2. #include <ze_vip>
  3.  
  4. native ze_has_vip_discount(iItemid)
  5.  
  6. new g_iCurrentEC,
  7.     g_iRequiredEC
  8.  
  9. public plugin_init()
  10. {
  11.     register_plugin("[ZE] Items Manager: Escape Coins", ZE_VERSION, AUTHORS)
  12. }
  13.  
  14. public ze_select_item_pre(id, itemid, ignorecost)
  15. {
  16.     if (ignorecost)
  17.         return ZE_ITEM_AVAILABLE
  18.    
  19.     g_iCurrentEC = ze_get_escape_coins(id)
  20.    
  21.     if ((ze_get_vip_flags(id) & VIP_A) && (ze_get_vip_flags(id) & VIP_B) && (ze_get_vip_flags(id) & VIP_C) && ze_has_vip_discount(itemid))
  22.     {
  23.         g_iRequiredEC = floatround(ze_get_item_cost(itemid) * (1.0 - 0.1))
  24.        
  25.         new szText[32]
  26.         formatex(szText, charsmax(szText), " \w(\r40 %% OFF\w)")
  27.         ze_add_text_to_item(szText)
  28.     }
  29.     else if ((ze_get_vip_flags(id) & VIP_A) && (ze_get_vip_flags(id) & VIP_B) && ze_has_vip_discount(itemid))
  30.     {
  31.         g_iRequiredEC = floatround(ze_get_item_cost(itemid) * (1.0 - 0.2))
  32.        
  33.         new szText[32]
  34.         formatex(szText, charsmax(szText), " \w(\r30 %% OFF\w)")
  35.         ze_add_text_to_item(szText)
  36.     }
  37.     else if ((ze_get_vip_flags(id) & VIP_A) && ze_has_vip_discount(itemid))
  38.     {
  39.         g_iRequiredEC = floatround(ze_get_item_cost(itemid) * (1.0 - 0.3))
  40.        
  41.         new szText[32]
  42.         formatex(szText, charsmax(szText), " \w(\r20 %% OFF\w)")
  43.         ze_add_text_to_item(szText)
  44.     }
  45.     else
  46.     {
  47.         g_iRequiredEC = ze_get_item_cost(itemid)
  48.     }
  49.    
  50.     if (g_iCurrentEC < g_iRequiredEC)
  51.         return ZE_ITEM_UNAVAILABLE
  52.    
  53.     return ZE_ITEM_AVAILABLE
  54. }
  55.  
  56. public ze_select_item_post(id, itemid, ignorecost)
  57. {
  58.     if (ignorecost)
  59.         return
  60.    
  61.     g_iCurrentEC = ze_get_escape_coins(id)
  62.    
  63.     if ((ze_get_vip_flags(id) & VIP_A) && (ze_get_vip_flags(id) & VIP_B) && (ze_get_vip_flags(id) & VIP_C) && ze_has_vip_discount(itemid))
  64.     {
  65.         g_iRequiredEC = floatround(ze_get_item_cost(itemid) * 0.6)
  66.     }
  67.     else if ((ze_get_vip_flags(id) & VIP_A) && (ze_get_vip_flags(id) & VIP_B) && ze_has_vip_discount(itemid))
  68.     {
  69.         g_iRequiredEC = floatround(ze_get_item_cost(itemid) * 0.7)
  70.     }
  71.     else if ((ze_get_vip_flags(id) & VIP_A) && ze_has_vip_discount(itemid))
  72.     {
  73.         g_iRequiredEC = floatround(ze_get_item_cost(itemid) * 0.8)
  74.     }
  75.     else
  76.     {
  77.         g_iRequiredEC = ze_get_item_cost(itemid)
  78.     }
  79.    
  80.     ze_set_escape_coins(id, g_iCurrentEC - g_iRequiredEC)
  81. }

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1717
Joined: 1 Year Ago
Location: Egypt
Has thanked: 28 times
Been thanked: 78 times
Age: 21
Contact:

#43

Post by Raheem » 2 Months Ago

Working right now?

[ Post made via Nexus 7 ]
You don't know? Learn and you will know.

User avatar
Mark
Senior Member
Senior Member
United States of America
Posts: 258
Joined: 3 Months Ago
Location: Des Moines/USA
Donation: 1x donated in total €10.00
Has thanked: 6 times
Been thanked: 19 times
Age: 33
Contact:

#44

Post by Mark » 2 Months Ago

Yes

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1717
Joined: 1 Year Ago
Location: Egypt
Has thanked: 28 times
Been thanked: 78 times
Age: 21
Contact:

#45

Post by Raheem » 2 Months Ago

Nice, see you later.

[ Post made via Nexus 7 ]
You don't know? Learn and you will know.

User avatar
Mark
Senior Member
Senior Member
United States of America
Posts: 258
Joined: 3 Months Ago
Location: Des Moines/USA
Donation: 1x donated in total €10.00
Has thanked: 6 times
Been thanked: 19 times
Age: 33
Contact:

#46

Post by Mark » 2 Months Ago

Raheem wrote:
2 Months Ago
Nice, see you later.
Thankyou for your help!

User avatar
Mark
Senior Member
Senior Member
United States of America
Posts: 258
Joined: 3 Months Ago
Location: Des Moines/USA
Donation: 1x donated in total €10.00
Has thanked: 6 times
Been thanked: 19 times
Age: 33
Contact:

#47

Post by Mark » 2 Months Ago

Raheem wrote:
2 Months Ago
Nice, see you later.
What is this @Raheem
  1. L 09/25/2018 - 20:37:10: [AMXX] Displaying debug trace (plugin "ze_items_vip.amxx", version "1.3")
  2. L 09/25/2018 - 20:37:10: [AMXX] Run time error 4: index out of bounds
  3. L 09/25/2018 - 20:37:10: [AMXX]    [0] ze_items_vip.sma::native_ze_set_item_vip (line 63)
  4. L 09/25/2018 - 20:37:10: Unhandled dynamic native error

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1717
Joined: 1 Year Ago
Location: Egypt
Has thanked: 28 times
Been thanked: 78 times
Age: 21
Contact:

#48

Post by Raheem » 2 Months Ago

I don't know, open topic with this issue as it's not related to discounts.

And explain in it how you generated this out of bounds error.

[ Post made via Nexus 7 ]
You don't know? Learn and you will know.

User avatar
Mark
Senior Member
Senior Member
United States of America
Posts: 258
Joined: 3 Months Ago
Location: Des Moines/USA
Donation: 1x donated in total €10.00
Has thanked: 6 times
Been thanked: 19 times
Age: 33
Contact:

#49

Post by Mark » 2 Months Ago

Raheem wrote:
2 Months Ago
I don't know, open topic with this issue as it's not related to discounts.

And explain in it how you generated this out of bounds error.

Ok is this related lol
  1. L 09/25/2018 - 20:41:32: [AMXX] Displaying debug trace (plugin "ze_items_manager.amxx", version "1.3")
  2. L 09/25/2018 - 20:41:32: [AMXX] Run time error 4: index out of bounds
  3. L 09/25/2018 - 20:41:32: [AMXX]    [0] ze_items_manager.sma::native_ze_has_vip_discount (line 379)
  4. L 09/25/2018 - 20:41:32: Unhandled dynamic native error

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1717
Joined: 1 Year Ago
Location: Egypt
Has thanked: 28 times
Been thanked: 78 times
Age: 21
Contact:

#50

Post by Raheem » 2 Months Ago

Hmm, post ur items manger source.

[ Post made via Nexus 7 ]
You don't know? Learn and you will know.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests