02.12.2012, 17:55
Hi i have this on OnPlayerDeath, and i want that when a player dies he will drop the crack if he got more than 10 grams in his inventory, but when i die the object drops, but when i try to pick it up it says there's just 0 grams.
Код:
if(PlayerInfo[playerid][pCrack] > 10) { PlayerInfo[playerid][pCrack] = 10; for(new i = 0; i < sizeof(DropInfo); i++) { if(DropInfo[i][dx] == 0.0 && DropInfo[i][dy] == 0.0 && DropInfo[i][dz] == 0.0) { new Float:X,Float:Y,Float:Z; new rpos[2]; GetPlayerPos(playerid, X, Y, Z); DropInfo[i][dType] = 2; DropInfo[i][dAmount][0] = PlayerInfo[playerid][pCrack] > 10; DropInfo[i][dx] = X; DropInfo[i][dy] = Y; DropInfo[i][dz] = Z; rpos[0] = random(4), rpos[1] = random(4); DropInfo[i][dWorld] = GetPlayerVirtualWorld(playerid); DropObject[i] = CreateObject(1575, X + rpos[0], Y + rpos[1], Z, GetPlayerVirtualWorld(playerid)); } } }