Inventory Drop
#1

Почему игрок может подобрать только последний выбросивший предмет?

Код:
if(newkeys & KEY_WALK) 
    { 
        for(new i; i < sizeof(ObjectInv); i++)
        {       
            if(IsPlayerInRangeOfPoint(playerid, 2.0,ObjectInv[i][obiDropPos][0],ObjectInv[i][obiDropPos][1],ObjectInv[i][obiDropPos][2]))
            {        
            	GiveInv(playerid, ObjectInv[i][obiDrop][0], ObjectInv[i][obiDrop][1]);
                DestroyObject(ObjectInv[i][obiObject]);
                ObjectInv[i][obiDrop][0] = 0;
	            ObjectInv[i][obiDrop][1] = 0;
	            ObjectInv[i][obiDropPos][0] = 0.0;
	            ObjectInv[i][obiDropPos][1] = 0.0;
	            ObjectInv[i][obiDropPos][2] = 0.0;
		        return 1;
            }  
        }
}
Код:
stock InvDrop(playerid)
{
	new Float:InvX; new Float:InvY; new Float:InvZ;	   
    GetPlayerPos(playerid,InvX ,InvY, InvZ); 
 	for(new i; i < sizeof(ObjectInv); i++)
    {
        ObjectInv[i][obiDrop][0] = PlayerInfo[playerid][pInvSlot][GetPVarInt(playerid,"SelectSlot")];
	    ObjectInv[i][obiDrop][1] = PlayerInfo[playerid][pInvKol][GetPVarInt(playerid,"SelectSlot")];  
        ObjectInv[i][obiDropPos][0] = InvX;
	    ObjectInv[i][obiDropPos][1] = InvY;
	    ObjectInv[i][obiDropPos][2] = InvZ;       
        ObjectInv[i][obiObject] = CreateObject(Items_All[PlayerInfo[playerid][pInvSlot][GetPVarInt(playerid,"SelectSlot")]][InvObject], ObjectInv[i][obiDropPos][0], ObjectInv[i][obiDropPos][1], ObjectInv[i][obiDropPos][2]-1, 80.0, 0.0, 0.0);
        
        PlayerTextDrawBackgroundColor(playerid, InvSlot[playerid][GetPVarInt(playerid,"SelectSlot")], -2139062017);
    	PlayerTextDrawSetPreviewModel(playerid,InvSlot[playerid][GetPVarInt(playerid,"SelectSlot")], 1649);
		PlayerTextDrawSetPreviewRot(playerid, InvSlot[playerid][GetPVarInt(playerid,"SelectSlot")], 0.000000, 0.000000, 90.000000, 2.000000);  
    	PlayerTextDrawShow(playerid, InvSlot[playerid][GetPVarInt(playerid,"SelectSlot")]);
   	 	PlayerInfo[playerid][pInvSlot][GetPVarInt(playerid,"SelectSlot")] = -1;  
		PlayerInfo[playerid][pInvKol][GetPVarInt(playerid,"SelectSlot")] = -1;
    	SetPVarInt(playerid, "SelectSlot", -1); SetPVarInt(playerid, "NewSelectSlot", -1);
    }    
	return 1;
}
Reply


Messages In This Thread
Inventory Drop - by DeViLsS - 23.01.2015, 08:31
Re: Inventory Drop - by Stepashka - 23.01.2015, 08:53
Re: Inventory Drop - by DeViLsS - 23.01.2015, 08:58
Re: Inventory Drop - by x_O - 23.01.2015, 09:01
Re: Inventory Drop - by DeViLsS - 23.01.2015, 09:02
Re: Inventory Drop - by x_O - 23.01.2015, 09:04
Re: Inventory Drop - by DeViLsS - 23.01.2015, 09:05
Re: Inventory Drop - by Stepashka - 23.01.2015, 10:40
Re: Inventory Drop - by DeViLsS - 23.01.2015, 10:53
Re: Inventory Drop - by x_O - 24.01.2015, 02:20

Forum Jump:


Users browsing this thread: 1 Guest(s)