Argument type mismatch - 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)
+--- Thread: Argument type mismatch (
/showthread.php?tid=588959)
Argument type mismatch -
nezo2001 - 13.09.2015
PHP код:
new unban;
cache_get_field_content(0, "unban", unban);
.
Re: Argument type mismatch -
JasonSchneider - 13.09.2015
Please write the error warnings in the PHP code
Re: Argument type mismatch -
Syzygy1 - 13.09.2015
Код:
new unban = cache_get_field_content_int(0, "unban");
or
Код:
new unban[sizehere];
cache_get_field_content(0, "unban", unban);
Re: Argument type mismatch -
nezo2001 - 14.09.2015
Quote:
Originally Posted by JasonSchneider
Please write the error warnings in the PHP code
|
It is -_-
Quote:
Originally Posted by Syzygy1
Код:
new unban = cache_get_field_content_int(0, "unban");
or
Код:
new unban[sizehere];
cache_get_field_content(0, "unban", unban);
|
Doesn't work :/
Re: Argument type mismatch -
nezo2001 - 14.09.2015
Bump!
Re: Argument type mismatch -
Darrenr - 14.09.2015
When you use cache_get_field_content it stores the data you are pulling into a STRING.
the mistake you're making is trying to store the "unban" value into a Integer which is not directly possible with this function.
You need to store the value that is given to you as a STRING and then convert it to a integer.
Код:
new result[128]; // variable which temporarily stores the value as a string7
new unban; // where we are storing our "unban" value permanently
cache_get_field_content(0, "unban", result);
unban = strval(result); // We pass the result through strval which returns our value as an integer and store.
hope this helps!