Zinc Syntax error

Status
Not open for further replies.
Level 12
Joined
Dec 2, 2016
Messages
733
First off sorry if this is in the wrong place? Seems like all the forum areas got changed, is this where script issues should go?

I'm getting this error
Screenshot - 9430e326bc3a3d62e632e010ddd66c93 - Gyazo
It's caused by this part of the code

JASS:
    if (GetPlayerState(GetTriggerPlayer(), PLAYER_STATE_RESOURCE_LUMBER < 10)) {
}
Any idea what the issue is? Full code below:
JASS:
private function resetLumberCommand() {
  integer i = 0;
 for (0 <= i < 12) {
    if (players[i].side == SIDE_HUMAN && ConvertedPlayer(i) == GetTriggerPlayer()) {
    if (GetPlayerState(GetTriggerPlayer(), PLAYER_STATE_RESOURCE_LUMBER < 10)) {
    SetPlayerStateBJ( GetTriggerPlayer(), PLAYER_STATE_RESOURCE_LUMBER, ( GetPlayerState(GetTriggerPlayer(), PLAYER_STATE_RESOURCE_LUMBER) + 10 ));
    }
 
   
    }
  }
}
 
I wonder why they moved it. Anyway, this is Triggers & Scripts
JASS:
if (GetPlayerState(GetTriggerPlayer(), PLAYER_STATE_RESOURCE_LUMBER)) < 10 {
}
This is how it should be, your brackets are in the wrong place.

ohhh, man I spent way to much time trying to figure out why this wasn't working last night haha. Thanks a lot.
 
Status
Not open for further replies.
Back
Top