SA-MP Forums Archive
Weapons Detect - 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)
+--- Thread: Weapons Detect (/showthread.php?tid=443715)



Weapons Detect - Stereotype - 13.06.2013

How i detect if player is holding weapons in hand?


Re: Weapons Detect - IstuntmanI - 13.06.2013

GetPlayerWeapon
GetPlayerWeaponData


Re: Weapons Detect - Stereotype - 13.06.2013

Yes , and how i can just to put some weapon in player hand if you get me xD
Ex: IfPlayerToPoint(playerid, bla bla bla) how i can set that player cannot hold weapon , not to reset , just to player cannot hold weapon ?: )


Re: Weapons Detect - Guest123 - 13.06.2013

here example

pawn Code:
public OnPlayerUpdate(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, Float:Size,Float:X,Float:Y,Float:Z))
    {
     if(GetPlayerWeapon(playerid))
     {
       ResetPlayerWeapons(playerid);
       GameTextForPlayer(playerid, "You Cannot Have A Weapon On This Cordinates !", 3000, 1);
       return 1;
      }
    }
  return 1;
}



Re: Weapons Detect - Stereotype - 13.06.2013

Yes , but ResetPlayerWeapons will remove player weapons ? .. I don't wanna remove it , just if player scrools on weapon , server will auto move to first (n/a) id 0 ..


Re: Weapons Detect - IstuntmanI - 13.06.2013

SetPlayerArmedWeapon, use it on OnPlayerUpdate and check if he is in that area, and if he is, just SetPlayerArmedWeapon to 0.


Re: Weapons Detect - Stereotype - 13.06.2013

Yes , i just was too retarded to find a function -.- .. Thank's guys .. REP +