[HELP]How can a make a message from the server ?
#1

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

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

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

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.
Reply
#5

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);
Reply
#6

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 ?
Reply
#7

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

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...
Reply
#9

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

nop didn't work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)