strval
#1

strval makes it into integers

is there a function like that , that works with strings?
Reply
#2

If you mean convert an integer to a string, you can use function valstr.

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

but how can I use it

pawn Код:
if(valstr(inputtext) == string)
not working?
Reply
#4

pawn Код:
if(!strcmp(inputtext, string)) //Blah blah...
Reply
#5

Quote:
Originally Posted by fissekarl
Посмотреть сообщение
but how can I use it

pawn Код:
if(valstr(inputtext) == string)
not working?
pawn Код:
if(strcmp(valstr(inputtext), string, true) == 0)
Reply
#6

didnt work
Reply
#7

@[GF]Sasino97, please learn what functions do before giving useless examples.
Reply
#8

Still in need of a help.

I want a string not numbers, to work in DIALOG_STYLE_INPUT?

like you need to type something in the dialog lets say "sa-mp" then the code would work
Reply
#9

As said before:
pawn Код:
if(!strcmp(inputtext, string)) //Blah blah...
with your sa-mp:
pawn Код:
if(!strcmp(inputtext, "sa-mp")) //Blah blah...
Reply
#10

You don't use "valstr" for inputtext because valstr convert a value in a string. Inputtext is a string and you can't. You can use strval: it converts a string in a value (inputtext is a string).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)