20.04.2020, 01:11
Pessoal estou tendo problema na callback, alguйm sabe oque pode ser?
se alguйm souber oque й, agradeзo.
PHP Code:
[02:21:28] [debug] Run time error 4: "Array index out of bounds"
[02:21:28] [debug] Attempted to read/write array element at index 121 in array of size 121
[02:21:28] [debug] AMX backtrace:
[02:21:28] [debug] #0 0003f840 in public OnPlayerStateChange (0, 2, 1) in Servidor.amx
[02:21:30] [debug] Run time error 4: "Array index out of bounds"
[02:21:30] [debug] Attempted to read/write array element at index 121 in array of size 121
[02:21:30] [debug] AMX backtrace:
[02:21:30] [debug] #0 0003f840 in public OnPlayerStateChange (1, 2, 1) in Servidor.amx
[02:24:48] [debug] Run time error 4: "Array index out of bounds"
[02:24:48] [debug] Attempted to read/write array element at index 121 in array of size 121
[02:24:48] [debug] AMX backtrace:
[02:24:48] [debug] #0 0003f840 in public OnPlayerStateChange (0, 2, 1) in Servidor.amx
[02:25:13] [debug] Run time error 4: "Array index out of bounds"
[02:25:13] [debug] Attempted to read/write array element at index 121 in array of size 121
[02:25:13] [debug] AMX backtrace:
[02:25:13] [debug] #0 0003f840 in public OnPlayerStateChange (1, 2, 1) in Servidor.amx
se alguйm souber oque й, agradeзo.
PHP Code:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new Float:posicao[3];
new modelo = GetVehicleModel(GetPlayerVehicleID(playerid));
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
{
GetVehiclePos(GetPlayerVehicleID(playerid), v@_P[0][playerid], v@_P[1][playerid], v@_P[2][playerid]);
TSTimer[playerid] = SetTimerEx("E@_At", 2000, true, "i", playerid);
}
if(newstate == PLAYER_STATE_DRIVER)
{
if(GetPlayerVehicleID(playerid) >= vehiclesI[0] && GetPlayerVehicleID(playerid) <= vehiclesI[sizeof(vehiclesI) - 1])
{
if(PlayerInfo[playerid][pTransProf] != 1)return Ret(playerid);
}
if(GetPlayerVehicleID(playerid) >= Motoboys[0] && GetPlayerVehicleID(playerid) <= Motoboys[sizeof(Motoboys) - 1])
{
if(PlayerInfo[playerid][pProfissao] != 1)return Ret(playerid);
}
if(GetPlayerVehicleID(playerid) >= EntregadorJ[0] && GetPlayerVehicleID(playerid) <= EntregadorJ[sizeof(EntregadorJ) - 1])
{
if(PlayerInfo[playerid][pProfissao] != 2)return Ret(playerid);
}
if(GetPlayerVehicleID(playerid) >= EntregadorC[0] && GetPlayerVehicleID(playerid) <= EntregadorC[sizeof(EntregadorC) - 1])
{
if(PlayerInfo[playerid][pProfissao] != 3)return Ret(playerid);
}
if(barcos(GetPlayerVehicleID(playerid)) ||avioes(GetPlayerVehicleID(playerid)) ||Motocicletas(GetPlayerVehicleID(playerid)) || carros(GetPlayerVehicleID(playerid)) || VeiculoDiesel(GetPlayerVehicleID(playerid)))
{
SendClientMessage(playerid,Amarelo,"| INFO | Para Ligar ou Desligar o Veнculo Aperte 'Y'!");
ShowPlayerVelocimetro(playerid);
}
}else{
HidePlayerVelocimetro(playerid);
}
if(oldstate == PLAYER_STATE_DRIVER)
{
new string[95];
GetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,alarm,doors,bonnet,boot,objective);
if(barcos(GetPlayerVehicleID(playerid)) ||avioes(GetPlayerVehicleID(playerid)) ||Motocicletas(GetPlayerVehicleID(playerid)) || carros(GetPlayerVehicleID(playerid)) || VeiculoDiesel(GetPlayerVehicleID(playerid)))
{
SetVehicleParamsEx(GetPlayerVehicleID(playerid), VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);
}
if(NewGlobal[playerid] == 500)
{
if(VeiculoDiesel(GetPlayerVehicleID(playerid)) || barcos(GetPlayerVehicleID(playerid)))
{
format(string, sizeof (string),"| INFO | Vocк Abasteceu Alguns Litros de {FFF000}Diesel {FFFFFF}e Pagou {008000}$%d",GranaB[playerid]);
SendClientMessage(playerid, -1,string);
perexc(playerid);
}
if(Motocicletas(GetPlayerVehicleID(playerid)) || carros(GetPlayerVehicleID(playerid)))
{
format(string, sizeof (string),"| INFO | Vocк Abasteceu Alguns Litros de {FFF000}Gasolina {FFFFFF}e Pagou {008000}$%d",GranaB[playerid]);
SendClientMessage(playerid, -1,string);
perexc(playerid);
}
if(avioes(GetPlayerVehicleID(playerid)))
{
format(string, sizeof (string),"| INFO | Vocк Abasteceu Alguns Litros de {FFF000}QAV/1 {FFFFFF}e Pagou {008000}$%d",GranaB[playerid]);
SendClientMessage(playerid, -1,string);
perexc(playerid);
}
}
if(pegvehicle[playerid] == true)
{
SendClientMessage(playerid,Amarelo,"| AVISO | Vocк Tem 90 Segundos Para Voltar ao Veнculo da Profissгo!");
TempProf[playerid] = SetTimerEx("CancelamentoProf", 90000, false, "i", playerid);
Timer[6][playerid] = SetTimerEx("temps", 1000, true, "i", playerid);
SetPVarInt(playerid,"SaiuVehicle",90);
}
}
if(newstate == PLAYER_STATE_DRIVER)
{
if(modelo == 430 )
{
if(PlayerInfo[playerid][pHELG] == false)
{
SendClientMessage(playerid, Vermelho, "| ERRO | Vocк Nгo Tem Habilitaзгo Especial 'HELG'!");
GetPlayerPos(playerid,posicao[0],posicao[1],posicao[2]);
SetPlayerPos(playerid,posicao[0],posicao[1],posicao[2]+1);
}
}
if(modelo == 476 || modelo == 520 || modelo == 425 || modelo == 548 || modelo == 447 )
{
if(PlayerInfo[playerid][pHEAG] == false)
{
SendClientMessage(playerid, Vermelho, "| ERRO | Vocк Nгo Tem Habilitaзгo Especial 'HEAG'!");
GetPlayerPos(playerid,posicao[0],posicao[1],posicao[2]);
SetPlayerPos(playerid,posicao[0],posicao[1],posicao[2]+1);
}
}
if(modelo == 432 || modelo == 433 || modelo == 470 )
{
if(PlayerInfo[playerid][pHEVG] == false)
{
SendClientMessage(playerid, Vermelho, "| ERRO | Vocк Nгo Tem Habilitaзгo Especial 'HEVG'!");
GetPlayerPos(playerid,posicao[0],posicao[1],posicao[2]);
SetPlayerPos(playerid,posicao[0],posicao[1],posicao[2]+1);
}
}
if(GetPVarInt(playerid,"TestO")>= 1)
{
}else{
if(modelo == 448 || modelo == 461 || modelo == 462 || modelo == 463 || modelo == 468 || modelo == 471 || modelo == 521 || modelo == 581 || modelo == 586)
{
if(PlayerInfo[playerid][pMotos] == false)
{
SendClientMessage(playerid, Vermelho, "| ERRO | Vocк Nгo Tem Habilitaзгo Para Conduzir Motos!");
GetPlayerPos(playerid,posicao[0],posicao[1],posicao[2]);
SetPlayerPos(playerid,posicao[0],posicao[1],posicao[2]+1);
}
}
if(modelo == 403 || modelo == 406 || modelo == 443 || modelo == 514 || modelo == 515)
{
if(PlayerInfo[playerid][pCarretas] == false)
{
SendClientMessage(playerid, Vermelho, "| ERRO | Vocк Nгo Tem Habilitaзгo Para Conduzir Carretas!");
GetPlayerPos(playerid,posicao[0],posicao[1],posicao[2]);
SetPlayerPos(playerid,posicao[0],posicao[1],posicao[2]+1);
}
}
if(modelo == 446 || modelo == 452 || modelo == 453 || modelo == 454 || modelo == 472 || modelo == 473 || modelo == 484 || modelo == 493 || modelo == 595)
{
if(PlayerInfo[playerid][pBarcos] == false)
{
SendClientMessage(playerid, Vermelho, "| ERRO | Vocк Nгo Tem Habilitaзгo Para Conduzir Barcos!");
GetPlayerPos(playerid,posicao[0],posicao[1],posicao[2]);
SetPlayerPos(playerid,posicao[0],posicao[1],posicao[2]+1);
}
}
if(modelo == 460 || modelo == 511 || modelo == 512 || modelo == 513 || modelo == 519 || modelo == 553 || modelo == 577 || modelo == 592 || modelo == 593)
{
if(PlayerInfo[playerid][pAvioes] == false)
{
SendClientMessage(playerid, Vermelho, "| ERRO | Vocк Nгo Tem Habilitaзгo Para Conduzir Aviхes!");
GetPlayerPos(playerid,posicao[0],posicao[1],posicao[2]);
SetPlayerPos(playerid,posicao[0],posicao[1],posicao[2]+1);
}
}
if(modelo == 417 || modelo == 447 || modelo == 469 || modelo == 487 || modelo == 488 || modelo == 497 || modelo == 548 || modelo == 563)
{
if(PlayerInfo[playerid][pHelicopteros] == false)
{
SendClientMessage(playerid, Vermelho, "| ERRO | Vocк Nгo Tem Habilitaзгo Para Conduzir Helicуpteros!");
GetPlayerPos(playerid,posicao[0],posicao[1],posicao[2]);
SetPlayerPos(playerid,posicao[0],posicao[1],posicao[2]+1);
}
}
if(modelo == 431 || modelo == 437)
{
if(PlayerInfo[playerid][pOnibus] == false)
{
SendClientMessage(playerid, Vermelho, "| ERRO | Vocк Nгo Tem Habilitaзгo Para Conduzir Фnibus!");
GetPlayerPos(playerid,posicao[0],posicao[1],posicao[2]);
SetPlayerPos(playerid,posicao[0],posicao[1],posicao[2]+1);
}
}
if(modelo == 407 || modelo == 428 || modelo == 427 || modelo == 455 || modelo == 456 || modelo == 443 || modelo == 408 || modelo == 424 || modelo == 478 || modelo == 609
|| modelo == 406 || modelo == 407 || modelo == 544 || modelo == 573 || modelo == 578 || modelo == 424 || modelo == 544)
{
if(PlayerInfo[playerid][pCaminhoes] == false)
{
SendClientMessage(playerid, Vermelho, "| ERRO | Vocк Nгo Tem Habilitaзгo Para Conduzir Caminhхes!");
GetPlayerPos(playerid,posicao[0],posicao[1],posicao[2]);
SetPlayerPos(playerid,posicao[0],posicao[1],posicao[2]+1);
}
}
for(new i = 0; i < 122; i++)
{
if(modelo == VehiclesCarros[i])
{
if(PlayerInfo[playerid][pCarros] == false)
{
SendClientMessage(playerid, Vermelho, "| ERRO | Vocк Nгo Tem Habilitaзгo Para Conduzir Carros!");
GetPlayerPos(playerid,posicao[0],posicao[1],posicao[2]);
SetPlayerPos(playerid,posicao[0],posicao[1],posicao[2]+1);
}
}
}
if((GetTickCount() - GetPVarInt(playerid, "cartime")) < 100)
{
SetPVarInt(playerid, "carspam", GetPVarInt(playerid, "carspam") + 1);
if(GetPVarInt(playerid, "carspam") >= 5)
{
new cs_string[85 + MAX_PLAYER_NAME],namePlayerState[MAX_PLAYER_NAME];
GetPlayerName(playerid, namePlayerState, sizeof(namePlayerState));
format(cs_string,sizeof(cs_string),"| INFO | O(A) Jogador(a) %s Foi Kickado(a) Pelo Anti-Cheater ( Motivo: Car Spam. )",namePlayerState);
SendClientMessageToAll(Vermelho,cs_string);
return SavePlayer(playerid), Kick(playerid);
}
}
SetPVarInt(playerid, "cartime", GetTickCount());
}
}
return 1;
}