problem faction hitman
#1

Hey I put some new cars in hitman were originally hitman I've put 3 and gives me an error when compiling
Код:
	hitmancar[1] = AddStaticVehicleEx(402,1072.6940,-294.4568,73.8174,184.0207,0,0, 60000);//BUFFALO
	hitmancar[2] = AddStaticVehicleEx(560,1056.7974,-296.0228,73.6476,220.6447,0,0, 60000);//SULTAN
	hitmancar[3] = AddStaticVehicleEx(402,1066.8027,-294.7601,73.7560,180.5475,0,0, 60000);//BUFFALO
	hitmancar[4] = AddStaticVehicleEx(469,1014.9276,-340.1649,74.0039,268.3130,1,3, 60000); //SPARROW
	hitmancar[5] = AddStaticVehicleEx(521,1085.8807,-290.4791,73.5638,138.1973,0,0,60000); //FCR-900
	hitmancar[6] = AddStaticVehicleEx(521,1059.5479,-290.2026,73.5641,202.6040,0,0,60000); //FCR-900
	hitmancar[7] = AddStaticVehicleEx(560,1087.6539,-295.5521,73.6510,136.4514,0,0,60000); //SULTAN
	hitmancar[8] = AddStaticVehicleEx(487,1042.5630,-352.4952,74.1504,1.1824,0,0,60000); //MAVERICK
	hitmancar[9] = AddStaticVehicleEx(469,1015.2458,-332.7486,74.0039,266.4392,1,3, 60000); //SPARROW
	hitmancar[10] = AddStaticVehicleEx(469,1015.1457,-325.4256,74.0042,271.3375,1,3, 60000); //SPARROW
	hitmancar[11] = AddStaticVehicleEx(469,1032.4514,-308.5603,74.0229,181.5628,1,3, 60000); //SPARROW
	hitmancar[12] = AddStaticVehicleEx(402,1078.1270,-294.4131,73.8107,178.4071,0,0, 60000); //BUFFALO
hitmancar 10 11 12 is added for me

tis is the error

Код:
C:\Users\Alex\Desktop\server\gamemodes\sa-zone.pwn(15526) : error 032: array index out of bounds (variable "hitmancar")
C:\Users\Alex\Desktop\server\gamemodes\sa-zone.pwn(15527) : error 032: array index out of bounds (variable "hitmancar")
C:\Users\Alex\Desktop\server\gamemodes\sa-zone.pwn(15528) : error 032: array index out of bounds (variable "hitmancar")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
sorry for my bad english
Reply
#2

array index out of bounds

that happens if you do something like this:
pawn Код:
new charStr[10];
charStr[5] = 'a';//valid
charStr[11] = 'b';//invalid, it's not within the address-space you've declared ([10 * 4 bytes])
make sure that hitmancar has 12 "slots"
and also, we start with 0 when it comes to array indexes, not 1

example:

pawn Код:
hitmancar[0] = AddStaticVehicleEx(402,1072.6940,-294.4568,73.8174,184.0207,0,0, 60000);//BUFFALO
    hitmancar[1] = AddStaticVehicleEx(560,1056.7974,-296.0228,73.6476,220.6447,0,0, 60000);//SULTAN
    hitmancar[2] = AddStaticVehicleEx(402,1066.8027,-294.7601,73.7560,180.5475,0,0, 60000);//BUFFALO
//and so on until 11
so it should look like this
Код:
new hitmancar[12];

	hitmancar[0] = AddStaticVehicleEx(402,1072.6940,-294.4568,73.8174,184.0207,0,0, 60000);//BUFFALO
	hitmancar[1] = AddStaticVehicleEx(560,1056.7974,-296.0228,73.6476,220.6447,0,0, 60000);//SULTAN
	hitmancar[2] = AddStaticVehicleEx(402,1066.8027,-294.7601,73.7560,180.5475,0,0, 60000);//BUFFALO
	hitmancar[3] = AddStaticVehicleEx(469,1014.9276,-340.1649,74.0039,268.3130,1,3, 60000); //SPARROW
	hitmancar[4] = AddStaticVehicleEx(521,1085.8807,-290.4791,73.5638,138.1973,0,0,60000); //FCR-900
	hitmancar[5] = AddStaticVehicleEx(521,1059.5479,-290.2026,73.5641,202.6040,0,0,60000); //FCR-900
	hitmancar[6] = AddStaticVehicleEx(560,1087.6539,-295.5521,73.6510,136.4514,0,0,60000); //SULTAN
	hitmancar[7] = AddStaticVehicleEx(487,1042.5630,-352.4952,74.1504,1.1824,0,0,60000); //MAVERICK
	hitmancar[8] = AddStaticVehicleEx(469,1015.2458,-332.7486,74.0039,266.4392,1,3, 60000); //SPARROW
	hitmancar[9] = AddStaticVehicleEx(469,1015.1457,-325.4256,74.0042,271.3375,1,3, 60000); //SPARROW
	hitmancar[10] = AddStaticVehicleEx(469,1032.4514,-308.5603,74.0229,181.5628,1,3, 60000); //SPARROW
	hitmancar[11] = AddStaticVehicleEx(402,1078.1270,-294.4131,73.8107,178.4071,0,0, 60000); //BUFFALO
Reply
#3

sorry man i don't find this lines on my gm
Reply
#4

Quote:
Originally Posted by oFFiCiaLBr
Посмотреть сообщение
sorry man i don't find this lines on my gm
it must be there somewhere.
because if it would not be there, the compiler wouldn't say such a thing as its out of bounds somewhere.
it would clearly say that you are using a variable which hasn't been created before.

so just hit ctrl + f and search for hitmancar until you've found it
Reply
#5

thx man the line it was
Quote:

new hitmancar[13];

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)