SA-MP Forums Archive
[FilterScript] Simple Weapon Dialog. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Simple Weapon Dialog. (/showthread.php?tid=553148)



Simple Weapon Dialog. - Zeel - 28.12.2014

Simple Weapon Dialog.



Info:-


When you spawn it shows you a dialog with two weapons packages
Package 1 :
Shawn-OFF Shotgun, UZI, Desert Eagle, AK47. Each weapon with 5000 bullets.

Package 2 :
MP5, M4, Sniper, ShotGun Each weapon with 5000 bullets

And when you choose a package it shows you a text with the packages includes you picked.

I'm not a very good coder, but still I can code.

Screenshots :


Link for pastebin code :-
http://pastebin.com/T748nhQe

Код:
#define FILTERSCRIPT
     
    #define DIALOG_WEAPON 2
    #define COLOR_RED 0xAA3333AA
     
    #include <a_samp>
     
    #if defined FILTERSCRIPT
     
    public OnFilterScriptInit()
    {
            print("\n--------------------------------------");
            print(" Weapons Dialog By Zeal");
            print("--------------------------------------\n");
            return 1;
    }
     
    public OnFilterScriptExit()
    {
            return 1;
    }
     
    main()
    {
            print("\n----------------------------------");
            print("Weapons Dialog By Zeal");
            print("----------------------------------\n");
    }
   
     
    public OnPlayerSpawn(playerid)
    {
        ShowPlayerDialog(playerid, DIALOG_WEAPON, DIALOG_STYLE_LIST, "Weapons Packages By Zeal", "Package 1\nPackage 2", "Select", "Exit");
            return 1;
    }
     
    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {
            if(dialogid == 2)
            {
                    if(response)
      {
                            if(listitem == 0)
            GivePlayerWeapon(playerid, 28, 5000);
        GivePlayerWeapon(playerid, 26, 5000);
        GivePlayerWeapon(playerid, 30, 5000);
        GivePlayerWeapon(playerid, 24, 5000);
        SendClientMessage(playerid, COLOR_RED, "You picked Package 1 - Shawn-OFF Shotgun, UZI, Desert Eagle, AK47. Each weapon with 5000 bullets.");
                    }
                    if(listitem == 1)
                    {
        GivePlayerWeapon(playerid, 29, 5000);
        GivePlayerWeapon(playerid, 31, 5000);
        GivePlayerWeapon(playerid, 34, 5000);
        GivePlayerWeapon(playerid, 25, 5000);
        SendClientMessage(playerid, COLOR_RED, "You picked Package 2 - MP5, M4, Sniper, ShotGun Each weapon with 5000 bullets ");
                    }
                    return 1;
            }
            return 1;
    }
Corrected - thanks to LivingLikeYouDo.


Bugs :-
There is no bugs, if there is report them in replies.

Credits :-
All credits returns to Zeal/Zeel.
Feel free to do anything with this script!

Kind regards,
Zeel.


Re: Simple Weapon Dialog. - Glossy42O - 28.12.2014

good job bro


Re: Simple Weapon Dialog. - UltraScripter - 28.12.2014

nice!


Re: Simple Weapon Dialog. - durd2001 - 28.12.2014

So Simple But Good For Begginers, Nice Job


Re: Simple Weapon Dialog. - Tookieson - 28.12.2014

Nice one! Good job Zeel!


Re: Simple Weapon Dialog. - LivingLikeYouDo - 28.12.2014

Nice, there were some few fixes to be made, I sent you the new file on skype.
Anyways, great work for a start!


Re: Simple Weapon Dialog. - JaydenJason - 28.12.2014

lmao you wrote your own name wrong in the dialog


Re: Simple Weapon Dialog. - Luicy. - 28.12.2014

Quote:
Originally Posted by Zeel
Посмотреть сообщение
Corrected - thanks to LivingLikeYouDo.
Not 100% Corrected as its Loose identifaction. Really Easy warning.


Re: Simple Weapon Dialog. - LivingLikeYouDo - 29.12.2014

Quote:
Originally Posted by Meller
Посмотреть сообщение
Not 100% Corrected as its Loose identifaction. Really Easy warning.
Pastebin messed the indentation.
Here is a fixed one:
pawn Код:
#define FILTERSCRIPT
     
#define DIALOG_WEAPON 2
#define COLOR_RED 0xAA3333AA
     
#include <a_samp>
     
#if defined FILTERSCRIPT
     
public OnFilterScriptInit()
{
        print("\n--------------------------------------");
        print(" Weapons Dialog By Zeal");
        print("--------------------------------------\n");
        return 1;
}
   
public OnFilterScriptExit()
{
        return 1;
}
     
main()
{
    print("\n----------------------------------");
    print("Weapons Dialog By Zeal");
    print("----------------------------------\n");
}


public OnPlayerSpawn(playerid)
{
    ShowPlayerDialog(playerid, DIALOG_WEAPON, DIALOG_STYLE_LIST, "Weapons Packages By Zeal", "Package 1\nPackage 2", "Select", "Exit");
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 2)
    {
        if(response)
        {
            if(listitem == 0)
            {
                GivePlayerWeapon(playerid, 28, 5000);
                GivePlayerWeapon(playerid, 26, 5000);
                GivePlayerWeapon(playerid, 30, 5000);
                GivePlayerWeapon(playerid, 24, 5000);
                SendClientMessage(playerid, COLOR_RED, "You picked Package 1 - Shawn-OFF Shotgun, UZI, Desert Eagle, AK47. Each weapon with 5000 bullets.");
            }
            if(listitem == 1)
            {
                GivePlayerWeapon(playerid, 29, 5000);
                GivePlayerWeapon(playerid, 31, 5000);
                GivePlayerWeapon(playerid, 34, 5000);
                GivePlayerWeapon(playerid, 25, 5000);
                SendClientMessage(playerid, COLOR_RED, "You picked Package 2 - MP5, M4, Sniper, ShotGun Each weapon with 5000 bullets ");
            }
            return 1;
        }
        return 1;
    }



Re: Simple Weapon Dialog. - AgusZ - 29.12.2014

Nice God Job