Home   Help Search Login Register  

Author Topic: Rating problem  (Read 923 times)

0 Members and 1 Guest are viewing this topic.

Offline Ding

  • Contributing Member
  • **
  • Jurassic Park
Rating problem
« on: 16 Jul 2005, 08:40:30 »
Hi i have a problem when i am trying to change the rating of the player, what i want to do is make it so that when the player is dead, his rating goes back to zero when he respawns, now i know how to do all of this except the rating command, ive tried addrating, but that seems only able to add or subtract a certain amount of rating from the player, which is not usefull, i tried the command just rating, but that is used to find the rating, is there a way of reseting the rating to normal?, some sort of global variable maybe? :D thanks
"If I remain lost and die on a cross, atleast I wasn't born in a manger"

Offline 456820

  • Contributing Member
  • **
Re:Rating problem
« Reply #1 on: 16 Jul 2005, 08:47:19 »
well i think this belongs in the multplayer section cause it sounds like you talking about MP stuff
but i think i can help
if 'rating' gets what the players rating is then do this

#loop
_playerrate = rating player

? !alive player : addarting - _playerrate
~5
goto "loop"

thats a quite simple one but syntax not guaranteed thats just of the top of my head it should get the players rating every 5 seconds then when the player is dead it takes away _playerrate (wich is the players rating) away from what he had i think
im not totally sure but that should help alll depends how your inc;uding this

Offline Ding

  • Contributing Member
  • **
  • Jurassic Park
Re:Rating problem
« Reply #2 on: 16 Jul 2005, 11:33:12 »
thanks for the help, i managed to work it out in the end though, what i did was this to stop the rating going below zero and to make it go back to 0:

_unit = _this select 0
_score = Rating _unit
hint format ["Players Gold is %1 Units", _score]
? _score = 0 : goto "score1"

#Score1
? _score <= 0
_score = 0
goto "score1"

and that seemed to work how iwanted it too, i will make this as solved now :D
« Last Edit: 16 Jul 2005, 11:34:44 by Ding »
"If I remain lost and die on a cross, atleast I wasn't born in a manger"

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Rating problem
« Reply #3 on: 16 Jul 2005, 11:50:39 »
unit addRating (-rating unit)

is all you need.  It sets the rating to zero.