Lockers
#1

How do I create equipment lockers?

I want my team to be able to go to a certain point within an interior and type;

/gear

Upon typing this, a dialog box should appear with the following options:

Colt .45
Desert Eagle
Shotgun
Combat Shotgun
MP5
M4A1
Sniper Rifle

When they click the options, it'll then give them the weapon.

Can I get some help with this? I learn by seeing finished codes, then I expand my knowledge upon it.

Thanks.
Reply
#2

Go make a script request, here is specific issues in scripting posting place.
Reply
#3

I'll help you, I messaged you my Skype.
Reply
#4

I do not use Skype.

Can you just help me over here?
Reply
#5

FIXED.
Reply
#6

This is just to show you, if you want this to have more options you will have to make it yourself.

The command
pawn Код:
if(strcmp(cmd, "/gear", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(IsPlayerInRangeOfPoint(playerid, 6,/* Cordinates here */))
            {
                new gear[] = "1\tColt 45\n2\tDeagle";
                ShowPlayerDialog(playerid,1000,DIALOG_STYLE_LIST,"List of Gear:",gear,"Select","Cancel"); // I put dialog id to 1000 since I dont know what other dialogid's you have
            }
        }
        else
        {
            SendClientMessage(playerid, -1,"You are not at the right place");
            return 1;
        }
        return 1;
    }
Then you must put this under OnDialogResponse
pawn Код:
if(dialogid == 1000)
    {
        if(response)
        {
            if (listitem == 0)
            {
                SafeGivePlayerWeapon(playerid, 22, 200);
            }
            else if (listitem == 1)
            {
                SafeGivePlayerWeapon(playerid, 24, 200);
            }
        }
    }
Im not so good at explaining but I hope you understand it and that I helped you (Y)
Reply
#7

You helped me a little, the only thing is that I use ZCMD.

Can anybody make this in ZCMD?
Reply
#8

Код:
CMD:gear(playerid, params[])
    {
        if(IsPlayerConnected(playerid))
        {
            if(IsPlayerInRangeOfPoint(playerid, 6,/* Cordinates here */))
            {
                new gear[] = "1\tColt 45\n2\tDeagle";
                ShowPlayerDialog(playerid,1000,DIALOG_STYLE_LIST,"List of Gear:",gear,"Select","Cancel"); // I put dialog id to 1000 since I dont know what other dialogid's you have
            }
        }
        else
        {
            SendClientMessage(playerid, -1,"You are not at the right place");
            return 1;
        }
        return 1;
    }
Reply
#9

Is that all that I need to add? Or are there other bits needed to make this work?
Reply
#10

https://sampforum.blast.hk/showthread.php?tid=355296
Quote:

7. If you are requesting a script, post in the Script Request Thread
You are quite clearly just requesting a code, as you've been told before by HurtLocker, you should post a script request.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)