SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 13/06/2013, 01:11 PM   #1
Stereotype
Huge Clucker
 
Stereotype's Avatar
 
Join Date: Jun 2011
Location: Balkans
Posts: 262
Reputation: 7
Default Weapons Detect

How i detect if player is holding weapons in hand?
Stereotype is offline   Reply With Quote
Old 13/06/2013, 01:12 PM   #2
IstuntmanI
High-roller
 
IstuntmanI's Avatar
 
Join Date: Mar 2009
Location: Romania
Posts: 1,801
Reputation: 375
Default Re: Weapons Detect

GetPlayerWeapon
GetPlayerWeaponData
__________________


IstuntmanI is offline   Reply With Quote
Old 13/06/2013, 01:16 PM   #3
Stereotype
Huge Clucker
 
Stereotype's Avatar
 
Join Date: Jun 2011
Location: Balkans
Posts: 262
Reputation: 7
Default Re: Weapons Detect

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 ?: )
Stereotype is offline   Reply With Quote
Old 13/06/2013, 01:28 PM   #4
Guest123
Huge Clucker
 
Guest123's Avatar
 
Join Date: Mar 2013
Location: Malaysia
Posts: 313
Reputation: 3
Default Re: Weapons Detect

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;
}
__________________
..
Guest123 is offline   Reply With Quote
Old 13/06/2013, 01:32 PM   #5
Stereotype
Huge Clucker
 
Stereotype's Avatar
 
Join Date: Jun 2011
Location: Balkans
Posts: 262
Reputation: 7
Default Re: Weapons Detect

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 ..
Stereotype is offline   Reply With Quote
Old 13/06/2013, 01:33 PM   #6
IstuntmanI
High-roller
 
IstuntmanI's Avatar
 
Join Date: Mar 2009
Location: Romania
Posts: 1,801
Reputation: 375
Default Re: Weapons Detect

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


IstuntmanI is offline   Reply With Quote
Old 13/06/2013, 01:34 PM   #7
Stereotype
Huge Clucker
 
Stereotype's Avatar
 
Join Date: Jun 2011
Location: Balkans
Posts: 262
Reputation: 7
Default Re: Weapons Detect

Yes , i just was too retarded to find a function -.- .. Thank's guys .. REP +
Stereotype is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to detect my name [D]ry[D]esert Scripting Help 5 26/08/2012 03:07 AM
detect key Blunt P Scripting Help 3 12/04/2012 11:18 AM
How to detect f12!! ZeQualX Help Archive 17 13/08/2011 03:24 PM
ID detect Rafa Help Archive 0 20/07/2011 11:13 PM
How to detect Torran Help Archive 1 23/02/2010 08:00 PM


All times are GMT. The time now is 03:14 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.