18.11.2015, 17:58
Hi, i'm using font "2" in my textdraws, but the problem is when one player has "[ or ]" in his name, and it show as stars, i don't want change the font, їany solution?
// format(str, sizeof(str),"Welcome %s", TDName(playerid)); // thats how you will use it
stock TDName(playerid)
{
new Name[128];
GetPlayerName(playerid, Name, sizeof(Name));
new string[64];
format(string, 64, "%s (%d)", Name, playerid);
new pos = 0;
while ((pos = strfind(string, "[", .pos = pos)) != -1) // we will find any matches with [
{
strdel(string, pos, pos); // now its time to delete it [ << this one
strins(string, "(", pos, sizeof(string)); // Lets put our desired bracket instead of that because [ opening bracket is the one show The stars not the ] closing bracket
}
return string; // Return the edited string and voila
}
Never tried/tested it i hope it works
PHP код:
|