RemovePlayerWeaponsEx [DEBUG] Spam
#1

Код:
[13:39:19] [debug] Run time error 4: "Array index out of bounds"
[13:39:19] [debug] Accessing element at index 50 past array upper bound 43
[13:39:19] [debug] AMX backtrace:
[13:39:19] [debug] #0 002831ec in public RemovePlayerWeaponEx (playerid=2, weaponid=50) at CSRPbeta.pwn:51451
[13:39:19] [debug] #1 00294730 in public OnPlayerUpdate (playerid=2) at CSRPbeta.pwn:53121
[13:39:19] [debug] Run time error 4: "Array index out of bounds"
[13:39:19] [debug] Accessing element at index 50 past array upper bound 43
[13:39:19] [debug] AMX backtrace:
[13:39:19] [debug] #0 002831ec in public RemovePlayerWeaponEx (playerid=2, weaponid=50) at CSRPbeta.pwn:51451
[13:39:19] [debug] #1 00294730 in public OnPlayerUpdate (playerid=2) at CSRPbeta.pwn:53121
[13:39:19] [debug] Run time error 4: "Array index out of bounds"
[13:39:19] [debug] Accessing element at index 50 past array upper bound 43
[13:39:19] [debug] AMX backtrace:
[13:39:19] [debug] #0 002831ec in public RemovePlayerWeaponEx (playerid=2, weaponid=50) at CSRPbeta.pwn:51451
[13:39:19] [debug] #1 00294730 in public OnPlayerUpdate (playerid=2) at CSRPbeta.pwn:53121
[13:39:19] [debug] Run time error 4: "Array index out of bounds"
[13:39:19] [debug] Accessing element at index 50 past array upper bound 43
[13:39:19] [debug] AMX backtrace:
[13:39:19] [debug] #0 002831ec in public RemovePlayerWeaponEx (playerid=2, weaponid=50) at CSRPbeta.pwn:51451
[13:39:19] [debug] #1 00294730 in public OnPlayerUpdate (playerid=2) at CSRPbeta.pwn:53121
We're not sure exactly what is causing this. We do know that this tends to happen the more players that are on the server.
I've asked one person to take a look, and he's asked me to adjust this:
pawn Код:
new plyWeapons[14] = 0;
new plyAmmo[14] = 0;
to 13 and then try 14 (was originally 12)
However, both times I still got spam in the server logs. Now I know I am missing something here, and I'm going to feel really really stupid when it's found.

HERE IS THE OnPlayerUpdate: http://pastebin.com/kkLabssZ

pawn Код:
forward RemovePlayerWeaponEx(playerid, weaponid);
public RemovePlayerWeaponEx(playerid, weaponid)
{
    new plyWeapons[14] = 0;
    new plyAmmo[14] = 0;
    for(new slot = 0; slot != 12; slot++)
    {
        new wep, ammo;
        GetPlayerWeaponData(playerid, slot, wep, ammo);

        if(wep != weaponid && ammo != 0)
        {
            GetPlayerWeaponData(playerid, slot, plyWeapons[slot], plyAmmo[slot]);
        }
    }

    ResetPlayerWeaponsEx(playerid);
    for(new slot = 0; slot != 12; slot++)
    {
        if(plyAmmo[slot] != 0)
        {
            GivePlayerWeaponEx(playerid, plyWeapons[slot], plyAmmo[slot]);
        }
    }
    SetPlayerArmedWeapon(playerid,0);
    Weapons[playerid][weaponid] = 0;
    return 1;
}

forward IsAnOwnableCar(vehid);
public IsAnOwnableCar(vehid)
{
    if(VehicleOwned[vehid] != SCRIPT_CARS)
    {
        return 1;
    }
    return 0;
}
Reply


Messages In This Thread
RemovePlayerWeaponsEx [DEBUG] Spam - by DJ_Shocker - 30.07.2013, 20:44
Re: RemovePlayerWeaponsEx [DEBUG] Spam - by Scottas - 30.07.2013, 20:49
Re: RemovePlayerWeaponsEx [DEBUG] Spam - by DJ_Shocker - 30.07.2013, 21:08
Re: RemovePlayerWeaponsEx [DEBUG] Spam - by Scottas - 30.07.2013, 21:25
Re: RemovePlayerWeaponsEx [DEBUG] Spam - by DJ_Shocker - 31.07.2013, 03:40
Re: RemovePlayerWeaponsEx [DEBUG] Spam - by Pottus - 31.07.2013, 03:58
Re: RemovePlayerWeaponsEx [DEBUG] Spam - by DJ_Shocker - 31.07.2013, 04:12
Re: RemovePlayerWeaponsEx [DEBUG] Spam - by Pottus - 31.07.2013, 04:15
Re: RemovePlayerWeaponsEx [DEBUG] Spam - by DJ_Shocker - 31.07.2013, 04:26

Forum Jump:


Users browsing this thread: 1 Guest(s)