Many errors on one line?
#1

Hey folks, simple again:

pawn Код:
public DoorOpened()
{
   new DoorOpened[MAX_PLAYERS];
   DoorOpened(playerid) == 0;
   return 1;
}
Thats the function which is called when the timer named DoorOpened ends, it gives me such errors on the DoorOpened(playerid) == 0; line:

Код:
error 012: invalid function call, not a valid address
error 017: undefined symbol "playerid"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
Any help? Im so stupid.
Reply
#2

You should define your function as
pawn Код:
public DoorOpened(playerid)
Then wherever you want to have this change for someone, use
pawn Код:
DoorOpened(playerid)
Reply
#3

okay, now I get this:

pawn Код:
(4003) : error 025: function heading differs from prototype
(4005) : warning 219: local variable "DoorOpened" shadows a variable at a preceding level
(4006) : error 012: invalid function call, not a valid address
(4006) : warning 215: expression has no effect
(4006) : error 001: expected token: ";", but found ")"
(4006) : error 029: invalid expression, assumed zero
(4006) : fatal error 107: too many error messages on one line
Read it like the first line of my code is line 4003 and the last line is 4008 ( Including the braces ) Now what?
Reply
#4

forward DoorOpened(playerid);
Reply
#5

Quote:
Originally Posted by Spiral
Посмотреть сообщение
okay, now I get this:

pawn Код:
(4003) : error 025: function heading differs from prototype
(4005) : warning 219: local variable "DoorOpened" shadows a variable at a preceding level
(4006) : error 012: invalid function call, not a valid address
(4006) : warning 215: expression has no effect
(4006) : error 001: expected token: ";", but found ")"
(4006) : error 029: invalid expression, assumed zero
(4006) : fatal error 107: too many error messages on one line
Read it like the first line of my code is line 4003 and the last line is 4008 ( Including the braces ) Now what?
1. error: You already forwarded your function with a different header
Solution: Change the header of the forward and the public so they match

1. warning: You already created a variable called DoorOpened
Solution: Remove the one in the warning line

And in line 4006, change the brackets '('')' to this brackets '['']' and remove one equal sign
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)