Problem with mSelection
#1

I Wanted To Build A Vehicle Spawner with It But Every Time I Choose The Category It Doesn't show The Menu
pawn Код:
#include < a_samp >
#include < streamer >
#include < mSelection >
#include < zcmd >

new Airplanes = mS_INVALID_LISTID;
new Helicopters = mS_INVALID_LISTID;
new Bikes = mS_INVALID_LISTID;
new Convertibles = mS_INVALID_LISTID;
new Industrial = mS_INVALID_LISTID;
new Lowriders = mS_INVALID_LISTID;
new OffRoad = mS_INVALID_LISTID;
new PublicServiceVehicles = mS_INVALID_LISTID;
new Saloons = mS_INVALID_LISTID;
new SportVehicles = mS_INVALID_LISTID;
new StationWagons = mS_INVALID_LISTID;
new Boats = mS_INVALID_LISTID;
new Trailers = mS_INVALID_LISTID;
new UniqueVehicles = mS_INVALID_LISTID;
new RCVehicles = mS_INVALID_LISTID;



public OnFilterScriptInit()
{
    Airplanes = LoadModelSelectionMenu("Planes.txt");
    Helicopters = LoadModelSelectionMenu("Helis.txt");
    Bikes = LoadModelSelectionMenu("Bikes.txt");
    Convertibles = LoadModelSelectionMenu("Convertibles.txt");
    Industrial = LoadModelSelectionMenu("Industrial.txt");
    Lowriders = LoadModelSelectionMenu("Low.txt");
    OffRoad = LoadModelSelectionMenu("Off Road.txt");
    PublicServiceVehicles = LoadModelSelectionMenu("Public.txt");
    Saloons = LoadModelSelectionMenu("Saloons.txt");
    SportVehicles = LoadModelSelectionMenu("Sports.txt");
    StationWagons = LoadModelSelectionMenu("Station.txt");
    Boats = LoadModelSelectionMenu("Boats.txt");
    Trailers = LoadModelSelectionMenu("Trailers.txt");
    UniqueVehicles = LoadModelSelectionMenu("Unique.txt");
    RCVehicles = LoadModelSelectionMenu("RC.txt");

    return 1;
}

COMMAND:vs(playerid, params[])
{
    if((GetPlayerInterior(playerid)!=0)||(GetPlayerVirtualWorld(playerid)!= 0)) return SendClientMessage(playerid,C_RED,"You can't use this command here.");
    ShowPlayerDialog(playerid, 814, DIALOG_STYLE_LIST, "Choose The Category", "{00FF31}Airplanes \n{00FF31}Helicopters \n{00FF31}Bikes \n{00FF31}Convertibles \n{00FF31}Industrial \n{00FF31}Lowriders \n{00FF31}Off Road \n{00FF31}Public Service Vehicles \n{00FF31}Saloons \n{00FF31}Sport Vehicles \n{00FF31}Station Wagons \n{00FF31}Boats \n{00FF31}Trailers \n{00FF31}Unique Vehicles \n{00FF31}RC Vehicles \n", "Select", "Cancel");// This is a comment
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 814)
    {
        if(response) // If they clicked 'Select' or double-clicked a weapon
        {
            // Give them the weapon
            if(listitem == 0) // They selected the first item - Desert Eagle
            {
                ShowModelSelectionMenu(playerid, Airplanes, "->Airplanes<-");
            }
            if(listitem == 1) // They selected the second item - AK-47
            {
                ShowModelSelectionMenu(playerid, Helicopters, "->Helicopters<-");
            }
            if(listitem == 2) // They selected the third item - Desert Eagle
            {
                ShowModelSelectionMenu(playerid, Bikes, "->Bikes<-");
            }
            if(listitem == 3) // They selected the first item - Desert Eagle
            {
                ShowModelSelectionMenu(playerid, Convertibles, "->Convertibles<-");
            }
            if(listitem == 4) // They selected the second item - AK-47
            {
                ShowModelSelectionMenu(playerid, Industrial, "->Industrial<-");
            }
            if(listitem == 5) // They selected the third item - Desert Eagle
            {
                ShowModelSelectionMenu(playerid, Lowriders, "->Low Riders<-");
            }
            if(listitem == 6) // They selected the first item - Desert Eagle
            {
                ShowModelSelectionMenu(playerid, OffRoad, "->Off Road<-");
            }
            if(listitem == 7) // They selected the second item - AK-47
            {
                ShowModelSelectionMenu(playerid, PublicServiceVehicles, "->Public Service Vehicles<-");
            }
            if(listitem == 8) // They selected the third item - Desert Eagle
            {
                ShowModelSelectionMenu(playerid, Saloons, "->Saloons<-");
            }
            if(listitem == 9) // They selected the first item - Desert Eagle
            {
                ShowModelSelectionMenu(playerid, SportVehicles, "->Sport Vehicles<-");
            }
            if(listitem == 10) // They selected the second item - AK-47
            {
                ShowModelSelectionMenu(playerid, StationWagons, "->Station Wagons<-");
            }
            if(listitem == 11) // They selected the third item - Desert Eagle
            {
                ShowModelSelectionMenu(playerid, Boats, "->Boats<-");
            }
            if(listitem == 12) // They selected the first item - Desert Eagle
            {
                ShowModelSelectionMenu(playerid, Trailers, "->Trailers<-");
            }
            if(listitem == 13) // They selected the second item - AK-47
            {
                ShowModelSelectionMenu(playerid, UniqueVehicles, "->Unique Vehicles<-");
            }
            if(listitem == 14) // They selected the third item - Desert Eagle
            {
                ShowModelSelectionMenu(playerid, RCVehicles, "->RC Vehicles<-");
            }
        }
        return 1; // We handled a dialog, so return 1. Just like OnPlayerCommandText.
    }

    return 0; // You MUST return 0 here! Just like OnPlayerCommandText.
}

