item amount problem
#1

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
Reply
#2

I don't understand your request, give me an example.
Reply
#3

What you're trying to make is very complex, here, I recommend you this library made by [HLF]Southclaw to make your life easier.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)