Settimer
#1

I need to set a text "If you need any help do /help" like this.
It should be automatically come in a fixed time .how to do this?
Reply
#2

https://sampwiki.blast.hk/wiki/SetTimer
Reply
#3

pawn Код:
forward message();
 
public OnGameModeInit()
{
    print("Starting timer...");
    SetTimer("message",1000,false); // Set a timer of 1000 miliseconds (1 second)
}
 
public message()
{
    print("1 second has passed.");
plz show me an example
Reply
#4

hi,
if u want to have more messages to announce (random) do it like in the folowing.
Otherwise just leave out the randomizing part and do a simple timer with only a single SendClientMessageToAll timer.

pawn Код:
//Timer, set time to whatever you want

//OnGameModeInit
SetTimer("RandomClientMessage",240000,1);

new Advertisement[][] = //RandomTimerClientMessages
{

{"message1"},
{"message2"},
{"message3"}

};

//Announcer/Advertisement Timer
forward RandomClientMessage();
public RandomClientMessage()
{
new randommessage = random(sizeof(Advertisement));
new Advertisementstring[140];
format(Advertisementstring, sizeof(Advertisementstring),"%s",Advertisement[randommessage]);
SendClientMessageToAll(0xFFFF00FF, Advertisementstring);
}
hope this helps.

regards...
Reply
#5

ok ty very much
Reply
#6

youre welcome
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)