Displaying vehicle model as name.
#7

Quote:
Originally Posted by Zeppo
Посмотреть сообщение
I now get "undefined command" ingame.
That's why I told you to check if the vehicle's model is valid because run time errors make the commands not to work well and display the unknown command message.

pawn Код:
CMD:myvehicles(playerid, params[])
{
    new
        id1 = GetVehicleModel(PlayerInfo[playerid][pVehicle1]),
        id2 = GetVehicleModel(PlayerInfo[playerid][pVehicle2]),
        id3 = GetVehicleModel(PlayerInfo[playerid][pVehicle3]),
        string[100];
   
    format(string, sizeof (string), "%s\n%s\n%s", (400 <= id1 <= 611) ? (VehicleNames[id1 - 400]) : ("N/A"), (400 <= id2 <= 611) ? (VehicleNames[id2 - 400]) : ("N/A"), (400 <= id3 <= 611) ? (VehicleNames[id3 - 400]) : ("N/A"));
    ShowPlayerDialog(playerid, DIALOG_MYVEH, DIALOG_STYLE_LIST, "Your current vehicles:", string, "Info", "Cancel");
    return 1;
}
If the vehicle's model isn't correct, it will show the name else "N/A".
Reply


Messages In This Thread
Displaying vehicle model as name. - by Zeppo - 29.03.2014, 18:40
Re: Displaying vehicle model as name. - by Abagail - 29.03.2014, 18:52
Re: Displaying vehicle model as name. - by Zeppo - 29.03.2014, 18:58
Re: Displaying vehicle model as name. - by Niko_boy - 29.03.2014, 19:06
Re: Displaying vehicle model as name. - by Konstantinos - 29.03.2014, 19:20
Re: Displaying vehicle model as name. - by Zeppo - 29.03.2014, 19:37
Re: Displaying vehicle model as name. - by Konstantinos - 29.03.2014, 19:43
Re: Displaying vehicle model as name. - by Zeppo - 29.03.2014, 19:48
Re: Displaying vehicle model as name. - by Konstantinos - 29.03.2014, 19:55
Re: Displaying vehicle model as name. - by Zeppo - 29.03.2014, 21:06

Forum Jump:


Users browsing this thread: 1 Guest(s)