Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Cool on May 06, 2016, 03:18 PM

Title: bank
Post by: Cool on May 06, 2016, 03:18 PM
how to block wepons in bank i trying this but not working
player.IsWeaponSyncBlocked = true;
Title: Re: bank
Post by: KAKAN on May 06, 2016, 03:28 PM
player.CanAttack = false;
or
player.CanShoot = false;

any 1 of 'em will work.
Title: Re: bank
Post by: MaTaDeToR on May 06, 2016, 03:35 PM
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;
Title: Re: bank
Post by: Cool on May 06, 2016, 03:43 PM
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;
   }
}
Title: Re: bank
Post by: KAKAN on May 06, 2016, 04:28 PM
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;
   }
Title: Re: bank
Post by: Cool on May 07, 2016, 02:16 PM
player cant shoot outside the bank why??
Title: Re: bank
Post by: Coolkid on May 07, 2016, 02:27 PM
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
Title: Re: bank reply
Post by: dEaN on May 07, 2016, 02:30 PM
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
Title: Re: bank reply
Post by: Coolkid on May 07, 2016, 02:34 PM
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
Title: Re: bank
Post by: dEaN on May 07, 2016, 02:38 PM
hmmm
Title: Re: bank
Post by: Thijn on May 07, 2016, 02:42 PM
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.
Title: Re: bank
Post by: dEaN on May 07, 2016, 02:47 PM
Quote from: Thijn on May 07, 2016, 02:42 PM
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.
what you mean?
Title: Re: bank
Post by: Coolkid on May 07, 2016, 02:48 PM
Quote from: dEaN on May 07, 2016, 02:47 PM
Quote from: Thijn on May 07, 2016, 02:42 PM
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.
what you mean?
He mean don't fucking spam here if you like a post like the post instead of saying hmm
Title: Re: bank
Post by: Cool on May 07, 2016, 03:07 PM
Quote from: Coolkid on May 07, 2016, 02:34 PM
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
i think coolkid you need rest in every topic you doing nosense talks shutup
Title: Re: bank
Post by: Mötley on May 07, 2016, 03:43 PM
[[Rantish and lazy, yet a better way]
Does virtual world exist in VC;MP if so this is how i would do the banks?
Title: Re: bank
Post by: Thijn on May 07, 2016, 05:21 PM
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.
Title: Re: bank
Post by: Mötley on May 07, 2016, 05:41 PM
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.
Title: Re: bank
Post by: KAKAN on May 07, 2016, 05:51 PM
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
Title: Re: bank
Post by: Mötley on May 07, 2016, 05:54 PM
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,.
Title: Re: bank
Post by: Coolkid on May 08, 2016, 03:08 PM
Quote from: Hercules on May 07, 2016, 03:07 PM
Quote from: Coolkid on May 07, 2016, 02:34 PM
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
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