AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   register_clcmd("setinfo" .. Not Working !! (https://forums.alliedmods.net/showthread.php?t=128189)

ÜnLoCo 05-29-2010 17:49

register_clcmd("setinfo" .. Not Working !!
 
Hello Guys
why is this code not working plz

Code:

public plugin_init()
{
  register_plugin(PLUGIN, VERSION, AUTHOR);
  register_clcmd("setinfo","setinfo")
}

public setinfo(id) {
    new arg[32]
    read_argv(1,arg,31)
    client_print(id,print_console,"%s",arg)
    return PLUGIN_CONTINUE
}

i tried register_clcmd("setinf","setinfo") for example and it worked (that was just for trying)

console:
Code:

setinf foo
foo

i want to catch when the user changes his "fb" key! to check it
so i tried register_clcmd("setinfo fb","setinfo") also and it didn't work !

anybody got an idea !
help .. thank you

Sn!ff3r 05-29-2010 17:57

Re: register_clcmd("setinfo" .. Not Working !!
 
Setinfo is only client side command.

You can user get_user_info(); for gettin client keyinfo informations.

ÜnLoCo 05-29-2010 18:06

Re: register_clcmd("setinfo" .. Not Working !!
 
okey then !
now i can see :S

i use get_user_info when the user connects ! but i want to check when he changes his "fb" keys ! and i don't want to use client_infochanged from fear of lag ...

anybody has an idea how to detect when a user executes
Code:

setinfo fb "anything"
if no i will use client_infochanged and proceed only if the new "fb" is different than the last recorded !
btw it's an fbconnect plugin.
take a look
http://apps.facebook.com/noexitpro/
....
ma'dja look :P

Sylwester 05-29-2010 18:06

Re: register_clcmd("setinfo" .. Not Working !!
 
You can get it this way:
PHP Code:

new g_fb[33][32]
public 
plugin_init()
{
   
register_plugin(PLUGINVERSIONAUTHOR)
}

public 
client_putinserver(id)
{
    
get_user_info(id"fb"g_fb[id], 31)
}

public 
client_infochanged(id)
{
    static 
tmp[32], name[32]
    
get_user_info(id"fb"tmp31)
    if(
equal(tmpg_fb[id]))
        return
    
copy(g_fb[id], 31tmp)
    
get_user_name(idname31)
    
client_print(0print_chat"%s has changed fb to %s"nametmp)



ÜnLoCo 05-29-2010 18:17

Re: register_clcmd("setinfo" .. Not Working !!
 
how awesome Bro !
.. magic :)

joropito 05-29-2010 20:19

Re: register_clcmd("setinfo" .. Not Working !!
 
If you want to detect when some user info field is changed, you can hook FM_ClientUserInfoChanged.

You have to track all variables to know which one is changed.

ÜnLoCo 05-30-2010 06:40

Re: register_clcmd("setinfo" .. Not Working !!
 
yeah it seems even "neater" ! Thank youuu
where's the karma+ button >.<

joropito 05-30-2010 09:32

Re: register_clcmd("setinfo" .. Not Working !!
 
Quote:

Originally Posted by ÜnLoCo (Post 1195099)
where's the karma+ button >.<

In the light table BAILOPAN


All times are GMT -4. The time now is 05:21.

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