Approved Antidote

Zombies/Humans Extra-Items
Rain1153
Senior Member
Senior Member
India
Posts: 277
Joined: 1 Year Ago
Has thanked: 2 times
Been thanked: 1 time
Age: 19
Contact:

Antidote

#1

Post by Rain1153 » 1 Year 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 on 09 Apr 2018, 05:22, edited 5 times in total.
LOL

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1962
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 21
Contact:

#2

Post by Raheem » 1 Year Ago

Make nice posting style bro... This style make me :lol: btw, it's good idea.
You don't know? Learn and you will know.

Rain1153
Senior Member
Senior Member
India
Posts: 277
Joined: 1 Year Ago
Has thanked: 2 times
Been thanked: 1 time
Age: 19
Contact:

#3

Post by Rain1153 » 1 Year Ago

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

User avatar
Mohamed Alaa
Mod Developer
Mod Developer
Egypt
Posts: 622
Joined: 2 Years Ago
Location: Egypt
Has thanked: 34 times
Been thanked: 48 times
Age: 19
Contact:

#4

Post by Mohamed Alaa » 1 Year Ago

I edited your code. Now, it's clean. Re-edit the post.
Want your own mod edition? PM me.
Accepting web projects.
CS 1.6 hosting: powergamingtech.com

Rain1153
Senior Member
Senior Member
India
Posts: 277
Joined: 1 Year Ago
Has thanked: 2 times
Been thanked: 1 time
Age: 19
Contact:

#5

Post by Rain1153 » 1 Year Ago

Thanks jack
LOL

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 633
Joined: 2 Years Ago
Location: Tunisia
Has thanked: 14 times
Been thanked: 7 times
Age: 19
Contact:

#6

Post by Spir0x » 1 Year Ago

@Jack GamePlay 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)
}
 
I trynna make money, not friends.

User avatar
SexY DeviL CJ
Mod Tester
Mod Tester
Posts: 73
Joined: 1 Year Ago
Has thanked: 1 time
Been thanked: 10 times
Contact:

#7

Post by SexY DeviL CJ » 1 Year 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: 633
Joined: 2 Years Ago
Location: Tunisia
Has thanked: 14 times
Been thanked: 7 times
Age: 19
Contact:

#8

Post by Spir0x » 1 Year 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
I trynna make money, not friends.

User avatar
Mohamed Alaa
Mod Developer
Mod Developer
Egypt
Posts: 622
Joined: 2 Years Ago
Location: Egypt
Has thanked: 34 times
Been thanked: 48 times
Age: 19
Contact:

#9

Post by Mohamed Alaa » 1 Year Ago

Your code is fine.
Want your own mod edition? PM me.
Accepting web projects.
CS 1.6 hosting: powergamingtech.com

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 633
Joined: 2 Years Ago
Location: Tunisia
Has thanked: 14 times
Been thanked: 7 times
Age: 19
Contact:

#10

Post by Spir0x » 1 Year 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.
I trynna make money, not friends.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest