switch weapons
#1

Hi I like to script if a player is in a certain zone , he can not use his weapons, it switch to the fist so I mean his weapons shouldn't be deleted.
Reply
#2

Код:
if(IsPlayerInRangeOfPoint(playerid,50.0,X,Y,Z);
{
   SetPlayerArmedWeapon(playerid,0);
}
change "50.0" to how big you think the area is.

and X,Y,Z to the coords.

And then put this code like in a timer, or if they teleport you cut put it OnPlayerSpawn.
Reply
#3

idea
find a function that is called often or is called when one switches between weapons (sorry it's been a while since i scritped sa-mp (about 2 years)) and make it so that he gets his weapon switched back to fist
OR you could make an array which would store his current weapons and remove them from his possession, leading to inability to switch old weapons, unless he obtains new with a cheat or in any other way. and when he leaves that area give the weapons from array back to him

best solution would be using both of these ideas.
Reply
#4

Quote:
Originally Posted by Naxix
Код:
if(IsPlayerInRangeOfPoint(playerid,50.0,X,Y,Z);
{
   SetPlayerArmedWeapon(playerid,0);
}
change "50.0" to how big you think the area is.

and X,Y,Z to the coords.

And then put this code like in a timer, or if they teleport you cut put it OnPlayerSpawn.
yes thx, and:

Quote:
Originally Posted by Izanagi
idea
find a function that is called often or is called when one switches between weapons (sorry it's been a while since i scritped sa-mp (about 2 years)) and make it so that he gets his weapon switched back to fist
OR you could make an array which would store his current weapons and remove them from his possession, leading to inability to switch old weapons, unless he obtains new with a cheat or in any other way. and when he leaves that area give the weapons from array back to him

best solution would be using both of these ideas.
why so complicated ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)