Home   Help Search Login Register  

Author Topic: making a member of a multiplayer group groupchat  (Read 1883 times)

0 Members and 1 Guest are viewing this topic.

stuartf

  • Guest
making a member of a multiplayer group groupchat
« on: 27 Sep 2005, 21:38:47 »
help plz...

a group of 10 playable men are put in my multiplayer map at start.

i need one of them to groupchat as soon as the mission begins.

BUT i only want one of them to groupchat.

and i need a line of script that makes one of the group - groupchat - any one will do as long as their actually playing - if that makes sense.

basically, if the person chooses to play as man 3 i need man 3 to do the groupchat.

if 2 people play as man 2 and man 5 in the group, i need only one of them to groupchat the message.

hope this makes sense.

filth.

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:making a member of a multiplayer group groupchat
« Reply #1 on: 27 Sep 2005, 21:51:32 »

Quote
_man = man5
if(alive Man1)then{man1 = _man; goto "NEXT"}
if(alive Man2)then{man2 = _man; goto "NEXT"}
if(alive Man3)then{man3 = _man; goto "NEXT"}
if(alive Man4)then{man4 = _man; goto "NEXT"}
if(alive Man5)then{man5 = _man; goto "NEXT"}

#NEXT
_man groupchat "Hello, message is......"
;; continue with rest of code

The above code must be run on all clients

eg ?(local player):[]exec "myscript.sqs"

Reason:
Groupchat is a local command, meaning, it will not be transmitted across a network, therefore you have to run the script that runs the code executed on all clients.

If its for the start of the mission, the Init.sqs is as goods as any, or possibly the Intro script

What the script does:
1) Looks to see if the first name in the list, eg man1 is alive, if so it skips checking the rest and jumps to the "next" label and so on and so forth
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Kyle Sarnik

  • Guest
Re:making a member of a multiplayer group groupchat
« Reply #2 on: 27 Sep 2005, 23:51:09 »
Pfft, don't make it any more complicated than it needs to be:

init.sqs
Code: [Select]
(leader GroupName) groupchat "Text"

Offline filth

  • Members
  • *
  • Who's the bad man?
Re:making a member of a multiplayer group groupchat
« Reply #3 on: 28 Sep 2005, 14:41:10 »
kyle and terox,

thank you for your replies.

brilliant.

will try them out.

thanks again,

filth.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:making a member of a multiplayer group groupchat
« Reply #4 on: 28 Sep 2005, 22:48:15 »
terox flipped his variables in the first part of the code so that wouldn't quite work anyway.... ::)

Kyle Sarnik

  • Guest
Re:making a member of a multiplayer group groupchat
« Reply #5 on: 29 Sep 2005, 03:18:59 »
terox flipped his variables in the first part of the code so that wouldn't quite work anyway.... ::)

Yep, the equal signs only work one way  ;)

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:making a member of a multiplayer group groupchat
« Reply #6 on: 29 Sep 2005, 11:56:39 »
:-)
Thats what happens when u just write the code on the fly
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123