Compiling Errors
#1

Error
Код:
(124736) : error 010: invalid function or declaration
Код:
public OnVehicleSpawn(vehicleid)
{
	if(IsATrailer(vehicleid))
	{
		foreach(Player, i)
		{
		    if(PlayerTruckJob[i][pTDTrailer] == vehicleid)
		    {
		        new string[128];
		        new lostrand = random(10000);
		 		ClearTruckJob(i);
		 		SendClientMessageEx(i, COLOR_RED, " * Your trailer has been destroyed, the Trucking Delivery has been canceled.");
		 		format(string, sizeof(string), " * Failing this delivery has cost you $%d.", lostrand);
		 		SendClientMessageEx(i, COLOR_RED, string);
		 		GivePlayerCash(i, -lostrand);
		 		gPlayerCheckpointStatus[i] = CHECKPOINT_NONE;
		    }
		}
	}
	Gas[vehicleid] =100.0;
	CheckingSpeed[vehicleid] = 0;
    VehicleStatus{vehicleid} = 0;
	Vehicle_Armor(vehicleid);
	new Float:X, Float:Y, Float:Z;
	GetObjectPos(Carrier[0], X, Y, Z);
	if(vehicleid == NGVehicles[0]) SetVehiclePos(vehicleid, (X-40.586371), (Y-5.692918), 11.5239);
	else if(vehicleid == NGVehicles[1]) SetVehiclePos(vehicleid, (X-50.758971), (Y-5.817918), 11.5200);
	else if(vehicleid == NGVehicles[2]) SetVehiclePos(vehicleid, (X-60.754871), (Y-5.590818), 11.5239);
	else if(vehicleid == NGVehicles[3]) SetVehiclePos(vehicleid, (X-89.337771), (Y-8.558118) ,-0.6940);
	else if(vehicleid == NGVehicles[4]) SetVehiclePos(vehicleid, (X-88.546371), (Y-3.55761), -0.7851);
	else if(vehicleid == NGVehicles[5]) SetVehiclePos(vehicleid, (X-83.861371), (Y+9.010282),0.2197);
	else if(vehicleid == NGVehicles[6]) SetVehiclePos(vehicleid, (X-83.788371), (Y+3.149882), -0.2992);
	else if(vehicleid == NGVehicles[7]) SetVehiclePos(vehicleid, (X-66.975571), (Y+2.436018), 2.8996);
	else if(vehicleid == NGVehicles[8]) SetVehiclePos(vehicleid, (X-66.928571), (Y+8.720218), 2.9000);
	else if(vehicleid == NGVehicles[9]) SetVehiclePos(vehicleid, (X-37.527971), (Y-5.000518), 19.5374);
	else if(vehicleid == NGVehicles[10]) SetVehiclePos(vehicleid, (X-49.288871), (Y-4.466818), 19.5374);
	else if(vehicleid == NGVehicles[11]) SetVehiclePos(vehicleid, (X-61.408771), (Y-4.106418), 19.5374);
	else if(vehicleid == NGVehicles[12]) SetVehiclePos(vehicleid, (X+50.462929), (Y-7.469218), 19.5374);
	else if(vehicleid == NGVehicles[13]) SetVehiclePos(vehicleid, (X+62.036429), (Y-7.419918), 19.5374);
	else if(vehicleid == NGVehicles[14]) SetVehiclePos(vehicleid, (X+73.444929), (Y-7.391618), 19.5374);
	else if(vehicleid == NGVehicles[15]) SetVehiclePos(vehicleid, (X+84.864529), (Y-7.157718), 19.5374);
	else if(vehicleid == NGVehicles[16]) SetVehiclePos(vehicleid, (X-75.592971), (Y-7.861318), 20.4642);
	else if(vehicleid == NGVehicles[17]) SetVehiclePos(vehicleid, (X+95.951729), (Y-7.315918), 19.3947);
	else if(vehicleid == NGVehicles[18]) SetVehiclePos(vehicleid, (X+62.937929), (Y+7.680682), 12.5242);
	else if(vehicleid == NGVehicles[19]) SetVehiclePos(vehicleid, (X+62.937929), (Y-2.632818), 12.5242);
	else if(vehicleid == NGVehicles[20]) SetVehiclePos(vehicleid, (X+18.567629), (Y-6.059118), 11.3398);
	else if(vehicleid == NGVehicles[21]) SetVehiclePos(vehicleid, (X+18.567629), (Y-8.597918), 11.3398);
	else if(vehicleid == NGVehicles[22]) SetVehiclePos(vehicleid, (X+18.567629), (Y-11.244118), 11.3398);
	new v;
	//VehicleFuel[vehicleid] = 100.0;
	foreach(Player, i)
	{
		if((v = GetPlayerVehicle(i, vehicleid)) != -1)
	    {
 			if(PlayerVehicleInfo[i][v][pvId] == vehicleid && GetVehicleModel(vehicleid) != PlayerVehicleInfo[i][v][pvModelId])
	  		{
				new isStolen = PlayerVehicleInfo[i][v][pvStolen];
	   			DestroyVehicle(vehicleid);
				PlayerVehicleInfo[i][v][pvId] = AddStaticVehicleEx(PlayerVehicleInfo[i][v][pvModelId], PlayerVehicleInfo[i][v][pvPosX], PlayerVehicleInfo[i][v][pvPosY], PlayerVehicleInfo[i][v][pvPosZ], PlayerVehicleInfo[i][v][pvPosAngle],PlayerVehicleInfo[i][v][pvColor1], PlayerVehicleInfo[i][v][pvColor2], -1);
				PlayerVehicleInfo[i][v][pvStolen] = isStolen;
				if(PlayerVehicleInfo[i][v][pvLocked] == 1) LockPlayerVehicle(i, PlayerVehicleInfo[i][v][pvId], PlayerVehicleInfo[i][v][pvLock]);	
				if(!isnull(PlayerVehicleInfo[i][v][pvPlate])) {
					SetVehicleNumberPlate(PlayerVehicleInfo[i][v][pvId], PlayerVehicleInfo[i][v][pvPlate]);
				}
				else
				{
					new string[128], randletter[2];
					randletter[0] = lAlphabet[random(sizeof(lAlphabet))][0];
					randletter[1] = lAlphabet[random(sizeof(lAlphabet))][0];
					format(string, sizeof(string), "%s%s%d", randletter[0], randletter[1], vehicleid);
					SetVehicleNumberPlate(vehicleid, string);
				}
     			ChangeVehiclePaintjob(PlayerVehicleInfo[i][v][pvId], PlayerVehicleInfo[i][v][pvPaintJob]);
				ChangeVehicleColor(PlayerVehicleInfo[i][v][pvId], PlayerVehicleInfo[i][v][pvColor1], PlayerVehicleInfo[i][v][pvColor2]);
				Gas[PlayerVehicleInfo[i][v][pvId]] = PlayerVehicleInfo[i][v][pvFuel];
				for(new m = 0; m < MAX_MODS; m++)
	   			{
	   			    if (PlayerVehicleInfo[i][v][pvMods][m] >= 1000 && PlayerVehicleInfo[i][v][pvMods][m] <= 1193)
	   			    {
		   				if (InvalidModCheck(GetVehicleModel(vehicleid), PlayerVehicleInfo[i][v][pvMods][m]))
		      			{
		      				AddVehicleComponent(PlayerVehicleInfo[i][v][pvId], PlayerVehicleInfo[i][v][pvMods][m]);
		      			}
		      			else
		      			{
		      			    printf("Removing invalid mod %d from %d of %s", PlayerVehicleInfo[i][v][pvMods][m], GetVehicleModel(vehicleid), GetPlayerNameEx(i));
		      			    PlayerVehicleInfo[i][v][pvMods][m] = 0;
		      			}
					}
	      		}
 			}
 			else
			{
				if(!isnull(PlayerVehicleInfo[i][v][pvPlate])) {
					SetVehicleNumberPlate(PlayerVehicleInfo[i][v][pvId], PlayerVehicleInfo[i][v][pvPlate]);
				}
				else
				{
					new string[128], randletter[2];
					randletter[0] = lAlphabet[random(sizeof(lAlphabet))][0];
					randletter[1] = lAlphabet[random(sizeof(lAlphabet))][0];
					format(string, sizeof(string), "%s%s%d", randletter[0], randletter[1], vehicleid);
					SetVehicleNumberPlate(vehicleid, string);
				}
                ChangeVehiclePaintjob(vehicleid, PlayerVehicleInfo[i][v][pvPaintJob]);
				ChangeVehicleColor(vehicleid, PlayerVehicleInfo[i][v][pvColor1], PlayerVehicleInfo[i][v][pvColor2]);
				for(new m = 0; m < MAX_MODS; m++)
	            {
	                if (PlayerVehicleInfo[i][v][pvMods][m] >= 1000 && PlayerVehicleInfo[i][v][pvMods][m] <= 1193)
	   			    {
			            if (InvalidModCheck(GetVehicleModel(vehicleid), PlayerVehicleInfo[i][v][pvMods][m]))
		                {
		    	            AddVehicleComponent(PlayerVehicleInfo[i][v][pvId], PlayerVehicleInfo[i][v][pvMods][m]);
			            }
			            else
			            {
			                printf("Removing invalid mod %d from %d of %s", PlayerVehicleInfo[i][v][pvMods][m], GetVehicleModel(vehicleid), GetPlayerNameEx(i));
			                PlayerVehicleInfo[i][v][pvMods][m] = 0;
			            }
					}
	            }
	            if(PlayerVehicleInfo[i][v][pvLocked] == 1) LockPlayerVehicle(i, PlayerVehicleInfo[i][v][pvId], PlayerVehicleInfo[i][v][pvLock]);
			}
				if(!PlayerVehicleInfo[i][v][pvStolen]) {
                new string[128];
				format(string,sizeof(string),"Your %s has been sent to the location at which you last parked it.",GetVehicleName(vehicleid));
				SendClientMessageEx(i, COLOR_GRAD1, string);
            }
		}
		else
		{
		    Gas[vehicleid] = 100.0;
		}
	}
	if(LockStatus[vehicleid])
	{
		foreach(Player, i)
		{
			if(PlayerInfo[i][pLockCar] == vehicleid)
			{
				PlayerInfo[i][pLockCar] = INVALID_VEHICLE_ID;
			}
		}
	}
	if(VehicleBomb[vehicleid] == 1)
	{
		foreach(Player, i)
		{
			if(PlayerInfo[i][pMember] == 8 || PlayerInfo[i][pLeader] == 8)
			{
				if(PlacedVehicleBomb[i] == vehicleid)
				{
					VehicleBomb[vehicleid] = 0;
  					PlacedVehicleBomb[i] = INVALID_VEHICLE_ID;
					PickUpC4(i);
					PlayerInfo[i][pC4Used] = 0;
					PlayerInfo[i][pC4Get] = 1;
				}
			}
		}
	}
	if(IsValidDynamicObject(obj1[vehicleid]) || IsValidDynamicObject(obj2[vehicleid]) || IsValidDynamicObject(obj3[vehicleid]) ||
	IsValidDynamicObject(obj4[vehicleid]) || IsValidDynamicObject(obj5[vehicleid]) || IsValidDynamicObject(obj6[vehicleid]) ||
	IsValidDynamicObject(obj7[vehicleid]) || IsValidDynamicObject(obj8[vehicleid]) || IsValidDynamicObject(obj9[vehicleid])) {
		DestroyDynamicObject(obj1[vehicleid]), DestroyDynamicObject(obj2[vehicleid]), DestroyDynamicObject(obj3[vehicleid]),
		DestroyDynamicObject(obj4[vehicleid]), DestroyDynamicObject(obj5[vehicleid]), DestroyDynamicObject(obj6[vehicleid]),
		DestroyDynamicObject(obj7[vehicleid]), DestroyDynamicObject(obj8[vehicleid]), DestroyDynamicObject(obj9[vehicleid]);
    }
	if(NeonON[vehicleid] == 1)
	{
		foreach(Player, i)
		{
			DestroyDynamicObject(GetPVarInt(i, "neon"));
			DestroyDynamicObject(GetPVarInt(i, "neon1"));
			NeonON[vehicleid]=0;
		}
	}
	if(VehicleBomb[vehicleid] == 1)
	{
		foreach(Player, i)
		{
			if(VehicleBomb[vehicleid] != PlacedVehicleBomb[i])
			{
		    	VehicleBomb[vehicleid] = 0;
			}
		}
	}
	arr_Engine{vehicleid} = 0;
	TruckContents[vehicleid] = 0;
	VanContents[vehicleid] = 0;
	MiningLoaded[vehicleid] = 0;
	//NOTE: IN ORDER TO GET THREE+ DIGIT NUMBERS IN YOUR LICENSE PLATES UNCOMMENT THE LINES BELOW AND MAKE THE TRADITIONAL POSSIBILITY A COMMENT!
        new string[128];
        new randdr = random(sizeof(PlatePossible));
        //===================================[Three+ Digit Number Plates]=======================/
        if(vehicleid <= 0 && vehicleid <= 873)
        {
                new calculation = vehicleid += 126;
                format(string, sizeof(string), "%s%s%s %d", PlatePossible[randdr], PlatePossible[randdr], PlatePossible[randdr], calculation);
        }
        if(vehicleid > 873)
        {
                new calculation = vehicleid -= 827; // If you have a vehicle ID of 1965 the calculation will read the three numbers
                format(string, sizeof(string), "%s%s%s %d", PlatePossible[randdr], PlatePossible[randdr], PlatePossible[randdr], calculation);
        }
        //===================================[TRADITIONAL LICENSE PLATE NUMBERS]================/
        /*format(string, sizeof(string), "%s%s%s %d", PlatePossible[randdr], vehicleid); //traditional Example: AVIF [VEHICLE ID]
        SetVehicleNumberPlate(vehicleid, string);*/
	}
	return 1; // Error Line
}
Reply


Messages In This Thread
Compiling Errors - by lwilson - 20.03.2015, 04:23
Re: Compiling Errors - by KayJ - 20.03.2015, 04:31
Re: Compiling Errors - by lwilson - 20.03.2015, 04:45
Re: Compiling Errors - by IzadorO - 20.03.2015, 12:32
Re: Compiling Errors - by fuckingcruse - 20.03.2015, 16:38
Re: Compiling Errors - by JeaSon - 20.03.2015, 16:42
Respuesta: Compiling Errors - by alexus - 20.03.2015, 17:02

Forum Jump:


Users browsing this thread: 2 Guest(s)