16.12.2019, 01:50
Hello, a friend passed me a script using strins but when executing it in the console it shows an error "[debug] Run time error 10:" Native function failed "", can you help me?
HTML Code:
new
szMessage[256] = "Hello @Player, how are you today?",
szMentionColor[] = "{FF0000}"
;
for (new i = 0, j = sizeof(szMessage); i != j; ++i)
{
if (szMessage[i] == '@')
{
new iColorEndPos;
for (new x = i; x != j; ++x)
{
if (szMessage[x] == ' ' || szMessage[x] == ',')
{
iColorEndPos = x;
}
else if (x == j - 1)
{
iColorEndPos = j;
}
}
strins(szMessage, szMentionColor, i, 256); // 256 = sizeof (szMessage)
strins(szMessage, "{FFFFFF}", iColorEndPos + 8, 256); // 256 = sizeof (szMessage), iColorEndPos + 8 = iColorEndPos + sizeof ("{FFFFFF}")
}
}


