Weird errors
#1

Can someone tell me whats wrong with this code?
Код:
		case 600: {
		    DisablePlayerCheckpoint(playerid);
		    SetPlayerCheckpoint(playerid, 1376.3273,-1729.8168,13.3828, 5.0);
		    playerVariables[playerid][pCheckpoint] = 601;
  		}
		case 601: {
		    DisablePlayerCheckpoint(playerid);
		    SetPlayerCheckpoint(playerid, 1315.0135,-1696.8950,13.3828, 5.0);
		    playerVariables[playerid][pCheckpoint] = 602;
  		}
		case 602: {
		    DisablePlayerCheckpoint(playerid);
		    SetPlayerCheckpoint(playerid, 1314.1085,-1588.5076,13.3828, 5.0);
		    playerVariables[playerid][pCheckpoint] = 603;
  		}
  		case 603: {
  		    DisablePlayerCheckpoint(playerid);
  		    SetPlayerCheckpoint(playerid, 1357.0042,-1421.5580,13.3906, 5.0);
  		    playerVariables[playerid][pCheckpoint] = 604;
		}
		case 604: {
		    DisablePlayerCheckpoint(playerid);
		    SetPlayerCheckpoint(playerid, 1304.5392,-1395.3401,13.2344, 5.0);
		    playerVariables[playerid][pCheckpoint] = 605;
		}
		case 605: {
			DisablePlayerCheckpoint(playerid);
			SetPlayerCheckpoint(playerid, 1219.6782,-1395.4934,13.1932, 5.0);
			playerVariables[playerid][pCheckpoint] = 606;
		}
		case 606: {
		    DisablePlayerCheckpoint(playerid);
		    SetPlayerCheckpoint(playerid, 1205.7156,-1296.7988,13.3839, 5.0);
		    playerVariables[playerid][pCheckpoint] = 607;
		}
        case 607: {
		    DisablePlayerCheckpoint(playerid);
		    SetPlayerCheckpoint(playerid, 1083.7260,-1279.3306,13.4355, 5.0);
		    playerVariables[playerid][pCheckpoint] = 608;
		}
		case 608: {
		    DisablePlayerCheckpoint(playerid);
		    SetPlayerCheckpoint(playerid, 1058.5392,-1313.6399,13.3828, 5.0);
		    playerVariables[playerid][pCheckpoint] = 609;
		}
		case 609: {
		    DisablePlayerCheckpoint(playerid);
		    SetPlayerCheckpoint(playerid, 981.7972,-1322.0190,13.3770, 5.0);
		    playerVariables[playerid][pCheckpoint] = 610;
		}
		case 610: {
		    DisablePlayerCheckpoint(playerid);
		    SetPlayerCheckpoint(playerid, 919.5800,-1326.3774,13.4778, 5.0);
		    playerVariables[playerid][pCheckpoint] = 611;
		}
		case 611: {
		    DisablePlayerCheckpoint(playerid);
		    SetPlayerCheckpoint(playerid, 916.2419,-1408.2440,13.2334, 5.0);
		    playerVariables[playerid][pCheckpoint] = 612;
		}
		case 612: {
		    DisablePlayerCheckpoint(playerid);
		    SetPlayerCheckpoint(playerid, 948.2761,-1489.6700,13.3652, 5.0);
		    playerVariables[playerid][pCheckpoint] = 613;
		}
		case 613: {
		    DisablePlayerCheckpoint(playerid);
		    SetPlayerCheckpoint(playerid, 1062.5082,-1496.9265,13.6694, 5.0);
		    playerVariables[playerid][pCheckpoint] = 614;
		}
		case 614: {
		    DisablePlayerCheckpoint(playerid);
		    SetPlayerCheckpoint(playerid, 1128.9255,-1516.6914,15.7964, 5.0);
		    playerVariables[playerid][pCheckpoint] = 615;
		}
        case 615: {
		    DisablePlayerCheckpoint(playerid);
		    SetPlayerCheckpoint(playerid, 1188.0037,-1489.1039,13.5469, 5.0);
		    playerVariables[playerid][pCheckpoint] = 616;
		}
		case 616: {
		    DisablePlayerCheckpoint(playerid);
		    SetPlayerCheckpoint(playerid, 1196.6313,-1561.4130,13.3828, 5.0);
		    playerVariables[playerid][pCheckpoint] = 617;
		}
		case 617: {
		    DisablePlayerCheckpoint(playerid);
		    SetPlayerCheckpoint(playerid, 1282.1779,-1570.9094,13.3828, 5.0);
		    playerVariables[playerid][pCheckpoint] = 618;
		}
		case 618: {
		    DisablePlayerCheckpoint(playerid);
		    SetPlayerCheckpoint(playerid, 1297.6853,-1698.0890,13.3828, 5.0);
		    playerVariables[playerid][pCheckpoint] = 619;
		}
		case 619: {
		    DisablePlayerCheckpoint(playerid);
		    SetPlayerCheckpoint(playerid, 1343.0488,-1861.2560,13.3828, 5.0);
		    playerVariables[playerid][pCheckpoint] = 620;
		}
		case 620: {
		    DisablePlayerCheckpoint(playerid);
		    SetPlayerCheckpoint(playerid, 1388.8010,-1795.6643,13.3828, 5.0);
		    playerVariables[playerid][pCheckpoint] = 621;
		}
		case 621: {
		    DisablePlayerCheckpoint(playerid);
		    SetPlayerCheckpoint(playerid, 1431.3575,-1694.0629,13.3828, 5.0);
		    playerVariables[playerid][pCheckpoint] = 630;
		}
  				case 630: {
  		    new Float:health;
  		    new veht = GetPlayerVehicleID(playerid);
  		    GetVehicleHealth(veht, health);
  		    DisablePlayerCheckpoint(playerid);
  		    playerVariables[playerid][pCheckpoint] = 0;
  		    new string[128];
	    	format(string, sizeof(string), " ");
	    	TextDrawSetString(dmv_time[playerid], string);
	    	TextDrawHideForPlayer(playerid, dmv_time[playerid]);
            if(health < 950)
			{
		    	if(dmvmins[playerid] > 235 && dmvmins[playerid] < 302)
		    	{
		    		SendClientMessage(playerid, COLOR_RED, "FAILED: {FFFFFF}You have failed your test. You will have to re-take the test in a little while.");
					playerVariables[playerid][pCheckpoint] = 0;
					DestroyVehicle(GetPlayerVehicleID(playerid));
					SetPlayerInterior(playerid, 0);
					dmvmins[playerid] = 0;
					SetPlayerVirtualWorld(playerid, 0);
					TextDrawHideForPlayer(playerid, dmv_time[playerid]);
				}
			}
  			 else
			{
		    	SendClientMessage(playerid, COLOR_GREEN, "Well Done! {FFFFFF}You have {33FF33}successfully{FFFFFF} passed your test!");
      			playerVariables[playerid][pBikeLicense] = 1;
	    		dmvmins[playerid] = 0;
	    		SetPlayerInterior(playerid, 0);
	    		SetPlayerVirtualWorld(playerid, 0);
	    		DestroyVehicle(GetPlayerVehicleID(playerid));
	    		TextDrawHideForPlayer(playerid, dmv_time[playerid]);
				}
			}
    	default: {
			DisablePlayerCheckpoint(playerid);
			playerVariables[playerid][pCheckpoint] = 0;

		}
    }
