Sawn-off Ban
#1

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?
Reply
#2

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;
}
Reply
#3

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.
Reply
#4

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.
Reply
#5

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

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)