Undefined Symbol "playerid" -
Beckett - 13.02.2013
------
Re: Undefined Symbol "playerid" -
zxc1 - 13.02.2013
You cannot insert 'public' inside another 'public'.
Re: Undefined Symbol "playerid" -
Smikkeltoetje - 13.02.2013
Quote:
Originally Posted by DaniceMcHarley
[I]Well, I'm a scripting beginner and i tried to script some gangs but after I'm done everything there are 26 errors appear.I have no idea why It's appearing
The errors are.
Код:
: error 017: undefined symbol "playerid"
There are 25 Errors like this..
The line is.
Код:
public OnGameModeExit()
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
Can anyone tell me what is the problem with this?
Thanks!!
|
you cant use that inside ongamemodeinit,
atleast thats what im aware of
EDIT:
OnPlayerStateChange is at the bottom of my "new.pwn"
so it should already be inside your pawno script :O
(i used the standard new.pwn inside the pawno folder... idk what your gm looks like)
Re: Undefined Symbol "playerid" -
Beckett - 13.02.2013
------
Re: Undefined Symbol "playerid" -
Smikkeltoetje - 13.02.2013
Quote:
Originally Posted by DaniceMcHarley
What are you talking about??
|
as zxc1 said,
you can't use "public" inside "public" <
Re: Undefined Symbol "playerid" -
Beckett - 13.02.2013
Quote:
Originally Posted by Smikkeltoetje
as zxc1 said,
you can't use "public" inside "public" <
|
Still the same problem.
Re: Undefined Symbol "playerid" - Patrick - 13.02.2013
DaniceMcHarley
As people said, you cant use any public inside of another public, why would you need those? you could do something like this also try to read
https://sampwiki.blast.hk/wiki/Scripting_Basics some of those
pawn Код:
public OnGameModeExit()
{
//codes here
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
//codes here
return 1;
}
Re: Undefined Symbol "playerid" -
zxc1 - 13.02.2013
Deleting the word 'public' won't help, OnPlayerStateChange is a function.
You have to separate them.
pawn Код:
public OnGameModeExit()
{
{
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
}
Re: Undefined Symbol "playerid" -
Smikkeltoetje - 13.02.2013
Quote:
Originally Posted by pds2012
DaniceMcHarley
As people said, you cant use any public inside of another public, why would you need those? you could do something like this also try to read https://sampwiki.blast.hk/wiki/Scripting_Basics some of those
pawn Код:
public OnGameModeExit() { //codes here return 1; }
public OnPlayerStateChange(playerid, newstate, oldstate) { //codes here return 1; }
|
thats exactly what i said, but i accidently edited in qoute haha,
lets hope we helped him out now.
It can happen to everyone that starts scripting ^^
Re: Undefined Symbol "playerid" -
DaRk_RaiN - 13.02.2013
Um, idk how to say this but you really need to start learning about pawn, you can't put a call back inside an other
Your code:
pawn Код:
public OnGameModeExit()//This is a call back
{
public OnPlayerStateChange(playerid, newstate, oldstate) //This is a call back
//Putting them together = hell
{
Right code
pawn Код:
public OnGameModeExit()
{
//bla bla
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
//code bla bla
return 1;
}