Error: undefined symbol
#1

So, I am learning scripting and I started by trying to make a TDM server. I did everything it told me here: https://sampwiki.blast.hk/wiki/PAWN_tutorial_1 (only did what it says bellow the "Making a Team Deathmath"). Anyways, so I did exactly the same as it said there and when I'm going to compile this message appears:


Desktop\PAWN Scripting\gamemodes\Untitled.pwn(95) : error 017: undefined symbol "classid"


and this is what I have on line 95:

92public OnPlayerSpawn(playerid)
93{
94 SetPlayerToTeamColor(playerid);
95 if (classid == 0)
96 {
97 gTeam[playerid] = TEAM_GROVE;
98 }


can you help me fix the problem? I'm really interested in learning pawn even thought it seems a bit difficult

thanks for reading and for the help
Reply
#2

I think you need read tutorial again.
You miss
pawn Код:
SetPlayerTeamFromClass(playerid, classid)
{
    if (classid == 0)
    {
        gTeam[playerid] = TEAM_GROVE;
    }
    else
    {
        gTeam[playerid] = TEAM_BALLA;
    }
}
Reply
#3

actually I put it on the script:

[IMG][/IMG]

I don't know if that is the right place though since I didnt understand a lot this part of tutorial:

Place that code OUTSIDE a function in your code (as it is a new function) and put these lines as the first things after the open curly braces in your OnPlayerRequestClass callback (notice the way the variables are not global so we are having to pass them to out function too):

SetPlayerTeamFromClass(playerid, classid);



The setplayerteam seems to be okay but the first part not..can you help me?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)