problem with strins
#1

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}")
  }
}
Reply


Messages In This Thread
problem with strins - by gui13 - 16.12.2019, 01:50
Re: problem with strins - by Mugala - 16.12.2019, 12:08
Re: problem with strins - by gui13 - 16.12.2019, 16:12
Re: problem with strins - by Joe Staff - 16.12.2019, 16:23
Re: problem with strins - by gui13 - 16.12.2019, 17:42

Forum Jump:


Users browsing this thread: 1 Guest(s)