Raised This Month: $ Target: $400
 0% 

Catch name changes


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Johnny got his gun
Veteran Member
Join Date: Jan 2004
Location: Tokyo
Old 06-16-2004 , 08:51  
Reply With Quote #2

I'm not entirely clear either how this works, but for WWW REg I hooked client_infochanged:

Code:
public client_infochanged(id) {     //if (regged(id))         //addregisteredaccess(id)     if (is_user_bot(id) || is_user_connecting(id))         return PLUGIN_CONTINUE     /*     new buffer[128]     get_info_keybuffer(id, buffer, 127)     client_print(0, print_chat, "ic %d:%s", id, buffer)     server_print("ic %d:%s", id, buffer)     */     new newname[32] // oldname[32],     //get_user_name(id, oldname, 31)     get_user_info(id, "name", newname, 31)     new prepend[32]     get_cvar_string(CVAR_PREPEND, prepend, 31)     new const PREPENDLENGTH = strlen(prepend)     if (PREPENDLENGTH > 0 && !regged(id)) { // if prepend cvar is empty, don't bother doing this!         // Force prefix on unregistered players         if (!equal(prepend, newname, PREPENDLENGTH)) {             server_print("[%s] Forcing Pub: name on %s", PLUGINNAME, newname)             new regurl[64]             get_cvar_string(CVAR_REGURL, regurl, 63)             client_print(id, print_console, "Because you aren't registered at %s you must use the prefix ^"%s^".", regurl, prepend)             format(newname, 31, "%s%s", prepend, newname)             //entity_set_string(idd[0], EV_SZ_netname, name)             set_user_info(id, "name", newname)             return PLUGIN_HANDLED         }     }     else if (regged(id)) {         // Regged here         if (!equal(newname, g_forumnames[id])) {             server_print("[%s] Forcing forum name (%s) on %s", PLUGINNAME, g_forumnames[id], newname)             client_print(id, print_console, "Sorry, you must use your name (%s) from forums!", g_forumnames[id], newname)             set_user_info(id, "name", g_forumnames[id]) // Force forum name             return PLUGIN_HANDLED         }     }     //new idd[1]     //idd[0] = id     //set_task(0.1, "checkname", 0, idd, 1)     return PLUGIN_CONTINUE }
Johnny got his gun is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:53.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode