how to change name without tag
#4

Код:
new search[] = "[tag]", name[] = "dog[tag]test",
	idx = strfind(name, search, true);

if(idx != -1)
{
	print("Found Tag");

	strdel(name, idx, idx + strlen(search));

	printf("New name: \"%s\"", name);
}
This works, the result is "dogtest".

Your code is (except the source of the strings) the same, so the error is either in the ClanInfo array or SetPlayerName.

Print out the result to see what's happening.
If there are uninitialized/invalid clans make sure they are skipped, otherwise it will delete 0 characters as an empty string is 0 characters long and break the loop.

Also make sure the playername remains at least 3 characters as that is the minimum name length.
Reply


Messages In This Thread
how to change name without tag - by rockys - 23.02.2019, 12:41
Re: how to change name without tag - by NaS - 23.02.2019, 14:53
Re: how to change name without tag - by rockys - 23.02.2019, 23:37
Re: how to change name without tag - by NaS - 24.02.2019, 02:50
Re: how to change name without tag - by rockys - 26.02.2019, 23:20
Re: how to change name without tag - by RoboN1X - 27.02.2019, 05:42
Re: how to change name without tag - by TheToretto - 27.02.2019, 05:52

Forum Jump:


Users browsing this thread: 3 Guest(s)