OnPlayerText
#1

https://pastebin.com/z577Ex3G

Hm, won't work (Under OnPlayerText)

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

Код:
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.
Reply
#3

thx+rep
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)