Home   Help Search Login Register  

Author Topic: kit changing script  (Read 1246 times)

0 Members and 2 Guests are viewing this topic.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
kit changing script
« on: 12 Jul 2005, 03:28:00 »
a while back i started out this script, so i decided to pull it back out.
i had it working for sp, but i knew it wouldn't work in mp, so i added some extra checks, and now it doesn't read the script ???

Code: [Select]
_A =_this select 0
_B =_this select 1
?!(local _A) && !(local _B):exit
hint "it didn't exit"
_Blackout = false
?_A == player || _B == player: _Blackout = true
_AWeapArray = weapons _A
_BWeapArray = weapons _B
_AMagArray = magazines _A
_BMagArray = magazines _B
hint "still going"
?_Blackout: titlecut ["","black out", .5]
~.5
hint "i'm not dead yet"
removeallweapons _A
removeallweapons _B
"_A addmagazine _x" foreach _AMagArray
"_B addmagazine _x" foreach _BMagArray
"_A addweapon _x" foreach _AWeapArray
"_B addweapon _x" foreach _BWeapArray
?_Blackout: titlecut ["","black in", .5]
hint "damn! what the hell?"
exit


i added in the hints to make sure it was reading all the way through, and i got each hint, but it doesn't switch out the weapons between the two units.

here are the lines i added:
?!(local _A) && !(local _B):exit
_Blackout = false
?_A == player || _B == player: _Blackout = true

and also the blackout checks later on for the blackout commands

I'm at a loss, any help?

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:kit changing script
« Reply #1 on: 12 Jul 2005, 13:35:02 »
what are you trying to do here.
The only reason i could think of having two variables assosciated with a local player would be for the following reason

are _This select 0 and _this select 1 issued via a killed event or hit event handler
is this some sort of suicide script or such like.

Please explain more

from the title of the post, i would expect this to be some sort of re equipping script, but all it does is refit the weapons with what the player already had


if not the above

local player runs on a computer that has a human player
there isd only 1 player on that computer, so _A and _B are the same thing

could you mean was _A a player on computer A and _B a player but on a different computer
« Last Edit: 12 Jul 2005, 13:56:33 by Terox »
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:kit changing script
« Reply #2 on: 12 Jul 2005, 16:21:00 »
ok, the script changes kits between 2 units, as in _A gets all _B's weapons and ammo, and _B gets _A's

since i have a blackout in the script, i had to use some sort of check to
a)make it only run on the computers it needs to (the server plus any players involed) and
b) not blackout on the server if AI are involed (and not the server's player)

so, if say, the player (not the server's) and an ai were going to switch kits, either _A or_B(it could be either) would be local to the player's comp that is switching and the ai local to the server.
since i have a blackout command, i couldn't have the server blackout just because the ai units are local to it, so if neither of the units are player, it means that the only units local to the server are ai, and therefore th blackout command must be nixed on the server, thus the "blackout = false"
but if its a player involved, it sets the blackout variable to true so it will blackout the players comp while he is switching weapons.

hope that clears it up

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:kit changing script
« Reply #3 on: 12 Jul 2005, 16:22:27 »
oh shit
damnit when i renamed the units and crap i put stuff in the wrong order


now i feel really stupid :P :-[ ::) :-\