Lockers -
SilencedPistol - 19.04.2013
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.
Re: Lockers -
HurtLocker - 19.04.2013
Go make a script request, here is specific issues in scripting posting place.
Re: Lockers -
BigGroter - 19.04.2013
I'll help you, I messaged you my Skype.
Re: Lockers -
SilencedPistol - 19.04.2013
I do not use Skype.
Can you just help me over here?
Re: Lockers -
HurtLocker - 19.04.2013
FIXED.
Re: Lockers -
Don_Cage - 19.04.2013
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)
Re: Lockers -
SilencedPistol - 22.04.2013
You helped me a little, the only thing is that I use ZCMD.
Can anybody make this in ZCMD?
Re: Lockers -
rbush12 - 22.04.2013
Код:
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;
}
Re: Lockers -
SilencedPistol - 22.04.2013
Is that all that I need to add? Or are there other bits needed to make this work?
Re: Lockers -
MattyG - 22.04.2013
https://sampforum.blast.hk/showthread.php?tid=355296
You are quite clearly just requesting a code, as you've been told before by HurtLocker, you should post a script request.