SA-MP Forums Archive
Please help me with this code - 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: Please help me with this code (/showthread.php?tid=407368)



Please help me with this code - Mikkel_RE - 13.01.2013

Hi, i'm making that if you got more than 15k on you when you die you will loose the money, also if you got 20k on you you will drop 5k onto the ground, and spawn with 15k, but it doesnt work correctly

I got this on OnPlayerDeath:

Код:
	new pdeathcash = GetMoney(playerid);
	for(new i = 0; i < sizeof(DropInfo); i++)
  	{
  	    if(DropInfo[i][dx] == 0.0 && DropInfo[i][dy] == 0.0 && DropInfo[i][dz] == 0.0 == pdeathcash > 15000)
  	    {
  	        new Float:X,Float:Y,Float:Z;
		    GetPlayerPos(playerid, X, Y, Z);
  	        DropInfo[i][dType] = 7;
  	        DropInfo[i][dAmount][0] = pdeathcash;
  	        DropInfo[i][dx] = X;
  	        DropInfo[i][dy] = Y;
  	        DropInfo[i][dz] = Z;
  	        DropInfo[i][dWorld] = GetPlayerVirtualWorld(playerid);
  	        GiveMoney(playerid,-(pdeathcash - 15000));
  	        DropObject[i] = CreateObject(1212, X, Y, Z-1, 0, 0, 0, 200.0, GetPlayerVirtualWorld(playerid));
		}
	}



Re: Please help me with this code - Mikkel_RE - 13.01.2013

Please help me


Re: Please help me with this code - Mikkel_RE - 13.01.2013

Can anyone help me please?


Re: Please help me with this code - Infinity90 - 13.01.2013

How does it not work correctly ?


Re: Please help me with this code - Mikkel_RE - 13.01.2013

Well, let's say you got 20k on hand, and you die somehow, then you will get in debt like -456469994, and it does only work once


Re: Please help me with this code - Mikkel_RE - 13.01.2013

So