string formating help
#1

this is a part of my /licences command,the command works,but if a licence is 0 hours it shows 0 hours left,how do i make it to show "Expired" if it's 0 hours


format(szDialog, sizeof(szDialog), "{ff0000}Driving:{ffffff} %d hours left\n{ff0000}Flying:{ffffff} %d hours left\n{ff0000}Boat:{ffffff} %d hours left\n{ff0000}Bike:{ffffff} %d hours left\n{ff0000}Weapon:{ffffff} %d hours left",
PlayerInfo[playerid][pCarLicence] , PlayerInfo[playerid][pFlyLicence], PlayerInfo[playerid][pBoatLicence], PlayerInfo[playerid][pBikeLicence], PlayerInfo[playerid][pGunLicence]);
ShowPlayerDialog(playerid, DIALOG_LICENCES, DIALOG_STYLE_MSGBOX, "Your licences", szDialog, "OK", "");
Reply
#2

Basic thing. You check if hours are below 1 and if they are, you format the string to say expired.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)