SA-MP Forums

SA-MP Forums (https://forum.sa-mp.com/index.php)
-   Scripting Help (https://forum.sa-mp.com/forumdisplay.php?f=12)
-   -   How to give weapons after they choosed? (https://forum.sa-mp.com/showthread.php?t=667751)

Edvukas 05/07/2019 08:32 PM

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?

Symon 05/07/2019 08:32 PM

Re: How to give weapons after they choosed?
 
GivePlayerWeapon i guess?

Fuzzy 05/07/2019 08:33 PM

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

Edvukas 05/07/2019 08:39 PM

Re: How to give weapons after they choosed?
 
I mean that when player close dialogue then he get weapon which he choosed

Fuzzy 05/07/2019 08:41 PM

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

Edvukas 05/07/2019 08:44 PM

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

Fuzzy 05/07/2019 08:46 PM

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

Edvukas 05/07/2019 08:51 PM

Re: How to give weapons after they choosed?
 
How can I save player's options and then give him weapons which he choosed?

Fuzzy 05/07/2019 08:52 PM

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;
}


Edvukas 05/07/2019 09:03 PM

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


All times are GMT. The time now is 09:35 AM.

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