SA-MP Forums Archive
[SOLVED] SendMSG - 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: [SOLVED] SendMSG (/showthread.php?tid=134959)



[SOLVED] SendMSG - FreddeN - 18.03.2010

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


Re: [HELP] SendMSG - Desert - 18.03.2010

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


Re: [HELP] SendMSG - FreddeN - 18.03.2010

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.


Re: [HELP] SendMSG - FreddeN - 18.03.2010

SOLVED, Thanks fort the Help