Public error name - 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: Public error name (
/showthread.php?tid=72424)
Public error name -
Rks25 - 08.04.2009
pawn Код:
//At OnPlayerText
new tmp[256], idx;
tmp = strtok(text, idx);
Test(playerid,tmp);
//At Bottom
forward Test(playerid,check);
public Test(playerid,check)
{
// Code using 'check'.
}
and it gives
Код:
error 035: argument type mismatch (argument 2)
What is wrong here?
Re: Public error name -
[M2S]moe - 08.04.2009
check is a string so you must format ti the right way:
public Test(playerid, check[])
Re: Public error name -
Rks25 - 08.04.2009
Oke done that, next question:
How to make a integer out of a string?
I want to make a integer out of check[].
Re: Public error name -
Weirdosport - 08.04.2009
You need to use Strval to get an integer from a string. For example:
pawn Код:
new iValue = strval(tmp);
Re: Public error name -
Rks25 - 08.04.2009
strval is when you need to convert a integer in a string right?
Re: Public error name -
Weirdosport - 08.04.2009
See for yourself, I might not have fully understood your query:
Click here
Re: Public error name -
Rks25 - 08.04.2009
Thanks, was confused with valstr.
Thanks again.
Re: Public error name -
Weirdosport - 08.04.2009
Now you've confused me, i'll have to look up valstr!
Re: Public error name -
Rks25 - 08.04.2009
valstr can be used to convert an integer value to a string.
strval can be used to convert a string to an integer.