Raised This Month: $ Target: $400
 0% 

Server crashes when comparing weapons...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BioHazardousWaste
Senior Member
Join Date: Apr 2005
Location: Ontario, Canada =)
Old 04-27-2005 , 22:15   Server crashes when comparing weapons...
Reply With Quote #1

Hey all, i'm just trying to compare weapons. I need to know if a user is holding a nade or a knife, because set_user_hitzones doesn't work for that. So I don't want it to say you dodged, when in fact you didn't. Maybe i'm not doing it right, but here's my code

if(is_user_alive(Victim) && (get_user_weapon(id) != CSW_KNIFE) || (get_user_weapon(id) != CSW_HEGRENADE){
//do dodge stuff
}

and it crashes.

If I use this, it works fine:
if(is_user_alive(Victim))
{
//do dodge stuff
}
__________________
"What then is truth? Truths are illusions which we have forgotten are illusions - they are metaphors that have become worn out... this (truth) is the duty to lie according to a fixed convention.

-Friedrich Nietzsche
BioHazardousWaste is offline
Send a message via MSN to BioHazardousWaste
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 04-27-2005 , 22:21   Re: Server crashes when comparing weapons...
Reply With Quote #2

Code:
if(is_user_alive(Victim) {     if((get_user_weapon(id) != CSW_KNIFE) || (get_user_weapon(id) != CSW_HEGRENADE))     {     //do dodge stuff     } }
have you tried it like this? I see that you are trying to put a and and or if statement together, not sure if that the problem.
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
Ced
Member
Join Date: Oct 2004
Old 04-27-2005 , 22:33  
Reply With Quote #3

try
Code:
if ( is_user_alive( victim ) ) {    new iWeaponId, iClip, iAmmo;    iWeaponId = get_user_weapon( id, iClip, iAmmo );    if ( iWeaponId != CSW_KNIFE || iWeaponId != CSW_HEGRENADE ) {       //whatever    } }
Ced 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:35.


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