04.02.2014, 11:50
Quote:
Take a look here carefully:
As you can see, he typed nothing (second line) and pressed enter. OnPlayerText was called and it passed an empty string in CallLocalFunction. You can fix it by checking if the text is not empty/null: pawn Code:
pawn Code:
However, there isn't any reason to use StoreChatLine with foward/public if you don't want to call it in another script or by a timer, you can use stock instead and just call it directly: pawn Code:
|
Code:
#if !defined isnull #define isnull(%1) \ ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1])))) #endif in anywhere above and under onplayertext if (isnull(text)) return 0;