• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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 ));
    }
 
   
    }
  }
}
 
Level 12
Joined
Dec 2, 2016
Messages
733
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.
Top