Problem with Float
#1

Hi, I have not a big problem, but I do not know how to solve.
Loot system with include j_inventory
How to run my system:
I pick up the loot, for example I don't need it and I throw it.
Select the second, third and so on...

The problem is that when I want to select only 1 loot, then getting thrown out.

I have a total new Float: x_loot, Float: y_loot, Float: z_loot.

I use it in check when picked up loot on the button and still use when get the coordinates of the person and under it create the object (removing from inventory). I hope you understand me

example: (when you dispose of the loot)

Код:
if(dialogid == 8000)
{
    if(response)
    {
        if(listitem == 0)
   	{
   	    new Float:health;
               
GetPlayerHealth(playerid,health),ClearAnimLoop(playerid),LoopingAnim(playerid,"FOOD","EAT_Burger", 4.1, 0, 1, 1, 1, 1);//êóøàòü
				if(health<80) SetPlayerHealth(playerid, health+20);
      			SendClientMessage(playerid, COLOR_WHITE, "Âû ñúåëè áîáû");
         	}
          	if(listitem == 1)
           	{
				if(!strcmp(itemname,"Áàíêà áîáîâ",true))
			  	{
					RemoveItem(playerid,itemname,1);
					GetPlayerPos(playerid, x_loot,y_loot,z_loot);
		   			LootObjects[0] = CreateObject(1666,x_loot,y_loot,z_loot-1,0,0,0);
					SendClientMessage(playerid, COLOR_WHITE, "Âû âûêèíóëè áàíêó áîáîâ!");
			  	}
            }
        }
    }
Reply
#2

I suggest you make the loot system using OnPlayerKeyStatChange to detect if the person pressed a button or not, If yes, Detect which weapon he is holding, And then create a pickup with the same weapon he held
Then just get rid of the weapon he was holding, It's a lot of code, but it turns out really good
Reply
#3

thanks, but I have another option. And I hope it will work
Reply
#4

Quote:
Originally Posted by kronka
Посмотреть сообщение
thanks, but I have another option. And I hope it will work
I may type the code for you, not too sure
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)