12.04.2015, 13:50
(
Последний раз редактировалось TheCoopster; 12.04.2015 в 14:03.
Причина: I solved the problem.
)
I've been having a problem with the OnPlayerWeaponShoot callback, and I was just wondering if what I've actually coded is going to work, it's basically an anti-ammo hack I thought could work.
I'm not 100% if this will actually work, it's not actually calling the function I don't think but either way I'd like to know how to fix it and if possible if this code will actually work once the callback is called.
Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ) { if(PlayerInfo[playerid][pLogged]) { new wepsl = GetWeaponSlot(weaponid); PlayerInfo[playerid][pAmmo][wepsl] -= 1; if(PlayerInfo[playerid][pAmmo] != GetPlayerAmmo(playerid)) { SendAdminMessage(COLOR_LIGHTRED,"AdmWarn: %s may possibly be ammo hacking (%s)(Current Ammo: %d)(Actual Ammo: %d)", PlayerName(playerid, false), GetWeaponNameEx(weaponid), PlayerInfo[playerid][pAmmo], GetPlayerAmmo(playerid)); Log("Files/Logs/weaponhacks.log","%s may possibly be ammo hacking (%s)(Current Ammo: %d)(Actual Ammo: %d)", PlayerName(playerid, false), GetWeaponNameEx(weaponid), PlayerInfo[playerid][pAmmo], GetPlayerAmmo(playerid)); } } return 1; }