SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 22/04/2020, 04:42 PM   #1
Pitstop
Big Clucker
 
Join Date: Aug 2015
Posts: 94
Reputation: 3
Default Is it possible?

I want to limit the player's weapons on hand to Three

How can I check how much guns the player is holding and limit them to three?
Pitstop is offline   Reply With Quote
Old 22/04/2020, 05:02 PM   #2
Ghazal
Gangsta
 
Ghazal's Avatar
 
Join Date: Oct 2013
Location: Egypt
Posts: 517
Reputation: 167
Default Re: Is it possible?

https://forum.sa-mp.com/showthread.php?t=586429
Ghazal is offline   Reply With Quote
Old 22/04/2020, 05:02 PM   #3
YouShootIDodge
Big Clucker
 
Join Date: May 2019
Posts: 65
Reputation: 14
Default Re: Is it possible?

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

Whenever a player picks up a new weapon or tried to buy it, check if the player has three weapons already using that ^
YouShootIDodge is online now   Reply With Quote
Old 22/04/2020, 06:51 PM   #4
Pitstop
Big Clucker
 
Join Date: Aug 2015
Posts: 94
Reputation: 3
Default Re: Is it possible?

Quote:
Originally Posted by Ghazal View Post
Quote:
Originally Posted by YouShootIDodge View Post
https://wiki.sa-mp.com/wiki/GetPlayerWeaponData

Whenever a player picks up a new weapon or tried to buy it, check if the player has three weapons already using that ^
May I get a better example please? I just couldn't realize from that example...

Code:
stock GetPlayerMaxGuns(playerid)
{
	new weapons[13][2];
	for (new i = 0; i <= 12; i++)
	{
		GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]);
	}
	if(GetPlayerWeapon(weapons[i][0]) // Here I want to detect if he's holding three or more than it on him.
}
Pitstop 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



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


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