Random messages
#1

Random messages arent working...
Please help me to fix them


pawn Код:
new randomMessages[][] =
    {
        "{F5511B}[HELP] {F5CD1B}Stuck somewhere? Use /helpmeup to move out!",
        "{F5511B}[HELP] {F5CD1B}Need a nice nick color? Try the /color command!",
        "{F5511B}[HELP] {F5CD1B}Saw a rulebreaker? Use /report to notify the staff!",
        "{F5511B}[HELP] {F5CD1B}Need a vehicle? Type /vehicle or /v to get a list of all the vehicles!",
        "{F5511B}[HELP] {F5CD1B}Enjoying our server? Don't forget to visit our website at "SERVER_WEBSITE".tk!",
        "{F5511B}[HELP] {F5CD1B}Are you using the default weaponset? Try out the new weaponsets using /weaponset!",
        "{F5511B}[HELP] {F5CD1B}If your vehicle is upside down, press NUMPAD 4 to flip it!",
        "{F5511B}[HELP] {F5CD1B}Are you bored with your current spawn place? Choose your own spawn place using /spawnplace!",
        "{F5511B}[HELP] {F5CD1B}Don't know all the commands? Check out all using /cmds!",
        "{F5511B}[HELP] {F5CD1B}Losing your health while stunting? Use /god to enable god protection!",
        "{F5511B}[HELP] {F5CD1B}Having problems configuring your preferences? Use your /settings menu!",
        "{F5511B}[HELP] {F5CD1B}Wanna Jump high?? Try /superjump or /sj!",
        "{F5511B}[SERVER] {F5CD1B}Help the server by donating a dollar, You'll receive VIP after donating.",
        "{F5511B}[SERVER] {F5CD1B}Welcome to our newly developed server, Own and scripted by our MaxFranky & Jacob.",
        "{F5511B}[SERVER] {F5CD1B}Report a player and get a reward! If proven they have broke something in the rules and regulations.",
        "{F5511B}[SERVER] {F5CD1B}We are current handpicking administrators and helpers for our server's beta testing.",
        "{F5511B}[SERVER] {F5CD1B}We have a zero tolerancy rule for server advertising and hacking.",
        "{F5511B}[SERVER] {F5CD1B}This is a freeroam server, Free to do whatever you want, as long as it isn't breaking the rules and regulations.",
        "{F5511B}[SERVER] {F5CD1B}Please remember to send all donations if you would like to keep us alive."
    };

forward RandomMessages();
public RandomMessages()
{
    new randomMsg = random(sizeof(randomMessages));
    SendClientMessageToAll(-1, randomMessages[randomMsg]);
}

public OnGameModeInit()
{
    RandMsgTimer = SetTimer("RandomMessages", 300000, true);
    return 1;
}

public OnGameModeExit()
{
    KillTimer(RandMsgTimer);
    return 1;
}
Reply
#2

Help me please
Reply
#3

color is -1
SendClientMessageToAll


maybe you sholud make a short time Timer to test;
Reply
#4

Quote:
Originally Posted by iLuXing
Посмотреть сообщение
color is -1
SendClientMessageToAll


maybe you sholud make a short time Timer to test;
Yeah, maybe, put it every 10 seconds, which equals 10000 millseconds.
Color hasn't anything to do with it.
Reply
#5

Quote:
Originally Posted by iLuXing
Посмотреть сообщение
color is -1
SendClientMessageToAll


maybe you sholud make a short time Timer to test;
Thats just sets the color to white.
Reply
#6

Just tested it in ma server with 3Second[3000] and it works.. I think you dint wait for 300seconds = 5mins.
Reply
#7

What's wrong with it? I just tried it and it works: http://i.imgur.com/9P7304v.png

EDIT: You don't need to store the timer anywhere as it is automatically destroyed when OnGameModeExit is called. Also, instead of using hex to define the color, why not just use the SendClientMessageToAll color param?
Reply
#8

Nope it isnt working...
Reply
#9

Yes, it is. Show more of your code, because there's nothing wrong with the code you provided.
Reply
#10

i tried everything and found this
when i restart server the random messages are working and then when i login or register through input it is getting stopped..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)