Crashdetect, AMX backtrace? What's this
#1

I keep getting this in my console, I have no clue what it is. My OnPlayerStateChance is LONG so if you need any bit of code from it, just ask.
Reply
#2

Compile your script with debug flag -d3 to get exact line.
Reply
#3

You cut off the most important part: the runtime error number. Post the entire trace. Also don't make screenshots of text; copy-paste works fine.
Reply
#4

The root cause is from your AntiCheat function, ELC_AC.

Btw, post your entire server log or post something more useful, linues just before the Amx backtrace are important.
Reply
#5

Quote:

[debug] Run time error 4: "Array index out of bounds"
[debug] Attempted to read/write array element at index 3 in array of size 3
[debug] AMX backtrace:
[debug] #0 00062ee8 in public ELC_AC_OnPlayerStateChange (0, 2, 1) from PRP.amx
[debug] #1 native CallLocalFunction () from samp-server.exe
[debug] #2 00019528 in public OnPlayerStateChange (0, 2, 1) from PRP.amx
[debug] Run time error 4: "Array index out of bounds"
[debug] Attempted to read/write array element at index 3 in array of size 3
[debug] AMX backtrace:
[debug] #0 00062ee8 in public ELC_AC_OnPlayerStateChange (0, 2, 1) from PRP.amx
[debug] #1 native CallLocalFunction () from samp-server.exe
[debug] #2 00019528 in public OnPlayerStateChange (0, 2, 1) from PRP.amx

This is the full error log of [debug], I can't figure out how to compile with the -d3 flag. Whenever I set it in the pawn.cfg or parameter it doesn't work like it should.
Reply
#6

Now I just got this:
Quote:

[debug] Run time error 4: "Array index out of bounds"
[debug] Attempted to read/write array element at index 3 in array of size 3
[debug] AMX backtrace:
[debug] #0 0007d710 in public ELC_AC_OnPlayerStateChange (playerid=0, newstate=2, oldstate=1) at C:\Users\Saint\Desktop\PRP\gamemodes\PRP.pwn:4775
[debug] #1 native CallLocalFunction () from samp-server.exe
[debug] #2 0001fa24 in public OnPlayerStateChange (playerid=0, newstate=2, oldstate=1) at C:\Users\Saint\Desktop\PRP\pawno\include\ELC_AC_BA SE.inc:1079

Reply
#7

showing that piece of code wont hurt you.
Reply
#8

