Weapon Slots
#1

Hello i wan to know is it possible to have 2 guns in one slot like have 9mm pistol and desert eagle at same time
Reply
#2

Impossible....
Reply
#3

That's not possible, but you can make something like a weaponchangesystem.

For example:

You can have 1 weaponpack (deagle, shotgun) and a second weaponpack (9mm, combat). To change now between the weaponpacks you can use a key on your keyboard. Like: You have now a normal shotgun, but you can use the "k" key to change to the second weaponpack and can shoot now with a combat shotgun. This is possible and can be comparable to what you want to make maybe. Good luck.
Reply
#4

Quote:
Originally Posted by Flori
Посмотреть сообщение
That's not possible, but you can make something like a weaponchangesystem.

For example:

You can have 1 weaponpack (deagle, shotgun) and a second weaponpack (9mm, combat). To change now between the weaponpacks you can use a key on your keyboard. Like: You have now a normal shotgun, but you can use the "k" key to change to the second weaponpack and can shoot now with a combat shotgun. This is possible and can be comparable to what you want to make maybe. Good luck.
ye that sound cool will try this

and how can i use K key for that ?
there is no k there :
https://sampwiki.blast.hk/wiki/Keys
Reply
#5

so how i can use key K ? can u define like :#define KEY_K ?
Reply
#6

Use the 'n' key, sorry. I don't know about the use of ex. 'k'. I just tried with n. This can work for sure.
Reply
#7

Quote:
Originally Posted by Flori
Посмотреть сообщение
Use the 'n' key, sorry. I don't know about the use of ex. 'k'. I just tried with n. This can work for sure.
okay just want to by sure i am going right way , i am using mysql , so on playerspawn i need to load those guns ( by defaul its should by usedk(0 meening so gun1,and gun 2) and they ammo and if ammo runs out i need to update database and set gun 1,2 and ammo to 0 right ? :

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{

     if (PRESSED(KEY_ANALOG_RIGHT))
	{
		if(PlayerInfo[playerid][JobID] == 1)
		{
			if(PlayerInfo[playerid][JobLevel] == 1 || 2)
			{
				if(Used6[playerid] == 0)
				{
                    Used6[playerid] == 1;
                    GivePlayerWeapon(playerid,PlayerInfo[playerid][Gun1],PlayerInfo[playerid][Ammo1]);
                    GivePlayerWeapon(playerid,PlayerInfo[playerid][Gun2],PlayerInfo[playerid][Ammo2]);
                    
				}
			 	if(Used6[playerid] == 1)
				{
                    Used6[playerid] == 0;
                    GivePlayerWeapon(playerid,PlayerInfo[playerid][Gun3],PlayerInfo[playerid][Ammo3]);
                    
				}
			}
			else if(PlayerInfo[playerid][JobLevel] == 3 || 4])
			{

                if(Used6[playerid] == 0)
				{
                    Used6[playerid] == 1;
                    GivePlayerWeapon(playerid,PlayerInfo[playerid][Gun1],PlayerInfo[playerid][Ammo1]);
                    GivePlayerWeapon(playerid,PlayerInfo[playerid][Gun2],PlayerInfo[playerid][Ammo2]);

				}
			 	if(Used6[playerid] == 1)
				{
                    Used6[playerid] == 0;
                    GivePlayerWeapon(playerid,PlayerInfo[playerid][Gun4],PlayerInfo[playerid][Ammo4]);

				}
			}
			else if(PlayerInfo[PlayerId][JobLevel] == 5)
			{
			    if(Used6[playerid] == 0)
				{
                    Used6[playerid] == 1;
                    GivePlayerWeapon(playerid,PlayerInfo[playerid][Gun1],PlayerInfo[playerid][Ammo1]);
                    GivePlayerWeapon(playerid,PlayerInfo[playerid][Gun2],PlayerInfo[playerid][Ammo2]);

				}
			 	if(Used6[playerid] == 1)
				{
                    Used6[playerid] == 0;
                    GivePlayerWeapon(playerid,PlayerInfo[playerid][Gun4],PlayerInfo[playerid][Ammo4]);
                    GivePlayerWeapon(playerid,PlayerInfo[playerid][Gun5],PlayerInfo[playerid][Ammo5]);

				}


			}
			else if(PlayerInfo[playerid][JobLevel] == 6 || 7)
			{
				if(Used6[playerid] == 0)
				{
                    Used6[playerid] == 1;
                    GivePlayerWeapon(playerid,PlayerInfo[playerid][Gun1],PlayerInfo[playerid][Ammo1]);
                    GivePlayerWeapon(playerid,PlayerInfo[playerid][Gun2],PlayerInfo[playerid][Ammo2]);

				}
			 	if(Used6[playerid] == 1)
				{
                    Used6[playerid] == 0;
                    GivePlayerWeapon(playerid,PlayerInfo[playerid][Gun3],PlayerInfo[playerid][Ammo3]);
                    GivePlayerWeapon(playerid,PlayerInfo[playerid][Gun4],PlayerInfo[playerid][Ammo4]);
                    GivePlayerWeapon(playerid,PlayerInfo[playerid][Gun5],PlayerInfo[playerid][Ammo5]);

				}

			}
		}
	}
	return 1;
}
Reply
#8

