20.01.2015, 13:31
(
Последний раз редактировалось PaulDinam; 20.01.2015 в 21:09.
)
I've tried doing something like this.. didn't really work well:
It does set the value to "Test" but when I try to set it in index 5 specifically it resets all indexes to "Test 5" and when I set it to "None" on player connect it displays as "|ne"
I got it to work, nevermind. Had to remove MEM free.
It does set the value to "Test" but when I try to set it in index 5 specifically it resets all indexes to "Test 5" and when I set it to "None" on player connect it displays as "|ne"
pawn Код:
MEM::struct e_TEXT
{
Message[20]
};
new Pointer:Texts[MAX_PLAYERS][10];
public OnPlayerConnect(playerid)
{
MEM_MACR_foreach(10, i)
{
Texts[playerid][i] = MEM::calloc(e_TEXT);
MEM::set_arr(Texts[playerid][i], Message, "None", 5);
MEM::free(Texts[playerid][i]);
}
return 1;
}
CMD:add(playerid, params[])
{
MEM_MACR_foreach(10, i)
{
MEM::set_arr(Texts[playerid][i], Message, "Test", 5);
MEM::free(Texts[playerid][i]);
}
MEM::set_arr(Texts[playerid][5], Message, "Test 5", 8);
MEM::free(Texts[playerid][5]);
return 1;
}
CMD:show(playerid, params[])
{
new text[20];
MEM_MACR_foreach(10, i)
{
MEM::get_arr(Texts[playerid][i], Message, text, 20);
SCMEx(playerid, -1, "Text in slot %d: %s", i, text);
MEM::free(Texts[playerid][i]);
}
return 1;
}