Approved Antidote

Zombies/Humans Extra-Items
Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

Antidote

#1

Post by Rain1153 » 6 years ago

Well i got this idea from jack's plugin "T-Virus".Given the credit to him :D
DESCRIPTION:-
The extra item is antidote. It is for zombies of course .Its a simple logic behind "use it to become human".
Installation and instruction
Just copy the code and compile in the compiler and install it like any other plugin after getting the amxx file :)




You don't need screenshots for antidote do you :P ?

CODE:-
  1. #include <zombie_escape>
  2.  
  3. new g_iAntidote, bool:g_bCanUse
  4.  
  5. public plugin_init()
  6. {
  7.     register_plugin("[ZE] Extra Item: Antidote", "1.1", "Rain1153/Jack GamePlay")
  8.     g_iAntidote = ze_register_item("Antidote", 30, 0)
  9. }
  10.  
  11. public ze_zombie_appear()
  12. {
  13.     g_bCanUse = false
  14. }
  15.  
  16. public ze_zombie_release()
  17. {
  18.     g_bCanUse = true
  19. }
  20.  
  21. public ze_select_item_pre(id, itemid, ignorecost)
  22. {
  23.     if (itemid != g_iAntidote)
  24.         return ZE_ITEM_AVAILABLE
  25.  
  26.     if (!ze_is_user_zombie(id))
  27.         return ZE_ITEM_DONT_SHOW
  28.  
  29.     if (!g_bCanUse || ze_get_zombies_number() <= 1)
  30.         return ZE_ITEM_UNAVAILABLE
  31.  
  32.     return ZE_ITEM_AVAILABLE
  33. }
  34.  
  35. public ze_select_item_post(id, itemid, ignorecost)
  36. {
  37.     if (itemid != g_iAntidote)
  38.         return
  39.  
  40.     new szName[32]
  41.     ze_set_user_human(id)
  42.     get_user_name(id, szName, charsmax(szName))
  43.     set_hudmessage(0, 255, 0, -0.05, -0.45, 1, 0.0, 5.0, 1.0, 1.0, -1)
  44.     show_hudmessage(0, "%s has used antidote!", szName)
  45. }
Last edited by Rain1153 6 years ago, edited 5 times in total.
LOL

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

#2

Post by Raheem » 6 years ago

Make nice posting style bro... This style make me :lol: btw, it's good idea.
He who fails to plan is planning to fail

Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

#3

Post by Rain1153 » 6 years ago

Raheem wrote: 6 years ago Make nice posting style bro... This style make me :lol: btw, it's good idea.
Yeah next time :D
LOL

User avatar
Night Fury
Mod Developer
Mod Developer
Posts: 677
Joined: 7 years ago
Contact:

#4

Post by Night Fury » 6 years ago

I edited your code. Now, it's clean. Re-edit the post.
Want your own mod edition? PM me.
Accepting private projects.
Discord: Fury#7469
Image

Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

#5

Post by Rain1153 » 6 years ago

Thanks jack
LOL

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

#6

Post by Spir0x » 5 years ago

[mention]Jack GamePlay[/mention] bro check his code.

When i'm human i see it on extra-items menu. and when i'm zombie it will be hided. this item is for zombies not for humans.

how can i fix it ?

Code: Select all

#include <ze_vip>
 
 
#define VIP_ACCESS ADMIN_RCON
new g_iAntidote
 
public plugin_init()
{
  register_plugin("[ZE] Extra Item: Antidote", "1.0", "Spi")
  g_iAntidote = ze_register_item("Antidote \w[\rOWNER\w]", 1, 0)
}
 
public ze_select_item_pre(id, itemid, ignorecost)
{
  if (itemid != g_iAntidote)
    return ZE_ITEM_UNAVAILABLE
 
    // Available for Humans only, So don't show it for zombies
  if (!ze_is_user_zombie(id))
    return ZE_ITEM_DONT_SHOW
    
    // Player not owner ?
  if (get_user_flags(id) & VIP_ACCESS)
    return ZE_ITEM_DONT_SHOW
 
  return ZE_ITEM_AVAILABLE
}
 
