Remove messages when connect and send new? - 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: Remove messages when connect and send new? (
/showthread.php?tid=487469)
Remove messages when connect and send new? -
DaZZleViirus - 13.01.2014
Hi! I want to remove that messages when i joining my server, And send new messages istead... Like
Welcome to Latvia stunt!..
this code is loading verry slow
is it any ways to make a faster one?
Код:
public OnPlayerConnect(playerid)
{
SetTimerEx("ClearChat", 500, false, "d", playerid);
return 1;
}
forward TimerWelcome(playerid);
public TimerWelcome(playerid)
{
SendClientMessage(playerid, -1, "Welcome to latvia stunt server!");
return 1;
}
forward ClearChat(playerid);
public ClearChat(playerid)
{
for(new i = 0; i < 50; i++) SendClientMessage(playerid, -1," ");
SetTimerEx("TimerWelcome", 1000, false, "d", playerid);
return 1;
}
Re: Remove messages when connect and send new? -
Voxel - 13.01.2014
Ok theres no need for a timer here, simply make a stock for the clearchat and then send the message.
pawn Код:
public OnPlayerConnect(playerid)
{
ClearChat(playerid); //clear the chat first
SendClientMessage(playerid, -1, "Welcome to latvia stunt server!"); //then send the message
return 1;
}
stock ClearChat(playerid)
{
for(new i = 0; i < 50; i++) SendClientMessage(playerid, -1," ");
return 1;
}
Try to use as less timers as possible in your script, good luck
!
Re: Remove messages when connect and send new? -
DaZZleViirus - 13.01.2014
Quote:
Originally Posted by Voxel
Ok theres no need for a timer here, simply make a stock for the clearchat and then send the message.
pawn Код:
public OnPlayerConnect(playerid) { ClearChat(playerid); //clear the chat first SendClientMessage(playerid, -1, "Welcome to latvia stunt server!"); //then send the message return 1; }
stock ClearChat(playerid) { for(new i = 0; i < 50; i++) SendClientMessage(playerid, -1," "); return 1; }
Try to use as less timers as possible in your script, good luck !
|
Then it be like this..
And how can i have same position on login and class selection??