SA-MP Forums Archive
Adding Classes To PPC Trucking Gets Error 040 - 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: Adding Classes To PPC Trucking Gets Error 040 (/showthread.php?tid=388785)



Adding Classes To PPC Trucking Gets Error 040 - DeTix - 30.10.2012

Hi, I add classes to my ppc trucking gamemode.
But get 8 of errors 040.
What is the problem?


Re: Adding Classes To PPC Trucking Gets Error 040 - NoahF - 30.10.2012

Post the errors and the code..


Re: Adding Classes To PPC Trucking Gets Error 040 - Mr.Anonymous - 30.10.2012

So you want us to help you with your script without knowing your code? Umm.. let me think, sorry atleat I can't.


Re: Adding Classes To PPC Trucking Gets Error 040 - DeTix - 30.10.2012

Add me on skype Skypename : Sampdetix and i can give errors and that


Re: Adding Classes To PPC Trucking Gets Error 040 - Mr.Anonymous - 30.10.2012

Give your code here and get help quickly. Or just go and find someone who'll add you on skype.


Re: Adding Classes To PPC Trucking Gets Error 040 - DeTix - 30.10.2012

Quote:

case ClassTruckDriver: format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Class: {00FF00}Trucker\n", PlayerStatList);
case ClassBusDriver: format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Class: {00FF00}Bus driver\n", PlayerStatList);
case ClassPilot: format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Class: {00FF00}Pilot\n", PlayerStatList);
case ClassPolice: format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Class: {00FF00}Police\n", PlayerStatList);
case ClassMafia: format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Class: {00FF00}Mafia\n", PlayerStatList);
case ClassCourier: format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Class: {00FF00}Courier\n", PlayerStatList);
case ClassAssistance: format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Class: {00FF00}Assistance\n", PlayerStatList);
case ClassPaperboy: format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Class: {00FF00}Paperboy\n", PlayerStatList);
case ClassGarbageman: format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Class: {00FF00}Garbageman\n", PlayerStatList);
case ClassFarmer: format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Class: {00FF00}Farmer\n", PlayerStatList);
}

// Set the missiontext based on the chosen class
switch (APlayerData[playerid][PlayerClass])
{
case ClassPaperboy: // Paperboy class
{
format(missiontext, sizeof(missiontext), Paperboy_NoJobText); // Preset the missiontext
SetPlayerColor(playerid, ColorClassPaperboy); // Set the playercolor (chatcolor for the player and color on the map)
}
case ClassGarbageman: // Garbageman class
{
format(missiontext, sizeof(missiontext), Garbageman_NoJobText); // Preset the missiontext
SetPlayerColor(playerid, ColorClassGarbageman); // Set the playercolor (chatcolor for the player and color on the map)
}
case ClassFarmer: // Farmer class
{
format(missiontext, sizeof(missiontext), Farmer_NoJobText); // Preset the missiontext
SetPlayerColor(playerid, ColorClassFarmer); // Set the playercolor (chatcolor for the player and color on the map)
}
}

case ClassPaperboy:
{
Index = random(sizeof(ASpawnLocationsPaperboy));
x = ASpawnLocationsPaperboy[Index][SpawnX]; // Get the X-position for the spawnlocation
y = ASpawnLocationsPaperboy[Index][SpawnY]; // Get the Y-position for the spawnlocation
z = ASpawnLocationsPaperboy[Index][SpawnZ]; // Get the Z-position for the spawnlocation
Angle = ASpawnLocationsPaperboy[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation
format(Msg, 128, "{00FF00}Player {FFFF00}%s{00FF00} joined {FFFF00}Paperboy class", Name);
}
case ClassGarbageman:
{
Index = random(sizeof(ASpawnLocationsGarbageman));
x = ASpawnLocationsGarbageman[Index][SpawnX]; // Get the X-position for the spawnlocation
y = ASpawnLocationsGarbageman[Index][SpawnY]; // Get the Y-position for the spawnlocation
z = ASpawnLocationsGarbageman[Index][SpawnZ]; // Get the Z-position for the spawnlocation
Angle = ASpawnLocationsGarbageman[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation
format(Msg, 128, "{00FF00}Player {FFFF00}%s{00FF00} joined {FFFF00}Garbageman class", Name);
}
case ClassFarmer:
{
Index = random(sizeof(ASpawnLocationsFarmer));
x = ASpawnLocationsFarmer[Index][SpawnX]; // Get the X-position for the spawnlocation
y = ASpawnLocationsFarmer[Index][SpawnY]; // Get the Y-position for the spawnlocation
z = ASpawnLocationsFarmer[Index][SpawnZ]; // Get the Z-position for the spawnlocation
Angle = ASpawnLocationsFarmer[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation
format(Msg, 128, "{00FF00}Player {FFFF00}%s{00FF00} joined {FFFF00}Farmer class", Name);
}
}

This is that is errors in


Re: Adding Classes To PPC Trucking Gets Error 040 - DeTix - 30.10.2012

Quote:

C:\Users\BenRoger\Desktop\Trucking\gamemodes\PPC_T rucking.pwn(520) : error 040: duplicate "case" label (value 6)
C:\Users\BenRoger\Desktop\Trucking\gamemodes\PPC_T rucking(521) : error 040: duplicate "case" label (value 7)
C:\Users\BenRoger\Desktop\Trucking\gamemodes\PPC_T rucking.pwn(703) : error 040: duplicate "case" label (value 6)
C:\Users\BenRoger\Desktop\Trucking\gamemodes\PPC_T rucking.pwn(70 : error 040: duplicate "case" label (value 7)
C:\Users\BenRoger\Desktop\Trucking\gamemodes\PPC_T rucking.pwn(713) : error 040: duplicate "case" label (value
C:\Users\BenRoger\Desktop\Trucking\gamemodes\PPC_T rucking.pwn(1076) : error 040: duplicate "case" label (value 6)
C:\Users\BenRoger\Desktop\Trucking\gamemodes\PPC_T rucking.pwn(1085) : error 040: duplicate "case" label (value 7)
C:\Users\BenRoger\Desktop\Trucking\gamemodes\PPC_T rucking.pwn(1094) : error 040: duplicate "case" label (value
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


8 Errors.

That is the errors


AW: Adding Classes To PPC Trucking Gets Error 040 - Skimmer - 30.10.2012

You don't need to post all your script, just post the lines where the compiler has found an error.
And it would be great, when you post this script as 'PAWN' code.


Re: Adding Classes To PPC Trucking Gets Error 040 - Mr.Anonymous - 30.10.2012

Please post it on Pastebin so we can understand the lines.


Re: Adding Classes To PPC Trucking Gets Error 040 - DeTix - 30.10.2012

http://pastebin.com/0jFMpfGu Here