Home   Help Search Login Register  

Author Topic: Hint messages to specific Player?  (Read 1145 times)

0 Members and 1 Guest are viewing this topic.

Offline myke13021

  • Contributing Member
  • **
  • Myke
Hint messages to specific Player?
« on: 03 Apr 2004, 19:19:25 »
Hay lads, i got a little problem...i'm making a map based on C&R and Civil RPG...so you play Cops or Civilian.
As a Cop you can arrest Civilians if they broke the law, they'll be setposed to jail and released after 2 minutes from jail.
For this i have 2 Scripts, one is attached to Cops, to arrest civilian. This arrest script starts another script which releases the Civilian after 2 minutes.

As far all works fine, i can arrest Civ's, they are setposed to Jail and released after 2 Minutes.

The problems are the hint messages.

As Cop you'll get a message saying "You arrested Dude..bla bla bla"...this works.
As Civ you should get Messages saying "You're arrested and released in X minutes"...this doesn't work. Well, for being precise...it works, but Cop gets these messages and not Civilian.

the release script looks like this:

_civ = _this select 0
_a = 0
_remain = "2 Minutes"
?!(local _civ): goto "end"
_bike = "kolo" createvehicle getpos release
#loop
~1
_msg = Format ["%1\nyou'll be released in %2", name _civ, _remain]
?!(alive _civ): exit
?(_a == 0): hint _msg
?(_a == 60): _remain = "1 Minute"
?(_a == 61): hint _msg
?(_a == 90): _remain = "30 Seconds"
?(_a == 91): hint _msg
?(_a == 105): _remain = "15 Seconds"
?(_a == 106): hint _msg
?(_a == 120): goto "release"
_a = _a + 1
goto "loop"

#release
_civ setpos getpos release
_msg = Format ["%1, you've been released from Jail and your Crime record is cleared", name _civ]
hint _msg

#end
exit

I've tried to play around with

?!(local _civ): goto "end"

by using

?!(local player): goto "end" (but there i guessed it wouldn't help)

So, how can i make it that the messages are shown to the correct player?

I know some of you knows the answer and i'm sure this person would share his knowledge with me  ;D

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Hint messages to specific Player?
« Reply #1 on: 04 Apr 2004, 19:14:16 »
As far as I see, it should work exactly like you have it.. IF you're executing it right. Check what's the 1st parameter you're passing to the script. ie. the value that _civ variable gets in the begining of the script.
Not all is lost.

Offline myke13021

  • Contributing Member
  • **
  • Myke
Re:Hint messages to specific Player?
« Reply #2 on: 04 Apr 2004, 20:21:23 »
thx artak....it didn't worked.

But i could solve it by using publicvariable and trigger

btw...the variable _civ is passed from the previous script like this:

[_civ] exec "release.sqs"

..and this previous script gets it by checking some conditions, like this:

_dist1 = cop1 distance civ1
?(_dist1 <=3): _civ = civ1; goto "status"

anyway...i think now it works... ;)
« Last Edit: 04 Apr 2004, 20:25:18 by myke13021 »