#1

"Brain stopped working...
Check the log for more info"

Well I need your help guys.
I have textdraw
PHP код:
TimerTD[playerid][0] = CreatePlayerTextDraw(playerid526.000305246.746658"Time_left:");
    
PlayerTextDrawLetterSize(playeridTimerTD[playerid][0], 0.2946661.490489);
    
PlayerTextDrawTextSize(playeridTimerTD[playerid][0], 647.0000000.000000);
    
PlayerTextDrawAlignment(playeridTimerTD[playerid][0], 1);
    
PlayerTextDrawColor(playeridTimerTD[playerid][0], -1);
    
PlayerTextDrawUseBox(playeridTimerTD[playerid][0], 1);
    
PlayerTextDrawBoxColor(playeridTimerTD[playerid][0], 255);
    
PlayerTextDrawSetShadow(playeridTimerTD[playerid][0], 0);
    
PlayerTextDrawSetOutline(playeridTimerTD[playerid][0], 0);
    
PlayerTextDrawBackgroundColor(playeridTimerTD[playerid][0], 255);
    
PlayerTextDrawFont(playeridTimerTD[playerid][0], 2);
    
PlayerTextDrawSetProportional(playeridTimerTD[playerid][0], 1);
    
PlayerTextDrawSetShadow(playeridTimerTD[playerid][0], 0);
    
TimerTD[playerid][1] = CreatePlayerTextDraw(playerid592.222290246.746673"100_sec");
    
PlayerTextDrawLetterSize(playeridTimerTD[playerid][1], 0.2946661.490489);
    
PlayerTextDrawAlignment(playeridTimerTD[playerid][1], 1);
    
PlayerTextDrawColor(playeridTimerTD[playerid][1], -1);
    
PlayerTextDrawSetShadow(playeridTimerTD[playerid][1], 0);
    
PlayerTextDrawSetOutline(playeridTimerTD[playerid][1], 0);
    
PlayerTextDrawBackgroundColor(playeridTimerTD[playerid][1], 255);
    
PlayerTextDrawFont(playeridTimerTD[playerid][1], 2);
    
PlayerTextDrawSetProportional(playeridTimerTD[playerid][1], 1);
    
PlayerTextDrawSetShadow(playeridTimerTD[playerid][1], 0); 
I need help on how to make these 100 sec go down? Like 99, 98, 97...
I have no idea now... I am confused..
I know I need to use timer
SetTimer("Timer", 1000, true);
but problem is that I don't know what to do here
PHP код:
forward Timer(playerid);
public 
Timer(playerid)
{
    return 
1;

Any ideas??
Reply
#2

PHP код:
SetTimerEx("Timer",1000false"ii"playerid100); 
PHP код:
forward Timer(playeridtime);
public 
Timer(playeridtime)
{
    if(
time != 0)
    {
        new 
string[5];
        
format(stringsizeof(string), "%d"time);
        
GameTextForPlayer(playeridstring10005);
        
SetTimerEx("Timer"1000false"ii"playeridtime-1);
    }
    else
    {
        
GameTextForPlayer(playerid"~g~GO!"25003); // or replace with anything else
    
}
    return 
true;

Reply
#3

EDIT: Still not fixed... DAMN!
Reply
#4

EDIT:It should work :/
Reply
#5

Sorry for this but
BUMP!
Reply
#6

You're creating the player textdraws in the wrong way.

PHP код:
// Top
new time[MAX_PLAYERS], TimerTD_0TimerTD_1;
// Somewhere
time[playerid] = 100;
// OnPlayerConnect
TimerTD_0 CreatePlayerTextDraw(playerid526.000305246.746658"Time_left:"); 
PlayerTextDrawLetterSize(playeridTimerTD_00.2946661.490489); 
PlayerTextDrawTextSize(playeridTimerTD_0647.0000000.000000); 
PlayerTextDrawAlignment(playeridTimerTD_01); 
PlayerTextDrawColor(playeridTimerTD_0, -1); 
PlayerTextDrawUseBox(playeridTimerTD_01); 
PlayerTextDrawBoxColor(playeridTimerTD_0255); 
PlayerTextDrawSetShadow(playeridTimerTD_00); 
PlayerTextDrawSetOutline(playeridTimerTD_00); 
PlayerTextDrawBackgroundColor(playeridTimerTD_0255); 
PlayerTextDrawFont(playeridTimerTD_02); 
PlayerTextDrawSetProportional(playeridTimerTD_01); 
PlayerTextDrawSetShadow(playeridTimerTD_00); 
TimerTD_1 CreatePlayerTextDraw(playerid592.222290246.746673"100_sec"); 
PlayerTextDrawLetterSize(playeridTimerTD_10.2946661.490489); 
PlayerTextDrawAlignment(playeridTimerTD_11); 
PlayerTextDrawColor(playeridTimerTD_1, -1); 
PlayerTextDrawSetShadow(playeridTimerTD_10); 
PlayerTextDrawSetOutline(playeridTimerTD_10); 
PlayerTextDrawBackgroundColor(playeridTimerTD_1255); 
PlayerTextDrawFont(playeridTimerTD_12); 
PlayerTextDrawSetProportional(playeridTimerTD_11); 
PlayerTextDrawSetShadow(playeridTimerTD_10); 
// OnPlayerDisconnect
PlayerTextDrawDestroy(playeridTimerTD_0);
PlayerTextDrawDestroy(playeridTimerTD_1);
// Somewhere
forward Timer(playerid); 
public 
Timer(playerid
{
    if(
time >= 1
    {
        
time -= 1;
        new 
string[10]; 
        
format(stringsizeof(string), "%d"time); 
        
PlayerTextDrawSetString(playeridTimerTD_1string);
        
SetTimerEx("Timer"1000false"ii"playerid); 
    }
    else
    {
        
time 0;
    }
    return 
true

Reply
#7

You gave me an idea.. Hold on.

EDIT: DOne thank you
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)