2 Vehicle File Errors. Please help! [array index out of bounds]
#1

[color=red][b][u]Status :: Still Need Help !!



In my script I was programming in 0.2.2 Now that there is 0.3 I transfered. Now when I compile I Get Two errors.

Code:
C:\Program Files (x86)\Rockstar Games\GTA San Andreas\SAMP\gamemodes\ZombieLSRP.pwn(2522) : error 032: array index out of bounds (variable "File_VehicleOwner")
C:\Program Files (x86)\Rockstar Games\GTA San Andreas\SAMP\gamemodes\ZombieLSRP.pwn(2523) : error 032: array index out of bounds (variable "File_VehicleOwner")
C:\Program Files (x86)\Rockstar Games\GTA San Andreas\SAMP\gamemodes\ZombieLSRP.pwn(3319) : warning 203: symbol is never used: "AddCandyMachine"
C:\Program Files (x86)\Rockstar Games\GTA San Andreas\SAMP\gamemodes\ZombieLSRP.pwn(3319) : warning 203: symbol is never used: "AddSprunkMachine"
C:\Program Files (x86)\Rockstar Games\GTA San Andreas\SAMP\gamemodes\ZombieLSRP.pwn(3319) : warning 203: symbol is never used: "KillVeh"
Normally, I get the last three warnings, and it compiles fine. What do I need to change to make it compatible with 0.3?

Here Is What I Have For The Script::

Code:
	
  		       new File_VehicleOwner[256];
			File_VehicleOwner = dini_Get(VehicleFile, "Owner");		
if (GetPlayerName(playerid, name, MAX_PLAYER_NAME) == File_VehicleOwner[MAX_PLAYERS]) { IsVehicleOwnerInCar[playerid] = 1; }
else if (GetPlayerName(playerid, name, MAX_PLAYER_NAME) == File_VehicleOwner[MAX_PLAYERS] ) { IsVehicleOwnerInCar[playerid] = 0; }
Thank you!


Note :: Before I updated, I never got those two errors.
Reply
#2

remove OnPlayerPrivmsg and OnPlayerInfoChange, as they are removed in 0.3a, as for the redefinition, delete that line from your MAIN GM (MAX_PICKUPS)
Reply
#3

I don't have MAX_PICKUPS anywhere on the main GM. What should I do? Also, I still need help with the two errors someone. Thanks!
Reply
#4

Then look in that include, most likely 2 times defined.
Reply
#5

EDIT::: I figured out the warning. I had to remove it from a_samp. It had the definition.
Anyway, so what about the two errors. And thanks for helping!
Reply
#6

Simply, remove #define MAX_PICKUPS 400
Reply
#7

I figured out the warning. I had to remove it from a_samp. It had the definition.
Anyway, so what about the two errors. And thanks for helping!

The two Errors are the main problems.
Reply
#8

Sorry for double post, but I can't seem to figure it out.

Someone, please help?
Reply
#9

im guessing its these

Code:
if (GetPlayerName(playerid, name, MAX_PLAYER_NAME) == File_VehicleOwner[MAX_PLAYERS]) { IsVehicleOwnerInCar[playerid] = 1; }
else if (GetPlayerName(playerid, name, MAX_PLAYER_NAME) == File_VehicleOwner[MAX_PLAYERS] ) { IsVehicleOwnerInCar[playerid] = 0; }
== File_VehicleOwner[MAX_PLAYERS] is out of bounds

there MAX_PLAYERS should be playerid at a guess
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)