Echtzeit Log

08/13/2014 22:39 Moneypulation#16
Neues Problem:

Ich versteh es einfach nicht.. Ich bekomm die ganze Zeit die "variable used without being declared" meldung" bei $AmountItems = $AmountItems + 1 obwohl ich am Anfang des Scripts geschrieben hab Global $AmountItems = 0

Der Bot soll nämlich zählen was er alles sammelt. Ich bekomm den Error bei der 2. Variable also:

Global $AmountItems = $AmountItems + 1
Global $AmountItems = ^ERROR

Einer von euch weiß sicher weiter

EDIT: Wenn ich es mit 1 statt 0 declare funktionierts. Ich werd dann bei den anderen Funktionen wo ich mit der Variable arbeite einfach $AmountItems -1 benutzen :p
08/14/2014 22:29 YatoDev#17
Quote:
Originally Posted by moneypulation View Post
Neues Problem:

Ich versteh es einfach nicht.. Ich bekomm die ganze Zeit die "variable used without being declared" meldung" bei $AmountItems = $AmountItems + 1 obwohl ich am Anfang des Scripts geschrieben hab Global $AmountItems = 0

Der Bot soll nämlich zählen was er alles sammelt. Ich bekomm den Error bei der 2. Variable also:

Global $AmountItems = $AmountItems + 1
Global $AmountItems = ^ERROR

Einer von euch weiß sicher weiter

EDIT: Wenn ich es mit 1 statt 0 declare funktionierts. Ich werd dann bei den anderen Funktionen wo ich mit der Variable arbeite einfach $AmountItems -1 benutzen :p
du musst ohne global schreiben. höchstens einmal am anfang des skripts.
und : $AmountItems += 1
geht auch mit &= ; *= .....