SA-MP Forums Archive
Server Timer - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Server Timer (/showthread.php?tid=585219)



Server Timer - Jigsaw123 - 11.08.2015

Hello!
Can someone help me make a timer so that 1 minute after the player connects, their chat gets cleared.
This is so that the
''Connected. Joining Server..."
Message goes away.


Cheers!


Re: Server Timer - TheLegend1 - 11.08.2015

show oneplayerconnect


Re: Server Timer - Jigsaw123 - 11.08.2015

Why? All I asked for is a timer..


Re: Server Timer - TheLegend1 - 11.08.2015

lol
Misc::ClearWindow(playerid);

add this at onplayerconnect


Re: Server Timer - SickAttack - 12.08.2015

pawn Код:
// [ DEVELOPMENT GAMEMODE ]

// INCLUDES:

#include <a_samp>

// DEFINES:

// FUNCTIONS:

#define function%0(%1) forward%0(%1); public%0(%1)

// PER-PLAYER VARIABLES:

// TIMERS:

new tmClearChat[MAX_PLAYERS];

// MAIN:

main()
{
    print("Development Mode: clear_chat_on_connect.amx");
}

// CALLBACKS:

public OnGameModeInit()
{
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerConnect(playerid)
{
    KillTimer(tmClearChat[playerid]);
    tmClearChat[playerid] = SetTimerEx("ClearChat", 1000 * 60, false, "i", playerid);
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    KillTimer(tmClearChat[playerid]);
    return 1;
}

// FUNCTIONS:

function ClearChat(playerid)
{
    for(new i = 0; i <= 15; i ++)
    {
        SendClientMessage(playerid, -1, " ");
    }
    return 1;
}