2024-03-09, 07:46 PM
Try this
PHP Code:
// Convert function
Convert(number)
{
new hours = 0, mins = 0, secs = 0, string[100];
hours = floatround(number / 3600);
mins = floatround((number / 60) - (hours * 60));
secs = floatround(number - ((hours * 3600) + (mins * 60)));
if (hours > 0)
format(string, sizeof(string), "%d:%02d:%02d", hours, mins, secs);
else
format(string, sizeof(string), "%d:%02d", mins, secs);
return string;
}
// Satiety update logic
if (PI[playerid][pSettings][5] == 1) {
new st_string[10], Float:st_count = PI[playerid][pSatiety] * 0.78;
format(st_string, sizeof(st_string), "%d%%", PI[playerid][pSatiety]);
PlayerTextDrawSetString(playerid, Satiety_PTD[playerid][4], st_string);
PlayerTextDrawTextSize(playerid, Satiety_PTD[playerid][0], st_count, 5.0);
for (new t; t != 14; t++)
TextDrawShowForPlayer(playerid, Satiety_TD[t]);
for (new t; t != 6; t++)
PlayerTextDrawShow(playerid, Satiety_PTD[playerid][t]);
if (Satiety_Timer[playerid] == -1) {
Satiety_Timer[playerid] = SetTimerEx("SatietyUPDATE", 1000, 1, "i", playerid);
Satiety_Time[playerid] = 10;
}
}
// Selfie system
GetPlayerPos(playerid, selfi1[playerid][0], selfi1[playerid][1], selfi1[playerid][2]);
new Float:n1X, Float:n1Y, Float:Selfi1;
GetPlayerFacingAngle(playerid, Selfi1);
n1X = selfi1[playerid][0] + selfi3 * floatcos(180.0, degrees);
n1Y = selfi1[playerid][1] + selfi3 * floatsin(180.0, degrees);
SetPlayerAttachedObject(playerid, 0, 18868, 6, 0.06, 0.01, 0.08, 180.0, 90.0, 0.0);
SetPlayerCameraPos(playerid, n1X, n1Y, selfi1[playerid][2] + selfi4);
SetPlayerCameraLookAt(playerid, selfi1[playerid][0], selfi1[playerid][1], selfi1[playerid][2] + 1);
SetPlayerFacingAngle(playerid, selfi2[playerid] - 270.0);
TogglePlayerControllable(playerid, 0);