13.01.2013, 15:58
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:
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)); } }