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



Onplayertext - Admigo - 16.05.2011

Heey guys
I made a skillmenu with onplayertext. If you typ a number you get that skill. I made 10 skills but i cant figure out how you can get it work with '10' because you get errors.1-9 works fine.
Pls help
Admigo


Re: Onplayertext - Seven_of_Nine - 16.05.2011

Code?


Re: Onplayertext - Admigo - 16.05.2011

if(text[0] == '10') The 10 gives the errors 0-9 works fine


Re: Onplayertext - Seven_of_Nine - 16.05.2011

Well, text[0] is 1 character. that means you have to make like
pawn Код:
if(text[0] == '1' && text[1] == '0')



Re: Onplayertext - Admigo - 16.05.2011

But then he choose skill 1


Re: Onplayertext - xDeadlyBoy - 16.05.2011

or you can do it like that:
pawn Код:
if(strfind(text, "10", true) == 0)
strfind return the index number.


Re: Onplayertext - Admigo - 16.05.2011

Sorry dont work


Re: Onplayertext - Admigo - 16.05.2011

Do anyone have idea how to fix this?


Re: Onplayertext - THE_KNOWN - 16.05.2011

If(strval(text)==10)


Re: Onplayertext - Admigo - 16.05.2011

Quote:
Originally Posted by THE_KNOWN
Посмотреть сообщение
If(strval(text)==10)
OMG!Thank you so much!