[SOLVED] SendMSG
#1

Sup again, well, now my question is... how can I adjust how many messages that will be sent?

Like, sometimes one message can be sent five times before the other mrssage gets sent.

Код:
forward SendMSG();
Код:
new Announcements[][] =
{
  "Thank you for roleplaying with us, please enjoy your stay here.",
  "Please remember to visit our new forums at BlaHBlah",
  "Want to have your own car, skin, house or maybe faction, please donate to the server and help us to keep it alive.",
  "This is Gangster Roleplay it is not a Deathmatch or a Turf War server.",
  "If you see a Rule Breaker, Deathmatcher or a Hacker, please (/re)port to an admin."
};
Код:
public SendMSG()
{
  new randMSG = random(sizeof(Announcements));
  SendClientMessageToAll(COLOR_LIGHTBLUE, Announcements[randMSG]);
}
Thanks
Reply
#2

This can't be adjusted since you can never trust what random chooses


But what you can do is create a variable

like this

pawn Код:
public SendMSG();
{
new Message;
switch(Message)
{
case 0:
{
SendClientMessage(playerid,0xFFFFFF,"Thank you for roleplaying with us, please enjoy your stay here.");
Message = 1;
}
case 1:
{
SendClientMessage(playerid,0xFFFFFF,"Please remember to visit our new forums at BlaHBlah");
Message = 2;
}
case 2:
{
SendClientMessage(playerid,0xFFFFFF,"Want to have your own car, skin, house or maybe faction, please donate to the server and help us to help us to keep it alive.");
Message = 3;
}
case 3:
{
SendClientMessage(playerid,0xFFFFFF,"This is Gangster Roleplay it is not a Deathmatch or a Turf War server.");
Message = 4;
}
case 4:
{
SendClientMessage(playerid,0xFFFFFF, "If you see a Rule Breaker, Deathmatcher or a Hacker, please (/re)port to an admin.");
Message = 0;
}
return 1;
}
Edit: Doh hitted enter by mistake xD
Reply
#3

Quote:
Originally Posted by Desert
This can't be adjusted since you can never trust what random chooses


But what you can do is create a variable

like this

[pawn]
public SendMSG();
{
new Message;
switch(Message)
{
case 0:
{
SendClientMessage(playerid,0xFFFFFF,"Thank you for roleplaying with us, please enjoy your stay here.");
Message = 1;
}
case 1:
{
SendClientMessage(playerid,0xFFFFFF,"Please remember to visit our new forums at BlaHBlah");
Message = 2;
}
case 2:
{
SendClientMessage(playerid,0xFFFFFF,"Want to have your own car, skin, house or maybe faction, please donate to the server and help us to help us to keep it alive.");
Message = 3;
}
case 3:
{
Oh, thanks I'll try this.
Reply
#4

SOLVED, Thanks fort the Help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)