how to block wepons in bank i trying this but not working
player.IsWeaponSyncBlocked = true;
player.CanAttack = false;
or
player.CanShoot = false;
any 1 of 'em will work.
Quote from: Hercules on May 06, 2016, 03:18 PMhow to block wepons in bank i trying this but not working
player.IsWeaponSyncBlocked = true;
player.CanAttack = toggle;
i.e :
if ( YOUR_AREA_FUNCTION =="NAME" ) player.CanAttack = true;
if ( YOUR_AREA_FUNCTION !="NAME" ) player.CanAttack = false;
not working this player can still kill another take a look
function onPlayerMove( player, lastX, lastY, lastZ, newX, newY, newZ )
{
if (Area( player, "bank" ))
{
Announce( "~y~ \x10 \x10 \x10 \x10 \x10 weapons disabled", player, 5 );
player.CanAttack = false;
}
player.CanAttack = true;
}
function Area( player, AreaName )
{
local checkpoly;
if ( AreaName == "bank" )
{
checkpoly = InPoly( player.Pos.x, player.Pos.y, -898.2357,-326.6091,-898.2196,-355.5072,-936.2309,-355.5205,-939.2854,-352.5587,-952.3001,-342.9138,-957.1079,-341.7898,-966.5380,-337.4671,-966.5401,-328.1766 );
if ( checkpoly ) return false;
else return true;
}
}
lol, you return false instead of true and vice versa XDD
here's the fixed function:
function Area( player, AreaName )
{
local checkpoly;
if ( AreaName == "bank" )
{
checkpoly = InPoly( player.Pos.x, player.Pos.y, -898.2357,-326.6091,-898.2196,-355.5072,-936.2309,-355.5205,-939.2854,-352.5587,-952.3001,-342.9138,-957.1079,-341.7898,-966.5380,-337.4671,-966.5401,-328.1766 );
if ( checkpoly ) return true; //Return true if the player is in the bank
else return false;
}
player cant shoot outside the bank why??
Quote from: Hercules on May 07, 2016, 02:16 PMplayer cant shoot outside the bank why??
Use your brain when player enters the bank player can attack is done False by poly so you need to do take poly of outside ban entrance and do same player can attack true by that way player can attack when he comes out of bank
try this
function onPlayerMove( player, lastX, lastY, lastZ, newX, newY, newZ )
{
if ( IsPlayerInArea( player, "bank" ) )
{
player.IsWeaponSyncBlocked = false;
Announce( "weapons disabled", player, 5 );
}
else
player.IsWeaponSyncBlocked = ture;
}
update :D
Quote from: dEaN on May 07, 2016, 02:30 PMtry this
function onPlayerMove( player, lastX, lastY, lastZ, newX, newY, newZ )
{
if ( IsPlayerInArea( player, "bank" ) )
{
player.IsWeaponSyncBlocked = false;
Announce( "weapons disabled", player, 5 );
}
else
player.IsWeaponSyncBlocked = ture;
}
update :D
I think he can take poly outside the bank and use that instead of this else because that will be easy
hmmm
Quote from: dEaN on May 07, 2016, 02:38 PMhmmm
hmmm what? If you're just going to make a post stating your brain exploded you might as well don't post at all.
Quote from: Thijn on May 07, 2016, 02:42 PMQuote from: dEaN on May 07, 2016, 02:38 PMhmmm
hmmm what? If you're just going to make a post stating your brain exploded you might as well don't post at all.
what you mean?
Quote from: dEaN on May 07, 2016, 02:47 PMQuote from: Thijn on May 07, 2016, 02:42 PMQuote from: dEaN on May 07, 2016, 02:38 PMhmmm
hmmm what? If you're just going to make a post stating your brain exploded you might as well don't post at all.
what you mean?
He mean don't fucking spam here if you like a post like the post instead of saying hmm
Quote from: Coolkid on May 07, 2016, 02:34 PMQuote from: dEaN on May 07, 2016, 02:30 PMtry this
function onPlayerMove( player, lastX, lastY, lastZ, newX, newY, newZ )
{
if ( IsPlayerInArea( player, "bank" ) )
{
player.IsWeaponSyncBlocked = false;
Announce( "weapons disabled", player, 5 );
}
else
player.IsWeaponSyncBlocked = ture;
}
update :D
I think he can take poly outside the bank and use that instead of this else because that will be easy
i think coolkid you need rest in every topic you doing nosense talks shutup
[[Rantish and lazy, yet a better way]
Does virtual world exist in VC;MP if so this is how i would do the banks?
You could, but you can't see the other people then. You'd still have to move people to other worlds in your script, so might as well just disable weapon damage.
Yes set immunity and disable the players weapons while in the virtual world, But if immune there is no point, Let them waist ammo, less scripting.
Best is to put a door so that no one can enter the bank, and a checkpoint/sphere before and after it to enter and exit, and do shits in the callbacks :D
That's a lot of work for a bank.
Suggestion, Might as well look into if already using timers with player loops in your script, Then get that general area of a player as spheres are ugly and I feel are unprofessional as a scripter. If done correctly you will not lag the player or the server,.
Quote from: Hercules on May 07, 2016, 03:07 PMQuote from: Coolkid on May 07, 2016, 02:34 PMQuote from: dEaN on May 07, 2016, 02:30 PMtry this
function onPlayerMove( player, lastX, lastY, lastZ, newX, newY, newZ )
{
if ( IsPlayerInArea( player, "bank" ) )
{
player.IsWeaponSyncBlocked = false;
Announce( "weapons disabled", player, 5 );
}
else
player.IsWeaponSyncBlocked = ture;
}
update :D
I think he can take poly outside the bank and use that instead of this else because that will be easy
i think coolkid you need rest in every topic you doing nosense talks shutup
do you really think what i told to use was shit then fuck off my suggestion was doing poly outside bank so whenver player gets out of bank attack is automatically on next timebefore cursing me think twice