Weapons
#1

it not showing the weapons not giveing it i need a code




Код:
COMMAND:weapon(playerid, params[])
{
    if (APlayerData[playerid][PlayerLevel] >= 3)
    ShowPlayerDialog(0, 1, DIALOG_STYLE_LIST, "Weapon", "Ak-47\n\rm4\n\rspaz", "Button1", "Button2"); //Weapons for admins
	// Let the server know that this was a valid command
	return 1;
}
Reply
#2

pawn Код:
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Weapon", "Ak-47\n\rm4\n\rspaz", "Button1", "Button2");
You were only showing it to ID 0.
Reply
#3

Can you help me on
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    return 1;
}
Reply
#4

What do you mean with rm4 and respaz?

Tell their original names.
Reply
#5

idk but i finded on a maker
Can you make me one?
/weapon?
Reply
#6

pawn Код:
if(dialogid == 1) {// if dialogid (id of the dialog) is 1 (our weapons dialog) do:
switch (listitem)
{
case 0: // case 0 => ak-47
{
// give ak47
}
case 1: // case 1 => m4
{
// give m4
}
case 2: // case 2 => spas
{
// give spas
}
}
Reply
#7

Ok, here. note that first one gets you AK47 and other M4 and the other one Respray as i understanded them.
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)// They pressed the first button    
    {
    switch(1)// Checking what dialog we're processing
        {
        case 1:// Our first dialog
            {
            switch(listitem)// Checking which item was chosen
            {
                case 0: // The first listitem
                {
                        GivePlayerWeapon(playerid, 30, 5000);  // AK47
                }
                case 1: // The second listitem
                {
                        GivePlayerWeapon(playerid, 31, 5000); // M4
                }
                case 2: // The third listitem
                {
                        GivePlayerWeapon(playerid, 41, 5000); // RESPRAY
                }        
            }
        }
    }
    return 1;
}
Reply
#8

wat? i got one idk is dis right




