Change name points behind
Hi, i have one problem on my code, this function add points behind your name/nick
eg: MACE<100>
When someone player connect to the server the points works fine on the name/nick, but if i change the name, the new name dont have points
eg on console: name LOL
MACE<100> changed name to LOL
its supposed add the points behind the new name/nick
eg: LOL<100>
eg: MACE<100> changed name to LOL<100>
Thanks for help
PHP Code:
stock points_in_name(id)
{
new szName[32]
get_user_name(id, szName, charsmax(szName))
new iLen = strlen(szName)
/* Finds and removes "<####>" */
new iPos = iLen - 1
if( szName[iPos] == '>' )
{
for( new i = 1; i < 6; i++)
{
if( szName[iPos - i] == '<' )
{
iLen = iPos - i
szName[iLen] = '^0'
break
}
}
}
format(szName[iLen], charsmax(szName) - iLen, szName[iLen-1] == ' ' ? "<%d>" : "<%d>", points[id])
//set_user_info(id, "name", szName)
server_cmd("amx_nick #%d ^"%s^"", get_user_userid(id), szName);
}
__________________