2025-09-07, 07:18 AM
Okay, you have this error, because you can't return array in Pawn stock function.
I made some changes and it works fine. Here's code:
And this is example:
I made some changes and it works fine. Here's code:
Code:
stock Convert(seconds, stringTos[], size = sizeof(stringTos))
{
stringTos[0] = 0x0;
new result[4];
result[0] = floatround(seconds / (3600 * 24));
result[1] = floatround(seconds / 3600);
result[2] = floatround((seconds / 60) - (result[1] * 60));
result[3] = floatround(seconds - ((result[1] * 3600) + (result[2] * 60)));
switch(result[0])
{
case 0:
{
switch(result[1])
{
case 0: format(stringTos, size, "%d:%02d", result[2], result[3]);
default: format(stringTos, size, "%d:%d:%02d", result[1], result[2], result[3]);
}
}
}
return 1;// Convert(time[0]/1000, timew[0]);//51
}
And this is example:
Code:
new buffer[128];
Convert(6000, buffer);
SendClientMessage(playerid, -1, "%s", buffer); //it returns string: 1:40:00