13.04.2016, 16:17
Код:
[13/04/2016 12:45:22] [debug] Run time error 4: "Array index out of bounds" [13/04/2016 12:45:22] [debug] Accessing element at negative index -1 [13/04/2016 12:45:22] [debug] AMX backtrace: [13/04/2016 12:45:22] [debug] #0 00353540 in public cmd_hfind (0x00000017, 0x07ed961c) from NGRP.amx [13/04/2016 12:45:22] [debug] #1 native CallLocalFunction () [004743b0] from samp-server.exe [13/04/2016 12:45:22] [debug] #2 0000670c in public OnPlayerCommandText (0x00000017, 0x07ed9600) from NGRP.amx
Код:
CMD:hfind(playerid, params[]) { if (IsAHitman(playerid) || (arrGroupData[PlayerInfo[playerid][pMember]][g_iBugAccess] != 32 || arrGroupData[PlayerInfo[playerid][pMember]][g_iGroupType] == 1) && PlayerInfo[playerid][pRank] >= arrGroupData[PlayerInfo[playerid][pMember]][g_iBugAccess]) { if(GetPVarType(playerid, "hFind")) { SendClientMessageEx(playerid, COLOR_GRAD2, "Stopped Updating"); DeletePVar(playerid, "hFind"); DisablePlayerCheckpoint(playerid); } else { new iTargetID; if(sscanf(params, "u", iTargetID)) { return SendClientMessageEx(playerid, COLOR_GREY, "SU DUNG: /hfind [player]"); } else if(iTargetID == playerid) { return SendClientMessageEx(playerid, COLOR_GREY, "Ban khong the su dung lenh nay cho ban."); } else if(!IsPlayerConnected(iTargetID)) { return SendClientMessageEx(playerid, COLOR_GREY, "Nguoi choi khong hop le."); } else if(GetPlayerInterior(iTargetID) != 0) { return SendClientMessageEx(playerid, COLOR_GREY, "Ban khong the su dung lenh nay trong khi dang o trong mot noi that."); } else if(PlayerInfo[iTargetID][pAdmin] >= 2 && PlayerInfo[iTargetID][pTogReports] != 1) { return SendClientMessageEx(playerid, COLOR_GREY, "You are unable to find this person."); } else if (GetPVarInt(playerid, "_SwimmingActivity") >= 1) { return SendClientMessageEx(playerid, COLOR_GRAD2, "Ban khong the tim thay nguoi nay trong khi dang boi loi."); } if (GetPVarInt(playerid, "_SwimmingActivity") >= 1) { SendClientMessageEx(playerid, COLOR_GRAD2, " Ban phai dung boi! (/stopswimming)"); return 1; } if(PhoneOnline[iTargetID] == 0 && PlayerInfo[iTargetID][pPnumber] != 0|| PlayerInfo[iTargetID][pBugged] == PlayerInfo[playerid][pMember]) { new szZone[MAX_ZONE_NAME], szMessage[108]; new Float:X, Float:Y, Float:Z; GetPlayerPos(iTargetID, X, Y, Z); DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, X, Y, Z, 4.0); GetPlayer3DZone(iTargetID, szZone, sizeof(szZone)); format(szMessage, sizeof(szMessage), "Theo doi tren %s, nhin thay o %s.", GetPlayerNameEx(iTargetID), szZone); SendClientMessageEx(playerid, COLOR_GRAD2, szMessage); SendClientMessageEx(playerid, COLOR_GRAD2, "Su dung /hfind mot lan nua de ngung theo doi."); SetPVarInt(playerid, "hFind", iTargetID); } else return SendClientMessageEx(playerid, COLOR_GRAD2, "Ban khong the co duoc dau vet' tren nguoi nay."); } } else SendClientMessageEx(playerid, COLOR_GRAD1, "Ban khong duoc phep su dung lenh nay."); return 1; }
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { return 1; }