Weapons.
#1

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.
Reply
#2

Would help if you showed the script.
Reply
#3

Why should I give the code when there are used only (GivePlayerWeapons and ResetPlayerWeapons)
Reply
#4

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;
}

Reply
#5

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.
Reply
#6

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; 
}
Reply
#7


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
.
Reply
#8

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?
Reply
#9

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.
Reply
#10

Like he can't switch weapons?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)