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=106829)
Weapons. -
Logitech334 - 05.11.2009
Hi, I would like to know how to block player slot arms(weapons slot) .. Eg. I have a command (/ak47), which gives the weapon. I now want that the player can not change it for sale only after /drop weapon.
Re: Weapons. -
Blaze09 - 06.11.2009
Would help if you showed the script.
Re: Weapons. -
Logitech334 - 06.11.2009
Why should I give the code when there are used only (GivePlayerWeapons and ResetPlayerWeapons)
Re: Weapons. -
retart441 - 07.11.2009
Just do the simple thing and create a new variable.
Код:
new GunCode[MAX_PLAYERS];
And on the /ak command
Код:
GunCode[playerid] = 1;
Then on what ever code you want to restrict when they do /ak
Код:
if(GunCode[playerid] == 1)
{
SendClientMessage(playerid, color, "You cant give this away!");
return 1;
}
else
{
// The regular code.
return 1;
}
On the drop command
Код:
{
ResetPlayerWeapons(playerid);
GunCode=0;
}
Re: Weapons. -
Blaze09 - 07.11.2009
Quote:
Originally Posted by retart441
Just do the simple thing and create a new variable.
Код:
new GunCode[MAX_PLAYERS];
And on the /ak command
Код:
GunCode[playerid] = 1;
Then on what ever code you want to restrict when they do /ak
Код:
if(GunCode[playerid] == 1)
{
SendClientMessage(playerid, color, "You cant give this away!");
return 1;
}
else
{
// The regular code.
return 1;
}
On the drop command
Код:
{
ResetPlayerWeapons(playerid);
GunCode=0;
}
|
Unnecessary resetting the player's weapons, what if they have more than one weapon?
You can just set the player's ammo for that weapon to 0.
Re: Weapons. -
retart441 - 07.11.2009
Quote:
Originally Posted by Blaze09
Unnecessary resetting the player's weapons, what if they have more than one weapon?
You can just set the player's ammo for that weapon to 0.
|
Oh I miss understood him I thought he ment drop weapons like them all.
On the Drop command
Код:
{
SetPlayerAmmo(playerid, 1, 0);
GunCode=0;
}
Re: Weapons. -
Logitech334 - 07.11.2009
Sory, wrong is. I do not mean exactly that. I would like to do this so that if a player has a weapon it can not switch it on "sale" just must have that weapon until you use the / drop
.
Re: Weapons. -
retart441 - 07.11.2009
Quote:
Originally Posted by Logitech334
Sory, wrong is. I do not mean exactly that. I would like to do this so that if a player has a weapon it can not switch it on "sale" just must have that weapon until you use the / drop
.
|
Like they can't sell weapons to a player until the drop the weapon they got with /ak?
Re: Weapons. -
Logitech334 - 07.11.2009
No. It's not about these commands .. Commands have to be as an example. The idea is that if a player has a weapon it does not want to be able to change it to another/hand until he had thrown.
Re: Weapons. -
retart441 - 07.11.2009
Like he can't switch weapons?