item amount problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: item amount problem (
/showthread.php?tid=538034)
item amount problem -
Slicebook - 19.09.2014
Hello! there is a problem:
pl. that if there are five pieces of food but I can not stand five, allow only four and left me with a piece of food.
all of them will not let me pass.
Код:
CMD:transf(playerid, params[])
{
new mit[512], amount,szendvics,atadid;
szendvics = GetItemAmount(playerid,"Food");
if(sscanf(params, "us[512]d", atadid, mit, mennyit)) return SendClientMessage(playerid, -1, "(( Hasznбlat: /transf [ Name/ID ] [ Food ] [ Amount ] ))");
if(!IsPlayerConnected(atadid)) return SendClientMessage(playerid, COLOR_ORANGE, "(( Offline player! ))");
if(atadid == playerid) return SendClientMessage(playerid, COLOR_ORANGE, "(( Magadnak nem adhatsz бt! ))");
if(IsPlayerOwnItem(playerid,"Food"))
{
if(mennyit < 0) return SCM(playerid,-1,"(( Not much you can give to! ))");
if(mennyit < szendvics) <<<< Pass amount
{
RemoveItem(playerid,"Food",amount);
AddItem(atadid,"Food",amount);
Cselekves(playerid,"transfer to a food.");
}
else
{
SCM(playerid,COLOR_RED,"(( Do not have that! ))");
}
}else SendClientMessage(playerid,-1,"(( No your food! ))");
return 1;
}
**Bad English
Re : item amount problem -
streetpeace - 19.09.2014
I don't understand your request, give me an example.
Re: item amount problem -
Marricio - 19.09.2014
What you're trying to make is very complex, here, I recommend you
this library made by [HLF]Southclaw to make your life easier.