Raised This Month: $ Target: $400
 0% 

Race[id]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ady20
Member
Join Date: Sep 2012
Old 10-29-2012 , 14:20   Race[id]
Reply With Quote #1

I have this human-class plugin where the VIP(with Race[id]=7) can jump 3 times.
It says something like this:
if(!is_user_alive(id) || Race[id] != 7) return PLUGIN_CONTINUE;

Now I want to add 2 more characters so they can jump 3 times also. If I add:
if(!is_user_alive(id) || Race[id] !=5 || Race[id] !=6 || Race[id] != 7) return PLUGIN_CONTINUE;
or
if(!is_user_alive(id) || Race[id] =5 || Race[id] =6 || Race[id] = 7) return PLUGIN_CONTINUE;
or
if(!is_user_alive(id) || Race[id] ==5 || Race[id] ==6 || Race[id] == 7) return PLUGIN_CONTINUE;

Noone of that works. How can I add?

Here's the whoole plugin.
Attached Files
File Type: sma Get Plugin or Get Source (Clase_Human_Ady20.sma - 586 views - 13.8 KB)

Last edited by Ady20; 10-29-2012 at 14:41.
Ady20 is offline
malec321
Senior Member
Join Date: May 2009
Location: Los Angeles
Old 10-30-2012 , 00:21   Re: Race[id]
Reply With Quote #2

try if(!is_user_alive(id) && (Race[id] != 5 || Race[id] != 6 || Race[id] != 7) return PLUGIN_CONTINUE;
__________________
Ayyylmao
malec321 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-30-2012 , 00:40   Re: Race[id]
Reply With Quote #3

Quote:
Originally Posted by malec321 View Post
(Race[id] != 5 || Race[id] != 6 || Race[id] != 7)
That will always return true.

It should be this:

Code:
if(!is_user_alive(id) || !(Race[id] == 5 || Race[id] == 6 || Race[id] == 7))
Also, a single equal sign means you are assigning a value to the cell of the array.
__________________

Last edited by fysiks; 10-30-2012 at 01:03.
fysiks is offline
Ady20
Member
Join Date: Sep 2012
Old 10-30-2012 , 04:31   Re: Race[id]
Reply With Quote #4

It worked. Thanks a lot for the tips.
Ady20 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:20.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode