Approved Random Prizes

Plug-ins compatibility with Zombie Escape 1.x only!


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

#21

Post by Raheem » 5 years ago

Maybe && instead of ||, try:
    1. public give_prize(id)
    2. {
    3.     if (is_user_alive(id) && g_bBlockBuy)
    4.     {
    5.         ze_colored_print(id, "!tYou must wait till zombie choosen!y.")
    6.         return
    7.     }
    8.    
    9.     if (ze_is_user_zombie(id) && g_bZBlockBuy)
    10.     {
    11.         ze_colored_print(id, "!tYou must wait till zombie released!y.")
    12.         return
    13.     }
    14.    
    15.     else if (g_bUsed[id])
    16.     {
    17.         ze_colored_print(id, "!tYou can only use this once per round!")
    18.         return
    19.     }
He who fails to plan is planning to fail

User avatar
Mark
VIP
VIP
United States of America
Posts: 283
Joined: 5 years ago
Location: Des Moines/USA
Contact:

#22

Post by Mark » 5 years ago

Raheem wrote: 5 years ago Maybe && instead of ||, try:
    1. public give_prize(id)
    2. {
    3.     if (is_user_alive(id) && g_bBlockBuy)
    4.     {
    5.         ze_colored_print(id, "!tYou must wait till zombie choosen!y.")
    6.         return
    7.     }
    8.    
    9.     if (ze_is_user_zombie(id) && g_bZBlockBuy)
    10.     {
    11.         ze_colored_print(id, "!tYou must wait till zombie released!y.")
    12.         return
    13.     }
    14.    
    15.     else if (g_bUsed[id])
    16.     {
    17.         ze_colored_print(id, "!tYou can only use this once per round!")
    18.         return
    19.     }
If thats it im going to rage lmfao

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

#23

Post by Raheem » 5 years ago

lol, try i don't test. Try and tell me.
He who fails to plan is planning to fail

User avatar
Mark
VIP
VIP
United States of America
Posts: 283
Joined: 5 years ago
Location: Des Moines/USA
Contact:

#24

Post by Mark » 5 years ago

Raheem wrote: 5 years ago lol, try i don't test. Try and tell me.
OMG BUT WHY!!!

I thought they do the same thing || &&

Yes it works now

:evil: :evil: :evil: :evil: :evil: :evil:

User avatar
Mark
VIP
VIP
United States of America
Posts: 283
Joined: 5 years ago
Location: Des Moines/USA
Contact:

#25

Post by Mark » 5 years ago

Raheem wrote: 5 years ago lol, try i don't test. Try and tell me.
NEVERMIND I SEE
  1. //This is false, because 1 returns true and 0 returns false.  
  2. //Since both are not true, && returns false.
  3. (1 && 0)
  4. (1 && 2)                    //Both numbers are "true", therefore the expression is true.
  5. (true && false)             //false
  6. (false && false)            //false
  7. (true && true)              //true
  8. The other important operator is "or". It returns true if one of two expressions are true.
  9.  
  10. (1 || 0)                    //true, since one of the values is true.
  11. (1 || 2)                    //true
  12. (true || false)             //true
  13. (false || false)            //false
  14. (true || true)              //true

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

#26

Post by Raheem » 5 years ago

if (!is_user_alive(id) || g_bBlockBuy)
  • Means if user not alive OR g_bBlockBuy is true
So better to say
  • If user is alive AND g_BlockBuy is true
The wrong in the following:

if (ze_is_user_zombie(id) || g_bZBlockBuy)
  • Means if user is zombie OR g_bZBlockBuy is true
    So for any zombie it will show always the message as it's OR
So right to say
  • If user is zombie AND g_bZBlockBuy is true
    So if he is already zombie the g_bZBlockBuy will be important and the full expresion result depend on it
That's it. AND and OR by logic :D
He who fails to plan is planning to fail

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