need help with textdraws + REP
#6

Okey

PHP код:

/*
 * native ConvertSeconds(time_seconds, &hours, &minutes, &seconds);
 */
stock ConvertSeconds(time_seconds, &hours, &minutes, &seconds) { 
    new 
tmp;
    
tmp time_seconds 86400;
    
hours tmp 3600;
    
tmp time_seconds 3600;
    
minutes tmp 60;
    
seconds tmp 60;        
    
// printf("ConvertSeconds %d TO %02d:%02d:%02d", time_seconds, hours, minutes, seconds);
}
new 
p_alivetimes[MAX_PLAYERS];
new 
Text:stats;
public 
OnGameModeInit() {
    
// Other options...
    // Create TextDraws
    
stats TextDrawCreate(517.80023192.759986"Alive_Time:000:00:00");
    
TextDrawLetterSize(stats0.2279991.170666);
    
TextDrawAlignment(stats1);
    
TextDrawColor(stats, -1);
    
TextDrawSetShadow(stats0);
    
TextDrawSetOutline(stats0);
    
TextDrawBackgroundColor(stats255);
    
TextDrawFont(stats1);
    
TextDrawSetProportional(stats1);
    
TextDrawSetShadow(stats0);
    return 
true;
}
public 
OnGameModeExit() {
    
TextDrawHideForAll(stats);
    
TextDrawDestroy(stats);
    return 
true;
}
public 
OnPlayerDisconnect(playeridreason) {
     
TextDrawHideForPlayer(playeridstats);
     return 
true;

public 
OnPlayerSpawn(playerid) {
     
TextDrawShowForPlayer(playeridstats);
     
p_alivetimes[playerid] = GetTickCount(); // Reset time
     
return true;
}
public 
OnPlayerUpdate(playerid) {
     new  
         
hours
         
minutes
         
seconds,
         
msg[256];
     
ConvertSeconds(((GetTickCount()-p_alivetimes[playerid]) / 1000), hoursminutesseconds);
     
format(msgsizeof(msg), "Alive_Time: %02d:%02d:%02d"hoursminutesseconds); // Last time from spawn
     
TextDrawSetString(statsmsg);
     return 
true;

Add

PHP код:
stock ConvertSeconds(time_seconds, &hours, &minutes, &seconds) { 
    new 
tmp;
    
tmp time_seconds 86400;
    
hours time_seconds 3600// Remove restriction 24 hours
    
tmp time_seconds 3600;
    
minutes tmp 60;
    
seconds tmp 60;        
    
printf("ConvertSeconds %d TO %02d:%02d:%02d"time_secondshoursminutesseconds);

Reply


Messages In This Thread
need help with textdraws + REP - by CraTzy - 28.08.2015, 02:33
Re: need help with textdraws + REP - by Logofero - 28.08.2015, 02:41
Re: need help with textdraws + REP - by CraTzy - 28.08.2015, 03:12
Re: need help with textdraws + REP - by Logofero - 28.08.2015, 03:15
Re: need help with textdraws + REP - by CraTzy - 28.08.2015, 03:29
Re: need help with textdraws + REP - by Logofero - 28.08.2015, 03:34
Re: need help with textdraws + REP - by CraTzy - 28.08.2015, 04:13

Forum Jump:


Users browsing this thread: 1 Guest(s)