Save the ammo he has when pressing n then reset his weapons, and then give the loaded new weapons.
Reply
#9

Quote:
Originally Posted by Flori
Посмотреть сообщение
Save the ammo he has when pressing n then reset his weapons, and then give the loaded new weapons.
F*** i am really cant find the way to do this : i have pickup in police office witch gives u guns :

Код:
	if(pickupid == PolicijosAmmo)
		{
		    if(PlayerInfo[playerid][GinkluLicenzija] == 1)
		    {
			    if(PlayerInfo[playerid][JobID] == 1)
			    {
			        if(PlayerInfo[playerid][JobLevel] == 0)
			        {
	                    GivePlayerWeapon(playerid,23,1);// taizeris (reik padaryt)
	                    GivePlayerWeapon(playerid,3,1);// bananas
					}
					else if(PlayerInfo[playerid][JobLevel] == 1 || PlayerInfo[playerid][JobLevel] == 2)
					{
					    GivePlayerWeapon(playerid,PlayerInfo[playerid][Gun3] = 22,PlayerInfo[playerid][Ammo3] = 250); // 9mm pistol
	                    GivePlayerWeapon(playerid,PlayerInfo[playerid][Gun2] = 23,PlayerInfo[playerid][Ammo2] = 200);// taizeris (reik padaryt)
	                    GivePlayerWeapon(playerid,PlayerInfo[playerid][Gun1] = 3,PlayerInfo[playerid][Ammo1] = 1);// bananas
					}
					else if(PlayerInfo[playerid][JobLevel] == 3 || PlayerInfo[playerid][JobLevel] == 4)
					{
					    GivePlayerWeapon(playerid,24,200); //Desert deagle
	                    GivePlayerWeapon(playerid,23,1);// taizeris (reik padaryt)
	                    GivePlayerWeapon(playerid,3,1);// bananas
					}
					else if(PlayerInfo[playerid][JobLevel] == 5)
					{
					    GivePlayerWeapon(playerid,29,450); //mp5
	                    GivePlayerWeapon(playerid,24,200); //Desert deagle
	                    GivePlayerWeapon(playerid,23,1);// taizeris (reik padaryt)
	                    GivePlayerWeapon(playerid,3,1);// bananas
					}
					else if(PlayerInfo[playerid][JobLevel] == 6 || PlayerInfo[playerid][JobLevel] == 7)
					{
	                    GivePlayerWeapon(playerid,25,200);//shotgun
	                    GivePlayerWeapon(playerid,29,450); //mp5
	                    GivePlayerWeapon(playerid,24,200); //Desert deagle
	                    GivePlayerWeapon(playerid,23,1);// taizeris (reik padaryt)
	                    GivePlayerWeapon(playerid,3,1);// bananas
					}
			    }
			    else
			    {
	                GameTextForPlayer(playerid,"~r~Giklai tik policijai",3000,3);
				}
			}
			else
			{
		    GameTextForPlayer(playerid,"~r~Neturi ginklo licenzijos",3000,3);
			}
		}
not sure i should update my db those web ids and then load again some ware , cuz now all the way i do i get bugged and cant hold 2 pistols at ones , and after i put them into my database i sould load them again and then by presing num6 save and load those values again ? confused
Reply
#10

Quote:
Originally Posted by Flori
Посмотреть сообщение
Save the ammo he has when pressing n then reset his weapons, and then give the loaded new weapons.
okay how to save ammo and reset weapons ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)