I see vehicles from bottom
#1

Hello, i have made a SelectionMenu to my vehicle system, but when i see the selectionmenu i see the vehicles from the bottom, how can i make it show from the front/top?

it looks like this:


But i want it to look like this:


Codes:
pawn Код:
if(strcmp(cmd, "/buyvehicle", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!IsAtDealership(playerid))
            {
                SendClientMessage(playerid, COLOR_WHITE, "You are not near a car dealership.");
                return 1;
            }
            if(!strlen(tmp))
            {
                if(PlayerToPoint(3.0, playerid,-2033.3193,-117.6438,1035.1718))
                {
                    new vehicle[28];
                    vehicle[0] = 602;
                    vehicle[1] = 542;
                    vehicle[2] = 549;
                    vehicle[3] = 555;
                    vehicle[4] = 489;
                    vehicle[5] = 579;
                    vehicle[6] = 551;
                    vehicle[7] = 496;
                    vehicle[8] = 580;
                    vehicle[9] = 526;
                    vehicle[10] = 516;
                    vehicle[11] = 491;
                    vehicle[12] = 445;
                    vehicle[13] = 545;
                    vehicle[14] = 540;
                    vehicle[15] = 527;
                    vehicle[16] = 529;
                    vehicle[17] = 546;
                    vehicle[18] = 533;
                    vehicle[19] = 566;
                    vehicle[20] = 550;
                    vehicle[21] = 400;
                    vehicle[22] = 561;
                    vehicle[23] = 482;
                    vehicle[24] = 405;
                    vehicle[25] = 412;
                    vehicle[26] = 567;
                    vehicle[27] = 536;
                    ShowModelSelectionMenuEx(playerid, vehicle, 28, "Coutt And Schutz", dealership1, 16.0, 0.0, -55.0);
                }
            }
        }
        return 1;
    }
on top of the script
pawn Код:
new dealership1 = mS_INVALID_LISTID;
on ongamemodeinit
pawn Код:
dealership1 = LoadModelSelectionMenu("dealership1.txt");

