ClearChat
#1

Hey guys... When you join a server, it says ''Connecting to :7777'' etc.
I put this under my OnPlayerConnect:
Код:
	SendClientMessage(playerid, -1, " ");
	SendClientMessage(playerid, -1, " ");
	SendClientMessage(playerid, -1, " ");
	SendClientMessage(playerid, -1, " ");
	SendClientMessage(playerid, -1, " ");
	SendClientMessage(playerid, -1, " ");
	SendClientMessage(playerid, -1, " ");
	SendClientMessage(playerid, -1, " ");
	SendClientMessage(playerid, -1, " ");
	SendClientMessage(playerid, -1, " ");
BUT -.. It still says ''Connected. .... '' How do I set a timer, So this message gets sent 5 seconds later?
Reply
#2

In top
Код:
forward Lol(playerid);
OnPlayerConnect
Код:
public OnPlayerConnect(playerid)
{
SetTimerEx("Lol",4000, false, "i", playerid);
Run Timer
Код:
public Lol(playerid)
{
    SendClientMessage(playerid, -1, " ");
	SendClientMessage(playerid, -1, " ");
	SendClientMessage(playerid, -1, " ");
	SendClientMessage(playerid, -1, " ");
	SendClientMessage(playerid, -1, " ");
	SendClientMessage(playerid, -1, " ");
	SendClientMessage(playerid, -1, " ");
	SendClientMessage(playerid, -1, " ");
	SendClientMessage(playerid, -1, " ");
	SendClientMessage(playerid, -1, " ");
    return 1;
}
Reply
#3

Set the timer for like 2 seconds, It will help you out!
Reply
#4

Don't need to spam your SendClientMessage(); loop instead.

pawn Код:
for(new i = 0; i > 150; i++)
{
SendClientMessage(playerid,-1,"");
}
That will repeat it 150 times.
Reply
#5

pawn Код:
//on top
new CTimer[MAX_PLAYERS];

//Under Onplayerconnect
CTimer[playerid] = SetTimerEx("CC",5000,false,"i",playerid);

//Somewhere else
forward cc(playerid);
public cc(playerid)
{
    //Your function here
    KillTimer(CTimer[playerid]);
}
Reply
#6

Its like this but Spam is not needed as Danice saide code is this
Код:
for(new i = 0; i > 150; i++)
{
SendClientMessage(playerid,-1,"");
}
Reply
#7

Quote:
Originally Posted by DaniceMcHarley
Посмотреть сообщение
Don't need to spam your SendClientMessage(); loop instead.

pawn Код:
for(new i = 0; i > 150; i++)
{
SendClientMessage(playerid,-1,"");
}
That will repeat it 150 times.
Wasn't it supposed to be i<150?
Reply
#8

Typo ._.

pawn Код:
for(new i = 0; i < 150; i++)
{
SendClientMessage(playerid,-1,"");
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)