[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