[FilterScript] Simple Weapon Dialog.
#1

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.
Reply
#2

good job bro
Reply
#3

nice!
Reply
#4

So Simple But Good For Begginers, Nice Job
Reply
#5

Nice one! Good job Zeel!
Reply
#6

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

lmao you wrote your own name wrong in the dialog
Reply
#8

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

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;
    }
Reply
#10

Nice God Job
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)