12.01.2013, 23:10
Hi, i will make that when a player dies, if he got more than 10 grams in the inventory he will drop it on the ground,
Also if he got 30 grams on him, he will drop 20 grams when he die, can you please help me with the code?
I got this on OnPlayerDeath
Also if he got 30 grams on him, he will drop 20 grams when he die, can you please help me with the code?
I got this on OnPlayerDeath
Код:
if(PlayerInfo[playerid][pPot] > 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; GetPlayerPos(playerid, X, Y, Z); DropInfo[i][dType] = 3; DropInfo[i][dAmount][0] = amount; DropInfo[i][dx] = X; DropInfo[i][dy] = Y; DropInfo[i][dz] = Z; DropInfo[i][dWorld] = GetPlayerVirtualWorld(playerid); strcpy(DropInfo[i][dPlayerName],tmp,MAX_PLAYER_NAME); DropObject[i] = CreateObject(1578, X, Y, Z-1, 0, 0, 0, 200.0, GetPlayerVirtualWorld(playerid)); }