#1

Код:
		case ClassFireman: // Fire-Man class
		{
			format(missiontext, sizeof(missiontext), BusDriver_NoJobText); // Preset the missiontext
			SetPlayerColor(playerid, FireMan); // Set the playercolor (chatcolor for the player and color on the map)
		}
Код:
C:\Users\gamemodes\PPC_Trucking.pwn(630) : error 017: undefined symbol "ClassFireman"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#2

It's because the variable is undefined in otherwords non-existant.
Reply
#3

is they a code like new something?
Reply
#4

Try This
Код:
new gTeam[MAX_PLAYERS];
new gPlayerClass[MAX_PLAYERS];
#define TEAM_FIREMEN 1

public OnGameModeInit ()
{
SetGameModeText ("Test")
AddPlayerClass(bla bla)
return 1;
}
public OnPlayerRequestClassplayerid, classid)
{
    gPlayerClass[playerid] = classid;
    gTeam[playerid] = classid;

    switch (classid) {

        case 0:

            {
format(missiontext, sizeof(missiontext), BusDriver_NoJobText); // Preset the missiontext
                gTeam[playerid] = TEAM_FIREMEN;
                GameTextForPlayer(playerid, "~r~ Firemen", 5500, 5);
                SetPlayerColor(playerid, COLOR_RED);

            }
}
             if(classid == 0)
       {
        SetPlayerPos(playerid, 2527.1042,-1664.5869,15.1666);
		SetPlayerFacingAngle(playerid,180);
		SetPlayerCameraPos(playerid,2526.9868,-1666.8330,15.1683);
		SetPlayerCameraLookAt(playerid,2527.1042,-1664.5869,15.1666);

	   }
	   return 1;
}
So when someone joins, and if he select Firemen, then this should work. (you must add the string)
Reply
#5

Also, if you do define the variable, it needs to be a part of the pre-processor also known as #define. You can't use non-constant values in a case statement. Example:



This is fine:

pawn Код:
#define ClassFireman 1

This is wrong:

pawn Код:
new ClassFireman = 1;
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)