pawn Код:
public OnPlayerModelSelectionEx(playerid, response, extraid, modelid)
{
    if(extraid == dealership1)
    {
        if(response)
        {
            if(ForwardOwnCar(1,playerid)) { SendClientMessage(playerid,COLOR_GREY,"You must park ( despawn ) your vehicle before you can buy another"); return 1; }
            else if(ForwardOwnCar(2,playerid)) { SendClientMessage(playerid,COLOR_GREY,"You must park ( despawn ) your vehicle before you can buy another"); return 1; }
            else if(ForwardOwnCar(3,playerid)) { SendClientMessage(playerid,COLOR_GREY,"You must park ( despawn ) your vehicle before you can buy another"); return 1; }
            else if(ForwardOwnCar(4,playerid)) { SendClientMessage(playerid,COLOR_GREY,"You must park ( despawn ) your vehicle before you can buy another"); return 1; }
            else if(ForwardOwnCar(5,playerid)) { SendClientMessage(playerid,COLOR_GREY,"You must park ( despawn ) your vehicle before you can buy another"); return 1; }
            if(PlayerInfo[playerid][pCarkey] != SCRIPT_CARS && PlayerInfo[playerid][pCarkey2] != SCRIPT_CARS && PlayerInfo[playerid][pCarkey3] != SCRIPT_CARS && PlayerInfo[playerid][pCarkey4] != SCRIPT_CARS && PlayerInfo[playerid][pCarkey5] != SCRIPT_CARS)
            {
                SendClientMessage(playerid,COLOR_GREY,"You already have 5 vehicles, you will need to sell one first.");
                return 1;
            }
            if(modelid == 560) // Sultan
            {
                if(PlayerInfo[playerid][pAccount] < 3999999) { SendClientMessage(playerid, COLOR_GREY, "You can not afford this vehicle (money gets transferred from your bank)."); return 1; }
                new found = 0;
                for(new i = 0; i < sizeof(CarInfo); i++)
                {
                    if(found != 1)
                    {
                        if(CarInfo[i][cOwnedCar] == 0)
                        {
                            found = 1;
                            CarInfo[i][cMod][0] = 0;
                            CarInfo[i][cMod][1] = 0;
                            CarInfo[i][cMod][2] = 0;
                            CarInfo[i][cMod][3] = 0;
                            CarInfo[i][cMod][4] = 0;
                            CarInfo[i][cMod][5] = 0;
                            CarInfo[i][cMod][6] = 0;
                            CarInfo[i][cMod][7] = 0;
                            CarInfo[i][cMod][8] = 0;
                            CarInfo[i][cMod][9] = 0;
                            if(PlayerInfo[playerid][pCarkey] == SCRIPT_CARS)
                            {
                                PlayerInfo[playerid][pCarkey] = i;
                            }
                            else if(PlayerInfo[playerid][pCarkey2] == SCRIPT_CARS)
                            {
                                PlayerInfo[playerid][pCarkey2] = i;
                            }
                            else if(PlayerInfo[playerid][pCarkey3] == SCRIPT_CARS)
                            {
                            PlayerInfo[playerid][pCarkey3] = i;
                            }
                            else if(PlayerInfo[playerid][pCarkey4] == SCRIPT_CARS)
                            {
                                PlayerInfo[playerid][pCarkey4] = i;
                            }
                            else if(PlayerInfo[playerid][pCarkey5] == SCRIPT_CARS)
                            {
                                PlayerInfo[playerid][pCarkey5] = i;
                            }
                            new string[250];
                            new sendername[MAX_PLAYER_NAME];
                            format(string, sizeof(string), ""COL_GREY"You have purchased a new Sultan, for $3000000, type {FF6347}/v help"COL_GREY" for details.");
                            SendClientMessage(playerid,COLOR_GREY,string);
                            SendClientMessage(playerid,COLOR_GREY,""COL_GREY"You must set your Sultan's spawn using {FF6347}/v setpark"COL_GREY" as soon as possible.");
                            SendClientMessage(playerid,COLOR_GREY,""COL_GREY"Los Santos Aircraft: We have parked your {FF6347}Sultan"COL_GREY" at Los Santos Airport");
                            PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-3000000;
                            CarInfo[i][cOwnedCar] = 1;
                            CarInfo[i][cModel] = 560;
                            format(string, sizeof(string), "Sultan");
                            strmid(CarInfo[i][cDescription], string, 0, strlen(string), 255);
                            CarInfo[i][cValue] = 3000000;
                            CarInfo[i][cColorOne] = 13;
                            CarInfo[i][cColorTwo] = 13;
                            CarInfo[i][cLock] = 0;
                            CarInfo[i][cLocationx] = 1993.2000;
                            CarInfo[i][cLocationy] = -2382.3000;
                            CarInfo[i][cLocationz] = 14.5000;
                            CarInfo[i][cAngle] = 90.00;
                            CarInfo[i][cDonate] = 0;
                            CarInfo[i][cTrunkWep][1] = 0;
                            CarInfo[i][cTrunkWep][2] = 0;
                            CarInfo[i][cTrunkWep][3] = 0;
                            CarInfo[i][cTrunkWep][4] = 0;
                            CarInfo[i][cTrunkAmmo][1] = 0;
                            CarInfo[i][cTrunkAmmo][2] = 0;
                            CarInfo[i][cTrunkAmmo][3] = 0;
                            CarInfo[i][cTrunkAmmo][4] = 0;
                            CarInfo[i][cTrunkArmour] = 0.0;
                            CarInfo[i][cTrunkCounter] = 0;
                            GetPlayerName(playerid, sendername, sizeof(sendername));
                            format(string, sizeof(string), "%s", sendername);
                            strmid(CarInfo[i][cOwner], string, 0, strlen(string), 255);
                            new carid = AddStaticVehicleEx(CarInfo[i][cModel],CarInfo[i][cLocationx],CarInfo[i][cLocationy],CarInfo[i][cLocationz]+1,CarInfo[i][cAngle],CarInfo[i][cColorOne],CarInfo[i][cColorTwo],3600);
                            VehicleOwned[carid] = i;
                            UpdateAccount(playerid);
                            SaveCars();
                            return 1;
                        }
                    }
                }
            }
        }
        else SendClientMessage(playerid, COLOR_GREY, "you canceled the vehicle selection.");
        return 1;
    }
Reply
#2

Are you using mSelection? Also put some parts of your script
Reply
#3

Last post you made you used ShowModelSelectionMenuEx so I assume you are using it here also, in that case these are parameters in the function.
pawn Код:
ShowModelSelectionMenuEx(playerid, items_array[], item_amount, header_text[], extraid, Float:Xrot = 0.0, Float:Yrot = 0.0, Float:Zrot = 0.0, Float:mZoom = 1.0, dialogBGcolor = 0x4A5A6BBB, previewBGcolor = 0x88888899 , tdSelectionColor = 0xFFFF00AA)
Three of the parameters in the function are "Float:Xrot = 0.0, Float:Yrot = 0.0, Float:Zrot = 0.0", you probably set one of them to something other than 0. If you want to see the vehicles normally try setting them back to 0.
Reply
#4

Of course, i frgot to add the codes

pawn Код:
if(strcmp(cmd, "/buyvehicle", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!IsAtDealership(playerid))
            {
                SendClientMessage(playerid, COLOR_WHITE, "You are not near a car dealership.");
                return 1;
            }
            if(!strlen(tmp))
            {
                if(PlayerToPoint(3.0, playerid,-2033.3193,-117.6438,1035.1718))
                {
                    new vehicle[28];
                    vehicle[0] = 602;
                    vehicle[1] = 542;
                    vehicle[2] = 549;
                    vehicle[3] = 555;
                    vehicle[4] = 489;
                    vehicle[5] = 579;
                    vehicle[6] = 551;
                    vehicle[7] = 496;
                    vehicle[8] = 580;
                    vehicle[9] = 526;
                    vehicle[10] = 516;
                    vehicle[11] = 491;
                    vehicle[12] = 445;
                    vehicle[13] = 545;
                    vehicle[14] = 540;
                    vehicle[15] = 527;
                    vehicle[16] = 529;
                    vehicle[17] = 546;
                    vehicle[18] = 533;
                    vehicle[19] = 566;
                    vehicle[20] = 550;
                    vehicle[21] = 400;
                    vehicle[22] = 561;
                    vehicle[23] = 482;
                    vehicle[24] = 405;
                    vehicle[25] = 412;
                    vehicle[26] = 567;
                    vehicle[27] = 536;
                    ShowModelSelectionMenuEx(playerid, vehicle, 28, "Coutt And Schutz", dealership1, 16.0, 0.0, -55.0);
                }
            }
        }
        return 1;
    }
