AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   MOTD Wont Show (https://forums.alliedmods.net/showthread.php?t=146833)

shuttle_wave 01-01-2011 19:27

MOTD Wont Show
 
it shows an empty motd.

PHP Code:

#pragma semicolon 1

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>

new const VERSION[] = "1.0";

new 
boolg_bShowMotd[33];

public 
plugin_init()
{
    
register_plugin("MOTD Test"VERSION"Shuttle_Wave");
    
    
// motd block by exolent
    
register_message(get_user_msgid("MOTD"), "message_MOTD");
    
RegisterHam(Ham_Spawn"player""fwdHamSpawn_Post"1);
}

public 
client_connect(id)
{
    
g_bShowMotd[id] = false;

    
set_task(0.1"task_ShowMotd"id);
}

public 
task_ShowMotd(id)
{
    new 
szAuthID[34];
    
get_user_authid(idszAuthID33);
    
    new 
szFormat[512];
    
formatex(szFormat511"http://gmreason.com/invite/test.php?SteamID=%s"szAuthID);
    
show_motd(idszFormat);
}
 
public 
message_MOTD(const MsgId, const MsgDest, const MsgEntity)
{
    if(!
g_bShowMotd[MsgEntity])
    {
        if(
get_msg_arg_int(1) == 1)
        {
            
g_bShowMotd[MsgEntity] = true;
            return 
PLUGIN_HANDLED;
        }        
    }
    return 
PLUGIN_CONTINUE;



xPaw 01-01-2011 19:32

Re: MOTD Wont Show
 
Maybe because your site really does.

Exolent[jNr] 01-01-2011 19:33

Re: MOTD Wont Show
 
PHP Code:

#pragma semicolon 1

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>

new const VERSION[] = "1.0";

new 
boolg_bShowMotd[33];

public 
plugin_init()
{
    
register_plugin("MOTD Test"VERSION"Shuttle_Wave");
    
    
// motd block by exolent
    
register_message(get_user_msgid("MOTD"), "message_MOTD");
    
RegisterHam(Ham_Spawn"player""fwdHamSpawn_Post"1);
}

public 
client_connect(id)
{
    
g_bShowMotd[id] = false;

    
//set_task(0.1, "task_ShowMotd", id);
}

public 
task_ShowMotd(id)
{
    new 
szAuthID[34];
    
get_user_authid(idszAuthID33);
    
    new 
szFormat[512];
    
formatex(szFormat511"http://gmreason.com/invite/test.php?SteamID=%s"szAuthID);
    
show_motd(idszFormat);
}
 
public 
message_MOTD(const MsgId, const MsgDest, const MsgEntity)
{
    if(!
g_bShowMotd[MsgEntity])
    {
        if(
get_msg_arg_int(1) == 1)
        {
            
g_bShowMotd[MsgEntity] = true;
            
set_task(0.1"task_ShowMotd"MsgEntity);
        }
        return 
PLUGIN_HANDLED;
    }
    return 
PLUGIN_CONTINUE;



shuttle_wave 01-01-2011 19:38

Re: MOTD Wont Show
 
y comment out //set_task(0.1, "task_ShowMotd", id)?
make the time longer? ( 10sec )

Quote:

Originally Posted by Exolent[jNr] (Post 1384037)
PHP Code:

#pragma semicolon 1

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>

new const VERSION[] = "1.0";

new 
boolg_bShowMotd[33];

public 
plugin_init()
{
    
register_plugin("MOTD Test"VERSION"Shuttle_Wave");
    
    
// motd block by exolent
    
register_message(get_user_msgid("MOTD"), "message_MOTD");
    
RegisterHam(Ham_Spawn"player""fwdHamSpawn_Post"1);
}

public 
client_connect(id)
{
    
g_bShowMotd[id] = false;

    
//set_task(0.1, "task_ShowMotd", id);
}

public 
task_ShowMotd(id)
{
    new 
szAuthID[34];
    
get_user_authid(idszAuthID33);
    
    new 
szFormat[512];
    
formatex(szFormat511"http://gmreason.com/invite/test.php?SteamID=%s"szAuthID);
    
show_motd(idszFormat);
}
 
public 
message_MOTD(const MsgId, const MsgDest, const MsgEntity)
{
    if(!
g_bShowMotd[MsgEntity])
    {
        if(
get_msg_arg_int(1) == 1)
        {
            
g_bShowMotd[MsgEntity] = true;
            
set_task(0.1"task_ShowMotd"MsgEntity);
        }
        return 
PLUGIN_HANDLED;
    }
    return 
PLUGIN_CONTINUE;




Exolent[jNr] 01-01-2011 19:40

Re: MOTD Wont Show
 
1st, client is not in the server client_connect().
2nd, it would be better to block the join MOTD, then show yours.


All times are GMT -4. The time now is 02:10.

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