Raised This Month: $ Target: $400
 0% 

register_clcmd("setinfo" .. Not Working !!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ÜnLoCo
Member
Join Date: Dec 2009
Location: 35.77N, 10.82E
Old 05-29-2010 , 17:49   register_clcmd("setinfo" .. Not Working !!
Reply With Quote #1

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
__________________

Last edited by ÜnLoCo; 05-29-2010 at 17:53.
ÜnLoCo is offline
Sn!ff3r
Veteran Member
Join Date: Aug 2007
Location: Poland
Old 05-29-2010 , 17:57   Re: register_clcmd("setinfo" .. Not Working !!
Reply With Quote #2

Setinfo is only client side command.

You can user get_user_info(); for gettin client keyinfo informations.
__________________
Join US - custom Zombie Server - Custom Addons:



Sn!ff3r is offline
Send a message via Skype™ to Sn!ff3r
ÜnLoCo
Member
Join Date: Dec 2009
Location: 35.77N, 10.82E
Old 05-29-2010 , 18:06   Re: register_clcmd("setinfo" .. Not Working !!
Reply With Quote #3

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
__________________
ÜnLoCo is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 05-29-2010 , 18:06   Re: register_clcmd("setinfo" .. Not Working !!
Reply With Quote #4

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)

__________________
Impossible is Nothing
Sylwester is offline
ÜnLoCo
Member
Join Date: Dec 2009
Location: 35.77N, 10.82E
Old 05-29-2010 , 18:17   Re: register_clcmd("setinfo" .. Not Working !!
Reply With Quote #5

how awesome Bro !
.. magic
__________________
ÜnLoCo is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 05-29-2010 , 20:19   Re: register_clcmd("setinfo" .. Not Working !!
Reply With Quote #6

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.
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
ÜnLoCo
Member
Join Date: Dec 2009
Location: 35.77N, 10.82E
Old 05-30-2010 , 06:40   Re: register_clcmd("setinfo" .. Not Working !!
Reply With Quote #7

yeah it seems even "neater" ! Thank youuu
where's the karma+ button >.<
__________________
ÜnLoCo is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 05-30-2010 , 09:32   Re: register_clcmd("setinfo" .. Not Working !!
Reply With Quote #8

Quote:
Originally Posted by ÜnLoCo View Post
where's the karma+ button >.<
In the light table BAILOPAN
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
Reply



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 05:21.


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