SA-MP Forums Archive
SetTimer message spams the chat? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: SetTimer message spams the chat? (/showthread.php?tid=167230)



SetTimer message spams the chat? - lSCARl - 11.08.2010

I set A timer to say a message every minute and it floods the chat every minute how can i make it say the message once a minute instead of like 20? here is the code i use.

Under OnGameModeInit
Код:
SetTimer("newcommand1", 60000, true);
Rest Of The Code
Код:
public newcommand1(playerid)
{
    {
        {
		 SendClientMessage(playerid, COLOR_RED,"NEW! Type /alive to see the players that are alive");
        }
    }
    return 1;
}



Re: SetTimer message spams the chat? - JaTochNietDan - 11.08.2010

Quote:
Originally Posted by lSCARl
Посмотреть сообщение
I set A timer to say a message every minute and it floods the chat every minute how can i make it say the message once a minute instead of like 20? here is the code i use.

Under OnGameModeInit
Код:
SetTimer("newcommand1", 60000, true);
Rest Of The Code
Код:
public newcommand1(playerid)
{
    {
        {
		 SendClientMessage(playerid, COLOR_RED,"NEW! Type /alive to see the players that are alive");
        }
    }
    return 1;
}
Well the way you're doing it is odd, you don't even specify a playerid when setting the timer. This would be a much better way of doing it.

pawn Код:
public newcommand1()
{
    SendClientMessageToAll(COLOR_RED,"NEW! Type /alive to see the players that are alive");
    return 1;
}



Re: SetTimer message spams the chat? - lSCARl - 11.08.2010

Quote:
Originally Posted by JaTochNietDan
Посмотреть сообщение
Well the way you're doing it is odd, you don't even specify a playerid when setting the timer. This would be a much better way of doing it.

pawn Код:
public newcommand1()
{
    SendClientMessageToAll(COLOR_RED,"NEW! Type /alive to see the players that are alive");
    return 1;
}
Wow Thanks youre the best fixed alot of problems with my game mode