Код:
C:\Users\Jordan\Desktop\CTRPWindows\gamemodes\ctrp.pwn(6412) : error 014: invalid statement; not in switch
C:\Users\Jordan\Desktop\CTRPWindows\gamemodes\ctrp.pwn(6412) : warning 215: expression has no effect
C:\Users\Jordan\Desktop\CTRPWindows\gamemodes\ctrp.pwn(6412) : error 001: expected token: ";", but found ":"
C:\Users\Jordan\Desktop\CTRPWindows\gamemodes\ctrp.pwn(6412) : error 029: invalid expression, assumed zero
C:\Users\Jordan\Desktop\CTRPWindows\gamemodes\ctrp.pwn(6412) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
This is line 6412:
Код:
		case 200: {
Reply
#2

can you show the script over the line which is giving errors?
Reply
#3

Код:
    	default: {
			DisablePlayerCheckpoint(playerid);
			playerVariables[playerid][pCheckpoint] = 0;

		}
	}
		case 200: { // 6412
		    DisablePlayerCheckpoint(playerid);
		    SetPlayerCheckpoint(playerid, 1376.3273,-1729.8168,13.3828, 5.0);
		    playerVariables[playerid][pCheckpoint] = 201;
  		}
		case 201: {
		    DisablePlayerCheckpoint(playerid);
		    SetPlayerCheckpoint(playerid, 1315.0135,-1696.8950,13.3828, 5.0);
		    playerVariables[playerid][pCheckpoint] = 202;
  		}
Reply
#4

place this before "default:"
Код:
       case 200: { 
		    DisablePlayerCheckpoint(playerid);
		    SetPlayerCheckpoint(playerid, 1376.3273,-1729.8168,13.3828, 5.0);
		    playerVariables[playerid][pCheckpoint] = 201;
  		}
		case 201: {
		    DisablePlayerCheckpoint(playerid);
		    SetPlayerCheckpoint(playerid, 1315.0135,-1696.8950,13.3828, 5.0);
		    playerVariables[playerid][pCheckpoint] = 202;
  		}
Reply
#5

that's part of the Car License.
Reply
#6

pawn Код:
default:
this needs to be LAST in the switch statement

example:
pawn Код:
switch(expression)
{
    case 1 : {}
    case 2 : {}
    default : {}
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)