Quote:
Originally Posted by Bugsy
Is the expectation that g_cName[] always has the users current name? If so, where are you setting the name to that array when the name gets changeed?
|
Yes, g_cName[] holds the user's current name, idk how to replace the value, so i tried with copy()
PHP Code:
public ChangeNick(iPlayer)
{
if(!GetAccess(iPlayer, ADMIN_KICK, 3))
return 1;
new cArg[32];
new iTarget, cNickname[32];
read_argv(1, cArg, sizeof(cArg)-1);
read_argv(2, cNickname, sizeof(cNickname)-1);
iTarget = GetTarget(iPlayer, cArg, FLAG_CHECK_IMMUNITY);
if(!iTarget)
return 1;
PrintToChat(0,"^x01[ADMIN]^x04 %s^x01: changed ^x04%s^x01's nickname to ^x03%s", g_cName[iPlayer], g_cName[iTarget], cNickname);
set_user_info(iTarget, "name", cNickname)
client_cmd(iTarget, "name ^"%s^"", cNickname);
copy(g_cName[iTarget], 32, cNickname) // copy the new nickname into g_cName[]
return 1;
}
also here
PHP Code:
verify_name(id)
{
static name[32]
get_user_info(id, "name", name, 31)
static i, ignore
ignore = false
for (i = 0; i <= g_sizeof_names_new; i++)
{
if(containi(name, g_names_new[i]) != -1)
{
ignore = true
break;
}
}
if(ignore)
return;
for (i = 0; i < 29; i++)
replace_all(name, 31, g_filter_chars, "")
for (i = 0; i < g_sizeof_names; i++)
{
if(containi(name, g_names[i]) != -1 && !g_bFake[i])
{
formatex(name, 31, "%s [%d]", g_names_new[random_num(0, g_sizeof_names_new)], g_names_changed)
set_user_info(id, "name", name)
client_cmd(id, "name ^"%s^"", name)
copy(g_cName[i], 32, name) // same, tried to copy the new name into g_cName[]
g_names_changed++
}
}
}
but same results