Client Message Looping
#1

Fixed!
Reply
#2

PHP код:
public RestartMessage()
{
new 
string[128];
format(string,sizeof(string),"{00FFEE}[ CALLENDER: Server Month is almost over. Restarting server in 1 minutes. ]");
SendClientMessageToAll(-1string);
return 
1;

Edit: Yeah, Thank you I forgot it
Reply
#3

If your picking up nezo2001's example (and you should) then dont forget to add
Код:
new string[256];
as first line in the function, so that string actually is a variable
Reply
#4

Fixed!
Reply
#5

It can't loop :/
Reply
#6

Then your calling RestartMessage() from some sort of loop.

Can you show us the code where you call the RestartMessage() function?
Reply
#7

As Suicidal Banana said (comit suicide already xD), the RestartMessage will be called while there is 23:00 on clock. When we add seconds it will call it few times on 23:00:00, few times 23:00:01, etc. You should use a flag that will make sure it is called only once.

Pseudo-code should look like this.

Код:
fun_from_which_is_RestartMessage_called() 
{
    // some stuff
    if(time is 23:00) 
    {
        if(!RestartCalled)
            RestartMessage();
 
        RestartCalled = true;
    }
    else 
        RestartCalled = false; 
}
Also, are you calling RestartMessage for every player? Main point is that the function should be called only once! if you are calling for everyplayer then RestartMessage should show message only to concrete player.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)