SetDisabledWeapons()
#42

Quote:
Originally Posted by TimmehBoy
Even easier

At the top of script
pawn Код:
new CurrentWeapon[MAX_PLAYERS];
pawn Код:
public OnPlayerUpdate(playerid)
{
  if(CurrentWeapon[playerid] != GetPlayerWeapon(playerid)) {
    OnPlayerWeaponChange(playerid, CurrentWeapon[playerid], GetPlayerWeapon(playerid));
    CurrentWeapon[playerid] = GetPlayerWeapon(playerid);
  }
}

stock OnPlayerWeaponChange(playerid, oldweapon, newweapon) {
  if(newweapon == WEAPONHERE) {
    //do whatever you want
  }
  return true;
}
I'm using such callbacks for my anti-cheat. Works perfectly (faster than timer).
And your system supports ONE weapon, so that's kind of stupid. My system blacklists a bunch of weapons and bans if a player has it.
Reply


Messages In This Thread
SetDisabledWeapons() - by Calgon - 05.09.2009, 17:35
Re: SetDisabledWeapons() - by [eLg]Timmy - 05.09.2009, 17:40
Re: SetDisabledWeapons() - by XtremeChio - 05.09.2009, 17:55
Re: SetDisabledWeapons() - by lavamike - 05.09.2009, 17:57
Re: SetDisabledWeapons() - by XtremeChio - 05.09.2009, 17:59
Re: SetDisabledWeapons() - by lavamike - 05.09.2009, 18:03
Re: SetDisabledWeapons() - by Balon - 05.09.2009, 18:05
Re: SetDisabledWeapons() - by lavamike - 05.09.2009, 18:07
Re: SetDisabledWeapons() - by d0 - 05.09.2009, 18:11
Re: SetDisabledWeapons() - by Westie - 05.09.2009, 18:15
Re: SetDisabledWeapons() - by MaTrIx4057 - 05.09.2009, 18:22
Re: SetDisabledWeapons() - by Correlli - 05.09.2009, 18:24
Re: SetDisabledWeapons() - by MaTrIx4057 - 05.09.2009, 18:26
Re: SetDisabledWeapons() - by Balon - 05.09.2009, 18:26
Re: SetDisabledWeapons() - by Correlli - 05.09.2009, 18:27
Re: SetDisabledWeapons() - by MaTrIx4057 - 05.09.2009, 18:29
Re: SetDisabledWeapons() - by Correlli - 05.09.2009, 18:42
Re: SetDisabledWeapons() - by [eLg]Timmy - 05.09.2009, 18:47
Re: SetDisabledWeapons() - by Correlli - 05.09.2009, 18:53
Re: SetDisabledWeapons() - by [eLg]Timmy - 05.09.2009, 19:10
Re: SetDisabledWeapons() - by BeckzyBoi - 06.09.2009, 00:12
Re: SetDisabledWeapons() - by Calgon - 06.09.2009, 05:05
Re: SetDisabledWeapons() - by Misiek - 06.09.2009, 09:48
Re: SetDisabledWeapons() - by Balon - 06.09.2009, 09:57
Re: SetDisabledWeapons() - by Jay_ - 06.09.2009, 11:32
Re: SetDisabledWeapons() - by Balon - 06.09.2009, 11:39
Re: SetDisabledWeapons() - by Sergei - 06.09.2009, 11:46
Re: SetDisabledWeapons() - by Calgon - 06.09.2009, 12:52
Re: SetDisabledWeapons() - by Przemcio - 06.09.2009, 15:08
Re: SetDisabledWeapons() - by BeckzyBoi - 06.09.2009, 15:21
Re: SetDisabledWeapons() - by Daem - 06.09.2009, 16:20
Re: SetDisabledWeapons() - by Calgon - 06.09.2009, 16:52
Re: SetDisabledWeapons() - by Calgon - 06.09.2009, 17:32
Re: SetDisabledWeapons() - by [eLg]Timmy - 06.09.2009, 17:34
Re: SetDisabledWeapons() - by ded - 06.09.2009, 17:46
Re: SetDisabledWeapons() - by Przemcio - 06.09.2009, 18:31
Re: SetDisabledWeapons() - by mini_tomo_2 - 06.09.2009, 18:35
Re: SetDisabledWeapons() - by Correlli - 06.09.2009, 18:37
Re: SetDisabledWeapons() - by ded - 06.09.2009, 18:45
Re: SetDisabledWeapons() - by Correlli - 06.09.2009, 18:50
Re: SetDisabledWeapons() - by [eLg]Timmy - 10.09.2009, 13:15
Re: SetDisabledWeapons() - by Calgon - 10.09.2009, 15:33
Re: SetDisabledWeapons() - by Sergei - 10.09.2009, 15:39
Re: SetDisabledWeapons() - by [eLg]Timmy - 10.09.2009, 16:00
Re: SetDisabledWeapons() - by lavamike - 11.09.2009, 00:47
Re: SetDisabledWeapons() - by Calgon - 11.09.2009, 20:03
Re: SetDisabledWeapons() - by [eLg]Timmy - 11.09.2009, 20:14
Re: SetDisabledWeapons() - by Calgon - 12.09.2009, 11:22
Re: SetDisabledWeapons() - by [eLg]Timmy - 12.09.2009, 11:25
Re: SetDisabledWeapons() - by Calgon - 12.09.2009, 11:28
Re: SetDisabledWeapons() - by Daem - 12.09.2009, 17:13
Re: SetDisabledWeapons() - by [eLg]Timmy - 12.09.2009, 17:20
Re: SetDisabledWeapons() - by Correlli - 12.09.2009, 21:32
Re: SetDisabledWeapons() - by Daem - 13.09.2009, 16:21
Re: SetDisabledWeapons() - by Sergei - 13.09.2009, 16:24
Re: SetDisabledWeapons() - by [eLg]Timmy - 13.09.2009, 16:25
Re: SetDisabledWeapons() - by Daem - 13.09.2009, 19:01
Re: SetDisabledWeapons() - by Correlli - 13.09.2009, 19:06
Re: SetDisabledWeapons() - by UsaBoy91 - 13.09.2009, 19:46

Forum Jump:


Users browsing this thread: 2 Guest(s)