SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 05/07/2019, 09:32 PM   #1
Edvukas
Little Clucker
 
Join Date: Nov 2018
Posts: 18
Reputation: 0
Default How to give weapons after they choosed?

Hi. How do I make a player choose weapons and he get them after he close the dialogue?
Edvukas is offline   Reply With Quote
Old 05/07/2019, 09:32 PM   #2
Symon
Gangsta
 
Symon's Avatar
 
Join Date: Apr 2019
Location: Italy
Posts: 635
Reputation: 42
Default Re: How to give weapons after they choosed?

GivePlayerWeapon i guess?
__________________



Find what you love and let it kill you.
Symon is online now   Reply With Quote
Old 05/07/2019, 09:33 PM   #3
Fuzzy
Big Clucker
 
Join Date: May 2019
Posts: 92
Reputation: 5
Default Re: How to give weapons after they choosed?

Add to the dialog cases that each case use GivePlayerWeapon with another gun id and amount of ammu
__________________
My Releases:
Tutorial:
Gamemode:
Fuzzy is offline   Reply With Quote
Old 05/07/2019, 09:39 PM   #4
Edvukas
Little Clucker
 
Join Date: Nov 2018
Posts: 18
Reputation: 0
Default Re: How to give weapons after they choosed?

I mean that when player close dialogue then he get weapon which he choosed
Edvukas is offline   Reply With Quote
Old 05/07/2019, 09:41 PM   #5
Fuzzy
Big Clucker
 
Join Date: May 2019
Posts: 92
Reputation: 5
Default Re: How to give weapons after they choosed?

That's why I said when you write the dialog there are "Case:" or something you work with idk
for each case: use what I said + gun id and amount of ammo and when he choose the weapon click on the name or pic of gun he'll get it
__________________
My Releases:
Tutorial:
Gamemode:
Fuzzy is offline   Reply With Quote
Old 05/07/2019, 09:44 PM   #6
Edvukas
Little Clucker
 
Join Date: Nov 2018
Posts: 18
Reputation: 0
Default Re: How to give weapons after they choosed?

I don't want give weapons instantly. I want give weapons which he choosed after he close dialogue
Edvukas is offline   Reply With Quote
Old 05/07/2019, 09:46 PM   #7
Fuzzy
Big Clucker
 
Join Date: May 2019
Posts: 92
Reputation: 5
Default Re: How to give weapons after they choosed?

When dialog opens its gives him options right? like guns name or picture of guns
So when he choose the gun the dialog getting closed and he gets the gun he choosed
__________________
My Releases:
Tutorial:
Gamemode:
Fuzzy is offline   Reply With Quote
Old 05/07/2019, 09:51 PM   #8
Edvukas
Little Clucker
 
Join Date: Nov 2018
Posts: 18
Reputation: 0
Default Re: How to give weapons after they choosed?

How can I save player's options and then give him weapons which he choosed?
Edvukas is offline   Reply With Quote
Old 05/07/2019, 09:52 PM   #9
Fuzzy
Big Clucker
 
Join Date: May 2019
Posts: 92
Reputation: 5
Default Re: How to give weapons after they choosed?

I'll give you an example

Code:
Dialog:AddNOS(playerid, response, listitem, inputtext[])
{
	new vehicleid = GetPlayerVehicleID(playerid);

	if (!IsPlayerInAnyVehicle(playerid) || !IsDoorVehicle(vehicleid))
	    return 0;

	if (response)
	{
	    switch (listitem)
	    {
	        case 0:
			{
			    AddComponent(vehicleid, 1009);
			    SendServerMessage(playerid, "You have added 2x NOS to this vehicle.");
			}
			case 1:
			{
			    AddComponent(vehicleid, 1008);
			    SendServerMessage(playerid, "You have added 5x NOS to this vehicle.");
			}
            case 2:
			{
			    AddComponent(vehicleid, 1010);
			    SendServerMessage(playerid, "You have added 10x NOS to this vehicle.");
			}
		}
	}
	return 1;
}
__________________
My Releases:
Tutorial:
Gamemode:
Fuzzy is offline   Reply With Quote
Old 05/07/2019, 10:03 PM   #10
Edvukas
Little Clucker
 
Join Date: Nov 2018
Posts: 18
Reputation: 0
Default Re: How to give weapons after they choosed?

Here is add instantly nos. There is example: /weapons > I choose weapon > When I click "Cancel" it give me weapons which I choosed
Edvukas is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Doesn't give weapons TheNerka Scripting Help 0 16/10/2014 06:39 AM
How to give weapons to All with one CMD? MAFIAWARS Scripting Help 5 26/09/2013 09:16 AM
Give player weapons from name Snowman12 Scripting Help 6 14/01/2012 02:46 AM
Give weapons when you tele? Quest123 Help Archive 1 30/10/2009 11:43 AM
Command To Give Weapons Dmac_91 Help Archive 4 27/05/2009 09:19 AM


All times are GMT. The time now is 09:32 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.