SA-MP Forums Archive
Weird things on 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: Weird things on OnPlayerText (/showthread.php?tid=245381)



Weird things on OnPlayerText - leong124 - 31.03.2011

Hello,
when I try to do some functions like strins or text[k] = text[k - 6] with the string "text" from the callback,
Everything will crash and the whole OnPlayerText callback will terminate and do things like returning 1 in the callback.
I am doing that strins/array assigns in another function.

However, when I try to copy the "text" string to another string variable declared inside the callback,
everything works perfectly.

So what's the problem?


Re: Weird things on OnPlayerText - Gamer_Z - 31.03.2011

let's take a look:
pawn Код:
array[0] = array[0-6] // array[0] = array[-6]
..


Re: Weird things on OnPlayerText - leong124 - 02.04.2011

I ensured that the k must be larger than 6 since its min value is pos + 6,which pos is the position for searching the string.
Also, the strins also cause error there, so cell overflow isn't the problem.


Re: Weird things on OnPlayerText - leong124 - 03.04.2011

Any idea