Please help me with this code
#1

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));
		}
	}
Reply
#2

Please help me
Reply
#3

Can anyone help me please?
Reply
#4

How does it not work correctly ?
Reply
#5

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
Reply
#6

So
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)