SA-MP Forums Archive
[HELP]How can a make a message from the server ? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP]How can a make a message from the server ? (/showthread.php?tid=150842)



[HELP]How can a make a message from the server ? - BiG_bEaR - 28.05.2010

I was playing in a server and there were some messages from the server , Like :
"See our webpage at ......" How can I make that ?


Re: [HELP]How can a make a message from the server ? - ViruZZzZ_ChiLLL - 28.05.2010

Код:
SendClientMessageToAll(Color, "See our webpage at....");



Re: [HELP]How can a make a message from the server ? - BiG_bEaR - 28.05.2010

WHere should I put it and isn't this when somebody writes a command ?


Re: [HELP]How can a make a message from the server ? - ViruZZzZ_ChiLLL - 28.05.2010

Quote:
Originally Posted by BiG_bEaR
WHere should I put it and isn't this when somebody writes a command ?
If you want it via connect of the player, put it under
[pawn]
public OnPlayerConnect(playerid)
{
SendClientMessageToAll(.....)
return 1;
}

Anywhere you possibly like.


Re: [HELP]How can a make a message from the server ? - Babul - 28.05.2010

declare these strings (to be printed randomly) where your other #defines, new; etc are:
Код:
new CommercialOld;
new Commercials[][]=
{
	"1 no line will be printed twice in a row",
	"2 blablabla",
	"3 blablabla",
	"4 blablabla w/o a comma at the last line >>"
}
add this callback:
Код:
forward CommercialMsg();
public CommercialMsg()
{
	new Rnd=(1+CommercialOld+(random(sizeof(Commercials)-1)))%sizeof(Commercials);
	SendClientMessageToAll(0xaaaa55ff,Commercials[Rnd]);
	CommercialOld=Rnd;
	return 1;
}
and finally, add this line in OnGameModeInit()
Код:
	SetTimer("CommercialMsg",60000,true);



Re: [HELP]How can a make a message from the server ? - BiG_bEaR - 28.05.2010

IS the
"1 no line will be printed twice in a row",
"2 blablabla",
"3 blablabla",
"4 blablabla w/o a comma at the last line >>"
the message that will appear and what time will the message appear ?


Re: [HELP]How can a make a message from the server ? - BiG_bEaR - 29.05.2010

So i putted everything like you sayd and didn't work


Re: [HELP]How can a make a message from the server ? - Babul - 30.05.2010

the (random) messages are supposed to appear each 60,000 millisecond, thats a real minute or 1 gamehour.. that concept should work, its a simple timer which prints out one of those lines by the function, called by the timer. weird...


Re: [HELP]How can a make a message from the server ? - BiG_bEaR - 30.05.2010

well i'm gonna try one more time and post the results


Re: [HELP]How can a make a message from the server ? - BiG_bEaR - 30.05.2010

nop didn't work