Undefined Symbol "playerid"
#1

------
Reply
#2

You cannot insert 'public' inside another 'public'.
Reply
#3

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)
Reply
#4

------
Reply
#5

Quote:
Originally Posted by DaniceMcHarley
Посмотреть сообщение
What are you talking about??
as zxc1 said,
you can't use "public" inside "public" <
Reply
#6

Quote:
Originally Posted by Smikkeltoetje
Посмотреть сообщение
as zxc1 said,
you can't use "public" inside "public" <
Still the same problem.
Reply
#7

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;
}
Reply
#8

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)
{

}
Reply
#9

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 ^^
Reply
#10

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)