26.05.2016, 17:55
(
Последний раз редактировалось Crystallize; 27.05.2016 в 10:21.
)
solved
new Float:zHealth[MAX_PLAYERS]; switch(weaponid) { case 30: if(DoubleTap[issuerid] == 1) zHealth[playerid] -= 2*amount; case 8: zHealth[playerid] -= 250; case 33: zHealth[playerid] -= amount + 10; case 24: zHealth[playerid] -= 80; case 34: zHealth[playerid] -= amount + 25; case 25: zHealth[playerid] -= amount + 6; case 27: zHealth[playerid] -= amount + 55; case 31: zHealth[playerid] -= amount + 79; case 29: zHealth[playerid] -= amount + 63; default: zHealth[playerid] -= amount; }
Well i think zHealth[playerid] should be Float because the amount is Float
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid,bodypart) also i don't know OnPlayerUpdate is too quick it will set your health or not better Update it under OnPlayerTakeDamage. Код:
new Float:zHealth[MAX_PLAYERS]; switch(weaponid) { case 30: if(DoubleTap[issuerid] == 1) zHealth[playerid] -= 2*amount; case 8: zHealth[playerid] -= 250; case 33: zHealth[playerid] -= amount + 10; case 24: zHealth[playerid] -= 80; case 34: zHealth[playerid] -= amount + 25; case 25: zHealth[playerid] -= amount + 6; case 27: zHealth[playerid] -= amount + 55; case 31: zHealth[playerid] -= amount + 79; case 29: zHealth[playerid] -= amount + 63; default: zHealth[playerid] -= amount; } |
case 31: zHealth[playerid] -= amount + 79;
I'm quite sure this will actually increase health... If I remember correctly (long time since I worked with weapon ids and damages) ID 31 is an M4 and that makes 10 damage per shot... uhm so what that does is actuall zHealth[playerid] = zHealth[playerid] - 10 + 79 = zHealth[playerid] + 69 Are you sure you want to use the + there? |