Home   Help Search Login Register  

Author Topic: giving captives guns  (Read 1191 times)

0 Members and 1 Guest are viewing this topic.

greg_t

  • Guest
giving captives guns
« on: 03 Mar 2003, 15:12:06 »
ok, the mission i'm working on the player and a team mate (preferably human) entering a resistance controlled town as two soviet snipers. after eliminating the sentrys the players must rescue a captive.

now, i'm no expert with the "addaction" command so that complicates thing further. I want the player to set the mans "setcaptive" back to false, easy enough, but i also want the player to be able to pass him what ever gun be it a dragunov, glock or ak. And, just to complicate it further I would also like to have the player able to give him new weapons later. ie: the chucks him a glock, they walk outside start shooting and an ingram becomes available. the player should be able to grab the ingram, pass it to the captive and the captive pass the glock back. BUT, I don't want players passing empty guns and getting full ammo back or passing the captive the same gun he already has.

As I mentioned this is intended as a co-op so either player should be able to do any of this. Perhaps even passing guns to each other.

I think that covers it all. Any and all help is welcome. :-[

greg_t

  • Guest
Re:giving captives guns
« Reply #1 on: 05 Mar 2003, 13:49:56 »
this is all i've worked out. as i said i'm not a great scripter.

Code: [Select]
; ***************************************
; Operation Flashpoint Script
;
; An action that will take a gun from a player and give it to someone.
; ***************************************

?(alpha HasWeapon "glocks"): Goto "glocks"
?(alpha HasWeapon "Ingram"): Goto "Ingram"
?(alpha HasWeapon "Beretta"): Goto "Beretta"
?(alpha HasWeapon "CZ75"): Goto "cz75"
?(alpha HasWeapon "Glock"): Goto "glock"
?(alpha HasWeapon "Revolver"): Goto "revolver"
?(alpha HasWeapon "Skorpion"): Goto "skorpion"
?(alpha HasWeapon "Tokarev"): Goto "tokarev"


#glocks
alpha AddAction ["Pass G-17s","passglocks.sqs"]

Exit

this is the first script, you need to expand it with your mind...
the second ( and many more like it) lok like this.

Code: [Select]
alpha RemoveWeapon "glocks"
alpha RemoveMagazines "glocksmag"

colonel AddMagazine "glocksmag"
colonel AddMagazine "glocksmag"
colonel AddMagazine "glocksmag"
colonel AddMagazine "glocksmag"

colonel AddWeapon "Glocks"

colonel SetCaptive "false"

alpha RemoveAction "Pass G-17s"

Exit

alpha is the player, colonel iis the captured guy.
« Last Edit: 05 Mar 2003, 13:50:31 by greg_t »