On my gamemode:
PHP код:
public OnPlayerStateChange(playeridnewstateoldstate)
{
    new 
vehicleid GetPlayerVehicleID(playerid);
    if(
newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)// If the player's state changes to a vehicle state we'll have to spec the vehicle.
    
{
        if(
IsBeingSpeced[playerid] == 1)//If the player being spectated, enters a vehicle, then let the spectator spectate the vehicle.
        
{
            foreach(
Player,i)
            {
                if(
spectatorid[i] == playerid)
                {
                    
PlayerSpectateVehicle(iGetPlayerVehicleID(playerid));// Letting the spectator, spectate the vehicle of the player being spectated (I hope you understand this xD)
                
}
            }
        }
    }
    if(
newstate == PLAYER_STATE_ONFOOT)
    {
        if(
IsBeingSpeced[playerid] == 1)//If the player being spectated, exists a vehicle, then let the spectator spectate the player.
        
{
            foreach(
Player,i)
            {
                if(
spectatorid[i] == playerid)
                {
                    
PlayerSpectatePlayer(iplayerid);// Letting the spectator, spectate the player who exited the vehicle.
                
}
            }
        }
    }
    if(
IsPlayerInAnyVehicle(playerid) && !IsBicycle(GetPlayerVehicleID(playerid)))
    {
        
//TextDrawShowForPlayer(playerid, SpeedoBox);
        
TextDrawShowForPlayer(playeridSpeedoText[playerid]);
        if(
VehicleSecurity[vehicleid] == 1)
        {
            
ToggleAlarm(vehicleidVEHICLE_PARAMS_ON);
            
SetTimerEx("StopAlarm"ALARM_TIMEfalse"d"vehicleid);
        }
    }
    else
    {
        
//TextDrawHideForPlayer(playerid, SpeedoBox);
        
TextDrawHideForPlayer(playeridSpeedoText[playerid]);
    }
    if(
newstate == PLAYER_STATE_PASSENGER)
    {
        if(
GetPlayerWeapon(playerid) == 24 || GetPlayerWeapon(playerid) == 23 || GetPlayerWeapon(playerid) == 26 || GetPlayerWeapon(playerid) == 34)
        {
            
SetPlayerArmedWeapon(playerid0);
        }
    }
    if(
newstate == PLAYER_STATE_DRIVER)
    {
         
SetPlayerArmedWeapon(playerid0);
    }
    if(
newstate == PLAYER_STATE_DRIVER)
    {
        new 
id GetVehicleID(vehicleid);
        if(
IsValidVehicle(id))
        {
            if(
VehicleCreated[id] == VEHICLE_DEALERSHIP)
            {
                
SetPVarInt(playerid"DialogValue1"id);
                
ShowDialog(playeridDIALOG_VEHICLE_BUY);
                return 
1;
            }
        }
        if(
IsBicycle(vehicleid))
        {
            
ToggleEngine(vehicleidVEHICLE_PARAMS_ON);
        }
        if(
Fuel[vehicleid] <= 0)
        {
            
ToggleEngine(vehicleidVEHICLE_PARAMS_OFF);
        }
    }
    if(
newstate == PLAYER_STATE_DRIVER)
    {
        for(new 
i=0i<4i++)
        {
            if(
IsPlayerInVehicle(playeridDMVcar[i]))
            {
                  if(
PlayerInfo[playerid][pDriverLicense] == 0)
                  {
                    if(
TakingDriverLicense[playerid] == true)
                    {
                        if(
DMVcp[playerid] == 0)
                        {
                            
SetPlayerCheckpoint(playerid2045.7646,-1930.0442,13.04103.0);
                            
DMVcp[playerid] = 1;
                            
SCM(playeridCOLOR_WHITE"* Drive through all of the checkpoints slowly to pass the test. Check your mini-map if you can't see the checkpoints.");
                            
SCM(playeridCOLOR_WHITE"* If you leave the vehicle it will respawn.");
                        }
                        else
                        {
                            
LeftDMVCar[playerid] = 0;
                        }
                    }
                    else
                    {
                        
RemovePlayerFromVehicle(playerid);
                        
SCM(playeridCOLOR_LIGHTRED"You are not taking a driver-license test.");
                    }
                }
                else
                {
                    
RemovePlayerFromVehicle(playerid);
                    
SCM(playeridCOLOR_LIGHTRED"You already have a drivers license.");
                }
            }
        }
    }
       if(
newstate == PLAYER_STATE_DRIVER)
    {
        for(new 
i=0i<6i++)
        {
            if(
IsPlayerInVehicle(playeridJunkCar[i]))
            {
                if(
WorkingJunk[playerid] == true)
                {
                    
SetPlayerCheckpoint(playerid, -1843.1804,-1647.9569,21.41823.0);
                    
JunkCP[playerid] = 1;
                       
SCM(playeridCOLOR_WHITE"Drive through all of the checkpoints to complete your shift.");
                       
SCM(playeridCOLOR_WHITE"If you leave the vehicle the job will restart and the vehicle will respawn.");
                       
SCM(playeridCOLOR_WHITE"Try not to damage the vehicle.");
                }
                else
                {
                    
RemovePlayerFromVehicle(playerid);
                    
SCM(playeridCOLOR_LIGHTRED"You are not working.");
                }
            }
            if(
IsPlayerInVehicle(playeridTrashCar[i]))
            {
                if(
WorkingTrash[playerid] == true)
                {
                    
SetPlayerCheckpoint(playerid2319.2988,-1934.7290,14.00853.0);
                    
TrashCP[playerid] = 1;
                       
SCM(playeridCOLOR_WHITE"Drive through all of the checkpoints to complete your shift.");
                       
SCM(playeridCOLOR_WHITE"If you leave the vehicle the job will restart and the vehicle will respawn.");
                       
SCM(playeridCOLOR_WHITE"Try not to damage the vehicle.");
                }
                else
                {
                    
RemovePlayerFromVehicle(playerid);
                    
SCM(playeridCOLOR_LIGHTRED"You are not working.");
                }
            }
            if(
IsPlayerInVehicle(playeridPizzaBike[i]))
            {
                if(
WorkingPizza[playerid] == true)
                {
                    new 
rand random(sizeof(PizzaCP));
                    
SetPlayerCheckpoint(playerid,PizzaCP[rand][0],PizzaCP[rand][1],PizzaCP[rand][2],PizzaCP[rand][3]);
                    
EndPizzaCP[playerid] = 1;
                       
SCM(playeridCOLOR_WHITE"Begin delivering pizzas to complete your shift.");
                       
SCM(playeridCOLOR_WHITE"If you leave the bike the job will restart and the bike will respawn.");
                       
SCM(playeridCOLOR_WHITE"Try not to damage the bike.");
                }
                else
                {
                    
RemovePlayerFromVehicle(playerid);
                    
SCM(playeridCOLOR_LIGHTRED"You are not working.");
                }
            }
           }
       }
    if(
newstate == PLAYER_STATE_DRIVER)
    {
           if(
GetVehicleModel(GetPlayerVehicleID(playerid)) == 487 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 488 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 497 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 513 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 512 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 511 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 519 ||
           
GetVehicleModel(GetPlayerVehicleID(playerid)) == 520 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 548 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 553 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 563 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 577 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 592 ||
           
GetVehicleModel(GetPlayerVehicleID(playerid)) == 593 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 417 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 425 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 476 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 469)
        {
            
GivePlayerWeapon(playerid461);
            
GivePlayerWeapon(playerid460);
        }
    }
    if(
newstate == PLAYER_STATE_DRIVER)
    {
        for(new 
i=0i<MAX_LUMBERCARSi++)
        {
            if(
IsPlayerInVehicle(playeridLumberCar[i]))
            {
                if(
WorkingLumber[playerid] == true)
                {
                    if(
LumberCP[playerid] == 0)
                    {
                        
SetPlayerCheckpoint(playerid, -2219.23193, -2165.1337941.661511.0);
                        
LumberCP[playerid] = 1;
                           
SCM(playeridCOLOR_WHITE"Drive to the checkpoint.");
                    }
                }
                else
                {
                    
RemovePlayerFromVehicle(playerid);
                    
SCM(playeridCOLOR_LIGHTRED"You are not working.");
                }
            }
           }
       }
    if(
newstate == PLAYER_STATE_DRIVER)
    {
        for(new 
i=0i<MAX_COPCARSi++)
        {
            if(
IsPlayerInVehicle(playeridPoliceCar[i]))
            {
                  if(
PlayerInfo[playerid][pFaction] != 2)
                  {
                    
RemovePlayerFromVehicle(playerid);
                }
            }
        }
    }
    if(
newstate == PLAYER_STATE_DRIVER)
    {
        for(new 
i=0i<MAX_GOVCARSi++)
        {
            if(
IsPlayerInVehicle(playeridGovCar[i]))
            {
                  if(
PlayerInfo[playerid][pFaction] != 1)
                  {
                    
RemovePlayerFromVehicle(playerid);
                }
            }
        }
    }
    if(
newstate == PLAYER_STATE_DRIVER)// If the player's state changes to a vehicle state we'll have to spec the vehicle.
    
{
        if(
PlayerInfo[playerid][pDriverLicense] == 0)
        {
            if(!
IsBicycle(vehicleid))
            {
                
SCM(playeridCOLOR_LIGHTRED"You do not have a driving license yet. Pass a driving test to obtain one.");
                return 
1;
            }
        }
    }
    if(
newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)// If the player's state changes to a vehicle state we'll have to spec the vehicle.
    
{
        if(
IsBeingSpeced[playerid] == 1)//If the player being spectated, enters a vehicle, then let the spectator spectate the vehicle.
        
{
            for(new 
0MAX_PLAYERSi++) if(IsPlayerConnected(i))
            {
                if(
spectatorid[i] == playerid)
                {
                    
PlayerSpectateVehicle(iGetPlayerVehicleID(playerid));// Letting the spectator, spectate the vehicle of the player being spectated (I hope you understand this xD)
                
}
            }
        }
    }
    if(
newstate == PLAYER_STATE_ONFOOT)
    {
        if(
IsBeingSpeced[playerid] == 1)//If the player being spectated, exists a vehicle, then let the spectator spectate the player.
        
{
            for(new 
0MAX_PLAYERSi++) if(IsPlayerConnected(i))
            {
                if(
spectatorid[i] == playerid)
                {
                    
PlayerSpectatePlayer(iplayerid);// Letting the spectator, spectate the player who exited the vehicle.
                
}
            }
        }
    }
    return 
1;

On the ELC_AC_BASE.inc :
PHP код:
public OnPlayerStateChange(playeridnewstateoldstate)
{
    if(
newstate == PLAYER_STATE_DRIVER)
    {
        if(
CheatPlayerInfo[playerid][elc_AntiVehicleTelportHack]>=1&&CheatPlayerInfo[playerid][elc_PlayerEnterVeh]!=GetPlayerVehicleID(playerid))
        {
            
CheatPlayerInfo[playerid][elc_PlayerEnterTime] = GetTickCount();
            new 
elc_vehicleid=GetPlayerVehicleID(playerid);
            if(
elc_vehicleid!=0)
            {
                
CheatPlayerInfo[playerid][elc_PlayerEnterVeh]=elc_vehicleid;
                
CheatVehicleInfo[elc_vehicleid][elc_vStatut]=1;
            }
        }
    }
    else if(
oldstate == PLAYER_STATE_DRIVER)
    {
//220 def
        
if(CheatPlayerInfo[playerid][elc_PlayerEnterTime]!=0&&(GetTickCount()-CheatPlayerInfo[playerid][elc_PlayerEnterTime]) < 220)//player entered and exited vehicle faster than 220 ms.
        
{
            
//if(CheatPlayerInfo[playerid][elc_PlayerEnterVeh]!=0)SetVehiclePos(CheatPlayerInfo[playerid][elc_PlayerEnterVeh], CheatVehicleInfo[CheatPlayerInfo[playerid][elc_PlayerEnterVeh]][elc_vX], CheatVehicleInfo[CheatPlayerInfo[playerid][elc_PlayerEnterVeh]][elc_vY], CheatVehicleInfo[CheatPlayerInfo[playerid][elc_PlayerEnterVeh]][elc_vZ]);
            
ELC_SendCheatWarning(playerid,9);
        }
        
CheatPlayerInfo[playerid][elc_PlayerEnterTime]=0;
    }
    
#if defined INCLUDE_BASE_MODE
    
return CallLocalFunction("ELC_AC_OnPlayerStateChange""ddd",playeridnewstateoldstate);
    
#else
    
return 1;
    
#endif

Reply
#9

bump
Reply
#10

Some array isnt big enough. Its the array that is being accessed in line 4775 in PRP.pwn
Thats what the error says, its not hard to know that if you take the time to read error messages.


Btw: bumping after 4 hours is rude. You arent the only person with a question, so why do you think your question is more important than others?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)