PDA

Просмотр полной версии : [Вопрос] Не пропадает объект брони



verteich
20.05.2019, 22:29
из за чего не пропадает объект брони, после того как игроку ему пробью (к примеру, диглом)?
stock J_SetPlayerArmour(playerid, Float:armour)
{
if (playerid == INVALID_PLAYER_ID) {
return 0;
}
if (armour > 0.0) {
if (!IsPlayerAttachedObjectSlotUsed(playerid, 8)) {
SetPlayerAttachedObject(playerid, 8, 19142, 1, 0.08, 0.04, 0.00, 0.0, 0.0, -7.4);
}
}
else {
if(IsPlayerAttachedObjectSlotUsed(playerid, 8)) {
RemovePlayerAttachedObject(playerid, 8);
}
}
AntiCheatOFF[playerid][ARMOUR_HACK] = 2;
PI[playerid][pArmour] = armour;
return SetPlayerArmour(playerid, armour);
}

DeimoS
21.05.2019, 12:35
Вероятно, потому что функция не вызывается? Или у тебя урон реализован на стороне сервера?
Если нет, то продублируй вот этот код:
if (armour > 0.0) {
if (!IsPlayerAttachedObjectSlotUsed(playerid, 8)) {
SetPlayerAttachedObject(playerid, 8, 19142, 1, 0.08, 0.04, 0.00, 0.0, 0.0, -7.4);
}
}
else {
if(IsPlayerAttachedObjectSlotUsed(playerid, 8)) {
RemovePlayerAttachedObject(playerid, 8);
}
}
в OnPlayerTakeDamage или в OnPlayerWeaponShot

verteich
21.05.2019, 17:56
Вероятно, потому что функция не вызывается? Или у тебя урон реализован на стороне сервера?
Если нет, то продублируй вот этот код:
if (armour > 0.0) {
if (!IsPlayerAttachedObjectSlotUsed(playerid, 8)) {
SetPlayerAttachedObject(playerid, 8, 19142, 1, 0.08, 0.04, 0.00, 0.0, 0.0, -7.4);
}
}
else {
if(IsPlayerAttachedObjectSlotUsed(playerid, 8)) {
RemovePlayerAttachedObject(playerid, 8);
}
}
в OnPlayerTakeDamage или в OnPlayerWeaponShot

Не помогло, решил самостоятельно.

DeimoS
22.05.2019, 11:55
Ну так поделись решением с другими

verteich
22.05.2019, 17:34
Ну так поделись решением с другими

Решил не мучаться, засунул в секудный таймер