Problem with Float - 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: Problem with Float (
/showthread.php?tid=637585)
Problem with Float -
kronka - 17.07.2017
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, "Âû âûêèíóëè áàíêó áîáîâ!");
}
}
}
}
Re: Problem with Float -
Arbico - 17.07.2017
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
Re: Problem with Float -
kronka - 18.07.2017
thanks, but I have another option. And I hope it will work
Re: Problem with Float -
Arbico - 18.07.2017
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