Page 2 of 4

Re: Zombie classes

Posted: 28 Jul 2018, 10:04
by Mohamed Alaa
Rain1153 wrote:
1 Year Ago
but it didn't come :/
Add this hunter will (will be shared later) & test it.
PS: use the same sound in speed boost plugin.

| Code:

  1. #include <zombie_escape>
  2. #include <ze_zombie_class>
  3.  
  4. // Trail effect configs
  5. #define TRAIL_LIFE  2   // Life
  6. #define TRAIL_WIDTH 10  // Width
  7. #define TRAIL_RED   90  // Red color
  8. #define TRAIL_GREEN 200 // Green color
  9. #define TRAIL_BLUE  90  // Blue color
  10. #define TRAIL_ALPHA 220 // Alpha
  11.  
  12. new g_pCvarSpeedAmount, g_pCvarBoostTime, g_pCvarSpeedBoostDelay
  13. new bool:g_bCanUseSB[33], g_iCoolDown_Time[33]
  14. new g_iSpeedTrail
  15. new g_iClassID
  16.  
  17. /*-------------------START CONFIGS ----------------*/
  18. new const HUNTER_NAME[] = "Hunter"
  19. new const HUNTER_INFO[] = "Speed boost"
  20. const HUNTER_HEALTH = 1800
  21. const HUNTER_SPEED = 0.75
  22. const HUNTER_GRAVITY = 1.0
  23. /*------------------- END CONFIGS -----------------*/
  24.  
  25. new const g_iSpeedSound[] = "zombie_escape/sprint.wav"
  26.  
  27. public plugin_precache()
  28. {
  29.     g_iClassID = ze_register_zombie_class(HUNTER_NAME, HUNTER_INFO, HUNTER_HEALTH, HUNTER_SPEED, HUNTER_GRAVITY)
  30.  
  31.     precache_sound(g_iSpeedSound)
  32.     g_iSpeedTrail = precache_model("sprites/smoke.spr")
  33. }
  34.  
  35. public plugin_init()
  36. {
  37.     register_plugin("[ZE] Addons: Speed Boost", "1.0", "Jack GamePlay")
  38.  
  39.     client_clcmd("drop", "SpeedBoost")
  40.  
  41.     g_pCvarBoostTime = register_cvar("ze_boost_time", "3.0")
  42.     g_pCvarSpeedAmount = register_cvar("ze_speed_amount", "450")
  43.     g_pCvarSpeedBoostDelay = register_cvar("ze_speedboost_delay", "10.0")
  44. }
  45.  
  46. public client_putinserver(id)
  47. {
  48.     g_bCanUseSB[id] = false
  49. }
  50.  
  51. public client_disconnected(id)
  52. {
  53.     g_bCanUseSB[id] = false
  54. }
  55.  
  56. public ze_user_infected(id)
  57. {
  58.     if (!is_user_alive(id) || (ze_get_current_zombie_class(id) != g_iClassID))
  59.         return
  60.  
  61.     g_bCanUseSB[id] = true
  62.     ze_colored_print(id, "!tPress !y[!gG!y] !tto get a speed boost!y.")
  63. }
  64.  
  65. public ze_user_humanized(id)
  66. {
  67.     if (!is_user_alive(id))
  68.         return
  69.  
  70.     g_bCanUseSB[id] = false
  71. }
  72.  
  73. public SpeedBoost(id)
  74. {
  75.     if (!is_user_alive(id))
  76.         return PLUGIN_CONTINUE
  77.  
  78.     if (!ze_is_user_zombie(id))
  79.     {
  80.         ze_colored_print(id, "!tThis option is for !gzombies !tonly!y.")
  81.         return PLUGIN_HANDLED
  82.     }
  83.  
  84.     if (g_bCanUseSB[id])
  85.     {
  86.         g_bCanUseSB[id] = false
  87.         ze_set_zombie_speed(id, get_pcvar_num(g_pCvarSpeedAmount))
  88.         ze_colored_print(id, "!tYou got !y[!g%i!y] !tspeed for !y[!g%i!y] !tsec!y.", get_pcvar_num(g_pCvarSpeedAmount), floatround(get_pcvar_float(g_pCvarBoostTime)))
  89.  
  90.         message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  91.         write_byte(TE_BEAMFOLLOW)
  92.         write_short(id)
  93.         write_short(g_iSpeedTrail)
  94.         write_byte(TRAIL_LIFE)
  95.         write_byte(TRAIL_WIDTH)
  96.         write_byte(TRAIL_RED)
  97.         write_byte(TRAIL_GREEN)
  98.         write_byte(TRAIL_BLUE)
  99.         write_byte(TRAIL_ALPHA)
  100.         message_end()
  101.  
  102.         emit_sound(id, CHAN_STREAM, g_iSpeedSound, 1.0, ATTN_NORM, 0, PITCH_NORM)
  103.         set_task(get_pcvar_float(g_pCvarBoostTime), "Remove_Boost", id)
  104.     }
  105.  
  106.     return PLUGIN_CONTINUE
  107. }
  108.  
  109. public Remove_Boost(id)
  110. {
  111.     if (!is_user_alive(id) || !ze_is_user_zombie(id))
  112.         return
  113.  
  114.     g_bCanUseSB[id] = false
  115.     g_iCoolDown_Time[id] = floatround(get_pcvar_float(g_pCvarSpeedBoostDelay))
  116.     ze_reset_zombie_speed(id)
  117.     ze_colored_print(id, "!gSpeed boost has ended!y.")
  118.     set_task(1.0, "ShowHUD", id, _, _, "a", g_iCoolDown_Time[id])
  119.     set_task(get_pcvar_float(g_pCvarSpeedBoostDelay), "Allow_Again", id)
  120. }
  121.  
  122. public ShowHUD(id)
  123. {
  124.     if (!is_user_alive(id))
  125.         return
  126.  
  127.     if (!g_bCanUseSB[id])
  128.     {
  129.         g_iCoolDown_Time[id] = g_iCoolDown_Time[id] - 1
  130.         set_hudmessage(200, 200, 200, 0.75, 0.92, 0, 1.0, 1.1, 0.0, 0.0, -1)
  131.         show_hudmessage(id, "Sprint cooldown: %i", g_iCoolDown_Time[id])
  132.     }
  133. }
  134.  
  135. public Allow_Again(id)
  136. {
  137.     if (!is_user_alive(id) || !ze_is_user_zombie(id))
  138.         return
  139.  
  140.     g_bCanUseSB[id] = true
  141.     ze_colored_print(id, "!gSpeed boost can be used!y.")
  142. }

