AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Replace default motd (https://forums.alliedmods.net/showthread.php?t=237262)

jakubs777 03-20-2014 23:52

Replace default motd
 
Hi guys,

I would like to replace default motd, because I want to pass SteamId value.
After I connect to my server I can only see my default motd and nothing happen.

//UPDATE: I rebuild the code. When I type /showmotd it works, but on client_authorized it just doesnt work.
I renamed motd.txt to disable it. It is off, but my own doesnt show up.

My code:
Code:

#include <amxmodx>
#include <amxmisc>

public plugin_init()
{
register_plugin("Own motd", "1.0", "Me")
register_clcmd("say /showmotd","showsteamid")
}

public showsteamid(id)
{
new steamid[32]
get_user_authid (id,steamid,31)

new szWebsite[ 128 ];
formatex( szWebsite, 127, "http://mysite.com/motd.php?sid=%s", steamid);
show_motd(id, szWebsite);

return PLUGIN_CONTINUE
}

public client_authorized(id)
{
new steamid[32]
get_user_authid (id,steamid,31)
   
new szWebsite[ 128 ];
formatex( szWebsite, 127, "http://mysite.com/motd.php?sid=%s", steamid);
show_motd(id, szWebsite);

   
return PLUGIN_CONTINUE
}

any ideas?

PLEASE HELP

Black Rose 03-22-2014 20:40

Re: Replace default motd
 
Add a small delay of 0.1 seconds using set_task()

jakubs777 03-25-2014 12:05

Re: Replace default motd
 
I already done it, but thanks a lot :)


All times are GMT -4. The time now is 06:04.

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