Raised This Month: $51 Target: $400
 12% 

str_to_num question


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
lexzor
Veteran Member
Join Date: Nov 2020
Old 05-07-2021 , 14:20   str_to_num question
Reply With Quote #1

hello. i have this code

PHP Code:
replace_all(szTemp[id], charsmax(szTemp[]), ":"" ")
        
parse(szTemp[id], szHoursTemp[id], charsmax(szHoursTemp[]), szMinutesTemp[id], charsmax(szMinutesTemp[]), szSecondsTemp[id], charsmax(szSecondsTemp[]))

        
iHoursTemp[id] = str_to_num(szHoursTemp[id]) + g_iPlayedTime[id][Hours]
        
iMinutesTemp[id] = str_to_num(szMinutesTemp[id]) + g_iPlayedTime[id][Minutes]
        
iSecondsTemp[id] = str_to_num(szSecondsTemp[id]) + g_iPlayedTime[id][Seconds]

        
server_print("%i %i %i"iHoursTemp[id], iMinutesTemp[id], iSecondsTemp[id])

        
formatex(g_iPlayersInfo[id][PlayedTime], charsmax(g_iPlayersInfo[][PlayedTime]), "%s%i:%s%i:%s%i",
        
iHoursTemp[id] < 10 "0" ""iHoursTemp[id], iMinutesTemp[id] < 10 "0" "",
        
iMinutesTemp[id], iSecondsTemp[id] < 10 "0" ""iSecondsTemp[id]) 
i'm trying to get the time. the problem is that the format is 00:00:00 (example of 5 hours, 14 mins and 7 second: 05:14:07)

The problem is that i think i can t use str_to_num like that (i mean to use it for a number like 05 or 07). some ideas ?
lexzor is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:18.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode