10.01.2016, 23:18
pawn Код:
[22:09:04] [debug] AMX backtrace:
[22:09:04] [debug] #0 000fbdd8 in public Timer3Segundos () from BPC.amx
[22:09:08] [debug] Run time error 4: "Array index out of bounds"
[22:09:08] [debug] Accessing element at index 9999 past array upper bound 250
pawn Код:
CallBack::Timer3Segundos(){
new Float:oldposx, Float:oldposy, Float:oldposz, Cops = 0, string[128];
for(new i = 0; i < MAX_PLAYERS; i++){
if(GetPlayerOrg(i) == 4){
Cops ++;
}
OnPlayerUpdate2(i);
if(IsPlayerConnected(i)){
if(PlayerInfo[i][pConta] > 999999999 && ComecouConversao[i] == 0){
TempoCheckGB[i] = SetTimerEx("CheckGB", 1000, 1, "i", i); ComecouConversao[i] = 1; IniciouGB[i] = 0; TerminouGB[i] = 0;
}
if(GetPlayerMoney(i) > 99999999 && ComecouConversao2[i] == 0){
TempoCheckGB2[i] = SetTimerEx("CheckCashGB", 1000, 1, "i", i); ComecouConversao2[i] = 1; IniciouGB2[i] = 0; TerminouGB2[i] = 0;
}
if(PlayerInfo[i][pLocal] != 9999 && PlayerInfo[i][pInt] != 0){
new House = PlayerInfo[i][pLocal];
GetPlayerPos(i, oldposx, oldposy, oldposz);
if(oldposz != 0.0){
if(oldposz < 600.0){
if(House > 10000){
new tmpcar = GetPlayerVehicleID(i);
if(!PlayerToPoint(6, i,1040.6,-1021.0,31.7) && House == 10001 ||!PlayerToPoint(6, i,-2720.5,217.5,4.1) && House == 10002 ||!PlayerToPoint(6, i,2644.6,-2044.9,13.3) && House == 10003){
if(GetPlayerState(i) == 2){
SetVehiclePos_pB(tmpcar, HouseCarSpawns[tmpcar-1][0], HouseCarSpawns[tmpcar-1][1], HouseCarSpawns[tmpcar-1][2]);
SetVehicleZAngle(tmpcar, HouseCarSpawns[tmpcar-1][3]);
LinkVehicleToInterior(tmpcar, 0);
}
else{
SetPlayerPos_pB(i, HouseCarSpawns[tmpcar-1][0], HouseCarSpawns[tmpcar-1][1], HouseCarSpawns[tmpcar-1][2]);
}
gSpentCash[i] = 0; TelePos[i][0] = 0.0; TelePos[i][1] = 0.0; PlayerInfo[i][pLocal] = 9999; SetPlayerInterior(i,0); PlayerInfo[i][pInt] = 0;
}
}
if(House >= 99 && House != 10000){
SetPlayerPos_pB(i, BizzInfo[House-99][bEntranceX], BizzInfo[House-99][bEntranceY],BizzInfo[House-99][bEntranceZ]);
PlayerInfo[i][pLocal] = 9999; SetPlayerInterior(i,0); PlayerInfo[i][pInt] = 0;
}
else if(House < 99 && House != 10000){
SetPlayerPos_pB(i, HouseInfo[House][hEntrancex], HouseInfo[House][hEntrancey],HouseInfo[House][hEntrancez]);
PlayerInfo[i][pLocal] = 9999; SetPlayerInterior(i,0); PlayerInfo[i][pInt] = 0;
}
}
}
}
if(CellTime[i] > 0){
if(CellTime[i] == 60){
CellTime[i] = 1;
if(Mobile[Mobile[i]] == i){
CallCost[i] = CallCost[i]+callcost;
}
}
CellTime[i] = CellTime[i] +1;
if(Mobile[Mobile[i]] == 9999 && CellTime[i] == 5){
if(IsPlayerConnected(Mobile[i])){
format(gstring, sizeof(gstring), "%s's Ligando.", PlayerName(Mobile[i]));
RingTone[Mobile[i]] = 10;
ProxDetector(30.0, Mobile[i], gstring, 0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA);
}
}
}
if(CellTime[i] == 0 && CallCost[i] > 0){
format(gstring, sizeof(gstring), "~w~Custo da ligacao~n~~r~$%d",CallCost[i]);
GivePlayerMoney(i, -CallCost[i]);
SBizzInfo[0][sbTill] += CallCost[i]/2; CofreOrg[7][Dinheiro] += CallCost[i]/2; ExtortionSBiz(0, CallCost[i]); GastarProdutos(2, 0, 24);
SBizzInfo[1][sbTill] += CallCost[i]/2; CofreOrg[7][Dinheiro] += CallCost[i]/2; ExtortionSBiz(1, CallCost[i]); GastarProdutos(2, 1, 24);
SBizzInfo[2][sbTill] += CallCost[i]/2; CofreOrg[7][Dinheiro] += CallCost[i]/2; ExtortionSBiz(2, CallCost[i]); GastarProdutos(2, 2, 24);
GameTextForPlayer(i, gstring, 5000, 1); CallCost[i] = 0;
}
if(TransportTime[i] > 0){
if(TransportTime[i] >= 16){
TransportTime[i] = 1;
if(TransportDriver[i] < 999){
if(IsPlayerConnected(TransportDriver[i])){
TransportCost[i] += TransportValue[TransportDriver[i]];
TransportCost[TransportDriver[i]] = TransportCost[i];
}
}
}
TransportTime[i] += 1;
format(gstring, sizeof(gstring), "~r~%d ~w~: ~g~$%d",TransportTime[i],TransportCost[i]);
GameTextForPlayer(i, gstring, 15000, 6);
}
}
if(IsPlayerConnected(i) && GetPlayerState(i) == PLAYER_STATE_DRIVER){
if(Cops >= 1){
new Float:health; GetVehicleHealth(GetPlayerVehicleID(i),health);
if(health <= 320){
switch(random(4)){
case 0,3:{
if(PegouF[GetPlayerVehicleID(i)] <= 0){
new Float:P[3];
SendClientMessage(i, -1, "Seu veiculo estб pegando fogo! Os bombeiros jб foram acionados!");
PegouF[GetPlayerVehicleID(i)] = 1;
format(string, sizeof(string), "O veiculo de %s estб pegando fogo!", PlayerName(i));
ProxDetector(20.0, i, string, 0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA);
SetVehicleHealth(GetPlayerVehicleID(i), 301);
GetVehiclePos(GetPlayerVehicleID(i), P[0], P[1], P[2]);
Fogando[GetPlayerVehicleID(i)] = CreateObject(18691, P[0], P[1], P[2]-1,0.0, 0.0, 96.0);
AttachObjectToVehicle(Fogando[GetPlayerVehicleID(i)], GetPlayerVehicleID(i), 0.0, 2.0, -3.0, 0.0, 0.0, 0.0);
new mot, lu, alar, por, cap, porma, ob;
GetVehicleParamsEx(GetPlayerVehicleID(i), mot, lu, alar, por, cap, porma, ob);
SetVehicleParamsEx(GetPlayerVehicleID(i), VEHICLE_PARAMS_OFF, lu, alar, por, cap, porma, ob);
RemovePlayerFromVehicle(i);
format(string, sizeof(string), "%s precisa de um bombeiro urgentemente. USE: (/aceitar medico)", PlayerName(i));
SendFamilyMessage(4, -1, string);
MedicCall = i;
}
}
case 1,2:{
PegouF[GetPlayerVehicleID(i)] = 1;
}
}
}
}
}
}
return 1;
}
pawn Код:
[22:09:08] [debug] AMX backtrace:
[22:09:08] [debug] #0 0003ec14 in public OnDialogResponse (28, 1, 1, -1, 8245588) from BPC.amx
[22:09:09] [debug] Run time error 10: "Native function failed"
[22:09:09] [debug] strmid