12.12.2012, 18:28
Bom Usei o Crashdetect para saber o motivo de estar reiniciando o meu Servidor e encontrei isso no Debug.
OnplayerDisconnect
OnplayerStateChange
Agradeзo quem puder me Ajudar !
Код:
[16:59:49] [debug] Run time error 4: "Array index out of bounds" [16:59:49] [debug] Accessing element at index 445 past array upper bound 301 [16:59:49] [debug] AMX backtrace: [16:59:49] [debug] #0 000436b8 in public OnPlayerDisconnect () from MegaCity.amx [16:59:49] [debug] Accessing element at index 443 past array upper bound 301 [16:59:49] [debug] AMX backtrace: [16:59:49] [debug] #0 000436b8 in public OnPlayerDisconnect () from MegaCity.amx [16:59:49] [debug] Accessing element at index 447 past array upper bound 301 [16:59:49] [debug] AMX backtrace: [16:59:49] [debug] #0 000436b8 in public OnPlayerDisconnect () from MegaCity.amx [16:59:49] [debug] Accessing element at index 434 past array upper bound 301 [16:59:49] [debug] AMX backtrace: [16:59:49] [debug] #0 000436b8 in public OnPlayerDisconnect () from MegaCity.amx [16:59:49] [debug] Accessing element at index 413 past array upper bound 301 [16:59:49] [debug] AMX backtrace: [16:59:49] [debug] #0 000436b8 in public OnPlayerDisconnect () from MegaCity.amx [16:59:49] [debug] Accessing element at index 437 past array upper bound 301 [16:59:49] [debug] AMX backtrace: [16:59:49] [debug] #0 000436b8 in public OnPlayerDisconnect () from MegaCity.amx [16:59:49] [debug] Accessing element at index 549 past array upper bound 301 [16:59:49] [debug] AMX backtrace: [16:59:49] [debug] #0 000436b8 in public OnPlayerDisconnect () from MegaCity.amx [16:59:49] [debug] Accessing element at index 419 past array upper bound 301 [16:59:49] [debug] AMX backtrace: [16:59:49] [debug] #0 000436b8 in public OnPlayerDisconnect () from MegaCity.amx [17:00:15] [debug] Accessing element at index 411 past array upper bound 301 [17:00:15] [debug] AMX backtrace: [17:00:15] [debug] #0 00059dc0 in public OnPlayerStateChange () from MegaCity.amx [17:00:20] [debug] AMX backtrace: [17:00:20] [debug] #0 00059cb0 in public OnPlayerStateChange () from MegaCity.amx
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
RemovePlayerAttachedObject(playerid,3);
RemovePlayerAttachedObject(playerid, 3);
DisablePlayerCheckpoint(playerid);
TextDrawDestroy(Text:FilaAtendimentoText[playerid]);
TextDrawDestroy(Text:TempoAtendimento2Text[playerid]);
KillTimer(timer[playerid]);
FilaAtendimento[playerid] = 999;
TempoAtendimento2[playerid] = 0;
OnPlayerSave(playerid);
KillTimer(tempotd[playerid]);
new caller = Mobile[playerid];
OnPlayerSave(playerid);
if(caller != 255)
{
if(caller < 255)
{
SendClientMessage(caller, COLOR_GRAD2, "A ligaзгo caiu...");
CellTime[caller] = 0;
CellTime[playerid] = 0;
Mobile[caller] = 255;
}
Mobile[playerid] = 255;
CellTime[playerid] = 0;
}
if(HireCar[playerid] > 0)
{
VTrancado[HireCar[playerid]] = 0;
UnLockCar(HireCar[playerid]);
SetVehicleToRespawn(HireCar[playerid]);
HireCar[playerid] = 0;
}
if (PlayerInfo[playerid][pBarraca] != 0)
{
RemoveBarraca(playerid);
}
if (PlayerInfo[playerid][pParedao] != 0)
{
RemoveParedao(playerid);
}
if(pRoadblock[playerid] != 0)
{
RemoveRoadblock(playerid);
}
if(SpikeInfo[playerid][sCreated] != 0)
{
RemoveRoadPregos(playerid);
}
if(pRoadCones[playerid] != 0)
{
RemoveRoadCones(playerid);
}
switch(reason)
{
case 0: format(gstring, sizeof(gstring), "%s saiu do Servidor por erro de conexгo ou crash.", PlayerName(playerid));
case 1: format(gstring, sizeof(gstring), "%s saiu por vontade propria.", PlayerName(playerid));
case 2: format(gstring, sizeof(gstring), "%s Saiu do servidor kickado ou banido.", PlayerName(playerid));
}
ProxDetector(100.0, playerid, gstring,COLOR_LIGHTBLUE,COLOR_LIGHTBLUE,COLOR_LIGHTBLUE,COLOR_LIGHTBLUE,COLOR_LIGHTBLUE);
gActivePlayers[playerid]--;
numplayers--;
if(MudarSenhaAceito[playerid] == 1)
{
MudarSenhaAceito[playerid] = 0;
}
if(MudarNickAceito[playerid] == 1)
{
MudarNickAceito[playerid] = 0;
}
if(ProvocoCasarao[playerid] == 1)
{
GangZoneStopFlashForAll(GZCasarao);
GangZoneShowForAll(GZCasarao, 0xFFFFFF96);
GuerranoCasarao = 0;
ProvocoCasarao[playerid] = 0;
donocasarao = 0;
Dominando[playerid] = 0;
KillTimer(TempoGuerraCasarao);
}
if(ProvocoEstacao[playerid] == 1)
{
GangZoneStopFlashForAll(GZEstacao);
GangZoneShowForAll(GZEstacao, 0xFFFFFF96);
GuerranaEstacao = 0;
ProvocoEstacao[playerid] = 0;
donoestacao = 0;
Dominando[playerid] = 0;
KillTimer(TempoGuerraEstacao);
}
if(ProvocoFavela[playerid] == 1)
{
GangZoneStopFlashForAll(GZFavela);
GangZoneShowForAll(GZFavela, 0xFFFFFF96);
GuerranaFavela = 0;
ProvocoFavela[playerid] = 0;
donoFavela = 0;
Dominando[playerid] = 0;
KillTimer(TempoGuerraFavela);
}
if(ProvocoSkate[playerid] == 1)
{
GangZoneStopFlashForAll(GZSkate);
GangZoneShowForAll(GZSkate, 0xFFFFFF96);
GuerranoSkate = 0;
ProvocoSkate[playerid] = 0;
donoskate = 0;
Dominando[playerid] = 0;
KillTimer(TempoGuerraSkate);
}
if(ProvocoAero[playerid] == 1)
{
GangZoneStopFlashForAll(GZAero);
GangZoneShowForAll(GZAero, 0xFFFFFF96);
GuerranoAero = 0;
ProvocoAero[playerid] = 0;
donoaero = 0;
Dominando[playerid] = 0;
KillTimer(TempoGuerraAero);
}
if(ProvocoPark[playerid] == 1)
{
GangZoneStopFlashForAll(GZPark);
GangZoneShowForAll(GZPark, 0xFFFFFF96);
GuerranoPark = 0;
ProvocoPark[playerid] = 0;
donopark = 0;
Dominando[playerid] = 0;
KillTimer(TempoGuerraPark);
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(TaxiAccepted[i] < 999)
{
if(TaxiAccepted[i] == playerid)
{
TaxiAccepted[i] = 999;
GameTextForPlayer(i, "~w~O Cliente~n~~r~Saiu do jogo", 5000, 1);
TaxiCallTime[i] = 0;
DisablePlayerCheckpoint(i);
}
}
else if(CopsrondaAccepted[i] < 999)
{
if(CopsrondaAccepted[i] == playerid)
{
CopsrondaAccepted[i] = 999;
GameTextForPlayer(i, "~w~Policial o player~n~~r~Deixou o jogo", 5000, 1);
CopsrondaCallTime[i] = 0;
DisablePlayerCheckpoint(i);
}
}
else if(MedicAccepted[i] < 999)
{
if(MedicAccepted[i] == playerid)
{
MedicAccepted[i] = 999;
GameTextForPlayer(i, "~w~O Cliente~n~~r~Saiu do jogo", 5000, 1);
MedicCallTime[i] = 0;
DisablePlayerCheckpoint(i);
}
}
else if(MechanicAccepted[i] < 999)
{
if(MechanicAccepted[i] == playerid)
{
MechanicAccepted[i] = 999;
GameTextForPlayer(i, "~w~O Cliente~n~~r~Saiu do jogo", 5000, 1);
MechanicCallTime[i] = 0;
DisablePlayerCheckpoint(i);
}
}
else if(BusAccepted[i] < 999)
{
if(BusAccepted[i] == playerid)
{
BusAccepted[i] = 999;
GameTextForPlayer(i, "~w~O Cliente~n~~r~Saiu do jogo", 5000, 1);
BusCallTime[i] = 0;
DisablePlayerCheckpoint(i);
}
}
}
}
if(TransportCost[playerid] > 0 && TransportDriver[playerid] < 999)
{
if(IsPlayerConnected(TransportDriver[playerid]))
{
TransportMoney[TransportDriver[playerid]] += TransportCost[playerid];
TransportTime[TransportDriver[playerid]] = 0;
TransportCost[TransportDriver[playerid]] = 0;
format(gstring, sizeof(gstring), "~w~Passageiro saiu~n~~g~ganhou R$%d",TransportCost[playerid]);
GameTextForPlayer(TransportDriver[playerid], gstring, 5000, 1);
}
}
if(GotHit[playerid] > 0)
{
if(GetChased[playerid] < 999)
{
if(IsPlayerConnected(GetChased[playerid]))
{
SendClientMessage(GetChased[playerid], COLOR_YELLOW, "Seu contrato saiu do servidor.");
GoChase[GetChased[playerid]] = 999;
}
}
}
if(HireCar[playerid] != 299)
{
gLastDriver[HireCar[playerid]] = 300;
VTrancado[HireCar[playerid]] = 0;
UnLockCar(HireCar[playerid]);
}
if (gLastCar[playerid] > 0)
{
gLastDriver[gLastCar[playerid]] = 300;
if(PlayerInfo[playerid][pPHousekey] != gLastCar[playerid]-1)
{
VTrancado[gLastCar[playerid]] = 0;
UnLockCar(gLastCar[playerid]);
}
}
if(PlayerBoxing[playerid] > 0)
{
if(Boxer1 == playerid)
{
if(IsPlayerConnected(Boxer2))
{
PlayerBoxing[Boxer2] = 0;
SetPlayerPos(Boxer2, 765.8433,3.2924,1000.7186);
SetPlayerInterior(Boxer2, 5);
GameTextForPlayer(Boxer2, "~r~Luta interrompida", 5000, 1);
}
}
else if(Boxer2 == playerid)
{
if(IsPlayerConnected(Boxer1))
{
PlayerBoxing[Boxer1] = 0;
SetPlayerPos(Boxer1, 765.8433,3.2924,1000.7186);
SetPlayerInterior(Boxer1, 5);
GameTextForPlayer(Boxer1, "~r~Luta interrompida", 5000, 1);
}
}
InRing = 0;
RorndStarted = 0;
Boxer1 = 255;
Boxer2 = 255;
TBoxer = 255;
}
if(TransportDuty[playerid] == 1)
{
TaxiDrivers -= 1;
}
else if(TransportDuty[playerid] == 2)
{
BusDrivers -= 1;
}
if(IsACop(playerid))
{
if(EmpregoDuty[playerid] == 2) { Copsronda -= 1; }
}
if(PlayerInfo[playerid][pMembro] == 4 || PlayerInfo[playerid][pLider] == 4)//1 daki pr baixo os 3
{
if(EmpregoDuty[playerid] == 2) { Medics -= 1; }
}
else if(IsAMec(playerid))
{
if(EmpregoDuty[playerid] == 2) { Mechanics -= 1; }
}
//CurrentMoney[playerid] = 0;
OnPlayerSave(playerid);
BusrouteEast[playerid][0] = 0;
BusrouteWest[playerid][0] = 0;
if((PlayerInfo[playerid][pAdmin] >= 1) && (PlayerInfo[playerid][pAdmin] <= GERENTE))
{
new string[256];
new AdminName[MAX_PLAYER_NAME];
GetPlayerName(playerid, AdminName, sizeof(AdminName));
format(string, sizeof(string), "~y~%s: ~r~OFF", AdminName);
for(new i=0; i<MAX_PLAYERS; i++)
{
GameTextForPlayer(i, string , 5000, 1);
}
}
}
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(IsPlayerNPC(playerid)) return true;
new oldnew;
PlayerInactivity[playerid] = 0;
if(newstate == PLAYER_STATE_ONFOOT)
{
if(TransportDuty[playerid] > 0)
{
if(TransportDuty[playerid] == 1)
{
TaxiDrivers -= 1;
}
else if(TransportDuty[playerid] == 2)
{
BusDrivers -= 1;
}
TransportDuty[playerid] = 0;
format(gstring, sizeof(gstring), "* Estб fora de serviзo, ganhou R$%d.", TransportMoney[playerid]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, gstring);
GivePlayerMoney(playerid, TransportMoney[playerid]);
ConsumingMoney[playerid] = 1; TransportValue[playerid] = 0; TransportMoney[playerid] = 0;
}
if(TransportCost[playerid] > 0 && TransportDriver[playerid] < 999)
{
if(IsPlayerConnected(TransportDriver[playerid]))
{
TransportMoney[TransportDriver[playerid]] += TransportCost[playerid];
TransportTime[TransportDriver[playerid]] = 0;
TransportCost[TransportDriver[playerid]] = 0;
format(gstring, sizeof(gstring), "~w~Custo da corrida~n~~r~R$%d",TransportCost[playerid]);
GameTextForPlayer(playerid, gstring, 5000, 1);
format(gstring, sizeof(gstring), "~w~Passageiro saiu do taxi~n~~g~ganhou R$%d",TransportCost[playerid]);
GameTextForPlayer(TransportDriver[playerid], gstring, 5000, 1);
GivePlayerMoney(playerid, -TransportCost[playerid]);
TransportCost[playerid] = 0;
TransportTime[playerid] = 0;
TransportDriver[playerid] = 999;
}
}
TelePos[playerid][0] = 0.0;
TelePos[playerid][1] = 0.0;
}
if (newstate == 2 || newstate == 3)
{
if (oldnew == 0)
{
format(gstring, sizeof(gstring), "~g~%s",vehName[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
GameTextForPlayer(playerid, gstring, 6000, 1);
}
}
if(newstate == PLAYER_STATE_PASSENGER) // TAXI, BUSSES, BOTS
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == 2 && TransportDuty[i] > 0)
{
if(GetPlayerMoney(playerid) < TransportValue[i])
{
format(gstring, sizeof(gstring), "* Vocк precisa de R$%d para entrar.", TransportValue[i]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, gstring);
RemovePlayerFromVehicleEx(playerid);
}
else
{
if(TransportDuty[i] == 1)
{
format(gstring, sizeof(gstring), "* Pagou R$%d para o taxista.", TransportValue[i]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, gstring);
format(gstring, sizeof(gstring), "* Passageiro %s entrou no Taxi.", name);
SendClientMessage(i, COLOR_LIGHTBLUE, gstring);
TransportTime[i] = 1;
TransportTime[playerid] = 1;
TransportCost[playerid] = TransportValue[i];
TransportCost[i] = TransportValue[i];
TransportDriver[playerid] = i;
}
else if(TransportDuty[i] == 2)
{
format(gstring, sizeof(gstring), "* Pagou R$%d para o Motorista De Onibus.", TransportValue[i]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, gstring);
format(gstring, sizeof(gstring), "* Passageiro %s entrou no Onibus.", name);
SendClientMessage(i, COLOR_LIGHTBLUE, gstring);
}
GivePlayerMoney(playerid, - TransportValue[i]);
TransportMoney[i] += TransportValue[i];
}
}
}
}
}
if(newstate == 2)
{
for(new i = 0; i < sizeof(CarInfo); i++)
{
new newcar = GetPlayerVehicleID(playerid);
new Aluguelbox[256];
//new string[256];
if(newcar == CarInfo[i][ownedvehicle])
{
if(CarInfo[i][cOwned]==0)
{
Controle(playerid, 0);
CarOffered[playerid]=1;
//format(string,sizeof(string),"~w~Carro: %s~n~Preco: ~g~%d~n~~w~/veiculo comprar para comprar",CarInfo[i][cDescription],CarInfo[i][cValue]);
format(Aluguelbox, sizeof(Aluguelbox),"Carro: %s Preco: %d\nGostaria de compra-lo ?", CarInfo[i][cDescription],CarInfo[i][cValue]);
Controle(playerid, 0);
ShowPlayerDialog(playerid, 2624, DIALOG_STYLE_MSGBOX, "Deseja comprar este veнculo ?", Aluguelbox, "Sim", "Nгo");
}
if(CarInfo[i][cOwned]==1)
{
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
if(strcmp(playername,CarInfo[i][cOwner],true)==0)
{
format(gstring,sizeof(gstring),"Vocк entrou no seu carro ele tem R$%d de grana no porta luva. Use: /retirargrana para pegar.",CarInfo[i][cGrana]);
SendClientMessage(playerid, COLOR_GREY, gstring);
TogglePlayerControllable(playerid, 1);
}
else
{
format(gstring,sizeof(gstring),"Vocк pagou R$%d para andar no veiculo de %s",granacarro,CarInfo[i][cOwner]);
SendClientMessage(playerid, COLOR_GREY, gstring);
CarInfo[i][cGrana] += granacarro;
GivePlayerMoney(playerid, -granacarro);
}
}
}
}
}
if(newstate == PLAYER_STATE_DRIVER)
{// 38 / 49 / 56 = SS
new newcar = GetPlayerVehicleID(playerid);
new oldcar = gLastCar[playerid];
new HouseCar = PlayerInfo[playerid][pPHousekey]+totalveiculos;
TelePos[playerid][0] = 0.0;
TelePos[playerid][1] = 0.0;
new carid=GetVehicleModel(newcar);
if(carid == 0 || carid == 0 || carid == 0) { }
else
{
if(IsAAztecaCar(newcar))
{
if(!IsAAzteca(playerid))
{
SendClientMessage(playerid, COR_AZTECAS, "Vocк nгo й um Azteca, por isso nгo tem a chave desse veнculo !");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsAOniCar(newcar))
{
if(!IsAOni(playerid))
{
SendClientMessage(playerid, COLOR_GRAD2, "Vocк nгo й um Motorista De Onibus, por isso nгo tem a chave desse veнculo !");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsAMecCar(newcar))
{
if(PlayerInfo[playerid][pEmprego] != 5)
{
SendClientMessage(playerid, COLOR_GRAD2, "Vocк nгo й um Mecвnico, por isso nгo tem a chave desse veнculo !");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsADriCar(newcar))
{
if(!IsADri(playerid))
{
SendClientMessage(playerid, COR_DRIFTERS, "Vocк nгo й um Drift, por isso nгo tem a chave desse veнculo !");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsAComandoVermelhoCar(newcar))
{
if(GetPlayerOrg(playerid) != 19)
{
SendClientMessage(playerid, 0xF6000000, "Vocк nгo й dos Comando Vermelho, por isso nгo tem a chave desse veнculo !");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsACaminhoneiroCar(newcar))
{
if(!IsACaminhoneiro(playerid))
{
SendClientMessage(playerid, COLOR_GRAD2, "Vocк nгo й um Caminhoneiro, por isso nгo tem a chave desse veнculo !");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsAJornalCar(newcar))
{
if(!IsAJornal(playerid))
{
SendClientMessage(playerid, COR_REP, "Vocк nгo й um Repуrter, por isso nгo tem a chave desse veнculo !");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsAHamasCar(newcar))
{
if(!IsAHamas(playerid))
{
SendClientMessage(playerid, COR_HAMAS, "Vocк nгo й do Hamas, por isso nгo tem a chave desse veнculo !");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsASonsofAnarchyCar(newcar))
{
if(!IsASonsofAnarchy(playerid))
{
SendClientMessage(playerid, COR_SONS, "Vocк nгo й dos The Warriors, por isso nгo tem a chave desse veнculo !");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsATriadCar(newcar))
{
if(!IsATriad(playerid))
{
SendClientMessage(playerid, COR_TRIADS, "Vocк nгo й dos Triads, por isso nгo tem a chave desse veнculo !");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsABallasCar(newcar))
{
if(!IsABallas(playerid))
{
SendClientMessage(playerid, COR_BALLAS, "Vocк nгo й dos Ballas, por isso nгo tem a chave desse veнculo !");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsAVagosCar(newcar))
{
if(!IsAVagos(playerid))
{
SendClientMessage(playerid, COR_VAGOS, "Vocк nгo й dos Vagos, por isso nгo tem a chave desse veнculo !");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsATaxiCar(newcar))
{
if(!IsATaxi(playerid))
{
SendClientMessage(playerid, COLOR_TAXISTA, "Vocк nгo й um Taxista, por isso nгo tem a chave desse veнculo !");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsAGrooveCar(newcar))
{
if(!IsAGroove(playerid))
{
SendClientMessage(playerid, COR_GRO, "Vocк nгo й da Groove Street, por isso nгo tem a chave desse veнculo !");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsAAlCar(newcar))
{
if(!IsAAl(playerid))
{
SendClientMessage(playerid, COR_AL, "Vocк nгo й da Al'Qaeda, por isso nгo tem a chave desse veнculo !");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsAFARCCar(newcar))
{
if(!IsAFARC(playerid))
{
SendClientMessage(playerid, COR_FARC, "Vocк nгo й da F.A.R.C, por isso nгo tem a chave desse veнculo !");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsAPoliciaCivilCar(newcar))
{
if(GetPlayerOrg(playerid) != 16)
{
SendClientMessage(playerid, COR_PC, "Vocк nгo й da Polнcia Civil, por isso nгo tem a chave desse veнculo !");
RemovePlayerFromVehicleEx(playerid);
}
if(OnDuty[playerid] != 1)
{
SendClientMessage(playerid,COLOR_RED,"Vocк nгo bateu o cartгo.");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsABOPEsCar(newcar))
{
if(GetPlayerOrg(playerid) != 2)
{
SendClientMessage(playerid, COR_BOPE, "Vocк nгo й do B.O.P.E, por isso nгo tem a chave desse veнculo !");
RemovePlayerFromVehicleEx(playerid);
}
if(OnDuty[playerid] != 1)
{
SendClientMessage(playerid,COLOR_RED,"Vocк nгo bateu o cartгo.");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsAPFCar(newcar))
{
if(GetPlayerOrg(playerid) != 11)
{
SendClientMessage(playerid, COR_PF, "Vocк nгo й do F.B.I, por isso nгo tem a chave desse veнculo !");
RemovePlayerFromVehicleEx(playerid);
}
if(OnDuty[playerid] != 1)
{
SendClientMessage(playerid,COLOR_RED,"Vocк nгo bateu o cartгo.");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsAExCar(newcar))
{
if(GetPlayerOrg(playerid) != 3)
{
SendClientMessage(playerid, COR_EXE, "Vocк nгo й do Exйrcito, por isso nгo tem a chave desse veнculo !");
RemovePlayerFromVehicleEx(playerid);
}
if(OnDuty[playerid] != 1)
{
SendClientMessage(playerid,COLOR_RED,"Vocк nгo bateu o cartгo.");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsACopCar(newcar))
{
if(GetPlayerOrg(playerid) != 1)
{
SendClientMessage(playerid, COR_PM, "Vocк nгo й da Polнcia Mнlitar, por isso nгo tem a chave desse veнculo !");
RemovePlayerFromVehicleEx(playerid);
}
if(OnDuty[playerid] != 1)
{
SendClientMessage(playerid,COLOR_RED,"Vocк nгo bateu o cartгo.");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsAHitCar(newcar))
{
if(!IsAHit(playerid))
{
SendClientMessage(playerid, COR_HITMAN, "Vocк nгo й um Hitman, por isso nгo tem a chave desse veнculo !");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsAYaCar(newcar))
{
if(!IsAYa(playerid))
{
SendClientMessage(playerid, COR_YAK, "Vocк nгo й da Mбfia Yakuza, por isso nгo tem a chave desse veнculo !");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsACosaNostraCar(newcar))
{
if(!IsACosaNostra(playerid))
{
SendClientMessage(playerid, COR_COSA, "Vocк nгo й da Mбfia Cosa Nostra, por isso nгo tem a chave desse veнculo !");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsAGOVCar(newcar))
{
if(!IsAGOV(playerid))
{
SendClientMessage(playerid, COR_PRE, "Vocк nгo й do governo, por isso nгo tem a chave desse veнculo !");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsAnAmbulanceCar(newcar))
{
if(!IsAAmbu(playerid))
{
SendClientMessage(playerid, COR_SAMU, "Vocк nгo й um Mйdico, por isso nгo tem a chave desse veнculo !");
RemovePlayerFromVehicleEx(playerid);
}
}
}
if(IsAPlane(newcar))
{
if(PlayerInfo[playerid][pFlyLic] < 1)
{
SendClientMessage(playerid, COLOR_GREY, "Vocк nгo tem licenзa para Voar!");
SendClientMessage(playerid, COLOR_GREY, "Para Adquirir Licenзas Digite /gps Centro de Licencas!");
SetPlayerCriminal(playerid,255,"Voando Sem Licenзa");
}
}
else
{
if(PlayerInfo[playerid][pCarLic] < 1)
{
if(PlayerDrunk[playerid] >= 1)
{
SetPlayerCriminal(playerid,255, "Dirigindo Bebado");
}
if(IsABikeCar(newcar)) { }
else {
SendClientMessage(playerid, COLOR_GREY, "Vocк nгo tem licenзa para dirigir carro!");
SendClientMessage(playerid, COLOR_GREY, "Para Adquirir Licenзas Digite /gps Centro de Licencas!");
SetPlayerCriminal(playerid,255,"Dirigindo Sem Carteira");
}
}
else if(PlayerDrunk[playerid] >= 1)
{
SetPlayerCriminal(playerid,255, "Dirigindo Bкbado");
}
}
if((newcar >= 322 && newcar <=367) || (newcar >= 402 && newcar <=408))
{
if (HireCar[playerid] != newcar)
{
new Aluguelbox[128];
format(Aluguelbox, sizeof(Aluguelbox),"Este Veiculo pode ser alugado Preзo:R$%d\nDeseja Aluga-lo ?", SBizzInfo[1][sbEntranceCost]);
Controle(playerid, 0);
ShowPlayerDialog(playerid, DIALOG_ALUGAR, DIALOG_STYLE_MSGBOX, "Aluguel de Veiculos", Aluguelbox, "Sim", "Nгo");
}
}
if((newcar >= 368 && newcar <= 370))
{
if (HireCar[playerid] != newcar)
{
new Aluguelbox[128];
format(Aluguelbox, sizeof(Aluguelbox),"Este Helicуptero pode ser alugado Preзo:R$%d\nDeseja Aluga-lo ?", SBizzInfo[19][sbEntranceCost]);
Controle(playerid, 0);
ShowPlayerDialog(playerid, DIALOG_ALUGAR2, DIALOG_STYLE_MSGBOX, "Aluguel de Helicopteros", Aluguelbox, "Sim", "Nгo");
}
}
else if(IsABikeCar(newcar))
{
SendClientMessage(playerid, COR_GRO, "Olб novato, seja bem vindo ao nosso servidor se tiver dъvidas use /pegarticket.");
SendClientMessage(playerid, COR_GRO, "Se vocк quiser saber alguns lugares importantes use /gps.");
SendClientMessage(playerid, COR_GRO, "Obrigado por Jogar aqui,{FF0000} Brasil Mega City.");
}
if(oldcar != 301)
{
if((HouseCar != oldcar && oldcar != 0) && (HireCar[playerid] != oldcar && newcar != HouseCar))
{
if(gLastDriver[oldcar] == playerid && oldcar != newcar)
{
gLastDriver[oldcar] = 300;
VTrancado[oldcar] = 0;
UnLockCar(oldcar);
}
}
}
gLastCar[playerid] = newcar;
gLastDriver[newcar] = playerid;
}
if(newstate == PLAYER_STATE_SPAWNED && logouagora[playerid] ==0 )
{
if(sincronizando[playerid] == 1)
{
return true;
}
new Float: lwx, Float:lwy, Float:lwz;
GetPlayerPos(playerid, lwx, lwy, lwz);
if((lwz > 530.0 && PlayerInfo[playerid][pInt] == 0) || PlayerToPoint(1000.0, playerid, -1041.9,-1868.4,79.1)) //the highest land point in sa = 526.8
{
if(sincronizando[playerid] == 1)
{
return true;
}
SetPlayerSpawn(playerid);
}
TelePos[playerid][0] = 0.0;
TelePos[playerid][1] = 0.0;
gPlayerSpawned[playerid] = 1;
SafeTime[playerid] = 60;
}
return true;
}