dialog inputtext problem.
#1

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.
Reply
#2

https://sampwiki.blast.hk/wiki/Strval
Reply
#3

Quote:
Originally Posted by [MWR]Blood
View Post
Thanks for posting a link a 2 year old could find, but without explaining it.


++GoldMedal.
Reply
#4

Quote:
Originally Posted by Jack_Leslie
View Post
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.
}
Reply
#5

Quote:
Originally Posted by [MWR]Blood
View Post
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.
Reply
#6

Quote:
Originally Posted by [MWR]Blood
View Post
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!
Reply
#7

strval returns an integer, you can't compare an integer with a string !
If you want to compare strings use strcmp.
Reply
#8

LoL, strval returns the first integer value in a string

Quote:
Originally Posted by Jack_Leslie
View Post
pawn Code:
if(strcmp(action,"change pin",true) == 0)
Action is a number, strcmp only compares two strings (Or two arrays).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)