• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Total gold acquired

Status
Not open for further replies.

SpasMaster

Hosted Project: SC
Level 23
Joined
Jan 29, 2010
Messages
1,969
Quick and simple, guys.

I wanna track the total gold acquired by a player. What's the math?

That's what I managed to come up with, but sadly it appears to track Current gold:

[trigger="Gold Acquired"]Gold Acquired
Events
Time - Every 2.00 seconds of game time
Conditions
Actions
Set Gold_Acquired = (Gold_Acquired + ((Player 1 (Red) Current gold) - Gold_Acquired))
Game - Display to (All players) the text: (String(Gold_Acquired))
[/trigger]
 
Level 13
Joined
Sep 13, 2010
Messages
550
Here use this:
JASS:
function GetTotalGoldForPlayer takes player p returns integer
    return GetPlayerState(p, PLAYER_STATE_GOLD_GATHERED)
endfunction

  • Example
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Custom script: set udg_TotalGold = GetTotalGoldForPlayer( GetTriggerPlayer() )
      • Game - Display to (All players) the text: (String(TotalGold))

Kobass, there is function in GUI for that as well :D Somewhat Player xy Total gold grathered

EDIT: yes delete your post noob :D
 
Status
Not open for further replies.
Top