Help with the "If" statement
I feel like an idiot asking this question, but obviously I am not getting it right. PAWN must be different from VB and Java, here are my if statements that get 4 errors and 2 warnings.
Code:
if(get_cvar_num("amx_rpgbuy")="0")Code:
if(omfg<4500)Code:
if(hasRPG[id]=1 && nrop = "CSW_AWP") |
Code:
Code:
Code:
PS. Next Time give the error to |
= is for assignment and == is for comparison
the second one is totaly fine the third... you cannot compare strings using = (or == for that matter), check the string.inc |
Ok it all works except for this line:
Code:
I guess I should have said Code:
|
What does cs_get_weapon_id return exactly? that might be the problem, sorry for the double post.
|
think it returns
Code:
CSW_P228 |
I am so glad I realised this, new wpnid = read_data(2)
cs_get_weapon_id won't work in this situation. |
so....? you got it all working?
|
CSW_AWP is integer constant which defined in includes so nrop must be integer either and then that operation would be correct: nrop == CSW_AWP
If you want get current weapon id, use get_user_weapon cs_get_weapon_id is for weapon entity id |
| All times are GMT -4. The time now is 16:39. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.