SA-MP Forums Archive
New Class - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: New Class (/showthread.php?tid=430901)



New Class - NathNathii - 15.04.2013

I'm trying to add a new class but when I compile the gamemode I get errors

Код:
C:\Users\Documents\GT Testing\gamemodes\gamemode.pwn(1441) : error 010: invalid function or declaration
C:\Users\Documents\GT Testing\gamemodes\gamemode.pwn(72) : error 021: symbol already defined: "AddPlayerClass"
C:\Users\Documents\GT Testing\gamemodes\gamemode.pwn(1438) : error 002: only a single statement (or expression) can follow each "case"
Line 1441
Код:
	return 1;
Line 72 (That is the only AddPlayerClass I have.
Код:
AddPlayerClass(285,1319.2378,1256.4791,10.8203,3.6149,0,0,0,0,0,0); // S.W.A.T
Line 1438
Код:
	SetPlayerTeam(playerid, TEAM_SWAT);



Re: New Class - DaTa[X] - 15.04.2013

use var like
pawn Код:
new gTeam[MAX_PLAYERS];
gTeam[playerid] = TEAM_SWAT;



Re: New Class - NathNathii - 15.04.2013

**Still the same errors.


Re: New Class - NathNathii - 15.04.2013

2 Errors

Код:
C:\Users\linda\Documents\GT Testing\gamemodes\GranTrucking.pwn(73) : error 021: symbol already defined: "GameTextForPlayer"
C:\Users\linda\Documents\GT Testing\gamemodes\GranTrucking.pwn(76) : error 010: invalid function or declaration
Line 73
Код:
		GameTextForPlayer(playerid,"~b~S.W.A.T~n~SPECIAL FORCES",1000,5);
Line 76
Код:
		return 1;



Re: New Class - Necip - 15.04.2013

Can you add the 5 lines above and 3 below the line 76?So we can see and help you solve the problem.


Re: New Class - NathNathii - 15.04.2013

pawn Код:
GameTextForPlayer(playerid,"~b~S.W.A.T~n~SPECIAL FORCES",1000,5);
        SetPlayerTeam(playerid, TEAM_SWAT);
        SetPlayerColor(playerid, 0x33CCFFAA);
        return 1;
}



Re: New Class - Necip - 15.04.2013

More lines above?I need to see how you start it.


Re: New Class - NathNathii - 15.04.2013

pawn Код:
#define TEAM_SWAT 0

        GameTextForPlayer(playerid,"~b~S.W.A.T~n~SPECIAL FORCES",1000,5);
        SetPlayerTeam(playerid, TEAM_SWAT);
        SetPlayerColor(playerid, 0x33CCFFAA);
        return 1;
}
Nothing more related to the errors..


Re: New Class - Necip - 15.04.2013

Try

pawn Код:
#define TEAM_SWAT 0

        GameTextForPlayer(playerid,"~b~S.W.A.T~n~SPECIAL FORCES",1000,5);
        SetPlayerTeam(playerid, TEAM_SWAT);
        SetPlayerColor(playerid, 0x33CCFFAA);
        }
        return 1;
}
OR

pawn Код:
#define TEAM_SWAT 0

        GameTextForPlayer(playerid,"~b~S.W.A.T~n~SPECIAL FORCES",1000,5);
        SetPlayerTeam(playerid, TEAM_SWAT);
        SetPlayerColor(playerid, 0x33CCFFAA);
        }
        return 1;
OR

pawn Код:
#define TEAM_SWAT 0

        GameTextForPlayer(playerid,"~b~S.W.A.T~n~SPECIAL FORCES",1000,5);
        SetPlayerTeam(playerid, TEAM_SWAT);
        SetPlayerColor(playerid, 0x33CCFFAA);
        return 1;



Re: New Class - ron_tim - 15.04.2013

Quote:
Originally Posted by Necip
Посмотреть сообщение
Try

pawn Код:
#define TEAM_SWAT 0

        GameTextForPlayer(playerid,"~b~S.W.A.T~n~SPECIAL FORCES",1000,5);
        SetPlayerTeam(playerid, TEAM_SWAT);
        SetPlayerColor(playerid, 0x33CCFFAA);
        }
        return 1;
}
OR

pawn Код:
#define TEAM_SWAT 0

        GameTextForPlayer(playerid,"~b~S.W.A.T~n~SPECIAL FORCES",1000,5);
        SetPlayerTeam(playerid, TEAM_SWAT);
        SetPlayerColor(playerid, 0x33CCFFAA);
        }
        return 1;
OR

pawn Код:
#define TEAM_SWAT 0

        GameTextForPlayer(playerid,"~b~S.W.A.T~n~SPECIAL FORCES",1000,5);
        SetPlayerTeam(playerid, TEAM_SWAT);
        SetPlayerColor(playerid, 0x33CCFFAA);
        return 1;
I agree this should work.