SA-MP Forums Archive
Variable doesn't exist although it does? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Variable doesn't exist although it does? (/showthread.php?tid=249337)



Variable doesn't exist although it does? - nuriel8833 - 18.04.2011

Hello
I used the variable strval_fix from the include string.inc several times on my mode,but I still get this error:
PHP код:
error 017undefined symbol "strval_fix" 
And I checked everything,the include does exist,and it is in the correct folder.
Then why do I still get those errors?
Please help me
Thanks


Re: Variable doesn't exist although it does? - Cjgogo - 18.04.2011

Do you have this on your gamemode?

#include <string.inc>


Re: Variable doesn't exist although it does? - nuriel8833 - 18.04.2011

Quote:
Originally Posted by Cjgogo
Посмотреть сообщение
Do you have this on your gamemode?

#include <string.inc>
yes.


Re: Variable doesn't exist although it does? - Cjgogo - 18.04.2011

If you say your error is undefined symbol,BUT you still have this on your gamemode line:
#include <string.inc>
Then try:
#define strval strval_fix
(as you have the inlcude file,I don't know why it's not working just try it)


Re: Variable doesn't exist although it does? - nuriel8833 - 18.04.2011

Quote:
Originally Posted by Cjgogo
Посмотреть сообщение
If you say your error is undefined symbol,BUT you still have this on your gamemode line:
#include <string.inc>
Then try:
#define strval strval_fix
(as you have the inlcude file,I don't know why it's not working just try it)
Not working either.
Do you have a download of this include? Maybe I need to re-download it


Re: Variable doesn't exist although it does? - Cjgogo - 18.04.2011

By the way I asked you earlier if you have at top of your gamemode this line:

#include <string.inc>

If you have exactly that,then it's not correct,it's:

#include <string> NOT <string.inc>


Re: Variable doesn't exist although it does? - Cjgogo - 18.04.2011

Yes,I think ****** is also right,but also as you said yes to #include <string.inc> than maybe you shoudl try #incldue <string>


Re: Variable doesn't exist although it does? - nuriel8833 - 18.04.2011

Quote:
Originally Posted by ******
Посмотреть сообщение
That's not a variable, it's a function - you might be using it wrong.
Here is an example of a usage of this function that gives me errors:
PHP код:
            if(strval_fix(tmp) < || strval_fix(tmp) > 50) { SendClientMessage(playeridCOLOR_WARNING"Warning!:The number must be between 1 and 50!"); return 1; } 
Quote:
Originally Posted by Cjgogo
Посмотреть сообщение
Yes,I think ****** is also right,but also as you said yes to #include <string.inc> than maybe you shoudl try #incldue <string>
I tried them both,none is working


Re: Variable doesn't exist although it does? - nuriel8833 - 19.04.2011

Bump


Re: Variable doesn't exist although it does? - nuriel8833 - 20.04.2011

Bump,please help
This issue is frustrating me and I can not continue modding untill I fix those errors (