public OnPlayerModelSelection(playerid, response, listid, modelid)
{
    if(listid == Airplanes)
    {
        if(response)
        {
            new Float:pos[3]; GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
            new lastveh;
            if(IsPlayerInAnyVehicle(playerid)){lastveh = GetPlayerVehicleID(playerid);ddo(lastveh);RemovePlayerFromVehicle(playerid);}
            new v = CreateVehicle(modelid, pos[0] + 2.5, pos[1], pos[2] + 2.5, 0.0, random(128), random(128), -1);
            DestroyVehicle(lastveh);
            PutPlayerInVehicle(playerid,v,0);

        }

        return 1;
    }
    if(listid == Helicopters)
    {
        if(response)
        {
            new Float:pos[3]; GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
            new lastveh;
            if(IsPlayerInAnyVehicle(playerid)){lastveh = GetPlayerVehicleID(playerid);ddo(lastveh);RemovePlayerFromVehicle(playerid);}
            new v = CreateVehicle(modelid, pos[0] + 2.5, pos[1], pos[2] + 2.5, 0.0, random(128), random(128), -1);
            DestroyVehicle(lastveh);
            PutPlayerInVehicle(playerid,v,0);
        }

        return 1;
    }
    if(listid == Bikes)
    {
        if(response)
        {
            new Float:pos[3]; GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
            new lastveh;
            if(IsPlayerInAnyVehicle(playerid)){lastveh = GetPlayerVehicleID(playerid);ddo(lastveh);RemovePlayerFromVehicle(playerid);}
            new v = CreateVehicle(modelid, pos[0] + 2.5, pos[1], pos[2] + 2.5, 0.0, random(128), random(128), -1);
            DestroyVehicle(lastveh);
            PutPlayerInVehicle(playerid,v,0);
        }

        return 1;
    }
    if(listid == Convertibles)
    {
        if(response)
        {
            new Float:pos[3]; GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
            new lastveh;
            if(IsPlayerInAnyVehicle(playerid)){lastveh = GetPlayerVehicleID(playerid);ddo(lastveh);RemovePlayerFromVehicle(playerid);}
            new v = CreateVehicle(modelid, pos[0] + 2.5, pos[1], pos[2] + 2.5, 0.0, random(128), random(128), -1);
            DestroyVehicle(lastveh);
            PutPlayerInVehicle(playerid,v,0);
        }

        return 1;
    }
    if(listid == Industrial)
    {
        if(response)
        {
            new Float:pos[3]; GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
            new lastveh;
            if(IsPlayerInAnyVehicle(playerid)){lastveh = GetPlayerVehicleID(playerid);ddo(lastveh);RemovePlayerFromVehicle(playerid);}
            new v = CreateVehicle(modelid, pos[0] + 2.5, pos[1], pos[2] + 2.5, 0.0, random(128), random(128), -1);
            DestroyVehicle(lastveh);
            PutPlayerInVehicle(playerid,v,0);
        }

        return 1;
    }
    if(listid == Lowriders)
    {
        if(response)
        {
            new Float:pos[3]; GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
            new lastveh;
            if(IsPlayerInAnyVehicle(playerid)){lastveh = GetPlayerVehicleID(playerid);ddo(lastveh);RemovePlayerFromVehicle(playerid);}
            new v = CreateVehicle(modelid, pos[0] + 2.5, pos[1], pos[2] + 2.5, 0.0, random(128), random(128), -1);
            DestroyVehicle(lastveh);
            PutPlayerInVehicle(playerid,v,0);
        }

        return 1;
    }
    if(listid == OffRoad)
    {
        if(response)
        {
            new Float:pos[3]; GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
            new lastveh;
            if(IsPlayerInAnyVehicle(playerid)){lastveh = GetPlayerVehicleID(playerid);ddo(lastveh);RemovePlayerFromVehicle(playerid);}
            new v = CreateVehicle(modelid, pos[0] + 2.5, pos[1], pos[2] + 2.5, 0.0, random(128), random(128), -1);
            DestroyVehicle(lastveh);
            PutPlayerInVehicle(playerid,v,0);
        }

        return 1;
    }
    if(listid == PublicServiceVehicles)
    {
        if(response)
        {
            new Float:pos[3]; GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
            new lastveh;
            if(IsPlayerInAnyVehicle(playerid)){lastveh = GetPlayerVehicleID(playerid);ddo(lastveh);RemovePlayerFromVehicle(playerid);}
            new v = CreateVehicle(modelid, pos[0] + 2.5, pos[1], pos[2] + 2.5, 0.0, random(128), random(128), -1);
            DestroyVehicle(lastveh);
            PutPlayerInVehicle(playerid,v,0);
        }

        return 1;
    }
    if(listid == Saloons)
    {
        if(response)
        {
            new Float:pos[3]; GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
            new lastveh;
            if(IsPlayerInAnyVehicle(playerid)){lastveh = GetPlayerVehicleID(playerid);ddo(lastveh);RemovePlayerFromVehicle(playerid);}
            new v = CreateVehicle(modelid, pos[0] + 2.5, pos[1], pos[2] + 2.5, 0.0, random(128), random(128), -1);
            DestroyVehicle(lastveh);
            PutPlayerInVehicle(playerid,v,0);
        }

        return 1;
    }
    if(listid == SportVehicles)
    {
        if(response)
        {
            new Float:pos[3]; GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
            new lastveh;
            if(IsPlayerInAnyVehicle(playerid)){lastveh = GetPlayerVehicleID(playerid);ddo(lastveh);RemovePlayerFromVehicle(playerid);}
            new v = CreateVehicle(modelid, pos[0] + 2.5, pos[1], pos[2] + 2.5, 0.0, random(128), random(128), -1);
            DestroyVehicle(lastveh);
            PutPlayerInVehicle(playerid,v,0);
        }

        return 1;
    }
    if(listid == StationWagons)
    {
        if(response)
        {
            new Float:pos[3]; GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
            new lastveh;
            if(IsPlayerInAnyVehicle(playerid)){lastveh = GetPlayerVehicleID(playerid);ddo(lastveh);RemovePlayerFromVehicle(playerid);}
            new v = CreateVehicle(modelid, pos[0] + 2.5, pos[1], pos[2] + 2.5, 0.0, random(128), random(128), -1);
            DestroyVehicle(lastveh);
            PutPlayerInVehicle(playerid,v,0);
        }

        return 1;
    }
    if(listid == Boats)
    {
        if(response)
        {
            new Float:pos[3]; GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
            new lastveh;
            if(IsPlayerInAnyVehicle(playerid)){lastveh = GetPlayerVehicleID(playerid);ddo(lastveh);RemovePlayerFromVehicle(playerid);}
            new v = CreateVehicle(modelid, pos[0] + 2.5, pos[1], pos[2] + 2.5, 0.0, random(128), random(128), -1);
            DestroyVehicle(lastveh);
            PutPlayerInVehicle(playerid,v,0);
        }

        return 1;
    }
    if(listid == Trailers)
    {
        if(response)
        {
            new Float:pos[3]; GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
            new lastveh;
            if(IsPlayerInAnyVehicle(playerid)){lastveh = GetPlayerVehicleID(playerid);ddo(lastveh);RemovePlayerFromVehicle(playerid);}
            new v = CreateVehicle(modelid, pos[0] + 2.5, pos[1], pos[2] + 2.5, 0.0, random(128), random(128), -1);
            DestroyVehicle(lastveh);
            PutPlayerInVehicle(playerid,v,0);
        }

        return 1;
    }
    if(listid == UniqueVehicles)
    {
        if(response)
        {
            new Float:pos[3]; GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
            new lastveh;
            if(IsPlayerInAnyVehicle(playerid)){lastveh = GetPlayerVehicleID(playerid);ddo(lastveh);RemovePlayerFromVehicle(playerid);}
            new v = CreateVehicle(modelid, pos[0] + 2.5, pos[1], pos[2] + 2.5, 0.0, random(128), random(128), -1);
            DestroyVehicle(lastveh);
            PutPlayerInVehicle(playerid,v,0);
        }

        return 1;
    }
    if(listid == RCVehicles)
    {
        if(response)
        {
            new Float:pos[3]; GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
            new lastveh;
            if(IsPlayerInAnyVehicle(playerid)){lastveh = GetPlayerVehicleID(playerid);ddo(lastveh);RemovePlayerFromVehicle(playerid);}
            new v = CreateVehicle(modelid, pos[0] + 2.5, pos[1], pos[2] + 2.5, 0.0, random(128), random(128), -1);
            DestroyVehicle(lastveh);
            PutPlayerInVehicle(playerid,v,0);
        }

        return 1;
    }
    return 1;
}
Reply
#2

guys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)