Help me, weapons and ammunition
#1


How to make the max ammo, for example M4 is 50-450 example, if taken further, it is, "You can not get more ammunition, weapons can not accommodate you," someone help me with



anyone give me suggestions or code
Reply
#2

The code..
Reply
#3

I do not know English, you can suggest me to look in the wiki you say that I do not know what you say
Reply
#4

Quote:
Originally Posted by huansohn
Посмотреть сообщение
I do not know English, you can suggest me to look in the wiki you say that I do not know what you say
Try


Код:
public OnPlayerSpawn(playerid)
{
        GivePlayerWeapon(playerid, 31, 450);
	return 1;
}
Reply
#5

https://sampwiki.blast.hk/wiki/GivePlayerWeapon
https://sampwiki.blast.hk/wroot/index.ph...=SetPlayerAmmo
https://sampwiki.blast.hk/wiki/GetPlayerAmmo

Код:
CMD:giveammo(playerid, params[])
{
	if(GetPlayerWeapon(playerid) == WEAPON_M4)
	{
		new ammo = GetPlayerAmmo(playerid)
		if(ammo <= 50 || ammo >= 450)
		{
			SetPlayerAmmo(playerid, 450);
		}
		else 
		{
			SendClientMessage(playerid, -1, "You can't have more then 50 ammo!");
		}
	}
	return true;
}
I'm not 100% sure what you wanted. Presuming something like that.

Haven't tested the code, no idea if it'll actually work.
Reply
#6

Quote:
Originally Posted by Luis-
Посмотреть сообщение
https://sampwiki.blast.hk/wiki/GivePlayerWeapon
https://sampwiki.blast.hk/wroot/index.ph...=SetPlayerAmmo
https://sampwiki.blast.hk/wiki/GetPlayerAmmo

Код:
CMD:giveammo(playerid, params[])
{
	if(GetPlayerWeapon(playerid) == WEAPON_M4)
	{
		new ammo = GetPlayerAmmo(playerid)
		if(ammo <= 50 || ammo >= 450)
		{
			SetPlayerAmmo(playerid, 450);
		}
		else 
		{
			SendClientMessage(playerid, -1, "You can't have more then 50 ammo!");
		}
	}
	return true;
}
I'm not 100% sure what you wanted. Presuming something like that.

Haven't tested the code, no idea if it'll actually work.
I mean, government organizations took bullets in the closet can only get 500 bullets is 450-50, while 500 did not get enough can get more
Reply
#7

Not much I can do without seeing any code you have, that's if you have any.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)