[HELP] AutoMessages suddenly stopped working ! - 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)
+--- Thread: [HELP] AutoMessages suddenly stopped working ! (
/showthread.php?tid=628375)
[HELP] AutoMessages suddenly stopped working ! -
MiiSha - 09.02.2017
Hello,
Everything was Okay before but after some weeks I couldn't know what I did to make this stop working ..
I'm really sure I did nothing but still It doesn't work for a reason I don't know ...
The thing is that some AutoMessages were popping to all players every 5 minutes, then suddenly it stopped working although I have never played with the function.
But I do wonder why is the AUTO_MESSAGE_TIME was never called in the script ? anyway I have never touched it and it was working fine before.
Here is the code, I hope you could find the problem :
Код:
#define AUTO_MESSAGE_TIME 5 // Minutes between automatic messages, <= This was never called in the script, is that okay ?
#define COLOR_AUTOMESSAGE 0xFF0D44AA // The Color
new AutoMessages[][] = {
"Want to donate to help our community stay alive, then ask an admin.",
"No admins on and you want to report someone? Make a player complaint on our forums!",
"Check out our forums at www.marrakechcity.boards.net",
"This is our Official TS3 Server : DirtyGaming.teamspeak.me",
"If you are having account issues, Make an administrative request on our forums!",
"We have a zero tolerancy rule for server advertising and hacking.",
"Remember at all times on the server you MUST roleplay.",
"Please remember to send donations to AYMAN (Mi$ha) only.",
"Use /information to view our current information about our server.",
"See someone cheating or breaking rules ? Do /report",
"Looking for some visual help? You may /requesthelp and an Advisor will be with you shortly.",
"Wanting to become a Helper? Help around on /new and the Chief Advisor will notice you."
};
forward AutoMessage();
public AutoMessage() {
new string[128];
format(string, sizeof(string), "[SERVER] %s", AutoMessages[random(sizeof(AutoMessages))]);
SendClientMessageToAll(COLOR_AUTOMESSAGE, string);
return 1;
}
Please, Help me as soon as possible, I would be very thankful, Thanks in advance.
Re: [HELP] AutoMessages suddenly stopped working ! -
silverms - 09.02.2017
does it have any errors or warning?
if it have plz post them here and if is there any callback also plz post them.
Re: [HELP] AutoMessages suddenly stopped working ! -
MiiSha - 09.02.2017
No. I have already posted anything that has to do with the Automessages. And No there is no errors or warnings my script is clean, I already said That I didn't change anythng it just stopped working by itself. If you could read the code slowly maybe you could find out the problem.
Re: [HELP] AutoMessages suddenly stopped working ! -
silverms - 09.02.2017
mm I think that it aint work like so because I have tested it in so many ways it should have a timer which maybe u deleted wrongly. so I suggest that I give u my random messages system if u want to.
Re: [HELP] AutoMessages suddenly stopped working ! -
MiiSha - 09.02.2017
Okay thanks .. You could paste it here and We'll see.
Re: [HELP] AutoMessages suddenly stopped working ! -
silverms - 10.02.2017
Okay here it is
PHP код:
#define CURRENT_MESSAGES 18//this is the number of random messag3s we have
#define MESSAGE_COLOR 0xFFFF00FF
#define MESSAGE_INTERVAL 160
//#define Msg_Name "TIP:"// this name of the random message under testing
new RM[CURRENT_MESSAGES][128];
forward SendRandomMessage();
public OnGameModeInit()
{
RandomMsg();
return 1;
}
public SendRandomMessage()
{
static lastmessage = 0;
new rand = random(CURRENT_MESSAGES);
while(rand == lastmessage && CURRENT_MESSAGES != 1) { rand = random(CURRENT_MESSAGES); }
lastmessage = rand;
SendClientMessageToAll(MESSAGE_COLOR, RM[lastmessage]);
}
stock AddRandomMessage(text[])
{
for(new m; m < CURRENT_MESSAGES; m++)
{
if(!strlen(RM[m]))
{
strmid(RM[m], text, 0, 127);
return 1;
}
}
return 0;
}
stock RandomMsg()
{
AddRandomMessage("TIP: Type /drivingschool To Get Teleported To The Next Driving School.");
AddRandomMessage("TIP: Type /help to see a short list of our server helpful commands.");
AddRandomMessage("TIP: The flying school is located at Verdant Meadows, LV.");
AddRandomMessage("TIP: Type /resetcar to reset your own vehicle to the closest police department.");
AddRandomMessage("TIP: The bike school is located at Blackfield, LV.");
AddRandomMessage("TIP: Use /findjob while in vehicles to see our server jobs which can generate money.");
AddRandomMessage("TIP: Use /ask whenever there's a support operator on-duty.");
AddRandomMessage("TIP: Have you seen someone breaking rules/cheating ?? /report is the solution.");
AddRandomMessage("TIP: Type /vhelp to view all vehicles commands.");
AddRandomMessage("TIP: Every 1 hour of playing = 1 score, at level 15 you can buy an own house, at 25 an own business.");
AddRandomMessage("TIP: Use /admins to see the online adminstrators.");
AddRandomMessage("TIP: To see enabled events use /events.");
AddRandomMessage("TIP: VIP member Level 1 get 2.500.000$ cash in-game, VIP member Level 2 get 5.000.000$ cash in-game.");
AddRandomMessage("TIP: VIP member level 1 can own 3 vehicles, VIP level 2 can own 6 vehicles.");
AddRandomMessage("TIP: VIP members don't lose their money, armor and weapons while dying. also they don't lose their vehicle when its destroyed.");
AddRandomMessage("TIP: Use /radio While In Car For Some New Music.");
SetTimer("SendRandomMessage", MESSAGE_INTERVAL * 1000, 1);
return 1;
}
Re: [HELP] AutoMessages suddenly stopped working ! -
MiiSha - 11.02.2017
Thanks a lot. But I've already fixed mine it was just that AUTO_MESSAGE_TIME thing that was accidently commented within the script.