[help]Count Down Timer :D
#1

Hi all
i want know how to made my textdraw count down Timer and showing to player if he is robing
PHP код:
    TimerTextDrawCreate(578.000000302.000000"00:30");
    
TextDrawBackgroundColor(Timer255);
    
TextDrawFont(Timer1);
    
TextDrawLetterSize(Timer0.2500001.100000);
    
TextDrawColor(Timer, -2147444225);
    
TextDrawSetOutline(Timer1);
    
TextDrawSetProportional(Timer1); 
PHP код:
SetTimerEx("Ammunationrobtimer"30000false"d"playerid); 
My Timer 30 Sec
i want count down it in my textdraw and the textdraw showing when player robing ))))
+rep for any one help me
Reply
#2

pawn Код:
new Time[MAX_PLAYERS];
new Timerr[MAX_PLAYERS] = 30;
pawn Код:
Timer[playerid] = SetTimerEx("Countdown", 1000, true, "i", playerid);
pawn Код:
forward Countdown(playerid);

public Countdown(playerid)
{
    Timerr[playerid]--;
    return 1;
}
Where you have your command of robbing add:

pawn Код:
Time[playerid] = 1;
Under OnPlayerUpdate(playerid) add:

pawn Код:
if(Time[playerid] = 1)
{
    new string[5];
    format(string, sizeof(string), "%d", Timerr[playerid]);
    TextDrawSetString(Timer, string);
}
Where you finish robbing after 30 seconds add:

pawn Код:
KillTimer(Timerr[playerid]);
Time[playerid] = 0;
Not tested.
Reply
#3

thanks i will test it
Reply
#4

error
Quote:

da(63) : error 017: undefined symbol "Timer"
da(64) : error 017: undefined symbol "Timer"
da(65) : error 017: undefined symbol "Timer"
da(66) : error 017: undefined symbol "Timer"
da(67) : error 017: undefined symbol "Timer"
da(6 : error 017: undefined symbol "Timer"
da(69) : error 017: undefined symbol "Timer"
da(70) : error 017: undefined symbol "Timer"
da(70) : error 017: undefined symbol "playerid"
da(70) : error 029: invalid expression, assumed zero
da(70) : fatal error 107: too many error messages on one line

Reply
#5

My wrong:

pawn Код:
Timerr[playerid] = SetTimerEx("Countdown", 1000, true, "i", playerid);
And that needs to be put under code where you make rob command. Where you put:

pawn Код:
SetTimerEx("Ammunationrobtimer", 30000, false, "d", playerid);
Put that too.
Reply
#6

this working in my cmd dude
its in my cmd
Quote:

SetTimerEx("Ammunationrobtimer", 30000, false, "d", playerid);

Reply
#7

i made this
PHP код:
new Time[MAX_PLAYERS];
new 
Timerr[MAX_PLAYERS] = 30
PHP код:
 public OnGameModeInit()
{
    
TimerTextDrawCreate(578.000000302.000000"00:30");
    
TextDrawBackgroundColor(Timer255);
    
TextDrawFont(Timer1);
    
TextDrawLetterSize(Timer0.2500001.100000);
    
TextDrawColor(Timer, -2147444225);
    
TextDrawSetOutline(Timer1);
    
TextDrawSetProportional(Timer1);
    
Timerr[playerid] = SetTimerEx("Countdown"1000true"i"playerid);
    return 
1;
}
forward Countdown(playerid);
public 
Countdown(playerid)
{
    
Timerr[playerid]--;
    return 
1;
}
public 
OnPlayerUpdate(playerid)
{
if(
Time[playerid] = 1)
{
    new 
string[5];
    
format(stringsizeof(string), "%d"Timerr[playerid]);
    
TextDrawSetString(Timerstring);
}
return 
1// Send this update to other players.

i put this in my cmd

PHP код:
Time[playerid] = 1
Reply
#8

after i add it
Quote:

Timerr[playerid] = SetTimerEx("Countdown", 1000, true, "i", playerid);

i get error again
Quote:

D:\da\filterscripts\bos.pwn(63) : error 017: undefined symbol "Timer"
D:\da\filterscripts\b.pwn(64) : error 017: undefined symbol "Timer"
D:\da\filterscripts\b.pwn(65) : error 017: undefined symbol "Timer"
D:\da\filterscripts\b.pwn(66) : error 017: undefined symbol "Timer"
D:\da\filterscripts\b.pwn(67) : error 017: undefined symbol "Timer"
D:\da\filterscripts\b.pwn(6 : error 017: undefined symbol "Timer"
D:\da\filterscripts\b.pwn(69) : error 017: undefined symbol "Timer"
D:\da\filterscripts\b.pwn(70) : error 017: undefined symbol "playerid"
D:\da\filterscripts\b.pwn(83) : warning 211: possibly unintended assignment
D:\da\filterscripts\b.pwn(87) : error 017: undefined symbol "Timer"

Reply
#9

HY
where u dude ?
help please
Reply
#10

after fixed
2 errors i have it now
Quote:

D:\da\filterscripts\bos.pwn(70) : error 017: undefined symbol "playerid"
D:\da\filterscripts\bos.pwn(83) : warning 211: possibly unintended assignment

line 70
Quote:

Timerr[playerid] = SetTimerEx("Countdown", 1000, true, "i", playerid);

line 83
Quote:

if(Time[playerid] = 1)

Quote:

public OnPlayerUpdate(playerid)
{
if(Time[playerid] = 1)
{
new string[5];
format(string, sizeof(string), "%d", Timerr[playerid]);
TextDrawSetString(Timer, string);
}

Quote:

public OnGameModeInit()
{
Timer = TextDrawCreate(578.000000, 302.000000, "00:30");
TextDrawBackgroundColor(Timer, 255);
TextDrawFont(Timer, 1);
TextDrawLetterSize(Timer, 0.250000, 1.100000);
TextDrawColor(Timer, -2147444225);
TextDrawSetOutline(Timer, 1);
TextDrawSetProportional(Timer, 1);
Timerr[playerid] = SetTimerEx("Countdown", 1000, true, "i", playerid);
return 1;
}

please help me to fix this 2 errors
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)