Home   Help Search Login Register  

Author Topic: Disabling a player  (Read 3807 times)

0 Members and 2 Guests are viewing this topic.

RDX

  • Guest
Disabling a player
« on: 26 Dec 2004, 01:46:28 »
Hi
I am making a multiplayer mission and want to disable a player from moving and do any action(not turning or shooting) for about 10s after he has executed an action.  Has somebody a tip for how I can accomplish this?









Korax

  • Guest
Re:Disabling a player
« Reply #1 on: 26 Dec 2004, 03:42:30 »
disableuserinput true

then

disableuserinput false
« Last Edit: 26 Dec 2004, 03:43:16 by Korax »

RDX

  • Guest
Re:Disabling a player
« Reply #2 on: 26 Dec 2004, 04:43:15 »
with that command you will freeze the player, however I want the player to still be able to turn around and shoot.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Disabling a player
« Reply #3 on: 26 Dec 2004, 04:55:38 »
try using a script:
exec this with the action:put this in your action script at the beginning
[_this select 0] exec "holdpos.sqs"
Code: [Select]
_unit = _this select 0
_pos = getpos _unit
_timer = 10
_clock = 0
#loop
?_clock >= _timer:exit
_unit setpos _pos
~.1
_clock = _clock + .1
goto "loop"

hope you know what i mean :P

RDX

  • Guest
Re:Disabling a player
« Reply #4 on: 26 Dec 2004, 14:12:42 »
Thanks for the help, I could get it to work is I used ~1 wait. When I used ~0.1 the player couldn't turn.  

However now I have a new problem, I thought I had it worked out yesterday, but I forgot to save the mission so I lost everything :-\. And now I can't get it to work.

I have a trigger that should activate an action to the player inside the trigger, I uses the following statement at the trigger.
On Activation:    action = Player AddAction ["Call AirStrike", "Strike.sqs"]
On Deactivation:    Player removeaction action

The problem is how to point to the player that activates the trigger. If I use "this" instead it doesn't work. And if I name the player Player it woks but I want it to work for everyone that enter the trigger. I can't tie the action to an object because "this" must point to the player in the script Strike.sqs    

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Disabling a player
« Reply #5 on: 26 Dec 2004, 22:33:36 »
Quote
I can't tie the action to an object because "this" must point to the player in the script Strike.sqs
not quite.
when you have an action, 3 things are passed to the script:
_this select 0 :what it is tied to
_this select 1 :who activated it
_this select 2 :action id

so in your script you define the unit by using:
_unit = _this select 1

RDX

  • Guest
Re:Disabling a player
« Reply #6 on: 26 Dec 2004, 23:29:50 »
It's quite embarrassing when I wrote the above post I didn't know that there was a "player" syntax so I solved the problem without knowing it myself. (it worked with my code above)

..as I solve a problem I discover another one, is there a way to make a static building unable to get destroyed? I want the two high towers at province to withstand everything you can throw at them.

I have tested an idea with triggers.  

Condition:        getdammage (nearestbuilding trigger)>0.1      
On Activation:    (nearestbuilding trigger) setdammage 0

But it doesn't work, I don't know if  "nearestbuilding" can take a trigger as an argument. Perhaps you could use the object(house) ID?

Can someone make buildings invincible?

Ps. Thanks Triggerhappy if I had known that I would have saved a lot of time.

RDX

  • Guest
Re:Disabling a player
« Reply #7 on: 27 Dec 2004, 00:14:30 »
I found a solution to the invincible House :D

I put the line "(object 20913) setdammage 0" in a time script.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Disabling a player
« Reply #8 on: 27 Dec 2004, 00:15:45 »
no prob
as for your question:
just use the object id
(object XXXX) setdammage 0
XXXX stands for the id
just use that command in a loop or something similar (conditional code)

oops too late  :P
« Last Edit: 27 Dec 2004, 00:16:15 by Triggerhappy »

RDX

  • Guest
Re:Disabling a player
« Reply #9 on: 28 Dec 2004, 22:04:27 »
Hi
In my mission I have the multiplayer S1-S14, is there a way to find out who is entering a trigger? The trigger should set 14 different variables according to who is entering the trigger.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Disabling a player
« Reply #10 on: 28 Dec 2004, 22:22:07 »
i think you would need a script to check because triggers can't have multiple activation lines.
or you could have 14 triggers, each checking for its respective player

if you use the script, it would be something like this:
Trigger: repeatedly
condition: whatever side present (should fit all players (thus, anybody would work fine)
activation:[thislist] exec "checkunit.sqs"

checkunit.sqs
_list = _this select 0
?s1 in _list:(varible change code here)
?s2 in _list:(varible change code here)
etc

RDX

  • Guest
Re:Disabling a player
« Reply #11 on: 29 Dec 2004, 15:12:26 »
Hi, now my mission has become ready to start testing it on a server. But it won't work on a server. I have saved it as usermisson and then copied all the script and files in to the map. And then packed it with make PBO v1.1. It works fine when I host it on local LAN, but when I upload it to the server, it just blink, when you choose the mission, and you are back at choosing missions.

I have heard that it could be a problem with the addons. But I have just added standard RES.
There are some not standard RES vehicle list but they were in the mission that I started to edit from. I have also heard that there should be a list of all addon in a file, but I can't find it.


Vehicle list:
UH60
OH58
AH64
Cobra
Kamov
Mi17
Mi24

A10LGB
A10
SU25
CESSNA

BMP2
BRADLEY
T55G
T72
M60
Vulcan
Zsu
T80
M1AbramsAuto

I have almost no idea what script/variables that should run on the server an on the client. But I was planning to test it to see what I should change.  But maybe it won't run if there are some errors with the local/not local varibles.

Mission:
http://www.geocities.com/rdxgames/RDX_1.2m_gunship.zip

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Disabling a player
« Reply #12 on: 29 Dec 2004, 16:45:20 »
unpbo your mission and look in the mission.sqm file
the addons used will be right at the top

RDX

  • Guest
Re:Disabling a player
« Reply #13 on: 29 Dec 2004, 17:49:58 »
thx, this is the addons in the mission file
Code: [Select]
   addOns[]=
   {
      "6G30",
      "ah64",
      "oh58",
      "bmp2",
      "bis_weaponpack",
      "bis_resistance",
      "vulcan",
      "bradley",
      "su25"
   };
   addOnsAuto[]=
   {
      "6G30",
      "bis_resistance"
   };

but as you can see in the previus post I am using more vehicle than is shown, should I add all of them?

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Disabling a player
« Reply #14 on: 29 Dec 2004, 18:07:39 »
anything from the original game doesn't need to be added, and you don't just add the names anyway, those are all names of pbo files in your (res) addons folder

i don't really know what the problem is that you're having, though. so i don't know how to help you. (something with your addons it seems?)
sorry