Random msg help
#1

I'm editing hiddos's random message script (not re-releasing of course) a bit and im kinda stuck on 2 bits.
I want to know if its possible to
1. Set it so only certain skins can see the msgs using GetPlayerSkin
2. How to use \n and if i can use it in a msg for a new line.
Thanks

pawn Код:
#include <a_samp>
#define CURRENT_MESSAGES 4 /*
This the the amount of messages you have. This number must be the exact number at ALL times!
*/
#define MESSAGE_COLOR 0x4169E1FF /*
This is the color you want your random messages to be
*/
#define MESSAGE_INTERVAL 60 /*
This is the amount of seconds between each randomly sent message.
*/
new RM[CURRENT_MESSAGES][128];
forward SendRandomMessage();
public OnFilterScriptInit()
{
    print("\n------------------------------------------");
    print(" Easy-to-use random message script");
    print(" Thank you for using! Created by Hiddos");
    print(" Piss on it.                         McFaik");
    print("--------------------------------------------\n");
    AddRandomMessage("3rd party mods aren't allowed on this server, cows");
    AddRandomMessage("You might wish to change those messages hehe.");
    AddRandomMessage("Adam Taylor you really are an asshole :D");
    AddRandomMessage("Server closed the connection.");
    SetTimer("SendRandomMessage", MESSAGE_INTERVAL * 1000, 1);
    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;
}
Reply


Messages In This Thread
Random msg help - by sherlock - 23.10.2011, 23:20
Re: Random msg help - by SmiT - 24.10.2011, 12:06
Re: Random msg help - by sherlock - 24.10.2011, 12:10
Re: Random msg help - by sherlock - 24.10.2011, 12:24
Re: Random msg help - by SmiT - 24.10.2011, 12:35
Re: Random msg help - by sherlock - 24.10.2011, 12:45
Re: Random msg help - by SmiT - 24.10.2011, 12:48
Re: Random msg help - by sherlock - 24.10.2011, 12:49
Re: Random msg help - by SmiT - 24.10.2011, 12:50
Re: Random msg help - by sherlock - 24.10.2011, 12:53

Forum Jump:


Users browsing this thread: 1 Guest(s)