SA-MP Forums Archive
weapons - 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: weapons (/showthread.php?tid=66291)



weapons - Dragonheart - 20.02.2009

hi, i know you can lock cars and skins, but can you lock a weapon so that only i can use it?


Re: weapons - Backwardsman97 - 20.02.2009

You could check under OnPlayerUpdate to see if they have whatever gun and remove it.


Re: weapons - Dragonheart - 20.02.2009

but i dun them to be able to use it at all , hm. well do you have a script for that?


Re: weapons - lavamike - 21.02.2009

pawn Код:
public OnPlayerUpdate(playerid)
{
  if(GetPlayerWeapon(playerid) == 38)
  {
    new Ammo[12];
    new Wep[12];
    for(new i = 0; i < 12; i++)
    {
      GetPlayerWeaponData(playerid, i+1, Wep[i], Ammo[i]);
      if(Wep[i] == 38)
      {
        GivePlayerWeapon(playerid, 38, -Ammo[i]);
        break;
      }
    }
  }
}
Tested and it worked for me, just replace 38(Weapon ID) with the weapon ID you don't want and you can add a check to see if the person is you or not.


Re: weapons - Dragonheart - 21.02.2009

ty, im gonna test it asap. ill tell you if i get any problems