Код:
// This callback gets called when a player interacts with a dialog
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	// Select the proper dialog to process
	switch (dialogid)
	{
		case DialogRegister: Dialog_Register(playerid, response, inputtext); // The "Register"-dialog
		case DialogLogin: Dialog_Login(playerid, response, inputtext); // The "Login"-dialog

		case DialogStatsOtherPlayer: Dialog_StatsOtherPlayer(playerid, response, listitem);
		case DialogStatsHouse: Dialog_StatsHouse(playerid, response, listitem);
		case DialogStatsGoHouse: Dialog_StatsGoHouse(playerid, response, listitem);
		case DialogStatsGoBusiness: Dialog_StatsGoBusiness(playerid, response, listitem);

		case DialogRescue: Dialog_Rescue(playerid, response, listitem); // The rescue-dialog

		case DialogBuyLicenses: Dialog_BuyLicenses(playerid, response, listitem); // The license-dialog (allows the player to buy trucker/busdriver licenses)

		case DialogRules: Dialog_Rules(playerid, response);

		case DialogTruckerJobMethod: Dialog_TruckerSelectJobMethod(playerid, response, listitem); // The work-dialog for truckers (shows the loads he can carry and lets the player choose the load)
		case DialogTruckerSelectLoad: Dialog_TruckerSelectLoad(playerid, response, listitem); // The load-selection dialog for truckers (shows the startlocations for the selected load and let the player choose his startlocation)
		case DialogTruckerStartLoc: Dialog_TruckerSelectStartLoc(playerid, response, listitem); // The start-location dialog for truckers (shows the endlocations for the selected load and let the player choose his endlocation)
		case DialogTruckerEndLoc: Dialog_TruckerSelectEndLoc(playerid, response, listitem); // The end-location dialog for truckers (processes the selected endlocation and starts the job)

		case DialogBusJobMethod: Dialog_BusSelectJobMethod(playerid, response, listitem); // The work-dialog for busdrivers (process the options to choose own busroute or auto-assigned busroute)
		case DialogBusSelectRoute: Dialog_BusSelectRoute(playerid, response, listitem); // Choose the busroute and start the job

		case DialogCourierSelectQuant: Dialog_CourierSelectQuant(playerid, response, listitem);

		case DialogBike: Dialog_Bike(playerid, response, listitem); // The bike-dialog
		case DialogCar: Dialog_Car(playerid, response, listitem); // The car-dialog (which uses a split dialog structure)
		case DialogPlane: Dialog_Plane(playerid, response, listitem); // The plane-dialog (which uses a split dialog structure)
		case DialogTrailer: Dialog_Trailer(playerid, response, listitem); // The trailer-dialog (which uses a split dialog structure)
		case DialogBoat: Dialog_Boat(playerid, response, listitem); // The boat-dialog
		case DialogNeon: Dialog_Neon(playerid, response, listitem); // The neon-dialog

		case DialogRentCarClass: Dialog_RentProcessClass(playerid, response, listitem); // The player chose a vehicleclass from where he can rent a vehicle
		case DialogRentCar: Dialog_RentCar(playerid, response, listitem); // The player chose a vehicle from the list of vehicles from the vehicleclass he chose before

		case DialogPlayerCommands: Dialog_PlayerCommands(playerid, response, listitem); // Displays all commands in a split-dialog structure
		case DialogPrimaryCarColor: Dialog_PrimaryCarColor(playerid, response, listitem);
		case DialogSedundaryCarColor: Dialog_SedundaryCarColor(playerid, response, listitem);

		case DialogWeather: Dialog_Weather(playerid, response, listitem); // The weather dialog
		case DialogCarOption: Dialog_CarOption(playerid, response, listitem); // The caroption dialog

		case DialogSelectConvoy: Dialog_SelectConvoy(playerid, response, listitem);

		case DialogHouseMenu: Dialog_HouseMenu(playerid, response, listitem); // Process the main housemenu
		case DialogUpgradeHouse: Dialog_UpgradeHouse(playerid, response, listitem); // Process the house-upgrade menu
		case DialogGoHome: Dialog_GoHome(playerid, response, listitem); // Port to one of your houses
		case DialogHouseNameChange: Dialog_ChangeHouseName(playerid, response, inputtext); // Change the name of your house
		case DialogSellHouse: Dialog_SellHouse(playerid, response); // Sell the house
		case DialogBuyCarClass: Dialog_BuyCarClass(playerid, response, listitem); // The player chose a vehicleclass from where he can buy a vehicle
		case DialogBuyCar: Dialog_BuyCar(playerid, response, listitem); // The player chose a vehicle from the list of vehicles from the vehicleclass he chose before
		case DialogSellCar: Dialog_SellCar(playerid, response, listitem);
		case DialogBuyInsurance: Dialog_BuyInsurance(playerid, response);
		case DialogGetCarSelectHouse: Dialog_GetCarSelectHouse(playerid, response, listitem);
		case DialogGetCarSelectCar: Dialog_GetCarSelectCar(playerid, response, listitem);
		case DialogUnclampVehicles: Dialog_UnclampVehicles(playerid, response);

		case DialogCreateBusSelType: Dialog_CreateBusSelType(playerid, response, listitem);
		case DialogBusinessMenu: Dialog_BusinessMenu(playerid, response, listitem);
		case DialogGoBusiness: Dialog_GoBusiness(playerid, response, listitem);
		case DialogBusinessNameChange: Dialog_ChangeBusinessName(playerid, response, inputtext); // Change the name of your business
		case DialogSellBusiness: Dialog_SellBusiness(playerid, response); // Sell the business

		case DialogBankPasswordRegister: Dialog_BankPasswordRegister(playerid, response, inputtext);
		case DialogBankPasswordLogin: Dialog_BankPasswordLogin(playerid, response, inputtext);
		case DialogBankOptions: Dialog_BankOptions(playerid, response, listitem);
		case DialogBankDeposit: Dialog_BankDeposit(playerid, response, inputtext);
		case DialogBankWithdraw: Dialog_BankWithdraw(playerid, response, inputtext);
		case DialogBankTransferMoney: Dialog_BankTransferMoney(playerid, response, inputtext);
		case DialogBankTransferName: Dialog_BankTransferName(playerid, response, inputtext);
		case DialogBankCancel: Dialog_BankCancel(playerid, response);

		case DialogHelpItemChosen: Dialog_HelpItemChosen(playerid, response, listitem);
		case DialogHelpItem: Dialog_HelpItem(playerid, response);

		case DialogOldPassword: Dialog_OldPassword(playerid, response, inputtext);
		case DialogNewPassword: Dialog_NewPassword(playerid, response, inputtext);
		case DialogConfirmPassword: Dialog_ConfirmPassword(playerid, response);
	}

    return 1;
}
Reply
#9

Omg, No? This is for login and other weird things!? use my damned code.
Reply
#10

Код:
C:\Users\PPC_Trucking.pwn(1630) : error 021: symbol already defined: "OnDialogResponse"
C:\Users\gamemodes\PPC_Trucking.pwn(1656) : error 030: compound statement not closed at the end of file (started at line 1631)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)