M
Mtzgamer01
Guest
I have a timer set for 9000 ticks, or five minutes, but I would like to be able to show that to the player in the format minutes:seconds. Is there a way to do that through drag and drop functions? Or do I have to use code?
var disp is_real(alarm[0] div room_speed)
var secs is_string(disp mod 60)
var mins is_string(disp div 60);
draw_text(x,y,mins+":"+secs);
draw_text(x,y,string((alarm[0] div room_speed) div 60)+":"+string((alarm[0] div room_speed) mod 60));
if timer
timer -= 1;
var disp = timer div room_speed;
var secs = string_replace(string_format(disp mod 60,2,0)," ","0");
var mins = string_replace(string_format(disp div 60,2,0)," ","0");
draw_text(8,0,mins+":"+secs);
FATAL ERROR in
action number 2
of Create Event
for object obj_Avatar:
COMPILATION ERROR in code action.
Error in code at line 3:
var disp = div room_speed;
at position 10: Unexpected symbol in expression.
var disp = timer div room_speed
if timer
timer -= 1;
var disp = timer div room_speed;
var secs = string_replace(string_format(disp mod 60,2,0)," ","0");
var mins = string_replace(string_format(disp div 60,2,0)," ","0");
draw_text(8,0,mins+":"+secs);
var disp, secs, mins;
disp = timer div room_speed;
secs = string_replace(string_format(disp mod 60,2,0)," ","0");
mins = string_replace(string_format(disp div 60,2,0)," ","0");
alarm[0] = room_speed * 300
var timer;
timer = alarm[0]
if timer
timer -= 1
var disp, secs, mins;
disp = timer div room_speed;
secs = string_replace(string_format(disp mod 60,2,0)," ","0");
mins = string_replace(string_format(disp div 60,2,0)," ","0");
draw_text(8,0,mins+":"+secs);
timer = 300*room_speed;
if (timer > 0) {
timer -= 1;
}
var disp, secs, mins;
disp = timer div room_speed;
secs = string_replace(string_format(disp mod 60, 2, 0), " ", "0");
mins = string_replace(string_format(disp div 60, 2, 0), " ", "0");
draw_text(8, 0, mins + ":" + secs);