13.06.2017, 13:17
Hey, I've found useful function from Slice called memset.
So I decided to use it here instead of loop setting all values to -1, but it outputs tag mismatch warning. When I tried to pass PlayerText:-1, warning still persists. Seems to be working fine in game though.
PHP код:
stock memset(variable[], cells, value) {
new address;
#emit LOAD.S.pri variable
#emit STOR.S.pri address
raw_memset(address, cells, value);
}
stock raw_memset(address, cells, value) {
new param_adr;
#emit LCTRL 6
#emit MOVE.alt
#emit LCTRL 0
#emit ADD
#emit MOVE.alt
#emit LCTRL 1
#emit SUB.alt
#emit ADD.C 92
#emit STOR.S.pri param_adr
#emit LOAD.S.pri cells
#emit SHL.C.pri 2
#emit SREF.S.pri param_adr
#emit LOAD.S.alt address
#emit LOAD.S.pri value
#emit FILL 0
}
PHP код:
enum E_MDC
{
PlayerText:E_MDC_TEXTDRAW[MDC_TEXTDRAW_SIZE],
//rest
}
memset(MDC_g_sPlayer[playerid][E_MDC_TEXTDRAW], MDC_TEXTDRAW_SIZE, -1);