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)
+--- Thread: OnPlayerText (/showthread.php?tid=660006)



OnPlayerText - playstores - 22.10.2018

https://pastebin.com/z577Ex3G

Hm, won't work (Under OnPlayerText)

Always saying "Write 'LEARN!' to learn new Fightingstyles or 'Cancel' to leave"


Re: OnPlayerText - NaS - 22.10.2018

Код:
if ((strcmp("LEARN!", text, true, strlen(text)) == 0) && (strlen(text) == strlen("yes")))
This statement can't possibly be true since you compare a 6 character string and then check if the given text is 3 characters. It can't be 6 and 3 characters long at the same time.

It should be this:

Код:
if ((strcmp("LEARN!", text, true) == 0))
Since text cannot be empty you don't need to check its length seperately. Same goes for the "Cancel" text. If you want "Cancel test" to be accepted as well you need to do this:

Код:
if ((strcmp("LEARN!", text, true, 6) == 0)
Note the 6 for the length of "LEARN!", not text's length.


Re: OnPlayerText - playstores - 22.10.2018

thx+rep