===
I messed the title up. It's clearly not a single digit string. It should read "number that's a string" I apologize
===
I've been struggling with this for hours now and I've officially ran out of ideas
I have a database query:
Code:
dbi_result(resultMaps, "time", qryTime, 31)
The "time" is an entry for "seconds". I believe this is returing a string and storing it in the qryTime variable.
Underneath that I have a line (cut it down for the purposes of this this thread) that sends it to the client in-game with the format:
In game this works perfectly fine, but it only tracks it in seconds. I would like it to print hours:minutes:seconds in the game.
I tried to create a function for this. The aim of this function is to pass "qryTime" into the parameter so it looks like this
Code:
"%s", convertTime(qryTime)
Here is my function
Code:
public convertTime(runTimeInSeconds[32]) {
new convertedTime[32]
new Float:finishTime = str_to_float(runTimeInSeconds[31])
new nHours = (floatround(Float:finishTime) / 3600) % 24
new nMinutes = (floatround(Float:finishTime) / 60) % 60
new nSeconds = floatround(Float:finishTime) % 60
convertedTime[31] = ("%i:%i:%i", nHours, nMinutes, nSeconds)
return convertedTime
}
I'm clearly doing something wrong here I can't even get my plug-in to compile now. It's saying "nMinutes" and "nHours" are not being used. Even if it does compile I have a suspicion it's not even going to work the way I want.