SA-MP Forums Archive
[Help]Gettickinsecond - 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)
+--- Thread: [Help]Gettickinsecond (/showthread.php?tid=569611)



[Help]Gettickinsecond - Markoni990 - 01.04.2015

How do miliseconds when a player hits the rec example 2.13sec?
PHP код:
FUNCTION: xReactionTest(playerid)
{
    new
        
xLength = (random(8) + 2),
        
string[256]
    ;
    
xCash = (random(784) + 287);
    
format(xChars, sizeof(xChars), "");
    
Loop(x, xLength) format(xChars, sizeof(xChars), "%s%s", xChars, xCharacters[random(sizeof(xCharacters))][0]);
    
format(string, sizeof(string), "{FF0000}[TK]{FFFFFF}Ko prvi upise u cetu {FF0000}%s{FFFFFF} dobija %d$. TRENUTNI REKORD: %s (%.i sek.)", xChars, xCash,ImeMarkoni(playerid),GetTimerInSeconds(GetTickCount()));
    
SendClientMessageToAll(PURPLE, string);
    
KillTimer(xReactionTimer);
    
xTestBusy = true;
    
SetTimer("xReactionProgress", 50000, 0);
    
//return 1;
}
GetTimerInSeconds(now,playerid)
{
    new 
timers = PlayerInfo[playerid][pStartTime];
   new 
secs, ms;
   
ms = now - timers;
   while(
ms > 999) {
       
secs++;
       
ms = ms-1000;
   }
   return 
secs;
} 



AW: [Help]Gettickinsecond - Markoni990 - 01.04.2015

Bump!