Home   Help Search Login Register  

Author Topic: Hint command for only 1 player at a time (different for each player)  (Read 2263 times)

0 Members and 2 Guests are viewing this topic.

Mike

  • Guest
How can I use Hint to show something different to each player.. In other words how do I hint to only one player?? Plz help
« Last Edit: 07 Nov 2002, 03:57:27 by Mike »

Offline Black_Feather

  • Former Staff
  • ****
  • I'll never forget you Daisey.
I'm not sure, I don't know much about mp editing but something like this could work

? unitname1 == player : hint "say something"
? unitname2 == player : hint "say something else"

Mike

  • Guest
isnt that just adding a condition to the hint line which everyone see's ???

Offline Black_Feather

  • Former Staff
  • ****
  • I'll never forget you Daisey.
oh yeah I never thought of that, the local commmand will probably have somthing to do with it then.

Offline toadlife

  • OFPEC Old Skool
  • Former Staff
  • ****
  • Official OFP Editing Center Toad
    • toadlife.net
Actually, I think this would work:
? unitname1 == player : hint "say something"
? unitname2 == player : hint "say something else"

but if it doesn't you can try using a local check too:


?((local player1) && (player == player1)):hint "player1 hint"
?((local player2) && (player == player2)):hint "player2 hint"
?((local player3) && (player == player3)):hint "player3 hint"

But then Im not sure if that would make any difference either.
"Whenever you want information on the 'net, don't ask a question; just post a wrong answer." -- Cancer Omega.

Mike

  • Guest
well.... heres my script.... and it appears to work.. I have 2 players that basically purchase a $200 Jeep... Now I got another problem related with this script.. I dont know how to get it all to activate with an addaction command. :(

Code: [Select]
Rep1startingmoney = _this select 0
Rep2startingmoney = _this select 1

RepJ1 = FALSE
RepJ2 = FALSE

? Rep1 distance jeept < 6 : RepJ1 = TRUE
? Rep2 distance jeept < 6 : RepJ2 = TRUE

? RepJ1 : Goto "buyjeep1a"
? !RepJ1 : Goto "buyjeep1b"
? RepJ2 : Goto "buyjeep2a"
? !RepJ2 : Goto "buyjeep2b"

#end

RepJ1 = FALSE
RepJ2 = FALSE

exit

#buyjeep1a

? RepJ1 : Rep1startingmoney = Rep1startingmoney - 200

#buyjeep1b

_msg=Format["Money: $%1",Rep1startingmoney]
Hint _msg
Goto "end"

#buyjeep2a

? RepJ2 : Rep2startingmoney = Rep2startingmoney - 200

#buyjeep2b

_msg=Format["Money: $%2",Rep2startingmoney]
Hint _msg
Goto "end"

The hint part Seems to only hint to one player.. unless its hinting both players and Im seeing the right result each time.. .. I dunno :\

I want each player to be able to activate this script with the addaction but to know which player activated.. Ive tried:

BuyJeep = Player1 AddAction ["Buy Jeep $200", "[Rep1startingmoney,Rep2startingmoney] exec "jeep.sqs"]; BuyJeep = Player2 AddAction ["Buy Jeep $200", "[Rep1startingmoney,Rep2startingmoney] exec "jeep.sqs"];

but it wont let me do it like that.. theres a problem in the script exec line..
« Last Edit: 08 Nov 2002, 06:41:38 by Mike »

Offline Black_Feather

  • Former Staff
  • ****
  • I'll never forget you Daisey.
it looks like you have a unneeded "

try this line

BuyJeep = Player1 AddAction ["Buy Jeep $200", [Rep1startingmoney,Rep2startingmoney] exec "jeep.sqs"];
« Last Edit: 08 Nov 2002, 07:14:22 by Black_Feather »

Mike

  • Guest
I just took out the:

Rep1startingmoney = _this select 0
Rep2startingmoney = _this select 1

then activated with normal:

BuyJeep = Player1 AddAction ["Buy Jeep $200", exec "jeep.sqs"]

and it worked.. but thanks for noticing the flaw  :)
« Last Edit: 09 Nov 2002, 06:35:43 by Mike »

dreaming_adam

  • Guest
Not sure if you can pass variable to a script using the AddAction command, which is quite frankly a pain in the arse. BUT if you wanted to be able to detect WHO buys the jeep (player one or player2) praps creating two seperate scripts (one for each player) and simply calling the buyjeep script from within them. That might sound complex but here is an example
(BTW you do not need EXEC in the addaction)


BuyJeep = Player1 AddAction ["Buy Jeep $200", "jeepp1.sqs"];
BuyJeep = Player2 AddAction ["Buy Jeep $200", "jeepp2.sqs"];

jeepp1.sqs CONTENTS:
[Rep1startingmoney,Rep2startingmoney,1] exec "jeep.sqs"];
EXIT

jeepp2.sqs CONTENTS:
[Rep1startingmoney,Rep2startingmoney,2] exec "jeep.sqs"];
EXIT


NOTE: the 1 and 2 variables added to the list... This way the player number who called the script will be sent to the jeep.sqs script..

I have no idea if I just answered a question for you or made things more difficult - if so my appologies :)

Ciao ciao
Adam
« Last Edit: 09 Nov 2002, 15:26:01 by dreaming_adam »

Mike

  • Guest
any help is good. Thanks :cheers:

Mike

  • Guest
I wrote my script over.. and tested it with a few different meathods... and Im still only getting 1 player alone that is getting the messages... and im attempting to message all players, but individually.. I attached my script.. if anyone knows why it isnt working lemme know. The script works in conjunction with a few other scripts.. basically to actually create the jeep and to add the action to the player to be able to buy the jeep...
« Last Edit: 11 Nov 2002, 02:45:58 by Mike »