on top of the script
pawn Код:
new dealership1 = mS_INVALID_LISTID;
on ongamemodeinit
pawn Код:
dealership1 = LoadModelSelectionMenu("dealership1.txt");

pawn Код:
public OnPlayerModelSelectionEx(playerid, response, extraid, modelid)
{
    if(extraid == dealership1)
    {
        if(response)
        {
            if(ForwardOwnCar(1,playerid)) { SendClientMessage(playerid,COLOR_GREY,"You must park ( despawn ) your vehicle before you can buy another"); return 1; }
            else if(ForwardOwnCar(2,playerid)) { SendClientMessage(playerid,COLOR_GREY,"You must park ( despawn ) your vehicle before you can buy another"); return 1; }
            else if(ForwardOwnCar(3,playerid)) { SendClientMessage(playerid,COLOR_GREY,"You must park ( despawn ) your vehicle before you can buy another"); return 1; }
            else if(ForwardOwnCar(4,playerid)) { SendClientMessage(playerid,COLOR_GREY,"You must park ( despawn ) your vehicle before you can buy another"); return 1; }
            else if(ForwardOwnCar(5,playerid)) { SendClientMessage(playerid,COLOR_GREY,"You must park ( despawn ) your vehicle before you can buy another"); return 1; }
            if(PlayerInfo[playerid][pCarkey] != SCRIPT_CARS && PlayerInfo[playerid][pCarkey2] != SCRIPT_CARS && PlayerInfo[playerid][pCarkey3] != SCRIPT_CARS && PlayerInfo[playerid][pCarkey4] != SCRIPT_CARS && PlayerInfo[playerid][pCarkey5] != SCRIPT_CARS)
            {
                SendClientMessage(playerid,COLOR_GREY,"You already have 5 vehicles, you will need to sell one first.");
                return 1;
            }
            if(modelid == 560) // Sultan
            {
                if(PlayerInfo[playerid][pAccount] < 3999999) { SendClientMessage(playerid, COLOR_GREY, "You can not afford this vehicle (money gets transferred from your bank)."); return 1; }
                new found = 0;
                for(new i = 0; i < sizeof(CarInfo); i++)
                {
                    if(found != 1)
                    {
                        if(CarInfo[i][cOwnedCar] == 0)
                        {
                            found = 1;
                            CarInfo[i][cMod][0] = 0;
                            CarInfo[i][cMod][1] = 0;
                            CarInfo[i][cMod][2] = 0;
                            CarInfo[i][cMod][3] = 0;
                            CarInfo[i][cMod][4] = 0;
                            CarInfo[i][cMod][5] = 0;
                            CarInfo[i][cMod][6] = 0;
                            CarInfo[i][cMod][7] = 0;
                            CarInfo[i][cMod][8] = 0;
                            CarInfo[i][cMod][9] = 0;
                            if(PlayerInfo[playerid][pCarkey] == SCRIPT_CARS)
                            {
                                PlayerInfo[playerid][pCarkey] = i;
                            }
                            else if(PlayerInfo[playerid][pCarkey2] == SCRIPT_CARS)
                            {
                                PlayerInfo[playerid][pCarkey2] = i;
                            }
                            else if(PlayerInfo[playerid][pCarkey3] == SCRIPT_CARS)
                            {
                            PlayerInfo[playerid][pCarkey3] = i;
                            }
                            else if(PlayerInfo[playerid][pCarkey4] == SCRIPT_CARS)
                            {
                                PlayerInfo[playerid][pCarkey4] = i;
                            }
                            else if(PlayerInfo[playerid][pCarkey5] == SCRIPT_CARS)
                            {
                                PlayerInfo[playerid][pCarkey5] = i;
                            }
                            new string[250];
                            new sendername[MAX_PLAYER_NAME];
                            format(string, sizeof(string), ""COL_GREY"You have purchased a new Sultan, for $3000000, type {FF6347}/v help"COL_GREY" for details.");
                            SendClientMessage(playerid,COLOR_GREY,string);
                            SendClientMessage(playerid,COLOR_GREY,""COL_GREY"You must set your Sultan's spawn using {FF6347}/v setpark"COL_GREY" as soon as possible.");
                            SendClientMessage(playerid,COLOR_GREY,""COL_GREY"Los Santos Aircraft: We have parked your {FF6347}Sultan"COL_GREY" at Los Santos Airport");
                            PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-3000000;
                            CarInfo[i][cOwnedCar] = 1;
                            CarInfo[i][cModel] = 560;
                            format(string, sizeof(string), "Sultan");
                            strmid(CarInfo[i][cDescription], string, 0, strlen(string), 255);
                            CarInfo[i][cValue] = 3000000;
                            CarInfo[i][cColorOne] = 13;
                            CarInfo[i][cColorTwo] = 13;
                            CarInfo[i][cLock] = 0;
                            CarInfo[i][cLocationx] = 1993.2000;
                            CarInfo[i][cLocationy] = -2382.3000;
                            CarInfo[i][cLocationz] = 14.5000;
                            CarInfo[i][cAngle] = 90.00;
                            CarInfo[i][cDonate] = 0;
                            CarInfo[i][cTrunkWep][1] = 0;
                            CarInfo[i][cTrunkWep][2] = 0;
                            CarInfo[i][cTrunkWep][3] = 0;
                            CarInfo[i][cTrunkWep][4] = 0;
                            CarInfo[i][cTrunkAmmo][1] = 0;
                            CarInfo[i][cTrunkAmmo][2] = 0;
                            CarInfo[i][cTrunkAmmo][3] = 0;
                            CarInfo[i][cTrunkAmmo][4] = 0;
                            CarInfo[i][cTrunkArmour] = 0.0;
                            CarInfo[i][cTrunkCounter] = 0;
                            GetPlayerName(playerid, sendername, sizeof(sendername));
                            format(string, sizeof(string), "%s", sendername);
                            strmid(CarInfo[i][cOwner], string, 0, strlen(string), 255);
                            new carid = AddStaticVehicleEx(CarInfo[i][cModel],CarInfo[i][cLocationx],CarInfo[i][cLocationy],CarInfo[i][cLocationz]+1,CarInfo[i][cAngle],CarInfo[i][cColorOne],CarInfo[i][cColorTwo],3600);
                            VehicleOwned[carid] = i;
                            UpdateAccount(playerid);
                            SaveCars();
                            return 1;
                        }
                    }
                }
            }
        }
        else SendClientMessage(playerid, COLOR_GREY, "you canceled the vehicle selection.");
        return 1;
    }
Reply
#5

In the function that shows the menu to the player you have this:
pawn Код:
ShowModelSelectionMenuEx(playerid, vehicle, 28, "Coutt And Schutz", dealership1, 16.0, 0.0, -55.0);
The xRot parameter is 16, if you change it to -16 it will work correctly:
pawn Код:
ShowModelSelectionMenuEx(playerid, vehicle, 28, "Coutt And Schutz", dealership1, -16.0, 0.0, -55.0);
Reply
#6

Thanks alot, it helped
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)