SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 08/07/2015, 08:07 AM   #1
Adarsh007
Huge Clucker
 
Adarsh007's Avatar
 
Join Date: Sep 2014
Location: Home
Posts: 213
Reputation: 8
Default How to detect if player has any weapons ?

Hello !

Can anyone tell me, How can I detect if a player has any weapons ? (Not Melee weapons)

Thanks in advance
Adarsh007 is offline   Reply With Quote
Old 08/07/2015, 08:18 AM   #2
SoFahim
Gangsta
 
SoFahim's Avatar
 
Join Date: May 2015
Location: Bangladesh.
Posts: 879
Reputation: 86
Default Re: How to detect if player has any weapons ?

This? GetPlayerWeapon
__________________
Lead Developer & Mapping manager of SARP

You can contact me at Discord, my ID: Gold#8839 available for paid works
Quote:
SoFahim is offline   Reply With Quote
Old 08/07/2015, 08:20 AM   #3
Adarsh007
Huge Clucker
 
Adarsh007's Avatar
 
Join Date: Sep 2014
Location: Home
Posts: 213
Reputation: 8
Default Re: How to detect if player has any weapons ?

No :/

I want to Detect if a Player has Even a Single GUN. and
GetPlayerWeapon is used for Detecting a Single Weapon ID. or More But "ID" and I want "any" weapon.
Adarsh007 is offline   Reply With Quote
Old 08/07/2015, 08:26 AM   #4
youssefehab500
Huge Clucker
 
youssefehab500's Avatar
 
Join Date: Feb 2014
Location: pawn.exe
Posts: 218
Reputation: 14
Default Re: How to detect if player has any weapons ?

PHP Code:
if(GetPlayerWeapon(playerid) == 24 || GetPlayerWeapon == 26)/*Random ids*/ 
You can add what ids you want to detect.
__________________
Code:
My works
[FilterScript] Name-Tag [FS] [FilterScript] Auto Car Fix[FS] [FIlterScript] HideMe[FS]
Rep+ if you like my work
youssefehab500 is offline   Reply With Quote
Old 08/07/2015, 08:28 AM   #5
Adarsh007
Huge Clucker
 
Adarsh007's Avatar
 
Join Date: Sep 2014
Location: Home
Posts: 213
Reputation: 8
Default Re: How to detect if player has any weapons ?

I tried it but not worked :/
Adarsh007 is offline   Reply With Quote
Old 08/07/2015, 08:29 AM   #6
youssefehab500
Huge Clucker
 
youssefehab500's Avatar
 
Join Date: Feb 2014
Location: pawn.exe
Posts: 218
Reputation: 14
Default Re: How to detect if player has any weapons ?

Alright, then explain more. What weapons do you want to detect and why. And show us the part of the code you want it implemented in.
__________________
Code:
My works
[FilterScript] Name-Tag [FS] [FilterScript] Auto Car Fix[FS] [FIlterScript] HideMe[FS]
Rep+ if you like my work
youssefehab500 is offline   Reply With Quote
Old 08/07/2015, 08:41 AM   #7
M4D
Huge Clucker
 
M4D's Avatar
 
Join Date: Oct 2014
Posts: 280
Reputation: 44
Default Re: How to detect if player has any weapons ?

player can carry only 1 weapon in every slot
there are 13 slots !
so Get Player Weapon Data For Every slot and check weapon ID.
you can ignore melee weapons slot !

https://wiki.sa-mp.com/wiki/GetPlayerWeaponData

explain more about what exactly want
__________________
Work Hard In Silence. Let Your Success Make The Noise
M4D is offline   Reply With Quote
Old 08/07/2015, 08:49 AM   #8
Adarsh007
Huge Clucker
 
Adarsh007's Avatar
 
Join Date: Sep 2014
Location: Home
Posts: 213
Reputation: 8
Default Re: How to detect if player has any weapons ?

Fixed it my self....Just Defined the ID(s) and done the job
Thanks Everyone
Adarsh007 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 if a player is in range of another player? rangerxxll Scripting Help 7 10/03/2014 11:48 PM
Weapons Detect Stereotype Scripting Help 6 13/06/2013 01:34 PM
Show player weapons in player skin Brandlax Scripting Help 3 07/12/2012 10:22 AM
Detect if player faces a wall & player Biesmen Scripting Help 7 25/10/2011 12:55 PM
detect if a player is near willsuckformoney Help Archive 12 30/07/2010 12:43 PM


All times are GMT. The time now is 06:39 PM.


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