Densi2882
Новичок
После того как надел бронежилет он начинает мерцать на теле. Как пофиксить?
код
код
CMD:armour(playerid)
{
if (!GetInvCount(playerid, Item_Armour))
return SCM(playerid, COLOR_GREY, !"У вас нет бронежилета");
new Float:armour;
GetPlayerArmour(playerid, armour);
if (armour)
{
SCM(playerid, COLOR_LIGHTBLUE, !"Вы сняли бронежилет!");
J_SetPlayerArmour(playerid, 0);
f(str_2, sizeof(str_2), "%s[%i] снял бронежилет.", cPN(playerid), playerid);
ProxDetector(25.0, playerid, str_2, COLOR_PURPLE);
}
else
{
if (GetPVarInt(playerid, !"armourtime") > gettime())
return SCM(playerid, COLOR_RED, !"[Ошибка] {FFFFFF}Можно использовать раз в минуту!");
InvAddEx(playerid, Item_Armour, -1);
SCM(playerid, COLOR_LIGHTBLUE, !"Вы надели бронежилет. Используйте /armour чтобы снять его или надеть ещё раз.");
J_SetPlayerArmour(playerid, 100);
f(str_2, sizeof(str_2), "%s[%i] одел бронежилет.", cPN(playerid), playerid);
ProxDetector(25.0, playerid, str_2, COLOR_PURPLE);
SetPVarInt(playerid, !"armourtime", gettime() + 60);
}
return 1;
}
{
if (!GetInvCount(playerid, Item_Armour))
return SCM(playerid, COLOR_GREY, !"У вас нет бронежилета");
new Float:armour;
GetPlayerArmour(playerid, armour);
if (armour)
{
SCM(playerid, COLOR_LIGHTBLUE, !"Вы сняли бронежилет!");
J_SetPlayerArmour(playerid, 0);
f(str_2, sizeof(str_2), "%s[%i] снял бронежилет.", cPN(playerid), playerid);
ProxDetector(25.0, playerid, str_2, COLOR_PURPLE);
}
else
{
if (GetPVarInt(playerid, !"armourtime") > gettime())
return SCM(playerid, COLOR_RED, !"[Ошибка] {FFFFFF}Можно использовать раз в минуту!");
InvAddEx(playerid, Item_Armour, -1);
SCM(playerid, COLOR_LIGHTBLUE, !"Вы надели бронежилет. Используйте /armour чтобы снять его или надеть ещё раз.");
J_SetPlayerArmour(playerid, 100);
f(str_2, sizeof(str_2), "%s[%i] одел бронежилет.", cPN(playerid), playerid);
ProxDetector(25.0, playerid, str_2, COLOR_PURPLE);
SetPVarInt(playerid, !"armourtime", gettime() + 60);
}
return 1;
}
stock J_SetPlayerArmour(playerid, Float:arm)
{
new Float:armour;
static str[10];
GetPlayerArmour(playerid, armour);
PI[playerid][pArmour] = arm;
UpdatePlayerDataFloat(playerid, "ARM", PI[playerid][pArmour]);
f(str, sizeof(str),"+%.0f ARM", (armour-arm));
SetPlayerChatBubble(playerid, str, COLOR_GREEN, 10.0, 5000);
if(InventStatus{playerid})
{
f(str, sizeof(str), "ARM: %.0f", arm),
PlayerTextDrawSetString(playerid, Invent[playerid][37], str);
}
return SetPlayerArmour(playerid, arm);
}
{
new Float:armour;
static str[10];
GetPlayerArmour(playerid, armour);
PI[playerid][pArmour] = arm;
UpdatePlayerDataFloat(playerid, "ARM", PI[playerid][pArmour]);
f(str, sizeof(str),"+%.0f ARM", (armour-arm));
SetPlayerChatBubble(playerid, str, COLOR_GREEN, 10.0, 5000);
if(InventStatus{playerid})
{
f(str, sizeof(str), "ARM: %.0f", arm),
PlayerTextDrawSetString(playerid, Invent[playerid][37], str);
}
return SetPlayerArmour(playerid, arm);
}
GetPlayerArmour(playerid, armour);
//7006;
if(armour > 0.0) if(!IsPlayerAttachedObjectSlotUsed(playerid, 9)) SetPlayerAttachedObject(playerid, 9, 19142, 1, 0.08, 0.04, 0.00, 0.0, 0.0, -7.4);
else if(IsPlayerAttachedObjectSlotUsed(playerid, 9)) RemovePlayerAttachedObject(playerid, 9);
//7006;
if(armour > 0.0) if(!IsPlayerAttachedObjectSlotUsed(playerid, 9)) SetPlayerAttachedObject(playerid, 9, 19142, 1, 0.08, 0.04, 0.00, 0.0, 0.0, -7.4);
else if(IsPlayerAttachedObjectSlotUsed(playerid, 9)) RemovePlayerAttachedObject(playerid, 9);
Последнее редактирование:
