Random Messages
#1

Hi, how to make a random messages in the server like "Need help? have problem? /report for assistant."
I want it without heavy timers that take a lot of CPU...
Random messages will be sent randomly every 10 minutes.

Thanks.
Reply
#2

e asim

primeiro cria a forward
PHP код:
forward SendMSG(); 
depois cria a new
PHP код:
new RandomMSG[][] =
{
  
"Esta Afim de Ouvir Uma Musiquinha?Use: /radios !!",
  
"Quer Ouvir Musicas Em quanto joga SAMP?Use:/radios"
  "    aqui a mensage "
  "    aqui a mensage "
  "    aqui a mensage "
//vc pode criar o tanto de mensage q quiser e so ir pra linha de baixo e colocar " mensage "
}; 
depois no public OnFilterScriptInit()
PHP код:
{
    
SetTimer("SendMSG"300000true);//no 300000 e o tempo
    
return 1;

e й isso
Reply
#3

it could be like this
pawn Код:
//this uder your game mode
SetTimer("message",60000,true);

//now this anywhere in script
forward message();
public  message()
{
new ran,mes[50];
ran=random(5);//no. of messages u use in brackets
switch(ran)
{
case 1:format(mes,50,"Use /help to view how to play on server");
case 2:format(mes,50,"Use /cmds to view commands");
//like this continue till no. of messages filled in brackets of random
}
SendClientMessageToAll(-1,mes);
}
Reply
#4

Try This

PHP код:
#define AUTO_MESSAGE_TIME 5 // Minutes between automatic messages
new AutoMessages[][] = {
    
"Remember, to start your vehicle engine - Type /engine",
    
"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 DenomET.eu",
    
"Donate to recieve certain rewards! It's a great way to fullen your experience!",
    
"Please note that if you are having account issues to 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 all donations if you would like to keep us alive.",
    
"Use /information to view our current information about our server.",
    
"Type /newchanges to see any new changes to the script.",
    
"Looking for some visual help? You may /requesthelp and an Helpers will be with you shortly.",
    
"Wanting to become a Helper? Help around on /newb and the Head Helper will notice you."
};
forward AutoMessage();
public 
AutoMessage() {
    new 
string[128];
    
format(stringsizeof(string), "%s"AutoMessages[random(sizeof(AutoMessages))]);
    
SendClientMessageToAll(COLOR_FORSTATSstring);
    return 
1;

Reply
#5

pawn Код:
//Top Of FilterScript Or GameMode
#define MAXIMAL_MESSAGES 3

new LastMessage;
//Callback OnFilterScriptInit Or OnGameModeInit
SetTimer("Message",1000 * 60 * 10,1);
//After Callbacks
forward Message();
public Message()
{
    switch(LastMessage)
    {
        case 0: SendClientMessageToAll(0xFFFFFFFF,"First Message");
        case 1: SendClientMessageToAll(0xFFFFFFFF,"Second Message");
        case 2: SendClientMessageToAll(0xFFFFFFFF,"Third Message");
    }
    LastMessage++;
    if(LastMessage == MAXIMAL_MESSAGES) LastMessage = 0;
    return 1;
}
Reply
#6

Quote:
Originally Posted by Greaper
Посмотреть сообщение
Try This

PHP код:
#define AUTO_MESSAGE_TIME 5 // Minutes between automatic messages
new AutoMessages[][] = {
    
"Remember, to start your vehicle engine - Type /engine",
    
"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 DenomET.eu",
    
"Donate to recieve certain rewards! It's a great way to fullen your experience!",
    
"Please note that if you are having account issues to 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 all donations if you would like to keep us alive.",
    
"Use /information to view our current information about our server.",
    
"Type /newchanges to see any new changes to the script.",
    
"Looking for some visual help? You may /requesthelp and an Helpers will be with you shortly.",
    
"Wanting to become a Helper? Help around on /newb and the Head Helper will notice you."
};
forward AutoMessage();
public 
AutoMessage() {
    new 
string[128];
    
format(stringsizeof(string), "%s"AutoMessages[random(sizeof(AutoMessages))]);
    
SendClientMessageToAll(COLOR_FORSTATSstring);
    return 
1;

#define AUTO_MESSAGE_TIME 5 where it being used? there is no timer or something like that.
Reply
#7

Quote:
Originally Posted by zDbruno
Посмотреть сообщение
e asim

primeiro cria a forward
PHP код:
forward SendMSG(); 
depois cria a new
PHP код:
new RandomMSG[][] =
{
  
"Esta Afim de Ouvir Uma Musiquinha?Use: /radios !!",
  
"Quer Ouvir Musicas Em quanto joga SAMP?Use:/radios"
  "    aqui a mensage "
  "    aqui a mensage "
  "    aqui a mensage "
//vc pode criar o tanto de mensage q quiser e so ir pra linha de baixo e colocar " mensage "
}; 
depois no public OnFilterScriptInit()
PHP код:
{
    
SetTimer("SendMSG"300000true);//no 300000 e o tempo
    
return 1;

e й isso
I dont understand spanish or whatever it is, english please?
Reply
#8

pawn Код:
new RandMsg[][] =
{
    "Welcome to "Server Name"! Before you start your journey here, use /help and /tlaws to start you off.",
    "You can acquire licenses at our City Hall.",
    "Found a bug? Pleases immediately file a bug report at "Website"",
    "Stay updated on the latest news by checking the forum: "Website"",
    "Remember, this is not a DM server. Everything must be role-played appropiately.",
    "Please follow the server rules at all times. They can be found on the forum. ("Website)",
    "
Found a player cheating/exploiting? File a complaint at once with (/report) to inform an adminstrator.",
    "
If you are caught by the LAPD commiting a crime, you must role-play fairly & properly.",
    "
Staff recruitment is underway. Please do not PM an administrator to join the staff team, instead check the forum.",
    "
Hacks are NOT tolerated! Cheating will result in severe punishment.",
    "
Create an application to join the staff team through our forum "Website",
    "Want to earn amazing privelages such as a V.I.P status? Donate Today, Enjoy Tomorrow.",
    "This is an Advanced-RP server. Use /requesthelp for more info.",
    "Donations are now ready! Please help the server survive by donating today! (Forum Tab).",
};
pawn Код:
forward ShowHelp();
public ShowHelp()
{
    new i = random(sizeof(RandMsg));
    new string[128];
    format(string, sizeof(string), "Server BOT: %s", RandMsg[i]);
    SendClientMessageToAll(COLOR_LIGHTBLUE, string);
}
put this under OnGameModeInit
pawn Код:
SetTimer("ShowHelp", 60 * 3 * 1000, 1);
Reply
#9

https://sampwiki.blast.hk/wiki/Random_Messages
Reply
#10

Here one for you
pawn Код:
#define GREEN      0x15FF00AA
new RandomMessages[][] = {
  "{FFFFFF}[Info]: {63F279}Like our server? Add us in favourite!",
  "{FFFFFF}[Info]: {63F279}To get more knowledge about the current commands, please use /cmds.",
  "{FFFFFF}[Info]: {63F279}You want to check your stats? use /stats [Your ID], you can check other's stats
  "
{FFFFFF}[Info]: {63F279}Use /admins to see the current online staff members.",
  "
{FFFFFF}[Info]: {63F279}Spotted a hacker? don't panic, use /report [ID] [Reason] and let our staff team handle it.",
  "{FFFFFF}[Info]: {63F279}You want to help the server grow up? donate for us to keep us alive!"
  };

forward RandomMessage();
public RandomMessage()
{
SendClientMessageToAll(GREEN, RandomMessages[random(sizeof(RandomMessages))]);
return 1;
}

public OnGameModeInit()
{
    SetTimer("RandomMessage", 60000, 1); // 1 Minutes
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)