SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 15/04/2013, 06:17 PM   #1
NathNathii
Huge Clucker
 
Join Date: Mar 2012
Posts: 447
Reputation: 5
Default New Class

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

Code:
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
Code:
	return 1;
Line 72 (That is the only AddPlayerClass I have.
Code:
AddPlayerClass(285,1319.2378,1256.4791,10.8203,3.6149,0,0,0,0,0,0); // S.W.A.T
Line 1438
Code:
	SetPlayerTeam(playerid, TEAM_SWAT);
NathNathii is offline   Reply With Quote
Old 15/04/2013, 06:20 PM   #2
DaTa[X]
Banned
 
Join Date: Aug 2012
Posts: 371
Reputation: 39
Default Re: New Class

use var like
pawn Code:
new gTeam[MAX_PLAYERS];
gTeam[playerid] = TEAM_SWAT;
DaTa[X] is offline   Reply With Quote
Old 15/04/2013, 06:21 PM   #3
NathNathii
Huge Clucker
 
Join Date: Mar 2012
Posts: 447
Reputation: 5
Default Re: New Class

**Still the same errors.
NathNathii is offline   Reply With Quote
Old 15/04/2013, 06:43 PM   #4
NathNathii
Huge Clucker
 
Join Date: Mar 2012
Posts: 447
Reputation: 5
Default Re: New Class

2 Errors

Code:
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
Code:
		GameTextForPlayer(playerid,"~b~S.W.A.T~n~SPECIAL FORCES",1000,5);
Line 76
Code:
		return 1;
NathNathii is offline   Reply With Quote
Old 15/04/2013, 06:45 PM   #5
Necip
Huge Clucker
 
Necip's Avatar
 
Join Date: May 2011
Posts: 334
Reputation: 25
Default Re: New Class

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


Necip is offline   Reply With Quote
Old 15/04/2013, 06:46 PM   #6
NathNathii
Huge Clucker
 
Join Date: Mar 2012
Posts: 447
Reputation: 5
Default Re: New Class

pawn Code:
GameTextForPlayer(playerid,"~b~S.W.A.T~n~SPECIAL FORCES",1000,5);
        SetPlayerTeam(playerid, TEAM_SWAT);
        SetPlayerColor(playerid, 0x33CCFFAA);
        return 1;
}
NathNathii is offline   Reply With Quote
Old 15/04/2013, 06:47 PM   #7
Necip
Huge Clucker
 
Necip's Avatar
 
Join Date: May 2011
Posts: 334
Reputation: 25
Default Re: New Class

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


Necip is offline   Reply With Quote
Old 15/04/2013, 06:49 PM   #8
NathNathii
Huge Clucker
 
Join Date: Mar 2012
Posts: 447
Reputation: 5
Default Re: New Class

pawn Code:
#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..
NathNathii is offline   Reply With Quote
Old 15/04/2013, 06:54 PM   #9
Necip
Huge Clucker
 
Necip's Avatar
 
Join Date: May 2011
Posts: 334
Reputation: 25
Default Re: New Class

Try

pawn Code:
#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 Code:
#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 Code:
#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;
__________________


Necip is offline   Reply With Quote
Old 15/04/2013, 06:56 PM   #10
NathNathii
Huge Clucker
 
Join Date: Mar 2012
Posts: 447
Reputation: 5
Default Re: New Class

Same errors ..
NathNathii is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
OnPlayerRequest class, Class Select doesn't appears MiGu3X Scripting Help 5 06/02/2013 12:01 AM
Use a Filterscripts Class Selection Instead of Gamemode Class Selection Eminem 2ka9 Scripting Help 12 04/08/2012 05:00 AM
[HELP] Class Selection - Showing the class name? CrucixTM Scripting Help 13 26/04/2012 06:38 PM
Help Setting A Player Class before class selection Madd Kat Scripting Help 4 09/02/2012 05:19 PM
help me with Class Selection Showing the class name The_Cobra Help Archive 2 05/02/2010 05:22 PM


All times are GMT. The time now is 03:09 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.