|
Veteran Member
Join Date: Nov 2014
Location: Lithuania
|
02-06-2019
, 10:19
Re: motd prints all playing players in rows
|
#14
|
Quote:
Originally Posted by CrazY.
Well, it "copy" the string to the variable from its "free space", otherwise the already stored string would be replaced.
Code:
new szText[5], iLen;
iLen = copy(szText, charsmax(szText), "abc");
// So, we have
// iLen = 3 (3 chars, abc)
// szText[0] would be "a"
// szText[1] would be "b"
// szText[2] would be "c"
// szText[iLen] would be "", could be represented by szText[3] in that example
copy(szText[iLen], charsmax(szText) - iLen, "de");
// Now, szText[3] would be "d" and szText[4] would be "e"
// Basically we have now
// szText[0] = "a"
// szText[1] = "b"
// szText[2] = "c"
// szText[3] = "d"
// szText[4] = "e"
// Instead of
// szText[0] = "a"
// szText[1] = "b"
// szText[2] = "c"
// szText[3] = ""
// szText[4] = ""
It's a method similar to the add so to say, but we can format the string.
https://www.amxmodx.org/api/string/add
Someone else may give you a better explanation.
|
I'm grateful to you for an explanation.
Last edited by DjSoftero; 02-06-2019 at 10:28.
|
|
|
|