01.01.2018, 22:33
Meu servidor sempre esta dando isso:
btu.pwn:69937
attachment-fix.inc:120
#ds_ac#2.0.inc:413
Alguйm pode me ajudar por favor.
Код:
[debug] Run time error 4: "Array index out of bounds" [debug] AMX backtrace: [debug] #0 003da258 in public J_OnPlayerKeyStateChange (playerid=0, newkeys=16, oldkeys=0) at C:\Users\Natan\Desktop\Brasil Top UP!\gamemodes\btu.pwn:69937 [debug] #1 0005fc24 in public abb_OnPlayerKeyStateChange (playerid=0, newkeys=16, oldkeys=0) at C:\Users\Natan\Desktop\Brasil Top UP!\pawno\include\../BTU_Includes/attachment-fix.inc:120 [debug] #2 native CallLocalFunction () from samp03svr [debug] #3 000430b8 in public OnPlayerKeyStateChange (playerid=0, newkeys=16, oldkeys=0) at C:\Users\Natan\Desktop\Brasil Top UP!\pawno\include\../BTU_Includes/#ds_ac#2.0.inc:413
PHP код:
for(new x; x != MAX_SOUNDS; x++){
if(SomInfo[x][somCreated] && IsPlayerInRangeOfPoint(playerid, 1.8, SomInfo[x][somX], SomInfo[x][somY], SomInfo[x][somZ]) && SomInfo[x][somID] == playerid){ //AKI NESTA LINHA
destroyPlayerSound(playerid);
format(string, sizeof(string), "* %s desligou seu rбdio portбtil.", NomePlayer(playerid));
SendClientMessageInRange(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
PlayerInfo[playerid][pComRadio] = true;
SetPlayerAttachedObject(playerid,Slot_Radio,2226,5,0.394999,0.045000,0.027000,-25.299999,-101.699974,0.000000);
ApplyAnimation(playerid,"BOMBER","BOM_Plant_2Idle",4.1,0,1,1,0,0);
break;
}
}
PHP код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
{
if(HOLDING(128))
{
switch(GetPlayerWeapon(playerid))
{
case 34..36, 43:
{
_J_AimedWithValidWeap[playerid] = true;
for(new i = 0; i < MAX_PLAYER_ATTACHED_OBJECTS; i++)
{
if(IsPlayerAttachedObjectSlotUsed(playerid, i))
{
new BitStream:bs = BS_New();
BS_WriteValue(
bs,
PR_UINT16, playerid,
PR_UINT32, i,
PR_BOOL, 0
);
BS_RPC(bs, playerid, 113, PR_LOW_PRIORITY, PR_RELIABLE_ORDERED);
BS_Delete(bs);
}
}
}
}
}
else if(RELEASED(128))
{
if(_J_AimedWithValidWeap[playerid])
{
_J_AimedWithValidWeap[playerid] = false;
for(new i = 0; i < MAX_PLAYER_ATTACHED_OBJECTS; i++)
{
if(IsPlayerAttachedObjectSlotUsed(playerid, i))
{
new BitStream:bs = BS_New();
BS_WriteValue(
bs,
PR_UINT16, playerid,
PR_UINT32, i,
PR_BOOL, 1,
PR_UINT32, _J_AttachmentsEnum[playerid][i][_J_ModelID],
PR_UINT32, _J_AttachmentsEnum[playerid][i][_J_Bone],
PR_FLOAT, _J_AttachmentsEnum[playerid][i][_J_OffsetX],
PR_FLOAT, _J_AttachmentsEnum[playerid][i][_J_OffsetY],
PR_FLOAT, _J_AttachmentsEnum[playerid][i][_J_OffsetZ],
PR_FLOAT, _J_AttachmentsEnum[playerid][i][_J_RotX],
PR_FLOAT, _J_AttachmentsEnum[playerid][i][_J_RotY],
PR_FLOAT, _J_AttachmentsEnum[playerid][i][_J_RotZ],
PR_FLOAT, _J_AttachmentsEnum[playerid][i][_J_ScaleX],
PR_FLOAT, _J_AttachmentsEnum[playerid][i][_J_ScaleY],
PR_FLOAT, _J_AttachmentsEnum[playerid][i][_J_ScaleZ],
PR_UINT32, _J_AttachmentsEnum[playerid][i][_J_MaterialColor1],
PR_UINT32, _J_AttachmentsEnum[playerid][i][_J_MaterialColor2]
);
BS_RPC(bs, playerid, 113, PR_LOW_PRIORITY, PR_RELIABLE_ORDERED);
BS_Delete(bs);
}
}
}
}
}
#if defined J_OnPlayerKeyStateChange
return J_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);//AKI NESTA LINHA
#else
return 1;
#endif
}
PHP код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_CROUCH)
fAutoC[playerid] = 0;
if(GetPlayerState(playerid) == 1 && (newkeys & 2048 || newkeys & 4096))
{
CallLocalFunction("PlayerCheater","id", playerid, Player_Joypad);
}
return CallLocalFunction("abb_OnPlayerKeyStateChange", "idd", playerid, newkeys, oldkeys); //AKI NESTA LINHA
}
forward abb_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);