Vadik_Chicano
Умник
Ребят, столкнулся с проблемой которую никогда не встречал, помогите если сможете! Когда я стреляю в игрока, у него не отнимаются хп, у игрока показывает якобы у меня не вылетают патроны из дигла, но я стреляю и слышно звук ему. Когда я начал копаться в данной проблеме, я понял что это связано с OnPlayerWeaponShot. Когда я убрал public OnPlayerWeaponShot, работало все отлично, а когда я убрал все содержимое public OnPlayerWeaponShot, так же само не работало. Даже когда я добавляю пустой public OnPlayerWeaponShot, хп игрока не снимаются при попадании. Объясните мне пожалуйста, почему когда я добавляю public OnPlayerWeaponShot, у игрока не снимаются хп при попадании по нему?
Вот код данного паблика:
Вот код данного паблика:
PHP:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if(GetPVarInt(playerid, "FirstFire") == 0) SetPVarInt(playerid, "FirstFire",GetTickCount());// Anti Rapid
else
{
switch(weaponid) { case 38: return true; }
SetPVarInt(playerid, "SecondFire",GetPVarInt(playerid, "FirstFire"));
SetPVarInt(playerid, "FirstFire",GetTickCount());
if(GetPVarInt(playerid, "FirstFire")-GetPVarInt(playerid, "SecondFire") < 70) Kick(playerid);
}
if(IsWeaponWithAmmo(weaponid))
{
new count = 0;
if(weaponid != GetPVarInt(playerid,"WepName")) SetPVarInt(playerid,"WepName",weaponid), SetPVarInt(playerid,"AmmoName",GetPlayerWeaponAmmo(playerid,weaponid)), count++;
if(GetPlayerWeaponAmmo(playerid,weaponid) > GetPVarInt(playerid,"AmmoName") || GetPlayerWeaponAmmo(playerid,weaponid) < GetPVarInt(playerid,"AmmoName"))
{
SetPVarInt(playerid,"AmmoName",GetPlayerWeaponAmmo(playerid,weaponid));
SetPVarInt(playerid,"NoReloading",0);
count++;
}
if(GetPlayerWeaponAmmo(playerid,weaponid) != 0 && GetPlayerWeaponAmmo(playerid,weaponid) == GetPVarInt(playerid,"AmmoName") && count == 0)
{
SetPVarInt(playerid,"NoReloading",GetPVarInt(playerid,"NoReloading") + 1);
if(GetPVarInt(playerid,"NoReloading") >= 3)
{
new str[250];
SetPVarInt(playerid,"NoReloading",0);
SetPVarInt(playerid,"WepName",0);
SetPVarInt(playerid,"AmmoName",0);
format(str,sizeof(str), "<<AntiCheat>> Èãðîê %s[%d] èñïîëüçîâàë ÷èò íà áåñêîíå÷íûå ïàòðîíû áåç ïåðåçàðÿäêè è áûë êèêíóò.",PlayerInfo[playerid][pNames],playerid);
ABroadCast(COLOR_RED,str,1);
KickEx(playerid);
return false;
}
}
}
return 0;
}
