Custom call back errors >_<
#1

Yeah, I took a piece of a script from the old SFTDM and Im getting errors with the SetPlayerClass callback..

So I defined it (new SetPlayerClass and a lot of errors went away, but im still left with four.

pawn Код:
new SetPlayerClass;

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerClass(playerid, classid);
Error:
Код:
C:\Users\Damien\Desktop\samp server\gamemodes\lvtdm.pwn(238) : error 012: invalid function call, not a valid address
C:\Users\Damien\Desktop\samp server\gamemodes\lvtdm.pwn(238) : warning 215: expression has no effect
C:\Users\Damien\Desktop\samp server\gamemodes\lvtdm.pwn(238) : warning 215: expression has no effect
C:\Users\Damien\Desktop\samp server\gamemodes\lvtdm.pwn(238) : error 001: expected token: ";", but found ")"
C:\Users\Damien\Desktop\samp server\gamemodes\lvtdm.pwn(238) : error 029: invalid expression, assumed zero
C:\Users\Damien\Desktop\samp server\gamemodes\lvtdm.pwn(238) : fatal error 107: too many error messages on one line
Line 238 being SetPlayerClass(playerid, classid);

I tried forwarding it also but the whole script got errors..
Reply
#2

new SetPlayerClass; = Variable

SetPlayerClass ( playerid , classid ) = function

Variable != function
Reply
#3

@Post1: No, no, no no! You have done a grave mistake (grave as in I will kill you.) But before I kill you, I suggest you look at the Wiki about the class system, seeing as that function obviously doesn't exist. (HINT, the server automatically sets classes.)

@Post2: Hmm... you *might* be right there, why anyone would want a function like that confuses me.
Reply
#4

I was refering to the fact that he declared SetPlayerClass as a variable then used it as a function.
Reply
#5

I took SetPlayerClass out of the whole script and got tons of stupid errors..

Код:
C:\Users\Damien\Desktop\samp server\gamemodes\lvtdm.pwn(273) : warning 217: loose indentation
C:\Users\Damien\Desktop\samp server\gamemodes\lvtdm.pwn(276) : error 002: only a single statement (or expression) can follow each "case"
C:\Users\Damien\Desktop\samp server\gamemodes\lvtdm.pwn(276) : error 004: function "OnPlayerConnect" is not implemented
C:\Users\Damien\Desktop\samp server\gamemodes\lvtdm.pwn(284) : warning 225: unreachable code
C:\Users\Damien\Desktop\samp server\gamemodes\lvtdm.pwn(284) : error 029: invalid expression, assumed zero
C:\Users\Damien\Desktop\samp server\gamemodes\lvtdm.pwn(284) : error 004: function "OnPlayerDisconnect" is not implemented
C:\Users\Damien\Desktop\samp server\gamemodes\lvtdm.pwn(289) : warning 225: unreachable code
C:\Users\Damien\Desktop\samp server\gamemodes\lvtdm.pwn(289) : error 029: invalid expression, assumed zero
C:\Users\Damien\Desktop\samp server\gamemodes\lvtdm.pwn(289) : error 004: function "OnPlayerSpawn" is not implemented
C:\Users\Damien\Desktop\samp server\gamemodes\lvtdm.pwn(322) : warning 225: unreachable code
C:\Users\Damien\Desktop\samp server\gamemodes\lvtdm.pwn(322) : error 029: invalid expression, assumed zero
C:\Users\Damien\Desktop\samp server\gamemodes\lvtdm.pwn(322) : error 004: function "OnPlayerDeath" is not implemented
C:\Users\Damien\Desktop\samp server\gamemodes\lvtdm.pwn(324) : error 017: undefined symbol "killerid"
C:\Users\Damien\Desktop\samp server\gamemodes\lvtdm.pwn(325) : error 017: undefined symbol "reason"
C:\Users\Damien\Desktop\samp server\gamemodes\lvtdm.pwn(327) : error 017: undefined symbol "killerid"
C:\Users\Damien\Desktop\samp server\gamemodes\lvtdm.pwn(329) : error 017: undefined symbol "killerid"
C:\Users\Damien\Desktop\samp server\gamemodes\lvtdm.pwn(330) : error 017: undefined symbol "killerid"
C:\Users\Damien\Desktop\samp server\gamemodes\lvtdm.pwn(331) : error 017: undefined symbol "killerid"
C:\Users\Damien\Desktop\samp server\gamemodes\lvtdm.pwn(337) : warning 225: unreachable code
C:\Users\Damien\Desktop\samp server\gamemodes\lvtdm.pwn(337) : error 029: invalid expression, assumed zero
C:\Users\Damien\Desktop\samp server\gamemodes\lvtdm.pwn(337) : error 004: function "OnPlayerCommandText" is not implemented
C:\Users\Damien\Desktop\samp server\gamemodes\lvtdm.pwn(339) : error 017: undefined symbol "cmdtext"
C:\Users\Damien\Desktop\samp server\gamemodes\lvtdm.pwn(343) : warning 217: loose indentation
C:\Users\Damien\Desktop\samp server\gamemodes\lvtdm.pwn(347) : warning 235: public function lacks forward declaration (symbol "SetupPlayerForClassSelection")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


17 Errors.
Reply
#6

Looks like your opening and closing brackets dont match in numbers now.

Make sure your functions dont have more {s than }s or vica - versa
Reply
#7

I've checked the brackets and their all good.. >_<
Reply
#8

look at lines around 200 - 350.

These errors can only be caused by unbalanced brackets.
Reply
#9

I've checked.. and still nothing.
Reply
#10

Try to return the value?
return 1;
}

?? Try that.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)