dialog inputtext problem. - 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: dialog inputtext problem. (
/showthread.php?tid=281650)
dialog inputtext problem. -
Jack_Leslie - 07.09.2011
Hi guys, I'm trying to ask what the inputtext was, so this is my code:
pawn Code:
if(strcmp(action,"change pin",true) == 0)
But I get error: error 035: argument type mismatch (argument 1)
I also tried:
pawn Code:
if(action, "change pin", true)
but that didn't work either.
This is my action:
pawn Code:
new action = strvalEx(inputtext);
\
EDIT:
Fixed, just used "inputtext" in place of the "action" bit.
Re: dialog inputtext problem. -
[MWR]Blood - 07.09.2011
https://sampwiki.blast.hk/wiki/Strval
Re: dialog inputtext problem. -
Jack_Leslie - 07.09.2011
Quote:
Originally Posted by [MWR]Blood
|
Thanks for posting a link a 2 year old could find, but without explaining it.
++GoldMedal.
Re: dialog inputtext problem. -
[MWR]Blood - 07.09.2011
Quote:
Originally Posted by Jack_Leslie
Thanks for posting a link a 2 year old could find, but without explaining it.
++GoldMedal.
|
Did you even bothered opening it?
pawn Code:
if(strval(inputtext) == "something")
{
//your code goes here.
}
Re: dialog inputtext problem. -
Jack_Leslie - 07.09.2011
Quote:
Originally Posted by [MWR]Blood
Did you even bothered opening it?
pawn Code:
if(strval(inputtext) == "something") { //your code goes here. }
|
Yeah I did, and I've fixed it myself now so thankyou anyway.
Re: dialog inputtext problem. -
Lorenc_ - 07.09.2011
Quote:
Originally Posted by [MWR]Blood
Did you even bothered opening it?
pawn Code:
if(strval(inputtext) == "something") { //your code goes here. }
|
That will not work, and the strval function isn't used like that!
Re: dialog inputtext problem. -
[NoV]LaZ - 07.09.2011
strval returns an integer, you can't compare an integer with a string !
If you want to compare strings use strcmp.
Re: dialog inputtext problem. -
Sasino97 - 07.09.2011
LoL, strval returns the first integer value in a string
Quote:
Originally Posted by Jack_Leslie
pawn Code:
if(strcmp(action,"change pin",true) == 0)
|
Action is a number, strcmp only compares two strings (Or two arrays).