Getting a couple of errors
Код:
[01:43:31] [debug] Run time error 4: "Array index out of bounds"
[01:43:31] [debug] Attempted to read/write array element at index 65535 in array of size 20
[01:43:31] [debug] AMX backtrace:
[01:43:31] [debug] #0 00020cc8 in public OnPlayerTakeDamage (playerid=0, issuerid=65535, Float:amount=3.30000, weaponid=54, 3) at F:\SAMP\Crimson Roleplay\gamemodes\mg-gm.pwn:1666
This relates to line 1666
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
{
if(ServerData[issuerid][Taser] == 1) //LINE 1666
{
if(ServerData[issuerid][PlayerVehicleID] == 0 && GetPlayerWeapon(issuerid) == 23 && ServerData[playerid][Tased] == 0)
{
new Float:phealth;
GetPlayerHealth(playerid,phealth);
SetPlayerHealth(playerid,phealth+amount);
if(ServerData[issuerid][TaserCooldown] == 0)
{
ApplyAnimation(playerid,"CRACK","crckdeth2",4.0,0,1,1,1,0);
ServerData[playerid][Tased] = gettime() + 5;
ServerData[issuerid][TaserCooldown] = gettime() + 3;
format(String,sizeof(String),"%s was struck by a probe from your taser.",GetName(playerid));
SendClientMessage(issuerid,Light_Green,String);
format(String,sizeof(String),"You were struck by a taser probe and fell to the ground.",GetName(playerid));
SendClientMessage(playerid,Light_Green,String);
}
}
}
Second error
Код:
[01:40:21] [debug] AMX backtrace:
[01:40:21] [debug] #0 0013f23c in public Speedometer (i=0) at F:\SAMP\Crimson Roleplay\gamemodes\mg-gm.pwn:20500
[01:40:21] [debug] Run time error 4: "Array index out of bounds"
[01:40:21] [debug] Attempted to read/write array element at negative index -1
pawn Код:
forward Speedometer(i);
public Speedometer(i)
{
if(GetPlayerVehicleSeat(i) == 0 || GetPlayerVehicleSeat(i) == 1)
{
if(!IsBicycle(ServerData[i][PlayerVehicleID]))
{
format(String,sizeof(String),"Speed: %i mph",GetPlayerSpeed(i));
TextDrawSetString(ServerData[i][sSpeed],String);
SetProgressBarValue(ServerData[i][pSpeed],GetPlayerSpeed(i));
GetVehicleHealth(ServerData[i][PlayerVehicleID],vHP);
format(String,sizeof(String),"Health: %.1f %",vHP/10);
TextDrawSetString(ServerData[i][sHealth],String);
SetProgressBarValue(ServerData[i][pHealth],vHP);
if(Fuel[ServerData[i][PlayerVehicleID]] <= 30) //ERROR LINE 20500
{
format(String,sizeof(String),"Fuel: ~r~%i~w~ L",Fuel[ServerData[i][PlayerVehicleID]]);
SetProgressBarColor(ServerData[i][pFuel],Red);
}
else
{
format(String,sizeof(String),"Fuel: ~w~%i L",Fuel[ServerData[i][PlayerVehicleID]]);
SetProgressBarColor(ServerData[i][pFuel],-205);
}
TextDrawSetString(ServerData[i][sFuel],String);
SetProgressBarValue(ServerData[i][pFuel],Fuel[ServerData[i][PlayerVehicleID]]);
ShowHideSpeedo(i,1);
if(GetPlayerSpeed(i) == 123 && !IsPlane(ServerData[i][PlayerVehicleID]))
{
GetAchievement(i, "Speeder (Drive at 123 mph)");
}
}
}
else
{
ShowHideSpeedo(i,0);
}
if(ServerData[i][Spawned] == 1 && ServerData[i][TDHideShow] == 0)
{
new zone[MAX_ZONE_NAME],zstr[MAX_ZONE_NAME];
GetPlayer2DZone(i, zone, MAX_ZONE_NAME);
format(zstr,sizeof(zstr),"%s", zone);
TextDrawSetString(ServerData[i][Zones], zstr);
TextDrawShowForPlayer(i,ServerData[i][Zones]);
}
if(ServerData[i][TestRunning] == 1)
{
new dis = GetVehicleDistanceToPoint(ServerData[i][TestRunVehicle],ServerData[i][DistanceX],ServerData[i][DistanceY],ServerData[i][DistanceZ]);
if(dis <= 1000.0)format(String,sizeof(String),"~w~Distance: %d m",dis);
if(dis >= 300.0)format(String,sizeof(String),"Distance: ~g~%d ~w~m",dis);
if(dis >= 500.0)format(String,sizeof(String),"Distance: ~y~~y~%d m",dis);
if(dis >= 700.0)format(String,sizeof(String),"Distance: ~y~%d ~w~m",dis);
if(dis >= 900.0)format(String,sizeof(String),"Distance: ~r~%d ~w~m",dis);
if(dis >= 1000.0)
{
format(String,sizeof(String),"~r~1000.0 meters!");
ServerData[i][TestRunning] = 0;
SendClientMessage(i,Red,"You have stolen this vehicle.");
SendClientMessage(i,White,"As a result, the vehicle's cost has been taken from your bank account.");
PlayerData[i][BankBalance] = PlayerData[i][BankBalance] - DealerInfo[ServerData[i][PlayerVehicleID]][VehPrice];
TextDrawDestroyEx(ServerData[i][TestRun]);
DestroyVehicle(ServerData[i][TestRunVehicle]);ServerData[i][TestRunVehicle] = -1;
}
TextDrawSetString(ServerData[i][TestRun], String);
}
if(PlayerData[i][LastHouseID] != 0)
{
SetPlayerHouseExit(i);
}
if(ServerData[i][IsLocatingVehicle] == 1)LocateVehicle(i,ServerData[i][LocateSlot]);
if(PlayerData[i][Locating] == 1)LocatePlayer(i,ServerData[i][locatingplayerid]);
}
All leads down to this happening again -
Код:
[01:45:58] [sampgdk:error] Too many callback arguments (at most 32 allowed)
[01:45:58] [debug] Run time error 8: "Heap underflow"
[01:45:58] [debug] Heap pointer (HEA) is 0x1, heap bottom (HLW) is 0x463804
I am almost sure I have mismatch of plugins from the versions I used to use but I am not 100% sure how that could have caused the issue? I appreciate your help
EDIT: Think this may well be my issue, when compiling the script I get
Код:
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
Header size: 18364 bytes
Code size: 1866520 bytes
Data size: 4601856 bytes
Stack/heap size: 16384 bytes; estimated max. usage=4038 cells (16152 bytes)
Total requirements: 6503124 bytes