PDA

View Full Version : Help me, weapons and ammunition


huansohn
14/02/2017, 01:48 AM
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

gamersx
14/02/2017, 01:56 AM
The code..

huansohn
14/02/2017, 01:58 AM
I do not know English, you can suggest me to look in the wiki you say that I do not know what you say

Ryan50
14/02/2017, 02:00 AM
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;
}

Luis-
14/02/2017, 02:03 AM
http://wiki.sa-mp.com/wiki/GivePlayerWeapon
http://wiki.sa-mp.com/wroot/index.php?title=SetPlayerAmmo
http://wiki.sa-mp.com/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.

huansohn
14/02/2017, 02:15 AM
http://wiki.sa-mp.com/wiki/GivePlayerWeapon
http://wiki.sa-mp.com/wroot/index.php?title=SetPlayerAmmo
http://wiki.sa-mp.com/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

Luis-
14/02/2017, 02:26 AM
Not much I can do without seeing any code you have, that's if you have any.