23.02.2013, 14:11
So I used this tutorial to create teams and their vehicles on my server.
I have followed every single step and changed the team names to my own.
However it gives me the following errors when compiling:
And this is my script:
Any help would be greatly appreciated.
Also sorry if the errors made are obvious and nooby, I'm new to this all.
I have followed every single step and changed the team names to my own.
However it gives me the following errors when compiling:
Quote:
C:\Documents and Settings\test\Bureaublad\FCCRP\gamemodes\FCCRP2.pw n(9) : error 017: undefined symbol "TeamCars" C:\Documents and Settings\test\Bureaublad\FCCRP\gamemodes\FCCRP2.pw n(9) : error 009: invalid array size (negative, zero or out of bounds) C:\Documents and Settings\test\Bureaublad\FCCRP\gamemodes\FCCRP2.pw n(48 ) : warning 213: tag mismatch C:\Documents and Settings\test\Bureaublad\FCCRP\gamemodes\FCCRP2.pw n(49) : warning 213: tag mismatch C:\Documents and Settings\test\Bureaublad\FCCRP\gamemodes\FCCRP2.pw n(254) : error 054: unmatched closing brace ("}") C:\Documents and Settings\test\Bureaublad\FCCRP\gamemodes\FCCRP2.pw n(265) : error 054: unmatched closing brace ("}") C:\Documents and Settings\test\Bureaublad\FCCRP\gamemodes\FCCRP2.pw n(268 ) : error 021: symbol already defined: "OnPlayerStateChange" C:\Documents and Settings\test\Bureaublad\FCCRP\gamemodes\FCCRP2.pw n(272) : warning 213: tag mismatch C:\Documents and Settings\test\Bureaublad\FCCRP\gamemodes\FCCRP2.pw n(281) : warning 213: tag mismatch Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 5 Errors. |
pawn Код:
#include <a_samp>
#define POLICE 1
#define EMS 2
#define POLICE_COLOR 0x1B4CE0AA
#define EMS_COLOR 0xFF8AF5AA
#define COLOR_RED 0xFF0000AA
new Cars[TeamCars];
enum TeamCars
{
Police,
Ems
}
new gTeam[MAX_PLAYERS];
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
#endif
public OnGameModeInit()
{
AddPlayerClass(282,2497.2693,-1676.9578,13.3398,23.6501,0,0,0,0,0,0); //POLICE
AddPlayerClass(275,1544.0514,-1675.7766,13.5577,98.0974,0,0,0,0,0,0); //EMS
Cars[Police] = AddStaticVehicle(598,-210.8453,999.8466,19.3565,88.9803,0,1); // FCpolice1
Cars[Ems] = AddStaticVehicle(416,-330.7315,1063.7899,19.8899,270.1239,1,3); // FCems1
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerTeamFromClass(playerid, classid);
return 1;
}
public OnPlayerConnect(playerid)
{
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnPlayerSpawn(playerid)
{
SetPlayerToTeamColour(playerid);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}
public OnRconCommand(cmd[])
{
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
return 1;
}
public OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}
public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}
public OnPlayerUpdate(playerid)
{
return 1;
}
public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}
public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}
public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}
public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
SetPlayerTeamFromClass(playerid, classid)
{
if(classid == 0)
{
gTeam[playerid] = POLICE;
}
if(classid == 1)
gTeam[playerid] = EMS;
}
}
SetPlayerToTeamColour(playerid)
{
if(gTeam[playerid] == POLICE)
{
SetPlayerColor(playerid,POLICE_COLOR); //BLUE
}
if(gTeam[playerid] == EMS)
SetPlayerColor(playerid,EMS_COLOR); // PINK
}
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == 2)
{
new CarCheck = GetPlayerVehicleID(playerid);
if(CarCheck == Cars[Police] )
{
if(gTeam[playerid] != 1)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "You don't belong to the correct faction.");
return 1;
}
}
if(CarCheck == Cars[Ems] )
{
if(gTeam[playerid] != 2)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "You don't belong to the correct faction.");
return 1;
}
}
return 1;
}
return 1;
}
Any help would be greatly appreciated.
Also sorry if the errors made are obvious and nooby, I'm new to this all.