Re: Zombie classes

Posted: 28 Jul 2018, 10:13
by Rain1153
You are mistaked bro...wait can you add 3 new default classes in ze class.sma? So that i can edit it from the source through defines?
Like in zp there r default 4 classes
And pls see why the ini file is not auto generated

Re: Zombie classes

Posted: 28 Jul 2018, 10:27
by Mohamed Alaa
Rain1153 wrote:
1 Year Ago
You are mistaked bro...wait can you add 3 new default classes in ze class.sma? So that i can edit it from the source through defines?
Like in zp there r default 4 classes
And pls see why the ini file is not auto generated
The INI file is auto generated if it doesn't exist & if any plugin ran & has this native in it:

Code: Select all

native ze_register_zombie_class
We put a default zombie class in the source so it's used when there are not any added zombie classes but if there is any zombie classes, default ZClasses will be useless. Just use the hunter class i have provided you & you will understand.

Re: Zombie classes

Posted: 28 Jul 2018, 11:17
by Rain1153
so i will try to convert other zp classes too

Re: Zombie classes

Posted: 28 Jul 2018, 13:17
by johnnysins2000
we can convert zp classes into ze ?

Re: Zombie classes

Posted: 28 Jul 2018, 13:22
by Mohamed Alaa
johnnysins2000 wrote:
1 Year Ago
we can convert zp classes into ze ?
Yes.

Re: Zombie classes

Posted: 28 Jul 2018, 13:39
by johnnysins2000
Jack GamePlay wrote:
1 Year Ago
johnnysins2000 wrote:
1 Year Ago
we can convert zp classes into ze ?
Yes.
a tutorial would be good in tutorials section ?

any chances of making it ? or atleast tell me which natives i can use to convert zp classes to ze?

Re: Zombie classes

Posted: 28 Jul 2018, 13:54
by Mohamed Alaa
johnnysins2000 wrote:
1 Year Ago

a tutorial would be good in tutorials section ?

any chances of making it ? or at least tell me which natives i can use to convert zp classes to ze?
Check the include file & you will find all natives & forwards.
I will make a tutorial.
I'm sharing examples.

Re: Zombie classes

Posted: 04 Nov 2018, 14:14
by DarkZombie
ze_zombie_class.sma can not be converted to amxx, this is the error: (image)

Re: Zombie classes

Posted: 04 Nov 2018, 21:37
by Mohamed Alaa
DarkZombie wrote:
10 Months Ago
ze_zombie_class.sma can not be converted to amxx, this is the error: (image)
Make a new file called "zombie_class_const.inc" & put in it the code in the first post.