#1

[debug] #2 0014a33c in public Store_OnPlayerDisconnect (12, 0)

PHP код:
public OnPlayerDisconnect(playeridreason)
{
    if(
PFlag(Robbing))
    {
        new 
pData[playerid][RobberyStore];
        
RemoveSafeMoney(Store[i][StoreSafe]);
        
CloseSafe(Store[i][StoreSafe]);
        
Store[i][StoreStatus] = STORE_HAS_ROBBED;
        
StopRobbery(playerid);
        switch(
random(4))
        {
            case 
0:
                
ApplyActorAnimation(Store[i][StoreActor], "PED""roadcross"4.111110);
            case 
1:
                
ApplyActorAnimation(Store[i][StoreActor], "PED""roadcross_female"4.111110);
            case 
2:
                
ApplyActorAnimation(Store[i][StoreActor], "PED","roadcross_gang"4.111110);
            case 
3:
                
ApplyActorAnimation(Store[i][StoreActor], "PED","roadcross_old"4.111110);
        }
    }
    
#if defined Store_OnPlayerDisconnect
        
return Store_OnPlayerDisconnect(playeridreason);
    
#else
        
return 1;
    
#endif
}
#if defined _ALS_OnPlayerDisconnect
    #undef OnPlayerDisconnect
#else
    #define _ALS_OnPlayerDisconnect
#endif
 
#define OnPlayerDisconnect Store_OnPlayerDisconnect
#if defined Store_OnPlayerDisconnect
    
forward Store_OnPlayerDisconnect(playeridreason);
#endif 
Reply
#2

Can you provide the complete error/debug message you're getting? Maybe also provide the Store_OnPlayerDisconnect function so we can check that for issues.
Reply
#3

[17:02:28] [debug] Run time error 4: "Array index out of bounds"
[17:02:28] [debug] Accessing element at index 500 past array upper
[17:02:28] [debug] AMX backtrace:
[17:02:28] [debug] #0 001485c0 in ?? (500) from cnr.amx
[17:02:28] [debug] #1 00148540 in ?? (12) from cnr.amx
[17:02:28] [debug] #2 0014a33c in public Store_OnPlayerDisconnect (12, 0) from cnr.amx
[17:02:28] [debug] #3 0013d0b4 in public Hs_OnPlayerDisconnect (12, 0) from cnr.amx
[17:02:28] [debug] #4 0012e174 in public Jl_OnPlayerDisconnect (12, 0) from cnr.amx
[17:02:28] [debug] #5 0011f4d8 in public Acc_OnPlayerDisconnect (12, 0) from cnr.amx
[17:02:28] [debug] #6 0011abc0 in public Spec_OnPlayerDisconnect (12, 0) from cnr.amx
[17:02:28] [debug] #7 000636d4 in public ppb_OnPlayerDisconnect (12, 0) from cnr.amx
[17:02:28] [debug] #8 0005c100 in public ATT_OnPlayerDisconnect (12, 0) from cnr.amx
[17:02:28] [debug] #9 00050214 in ?? (12, 0) from cnr.amx
[17:02:28] [debug] #10 0002b048 in public Itter_OnPlayerDisconnect (12, 0) from cnr.amx
[17:02:28] [debug] #11 00024d10 in public SSCANF_OnPlayerDisconnect (12, 0) from cnr.amx
[17:02:28] [debug] #12 000017e4 in public OnPlayerDisconnect (12, 0) from cnr.amx
Reply
#4

This function is not the exact cause. There are two more entries above it. Keep in mind that a stack-trace is in reverse order: the first thing that is listed is the last thing that happened. Entry #1 is a function that accepts one parameter which is likely the playerid. So that points to the function StopRobbery(). And in that function in turn there is a function that accepts one parameter and to which you passed "500". It is that last function that is the culprit.
Reply
#5

Quote:
Originally Posted by Vince
Посмотреть сообщение
This function is not the exact cause. There are two more entries above it. Keep in mind that a stack-trace is in reverse order: the first thing that is listed is the last thing that happened. Entry #1 is a function that accepts one parameter which is likely the playerid. So that points to the function StopRobbery(). And in that function in turn there is a function that accepts one parameter and to which you passed "500". It is that last function that is the culprit.
got it thank you sir.
Reply
#6

[16:36:16] [debug] Run time error 4: "Array index out of bounds"
[16:36:16] [debug] Accessing element at negative index -22
[16:36:16] [debug] AMX backtrace:
[16:36:16] [debug] #0 00044898 in public OnPlayerWeaponShot (18, 0, 1, 13, 1047715840, 1053569024, 1046319104) from cnr.amx
PHP код:
public OnPlayerWeaponShot(playeridweaponidhittypehitidFloat:fXFloat:fYFloat:fZ)
{
    if(
hittype == BULLET_HIT_TYPE_PLAYER)
    {
        if(!
IsPlayerConnected(hitid))
            return 
1;
        if(
IsPlayerLeo(playerid))
        {
            if(!
pData[playerid][Event])
            {
                if(
IsPlayerLeo(hitid))
                    return 
GameTextForPlayer(playerid"Don't shoot your teammates"30003), 0;
                if(!
GetPlayerWantedLevel(hitid))
                    return 
GameTextForPlayer(playerid"Don't shoot innocent player"30003), 0;
            }
        }
    }
    if(
hittype == BULLET_HIT_TYPE_VEHICLE)
    {
        if(
IsPlayerLeo(playerid))
        {
            foreach(new 
Player)
            {
                if(
IsPlayerInVehicle(ihitid) && != playerid && IsPlayerLeo(i) && !GetPlayerVehicleSeat(i))
                    return 
GameTextForPlayer(playerid"Don't shoot your teammates vehicle"30003), 0;
            }
        }
        else
        {
            foreach(new 
Player)
            {
                if(
IsPlayerInVehicle(ihitid) && != playerid && IsPlayerLeo(i) && !GetPlayerVehicleSeat(i))
                {
                    
pData[playerid][PoliceCarShot]++;
                    if(
pData[playerid][PoliceCarShot] == 5)
                        
UpdatePlayerWantedLevel(playerid6);
                    break;
                }
            }
        }
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)