SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 17/07/2017, 07:31 PM   #1
kronka
Little Clucker
 
Join Date: Apr 2016
Posts: 16
Reputation: 0
Default Problem with Float

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)

Code:
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, "Âû âûêèíóëè áàíêó áîáîâ!");
			  	}
            }
        }
    }
kronka is offline   Reply With Quote
Old 17/07/2017, 11:15 PM   #2
Arbico
Little Clucker
 
Arbico's Avatar
 
Join Date: Jul 2017
Posts: 37
Reputation: 1
Default Re: Problem with Float

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
__________________
Code:
public OnPlayerConnect(playerid) {
     SendClientMessage(playerid, COLOR_RED, "THIS IS MY SERVER!");
     Ban(playerid);
     return 1;
}
Arbico is offline   Reply With Quote
Old 18/07/2017, 09:47 AM   #3
kronka
Little Clucker
 
Join Date: Apr 2016
Posts: 16
Reputation: 0
Default Re: Problem with Float

thanks, but I have another option. And I hope it will work
kronka is offline   Reply With Quote
Old 18/07/2017, 10:53 AM   #4
Arbico
Little Clucker
 
Arbico's Avatar
 
Join Date: Jul 2017
Posts: 37
Reputation: 1
Default Re: Problem with Float

Quote:
Originally Posted by kronka View Post
thanks, but I have another option. And I hope it will work
I may type the code for you, not too sure
__________________
Code:
public OnPlayerConnect(playerid) {
     SendClientMessage(playerid, COLOR_RED, "THIS IS MY SERVER!");
     Ban(playerid);
     return 1;
}
Arbico is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Float:Angle2D(Float:PointA[], Float:PointB[]) warning but I don't get it why... Scrillex Scripting Help 6 26/03/2013 12:52 AM
Whats the easy way to get (Float:minx, Float:miny, Float:maxx, Float:maxy) for GangZoneCreate Issam Scripting Help 8 18/09/2011 06:16 PM
Move3DTextLabel(ID, string[], color, Float:NewX, Float:NewY, Float:NewZ) Eazy_Efolife Help Archive 5 28/06/2011 10:17 PM
OnPlayerClick(playerid, Float:x, Float:y, Float:z) [HELP] Medal Of Honor team Help Archive 7 28/03/2011 01:57 PM
GetArea(&Float:minx,&Float:miny,&Float:maxx,&Float:maxy) pagie1111 Help Archive 2 14/04/2010 10:39 AM


All times are GMT. The time now is 07:48 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.