- public give_prize(id)
- {
- if (is_user_alive(id) && g_bBlockBuy)
- {
- ze_colored_print(id, "!tYou must wait till zombie choosen!y.")
- return
- }
- if (ze_is_user_zombie(id) && g_bZBlockBuy)
- {
- ze_colored_print(id, "!tYou must wait till zombie released!y.")
- return
- }
- else if (g_bUsed[id])
- {
- ze_colored_print(id, "!tYou can only use this once per round!")
- return
- }
Random Prizes
Maybe && instead of ||, try:
He who fails to plan is planning to fail
If thats it im going to rage lmfaoRaheem wrote: ↑5 years ago Maybe && instead of ||, try:
public give_prize(id) { if (is_user_alive(id) && g_bBlockBuy) { ze_colored_print(id, "!tYou must wait till zombie choosen!y.") return } if (ze_is_user_zombie(id) && g_bZBlockBuy) { ze_colored_print(id, "!tYou must wait till zombie released!y.") return } else if (g_bUsed[id]) { ze_colored_print(id, "!tYou can only use this once per round!") return }
NEVERMIND I SEE
- //This is false, because 1 returns true and 0 returns false.
- //Since both are not true, && returns false.
- (1 && 0)
- (1 && 2) //Both numbers are "true", therefore the expression is true.
- (true && false) //false
- (false && false) //false
- (true && true) //true
- The other important operator is "or". It returns true if one of two expressions are true.
- (1 || 0) //true, since one of the values is true.
- (1 || 2) //true
- (true || false) //true
- (false || false) //false
- (true || true) //true
if (!is_user_alive(id) || g_bBlockBuy)
- Means if user not alive OR g_bBlockBuy is true
- If user is alive AND g_BlockBuy is true
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
- 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
He who fails to plan is planning to fail
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
Sign in
Who is online
Users browsing this forum: No registered users and 0 guests