Sshokk97
Ученик
[22:14:56] [debug] #0 0000f050 in ?? (65535) from Skyline.amx
[22:14:56] [debug] #1 001c1714 in public OnPlayerWeaponShot (8, 31, 0, 65535, 1159490818, -996215369, 1107818230) from Skyline.amx
Выводится ошибка в консоль. Грешит на OnPlayerWeaponShot
Что тут не так? Подскажите
[22:14:56] [debug] #1 001c1714 in public OnPlayerWeaponShot (8, 31, 0, 65535, 1159490818, -996215369, 1107818230) from Skyline.amx
Выводится ошибка в консоль. Грешит на OnPlayerWeaponShot
Что тут не так? Подскажите
Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
//Desync weapon IDs that don't fire bullets
if (weaponid < 22 || weaponid > 38) return 0;
//Desync shots with Z pos out of bounds
if(!(-20000.0 <= z <= 20000.0)) return 0;
if(hittype == BULLET_HIT_TYPE_NONE)
{
if(hitid != 65535) return 1;
}
else if(hittype == BULLET_HIT_TYPE_PLAYER)
{
if(BadFloat(fX) || BadFloat(fY) || BadFloat(fZ)) return 0;
if(hitid == INVALID_PLAYER_ID) return 0;
else if(IsAnDMZone(playerid))
{
if(GetPVarInt(playerid, "antidm") <= 2)
{
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Зелёная зона", "В зелёной зоне нельзя драться!\nЕсли вы продолжите будете кикнуты", "Закрыть", "");
SetPVarInt(playerid,"antidm", GetPVarInt(playerid,"antidm") + 1);
return 0;
}
if(GetPVarInt(playerid, "antidm") == 3)
{
ResetPlayerWeapons(playerid);
SetPVarInt(playerid, "antidm", 0);
SKick(playerid,6745);
return 0;
}
}
}
if(!IsPlayerNPC(playerid)&&GetPVarInt(playerid,"FP_Protection")==1)
{
FP_Ammo_Reloading[playerid][0] = GetPlayerAmmo(playerid);
if(FP_Ammo_Reloading[playerid][0] == FP_Ammo_Reloading[playerid][1])
{
switch(GetPlayerWeapon(playerid))
{
case 0,1,2,3,4,5,6,7,8,10,11,12,13,14,15,40,44,45,46:
{
FP_Ammo_Reloading[playerid][1] = FP_Ammo_Reloading[playerid][0];
FP_Player_Warns_Ammo_Reloading[playerid] = 0;
return 1;
}
}
FP_Player_Warns_Ammo_Reloading[playerid]++;
if(FP_Player_Warns_Ammo_Reloading[playerid] > 5)
{
new string[128];
format(string, 128, "[A] %s[%d] кикнут за использование бесконечных патронов", GetName(playerid), playerid);
SendAdminMessage(0xff4f00ff, string);
Log("CheatLog",string);
SendClientMessage(playerid,COLOR_RED,"Вы были кикнуты за использование бесконечных патронов!");
Kick(playerid);
}
}
else
{
FP_Ammo_Reloading[playerid][1] = FP_Ammo_Reloading[playerid][0];
FP_Player_Warns_Ammo_Reloading[playerid] = 0;
}
}
if(weaponid != 38)
{
if((gettime() - shotTime[playerid]) < 1) shot[playerid] += 1;
else shot[playerid] = 0;
if(shot[playerid] > 10) Kick(playerid);
shotTime[playerid] = gettime();
}
if(IsPlayerAFK(hitid)) return 0;
new block = 0, Float:Pos[6]; // блокируем фейк урон
GetPlayerLastShotVectors(playerid, Pos[0], Pos[1], Pos[2], Pos[3], Pos[4], Pos[5]);
if(hittype != 0 && Pos[0] != 0.0 && Pos[1] != 0.0 && Pos[2] != 0.0 && GetPVarInt(playerid, "LastTimeShot_Advanced") == GetTickCount() && floatcmp(Pos[0], GetPVarFloat(playerid, "LastShotPosX")) == 0 && floatcmp(Pos[1], GetPVarFloat(playerid, "LastShotPosY")) == 0 && floatcmp(Pos[2], GetPVarFloat(playerid, "LastShotPosZ")) == 0) block = 1;
SetPVarInt(playerid, "LastTimeShot_Advanced", GetTickCount());
SetPVarFloat(playerid, "LastShotPosX", Pos[0]);
SetPVarFloat(playerid, "LastShotPosY", Pos[1]);
SetPVarFloat(playerid, "LastShotPosZ", Pos[2]);
if(block == 1) return 0;
return 1;
}
Последнее редактирование:
