timer textdraw? - 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: timer textdraw? (
/showthread.php?tid=174697)
timer textdraw? -
thomas.. - 06.09.2010
hey
is there any FS, tut or anything else with a timer textdraw? (so that you can see the time counting down..)
yeah..
is there one?
AND I HAVE SEARCHED
for 10 secs :P
Re: timer textdraw? -
LarzI - 06.09.2010
Better use gametext for that one.
Here's the one I use:
pawn Код:
//global
new
g_tiCD,
g_iCD = 5;
new
bool:g_bCDStarted = false,
pawn Код:
//timer
public CountDown()
{
GameTextForAll( "~r~Get ready!", 2000, 6 );
g_iCD--;
switch( g_iCD )
{
case 0:
{
GameTextForAll( "~g~GO!", 4000, 6 );
PlaySoundForAll( 1057 );
g_iCD = 5;
KillTimer( g_tiCD );
g_bCDStarted = false;
}
case 1:
{
GameTextForAll( "~w~1..", 950, 6 );
PlaySoundForAll( 1056 );
}
case 2:
{
GameTextForAll( "~w~2..", 950, 6 );
PlaySoundForAll( 1056 );
}
case 3:
{
GameTextForAll( "~w~3..", 950, 6 );
PlaySoundForAll( 1056 );
}
}
}
pawn Код:
//command
CMD:cd(playerid, params[])
{
if( g_bCDStarted )
SendClientMessage( playerid, 0xFF0000ff, "**[ERROR] A countdown is already in progress." );
else
{
g_tiCD = SetTimer( "CountDown", 1000, true );
g_bCDStarted = true;
}
return true;
}
ZCMD is needed btw.
For strcmp:
pawn Код:
//command
if( !strcmp( cmdtext, "/cd", true ))
{
if( g_bCDStarted )
SendClientMessage( playerid, 0xFF0000ff, "**[ERROR] A countdown is already in progress." );
else
{
g_tiCD = SetTimer( "CountDown", 1000, true );
g_bCDStarted = true;
}
return true;
}