[help] - message
#1

can someone tell me how to make a message that will be showed every 10 minutes, and it will not be as a client message in the chat but you see it with great letters, at your screen, in the color red, with the text, /report rulebreakers!
Reply
#2

https://sampwiki.blast.hk/wiki/Random_Messages - these are with SendClientMessage, it's easy to change it to GameText or Textdraw - https://sampwiki.blast.hk/wiki/TextDrawCreate / https://sampwiki.blast.hk/wiki/GameTextForPlayer
Reply
#3

Код:
SetTimer("FunctionName", 1000*60*10, 1);

public FunctionName()
{
    GameTextForAll("~r~/report rulebreakers!", 5000, 0);
}
Reply
#4

Quote:
Originally Posted by Alice[A11
]
Код:
SetTimer("FunctionName", 1000*60*10, 1);

public FunctionName()
{
   GameTextForAll("~r~/report rulebreakers!", 5000, 0);
}
C:\Users\Onno\Documents\ALLIN1\da\gamemodes\saa.pw n(66) : error 021: symbol already defined: "SetTimer"
Reply
#5

First learn how to use SetTimer and where.
Reply
#6

just givve me the good code without that error please.
Reply
#7

SetTimer("FunctionName", 1000*60*10, 1); have to be in the OnGameModInit function
Reply
#8

Quote:
Originally Posted by PANNA
just givve me the good code without that error please.
He did, just learn how to use it and where.
Reply
#9

Quote:
Originally Posted by PANNA
just givve me the good code without that error please.
EDIT:

He gave you perfectly good code, and advice. Listen to him next time :P. (functions can not be placed outside of defines/callbacks/custom subroutines)

pawn Код:
#include <a_samp>

#define MESSAGE_TIME 60 //how many seconds it takes to show the next message

#define DEFAULT_SHOW_TIME 10 //Default time for the messages to be shown
#define DEFAULT_STYLE 3 //defualt syle for the messages

new MessageID, bool:Static;

enum MessageData
{
    Message[128],
    DisplayTime,
    Style
}

new ServerMessages[][MessageData] =
{
    //Message, DisplayTime, Style
    {"ZOMG MESSAGE 1", DEFAULT_SHOW_TIME,DEFAULT_STYLE},
    {"ZOMG MESSAGE 2", DEFAULT_SHOW_TIME,DEFAULT_STYLE},
    {"ZOMG MESSAGE 3", DEFAULT_SHOW_TIME,DEFAULT_STYLE},
    {"ETC", DEFAULT_SHOW_TIME,DEFAULT_STYLE}
};

public OnFilterScriptInit()
{
    Static = true;
    SetTimer("SendServerMessage", MESSAGE_TIME*1000, true);
    return 1;
}

forward SendServerMessage();
public SendServerMessage()
{
    if(Static == false)
    {
        new ID = random(sizeof(ServerMessages));
        GameTextForAll(ServerMessages[ID][Message],ServerMessages[ID][DisplayTime]*1000,ServerMessages[ID][Style]);
        return 1;
    }

    if(MessageID < sizeof(ServerMessages) && Static == true)
    {
        GameTextForAll(ServerMessages[MessageID][Message],ServerMessages[MessageID][DisplayTime]*1000,ServerMessages[MessageID][Style]);
        MessageID++;
        return 1;
    }
    MessageID = 0;
    GameTextForAll(ServerMessages[MessageID][Message],ServerMessages[MessageID][DisplayTime]*1000,ServerMessages[MessageID][Style]);
    MessageID++;
    return 1;
}

sorry, dont have time to test it ... post any problems and i'll fix them (if there are any).

Works fine. Use the gametext color codes to change the color of the message etc..
Reply
#10

<DELETE>
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)