OnPlayerWeaponShoot problem. [Solved]
#1

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.

Код:
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;
}
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.
Reply
#2

Nevermind, I solved it. I never enabled Lagcomp. Thanks anyway!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)