Need help regarding a error
#1

I'm having this error, I'm not sure how to fix it either,can anyone help me out ? & explain .
That would be great .

error 017: undefined symbol "VehicleSpawned"
error 001: expected token: ";", but found "]"
Код:
	if(dialogid == VSTORAGE && response) {
		if(PlayerVehicleInfo[playerid][listitem][pvSpawned])
		{
			new
				Float: vehiclehealth;

			GetVehicleHealth(PlayerVehicleInfo[playerid][listitem][pvId], vehiclehealth);

			if(vehiclehealth < 750)
			{
				SendClientMessage(playerid, COLOR_WHITE, "This vehicle is too damaged to be stored.");
			}
			else {
				--PlayerCars;
				VehicleSpawned[playerid]--;				PlayerVehicleInfo[playerid][listitem][pvSpawned] = 0;
				DestroyVehicle(PlayerVehicleInfo[playerid][listitem][pvId]);
				VehicleRadioStation[PlayerVehicleInfo[playerid][listitem][pvId]] = 0;
				PlayerVehicleInfo[playerid][listitem][pvId] = INVALID_PLAYER_VEHICLE_ID;

				new vstring[128];
				format(vstring, sizeof(vstring), "You have stored your %s. The vehicle has been despawned.", VehicleName[PlayerVehicleInfo[playerid][listitem][pvModelId] - 400]);
			...
.
.
.
.so on..
Reply
#2

Quote:
Originally Posted by ******
Посмотреть сообщение
That means you're using a variable that doesn't exist.
Oh, But i'm not that good in scripting, still learning - How can i fix it ?, i mean add that missing variable ?..
Reply
#3

Quote:
Originally Posted by Desi_Dude
Посмотреть сообщение
Oh, But i'm not that good in scripting, still learning - How can i fix it ?, i mean add that missing variable ?..
You need to define VehicleSpawned
Reply
#4

Add:
pawn Код:
new VehicleSpawned[MAX_PLAYERS];
to the top of your script.
Reply
#5

Quote:
Originally Posted by BenzoAMG
Посмотреть сообщение
Add:
pawn Код:
new VehicleSpawned[MAX_PLAYERS];
to the top of your script.
Thank you alot , i wasn't sure if i had to add
Код:
new VehicleSpawned;
or with [MAX_PLAYERS];-so could you explain me why do we have to add [MAX_PLAYERS]?

EDIT:I'm getting another error.
Код:
error 029: invalid expression, assumed zero
warning 215: expression has no effect
error 001: expected token: ";", but found "]"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
Whole code here..
Код:
	if(dialogid == VSTORAGE && response) {
		if(PlayerVehicleInfo[playerid][listitem][pvSpawned])
		{
			new
				Float: vehiclehealth;

			GetVehicleHealth(PlayerVehicleInfo[playerid][listitem][pvId], vehiclehealth);

			if(vehiclehealth < 750)
			{
				SendClientMessage(playerid, COLOR_WHITE, "This vehicle is too damaged to be stored.");
			}
			else {
				--PlayerCars;
				VehicleSpawned[playerid]--;
                                           PlayerVehicleInfo[playerid][listitem][pvSpawned] = 0;
				DestroyVehicle(PlayerVehicleInfo[playerid][listitem][pvId]);
				VehicleRadioStation[PlayerVehicleInfo[playerid][listitem][pvId]] = 0;
				PlayerVehicleInfo[playerid][listitem][pvId] = INVALID_PLAYER_VEHICLE_ID;

				new vstring[128];
				format(vstring, sizeof(vstring), "You have stored your %s. The vehicle has been despawned.", VehicleName[PlayerVehicleInfo[playerid][listitem][pvModelId] - 400]);
				SendClientMessage(playerid, COLOR_WHITE, vstring);
			}
		}
		else if(PlayerVehicleInfo[playerid][listitem][pvModelId] == 0) {
			SendClientMessage(playerid, COLOR_WHITE, "You can't spawn an non-existant vehicle.");
		}
		else if(PlayerVehicleInfo[playerid][listitem][pvImpounded]) {
			SendClientMessage(playerid, COLOR_WHITE, "You can't spawn an impounded vehicle. If you wish to reclaim it, do so at the DMV in Dillimore.");
		}
		else if(PlayerVehicleInfo[playerid][listitem][pvDisabled] == 1) {
			SendClientMessage(playerid, COLOR_WHITE, "You can't spawn a disabled vehicle. It is disabled due to your Donator level (vehicle restrictions).");
		}
		else if(PlayerVehicleInfo[playerid][listitem][pvSpawned] == 0) {
			if(PlayerInfo[playerid][pDonateRank] == 0 && VehicleSpawned[playerid] >= 3) {
				SendClientMessage(playerid, COLOR_GREY, "As non-VIP you can only have 3 vehicle spawned. You must store a vehicle in order to spawn another one.");
			}
			else if(PlayerInfo[playerid][pDonateRank] == 1 && VehicleSpawned[playerid] >= 4) {
				SendClientMessage(playerid, COLOR_GREY, "As Bronze VIP you can only have 4 vehicles spawned. You must store a vehicle in order to spawn another one.");
			}
			else if(PlayerInfo[playerid][pDonateRank] == 2 && VehicleSpawned[playerid] >= 5) {
				SendClientMessage(playerid, COLOR_GREY, "As Silver VIP you can only have 5 vehicles spawned. You must store a vehicle in order to spawn another one.");
			}
			else if(PlayerInfo[playerid][pDonateRank] == 3 && VehicleSpawned[playerid] >= 6) {
				SendClientMessage(playerid, COLOR_GREY, "As Gold VIP you can only have 6 vehicles spawned. You must store a vehicle in order to spawn another one.");
			}
			else if(PlayerInfo[playerid][pDonateRank] == 4 && VehicleSpawned[playerid] >= 10) {
				SendClientMessage(playerid, COLOR_GREY, "As Platinum VIP you can only have 10 vehicles spawned. You must store a vehicle in order to spawn another one.");
			}
			else if(PlayerInfo[playerid][pDonateRank] == 5 && VehicleSpawned[playerid] >= 10){
				SendClientMessage(playerid, COLOR_GREY, "As VIP Moderator you can only have 10 vehicles spawned. You must store a vehicle in order to spawn another one.");
			}
			else if(!(0 <= PlayerInfo[playerid][pDonateRank] <= 6)) {
				SendClientMessage(playerid, COLOR_GREY, "You have an invalid VIP level.");
			}
			else {
				++PlayerCars;
				VehicleSpawned[playerid]++;
				PlayerVehicleInfo[playerid][listitem][pvSpawned] = 1;
				PlayerVehicleInfo[playerid][listitem][pvId] = CreateVehicle(PlayerVehicleInfo[playerid][listitem][pvModelId], PlayerVehicleInfo[playerid][listitem][pvPosX], PlayerVehicleInfo[playerid][listitem][pvPosY], PlayerVehicleInfo[playerid][listitem][pvPosZ], PlayerVehicleInfo[playerid][listitem][pvPosAngle],PlayerVehicleInfo[playerid][listitem][pvColor1], PlayerVehicleInfo[playerid][listitem][pvColor2], -1);
				//VehicleFuel[PlayerVehicleInfo[playerid][listitem][pvId]] = PlayerVehicleInfo[playerid][listitem][pvFuel];
				if(PlayerVehicleInfo[playerid][listitem][pvLocked] == 1) LockPlayerVehicle(playerid, PlayerVehicleInfo[playerid][listitem][pvId], PlayerVehicleInfo[playerid][listitem][pvLock]);

				if(strlen(PlayerVehicleInfo[playerid][listitem][pvNumberPlate]) > 0)
					SetVehicleNumberPlate(PlayerVehicleInfo[playerid][listitem][pvId], PlayerVehicleInfo[playerid][listitem][pvNumberPlate]);

				LoadPlayerVehicleMods(playerid, listitem);

				new vstring[128];
				format(vstring, sizeof(vstring), "You have taken your %s out of storage. The vehicle has been spawned at the last parking location.", VehicleName[PlayerVehicleInfo[playerid][listitem][pvModelId] - 400]);
				SendClientMessage(playerid, COLOR_WHITE, vstring);
			}
		}
		else SendClientMessage(playerid, COLOR_WHITE, "You can't spawn a non-existent vehicle.");
	}
Reply
#6

Bump..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)