SA-MP Forums Archive
Sawn-off Ban - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Sawn-off Ban (/showthread.php?tid=105132)



Sawn-off Ban - Rhemsis - 27.10.2009

Lately, a few of our members are using the '2-shot' reload bug on the sawn off shotguns. They run around and DM, on our cops and robbers server and present a huge disadvantage to the other players.

I want to be able to ban the sawn off shotgun, but it is always available at Ammunation. Is there any way to remove it, or to replace the sawn-off with a different weapon when they purchase it from Ammunation?


Re: Sawn-off Ban - ev0lution - 27.10.2009

You could use this to reset their weapons and desync them if they have a sawn-off shotgun:
pawn Код:
public OnPlayerUpdate(playerid)
{
  if(GetPlayerWeapon(playerid) == 26) {
    ResetPlayerWeapons(playerid);
    return 0;
  }
  return 1;
}



Re: Sawn-off Ban - Burridge - 27.10.2009

Disable people from entering interiors,

Under "OnGameModeInit"

Код:
DisableInteriorEnterExits //I THINK
Then make your own way of buying weapons!

Then to ban people from using Sawn-offs use the following code:

pawn Код:
public OnPlayerUpdate(playerid)
{
    if(GetPlayerWeapon(playerid) == WEAPON_SAWEDOFF)
    {
        SendClientMessage(playerid, COLOR_HERE, "Don't hack Sawn-Offs here! ");
        Ban(playerid);
        return 0;
    }
    return 1;
}
Hope that helps.

Although, you could stop people from having duel sawn-offs.

Put the following code under OnPlayerSpawn:

pawn Код:
SetPlayerSkillLevel(playerid,WEAPONSKILL_SAWNOFF_SHOTGUN,200);
Either way SHOULD stop your problem.


Re: Sawn-off Ban - Rhemsis - 28.10.2009

Thanks a ton guys, the most I was looking for was a 'yes' or 'no', but you guys went as far as to post the code :P Thanks for saving me some time.


Re: Sawn-off Ban - MadeMan - 28.10.2009

You could aslo use https://sampwiki.blast.hk/wiki/SetPlayerArmedWeapon to change player's weapon.


Re: Sawn-off Ban - Sergei - 28.10.2009

pawn Код:
public OnPlayerUpdate(playerid)
{
   if(GetPlayerWeapon(playerid) = 26)
   {
     GivePlayerWeapon(playerid,26,-1);
     SendClientMessage(playerid,SOMECOLOR,"SERVER: Shawn-off shotguns aren't allowed");
   }
   return 1;
}
There is no way to edit default ammunation menu.