public ze_select_item_post(id, itemid, ignorecost)
{
  if (itemid != g_iAntidote)
    return
 
  new szName[32]
  ze_set_user_human(id)
  get_user_name(id, szName, charsmax(szName))
  set_hudmessage(0, 0, 255, -0.05, -0.45, 1, 0.0, 5.0, 1.0, 1.0, -1)
  show_hudmessage(0, "%s has used antidote!", szName)
}
 

User avatar
SexY DeviL CJ
Mod Tester
Mod Tester
Posts: 73
Joined: 6 years ago
Contact:

#7

Post by SexY DeviL CJ » 5 years ago

Bro u are not showing this extra for zombies check on line 18 its used when you make extra item only for humans did u got me ? I guess should use
if_user_alive(id)
......Devil Was Here......

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

#8

Post by Spir0x » 5 years ago

See this bro not correct ?

// Available for Zombies only, So don't show it for Humans
if (!ze_is_user_zombie(id))
return ZE_ITEM_DONT_SHOW

User avatar
Night Fury
Mod Developer
Mod Developer
Posts: 677
Joined: 7 years ago
Contact:

#9

Post by Night Fury » 5 years ago

Your code is fine.
Want your own mod edition? PM me.
Accepting private projects.
Discord: Fury#7469
Image

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

#10

Post by Spir0x » 5 years ago

Where bro. i see it on extra menu 3. Antidote when i'm human. and when i'm as zombie i see only madness i dont see anti dote.

User avatar
Night Fury
Mod Developer
Mod Developer
Posts: 677
Joined: 7 years ago
Contact:

#11

Post by Night Fury » 5 years ago

Spir0x wrote: 5 years ago Where bro. i see it on extra menu 3. Antidote when i'm human. and when i'm as zombie i see only madness i dont see anti dote.
Try to change this

Code: Select all

// Player not owner ?
  if (get_user_flags(id) & VIP_ACCESS)
    return ZE_ITEM_DONT_SHOW
to this

Code: Select all

// Player not owner ?
  if (!(get_user_flags(id) & VIP_ACCESS))
    return ZE_ITEM_DONT_SHOW
Want your own mod edition? PM me.
Accepting private projects.
Discord: Fury#7469
Image

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

#12

Post by Spir0x » 5 years ago

ok. this code miss some optimizations. when i set this plugin active all items on the Extra-items menu will be transparent like i have no escape coins and i cant buy anything only antidote from all the extra items. and when i use it nightvision still working. thanks

User avatar
Night Fury
Mod Developer
Mod Developer
Posts: 677
Joined: 7 years ago
Contact:

#13

Post by Night Fury » 5 years ago

Found the problem!
Edit this:

Code: Select all

if (itemid != g_iAntidote)
    return ZE_ITEM_UNAVAILABLE
To this:

Code: Select all

if (itemid != g_iAntidote)
    return ZE_ITEM_AVAILABLE
Want your own mod edition? PM me.
Accepting private projects.
Discord: Fury#7469
Image

User avatar
Night Fury
Mod Developer
Mod Developer
Posts: 677
Joined: 7 years ago
Contact:

#14

Post by Night Fury » 5 years ago

*BUMB*
Want your own mod edition? PM me.
Accepting private projects.
Discord: Fury#7469
Image

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

#15

Post by Spir0x » 5 years ago

Ok, it's too late now i'll test it tomorrow and what about fixing nightvision when using antidote.

Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

#16

Post by Rain1153 » 5 years ago

:lol:
LOL

Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

#17

Post by Rain1153 » 5 years ago

Well you can off it when u were zombie by pressing N ( in a simple term)
LOL

Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

#18

Post by Rain1153 » 5 years ago

And just take the antidote you'll be fine
LOL

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

#19

Post by Spir0x » 5 years ago

And why ? you just need to fix and update your plugin.

User avatar
DarkZombie
Member
Member
Hungary
Posts: 76
Joined: 5 years ago
Contact:

#20

Post by DarkZombie » 5 years ago

During the game's preparation period, if someone uses it then the game will be buggy. That someone fix it?

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