23.03.2014, 18:08
Hi, I was writing my own /me cmd for a RolePlay gamemode and I wanted to split the /me string into a two strings when it's too long.
I wrote this function:
In this example the strlen of the first string is 40.
When I try to show the two strings with a SendClientMessage it does show just the second string!
I thought could be a problem with the string terminator so I changed this line:
With:
With this fix the problem is just the same.
Someone can help me please? What's the problem?
I wrote this function:
pawn Код:
public SplitMe(textme[], len, first[], second[])
{
new i = 0;
new j = 0;
while(i<40)
{
first[i] = textme[i];
i++;
}
first[i+1] = '\0';
while(i<len)
{
second[j] = textme[i];
i++;
j++;
}
return 1;
}
When I try to show the two strings with a SendClientMessage it does show just the second string!
I thought could be a problem with the string terminator so I changed this line:
pawn Код:
first[i+1] = '\0';
pawn Код:
first[i+1] = 0;
Someone can help me please? What's the problem?