Raised This Month: $ Target: $400
 0% 

get_user_aiming => unintended assigment


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wouter
Senior Member
Join Date: Feb 2005
Location: Belgium
Old 04-30-2006 , 09:36   get_user_aiming => unintended assigment
Reply With Quote #1

this is what i got
Code:
public dontshoot(id)     {     if ( ! get_cvar_num("amx_camouflage") )           return PLUGIN_HANDLED           new index, bodypart, distance = 99999;     get_user_aiming(id, index, bodypart, distance);         if(is_user_connected(index) && is_user_alive(index))         {         if(get_user_team(id) != get_user_team(index))             {             // looking at enemy => check for camouflage             if(HasCamo[index] = true)  // warning 211: possible unintended assigment                 {                 set_hudmessage(0, 0, 255, -1.0, -1.0, 0, 6.0, 7.0)                 show_hudmessage(id, "He is a friend!\nDo not shoot!")               }         }         else             {             // not looking at enemy => do nothing             return PLUGIN_HANDLED                   }     }     return PLUGIN_HANDLED }

can someone tell me how to fix this warning?
wouter is offline
Willmaker
Senior Member
Join Date: Dec 2004
Location: Sydney, Australia
Old 04-30-2006 , 09:40  
Reply With Quote #2

With:
Code:
 if(HasCamo[index] = true)

With this, your basically trying to set HasCamo[index] to true, hence unintended assignment.

What you want is:

Code:
 if(HasCamo[index] == true)
__________________
GargStudios.net - Australian SvenCoop/Ent Server with Time Based Rewards
Willmaker is offline
Send a message via ICQ to Willmaker Send a message via AIM to Willmaker Send a message via MSN to Willmaker Send a message via Yahoo to Willmaker
wouter
Senior Member
Join Date: Feb 2005
Location: Belgium
Old 04-30-2006 , 09:43  
Reply With Quote #3

oh stupid of me.

thx
wouter is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 04-30-2006 , 11:01  
Reply With Quote #4

you could also do it like so:
Code:
 if ( HasCamo[index] )
[ --<-@ ] Black Rose is offline
wouter
Senior Member
Join Date: Feb 2005
Location: Belgium
Old 05-01-2006 , 12:49  
Reply With Quote #5

must it be a loob to work?
because it does nothing
wouter 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 05:07.


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