/licences on dialog help
#1

This is my licences command,it works,but when one licence has 0 hours,i want to make it to write Driving:Expired,not Driving:0, for example,i want for all of them not only the driving one

CMD:licences(playerid, params[]) return ShowLicences(playerid);


function ShowLicences(playerid){

new szDialog[256];
format(szDialog, sizeof(szDialog), "{ff0000}Driving:{ffffff} %d\n{ff0000}Flying:{ffffff} %d\n{ff0000}Boat:{ffffff} %d\n{ff0000}Bike:{ffffff} %d\n{ff0000}Weapon:{ffffff} %d",
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", "");
return 1;
}
Reply
#2

PHP код:
function ShowLicences(playerid){
    new 
carLicence[16];
    switch(
PlayerInfo[playerid][pCarLicence])
    {
        case 
0:
            
format(carLicencesizeof(carLicence), "expired");
        default:
            
format(carLicencesizeof(carLicence), "%d"PlayerInfo[playerid][pCarLicence]);
    }
    new 
szDialog[256];
    
format(szDialogsizeof(szDialog), "{ff0000}Driving:{ffffff} %s\n{ff0000}Flying:{ffffff} %d\n{ff0000}Boat:{ffffff} %d\n{ff0000}Bike:{ffffff} %d\n{ff0000}Weapon:{ffffff} %d",
    
carLicencePlayerInfo[playerid][pFlyLicence], PlayerInfo[playerid][pBoatLicence], PlayerInfo[playerid][pBikeLicence], PlayerInfo[playerid][pGunLicence]);
    
ShowPlayerDialog(playeridDIALOG_LICENCESDIALOG_STYLE_MSGBOX"Your licences"szDialog"OK""");
    return 
1;

Quote:
Originally Posted by OnlyMiniGames
Посмотреть сообщение
format(szDialog, sizeof(szDialog), "{ff0000}Driving:{ffffff} %s\n{ff0000}Flying:{ffffff} %d\n{ff0000}Boat:{ffffff} %d\n{ff0000}Bike:{ffffff} %d\n{ff0000}Weapon:{ffffff} %d",
PlayerInfo[playerid][pCarLicence] ? {PlayerInfo[playerid][pCarLicence]}:"Driving:Expired", PlayerInfo[playerid][pFlyLicence], PlayerInfo[playerid][pBoatLicence], PlayerInfo[playerid][pBikeLicence], PlayerInfo[playerid][pGunLicence]);
This don't gonna work because you are trying to format PlayerInfo[playerid][pCarLicence] like a string, and it is not a string.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)