SA-MP Forums Archive
strval - 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: strval (/showthread.php?tid=249777)



strval - fissekarl - 20.04.2011

strval makes it into integers

is there a function like that , that works with strings?


Re: strval - Zimon95 - 20.04.2011

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

https://sampwiki.blast.hk/wiki/Valstr


Re: strval - fissekarl - 20.04.2011

but how can I use it

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


Re: strval - Jeffry - 20.04.2011

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



Re: strval - Sasino97 - 20.04.2011

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)



Re: strval - fissekarl - 20.04.2011

didnt work


Re: strval - Sergei - 20.04.2011

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


Re: strval - fissekarl - 20.04.2011

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


Re: strval - Jeffry - 21.04.2011

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



Re: strval - mitosking - 21.04.2011

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).