Описание: Будет срабатывать если только стрелять по игроку + исправление недоработок о ложных срабатываний если наносить урон коктейлем молотова, гранатами, базукой и огнемётом.
К переменным:
new FP_Ammo_Reloading[MAX_PLAYERS][2];
new FP_Player_Warns_Ammo_Reloading[MAX_PLAYERS];
В OnPlayerSpawn:
SetPVarInt(playerid, "FP_Protection", 1);
В OnPlayerTakeDamage:
if(!IsPlayerNPC(issuerid) && GetPVarInt(issuerid, "FP_Protection") == 1 && GetPVarInt(playerid, "ANTIGUN") <= gettime())
{
FP_Ammo_Reloading[issuerid][0] = GetPlayerAmmo(issuerid);
if(FP_Ammo_Reloading[issuerid][0] == FP_Ammo_Reloading[issuerid][1] && !IsPlayerInAnyVehicle(issuerid))
{
switch(GetPlayerWeapon(issuerid))
{
case 0,1,2,3,4,5,6,7,8,10,11,12,13,14,15,16,18,35,36,37,39,40,41,42,44,45,46:
{
FP_Ammo_Reloading[issuerid][1] = FP_Ammo_Reloading[issuerid][0];
FP_Player_Warns_Ammo_Reloading[issuerid] = 0;
SetPVarInt(playerid, "ANTIGUN", gettime() + 10);
return 0;
}
}
FP_Player_Warns_Ammo_Reloading[issuerid]++;
if(FP_Player_Warns_Ammo_Reloading[issuerid] > 5)
{
SendClientMessage(issuerid, 0xCEFF1DFF, "У тебя пули не кончаются, ты был кикнут");
Kick(issuerid);
}
}
else
{
FP_Ammo_Reloading[issuerid][1] = FP_Ammo_Reloading[issuerid][0];
FP_Player_Warns_Ammo_Reloading[issuerid] = 0;
}
}
К переменным:
new FP_Ammo_Reloading[MAX_PLAYERS][2];
new FP_Player_Warns_Ammo_Reloading[MAX_PLAYERS];
В OnPlayerSpawn:
SetPVarInt(playerid, "FP_Protection", 1);
В OnPlayerTakeDamage:
if(!IsPlayerNPC(issuerid) && GetPVarInt(issuerid, "FP_Protection") == 1 && GetPVarInt(playerid, "ANTIGUN") <= gettime())
{
FP_Ammo_Reloading[issuerid][0] = GetPlayerAmmo(issuerid);
if(FP_Ammo_Reloading[issuerid][0] == FP_Ammo_Reloading[issuerid][1] && !IsPlayerInAnyVehicle(issuerid))
{
switch(GetPlayerWeapon(issuerid))
{
case 0,1,2,3,4,5,6,7,8,10,11,12,13,14,15,16,18,35,36,37,39,40,41,42,44,45,46:
{
FP_Ammo_Reloading[issuerid][1] = FP_Ammo_Reloading[issuerid][0];
FP_Player_Warns_Ammo_Reloading[issuerid] = 0;
SetPVarInt(playerid, "ANTIGUN", gettime() + 10);
return 0;
}
}
FP_Player_Warns_Ammo_Reloading[issuerid]++;
if(FP_Player_Warns_Ammo_Reloading[issuerid] > 5)
{
SendClientMessage(issuerid, 0xCEFF1DFF, "У тебя пули не кончаются, ты был кикнут");
Kick(issuerid);
}
}
else
{
FP_Ammo_Reloading[issuerid][1] = FP_Ammo_Reloading[issuerid][0];
FP_Player_Warns_Ammo_Reloading[issuerid] = 0;
}
}