how to change name without tag
#2

Is it about specific tags only (like only [KING] is going to be removed), or all clan tags?

You can use strfind (it returns the index where it was found, eg. 0 if it's at the start, or in your example 5, -1 if it wasn't found).

Then you know where the tag begins in the name, from there you can use strdel to remove it:

Код:
new idx = strfind(name, "[KING]", true);

if(idx != -1)
{
strdel(name, idx, idx + 6); // Deletes characters from (idx) to (idx+6), since 6 is the length of the tag
SetPlayerName(playerid, name);
}
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: 1 Guest(s)