This command won't return if the player doesn't have vehicles.
#1

pawn Код:
CMD:myvehicles(playerid, params[])//NEEDS REWRITE
{
    new string[512], name1, am = 0;
    if(LoggedIn[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You must be logged in to use this command.");

    for(new v = 1; v < MAX_VEHICLES; v++)
    {
        if(VehOwner[v] == PlayerSQLID[playerid])
        {
            am ++;
            printf("CHECKING IF VEHOWNER");
            name1 = GetVehicleModel(v) - 400;
            printf("VehMODEL %d", VehModel[v]);
            format(string, sizeof(string), "{FFFFFF}%s{FFFFFF}%s - {FFFFFF}ID({33AA33}%d{FFFFFF}) - Plate: {33AA33}%s\n",string, VehicleNames[name1], v, VehPlate[v]);
            printf("%s");
        }

    }
    if(am < 1)return SendClientMessage(playerid, COLOUR_GREY, "You do not own any vehicles");
    ShowPlayerDialog(playerid,DIALOG_SHOWCAR,DIALOG_STYLE_MSGBOX,"My Vehicles", string,"Close","");
    printf("shown dialog");
    return 1;
}
Title says all. I can't seem to get it to work if the player has no vehicles?
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)