SA-MP Forums Archive
How can I set null a string? - 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: How can I set null a string? (/showthread.php?tid=320119)



How can I set null a string? - Konstantinos - 21.02.2012

Hello guys. I made a stat command and it shows the text that it's attached to a player. But if I delete the label it still appears the text on the stat command. How can I set it to "" (null).
pawn Код:
// OnCreatingLabel
UserData[ id ][ PLAYER_TAG_TEXT ] = Txt;
pawn Код:
// OnDeletingLabel
UserData[ id ][ PLAYER_TAG_TEXT ] = ""; // Error Line
The error
pawn Код:
error 047: array sizes do not match, or destination array is too small
How can I fix it. I can't think anything else right now.


Re: How can I set null a string? - [HiC]TheKiller - 21.02.2012

pawn Код:
UserData[ id ][ PLAYER_TAG_TEXT][0] = '\0';
or
UserData[ id ][ PLAYER_TAG_TEXT][0] = EOS;



Re: How can I set null a string? - Konstantinos - 21.02.2012

Thank you TheKiller, I totally forgot that!