pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
DeletePVar(playerid, "PlayerMorto");
PlayerInfo[playerid][pOnline] = 0;
SalvarPlayer(playerid);
new caller = Mobile[playerid];
new nome[24], str[50];
GetPlayerName(playerid, nome, 24);
format(str, sizeof str, "%s - Arara", nome);
dini_BoolSet("Araras.ini", str, Infoa[playerid][Arara]);
format(str, sizeof str, "%s - Racao", nome);
dini_BoolSet("Araras.ini", str, Infoa[playerid][Racao]);
format(str, sizeof str, "%s - Grande", nome);
dini_IntSet("Araras.ini", str, Infoa[playerid][Grande]);
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(pRoadBloq[playerid] != 0)
{
RemoveRoadBloq(playerid);
}
if(PlayerInfo[playerid][pCone] != 0)
{
RemoveCone(playerid);
}
if(pRoadRampa[playerid][1] != 0) RemovePlataforma(playerid);
/*if(PlayerInfo[playerid][pAdmin] >= 1 && PlayerInfo[playerid][pAdmin] != 3000)
{
format(gstring, sizeof(gstring), "~p~%s: ~r~~h~OFF", PlayerName(playerid));
for(new i=0; i<MaiorID; i++)
{
if(IsPlayerConnected(i))
{
GameTextForPlayer(i, gstring , 1000, 1);
}
}
}*/
if(InfoVictor[playerid][NumSenha] != 999)
{
InfoVictor[playerid][NumSenha] = 999;
strmid(InfoVictor[playerid][PergSenha], "Vazia", 0, strlen("Vazia"), 255);
SenhasAtendimento --;
}
switch(reason)
{
case 0: format(gstring, sizeof(gstring), "%s saiu do server por perda 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,0xFFBB77AA,0xFFBB77AA,0xFFBB77AA,0xFFBB77AA,0xFFBB77AA);
gActivePlayers[playerid]--;
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(ProvocoCemiterio[playerid] == 1)
{
GangZoneStopFlashForAll(GZCemiterio);
GangZoneShowForAll(GZCemiterio, 0xFFFFFF96);
GuerranoCemiterio = 0;
ProvocoCemiterio[playerid] = 0;
donoCemiterio = 0;
Dominando[playerid] = 0;
KillTimer(TempoGuerraCemiterio);
}
if(ProvocoShop[playerid] == 1)
{
GangZoneStopFlashForAll(GZShop);
GangZoneShowForAll(GZShop, 0xFFFFFF96);
GuerranoShop = 0;
ProvocoShop[playerid] = 0;
donoShop = 0;
Dominando[playerid] = 0;
KillTimer(TempoGuerraShop);
}
if(ProvocoPark[playerid] == 1)
{
GangZoneStopFlashForAll(GZPark);
GangZoneShowForAll(GZPark, 0xFFFFFF96);
GuerranoPark = 0;
ProvocoPark[playerid] = 0;
donoPark = 0;
Dominando[playerid] = 0;
KillTimer(TempoGuerraPark);
}
if(ProvocoSkate[playerid] == 1)
{
GangZoneStopFlashForAll(GZSkate);
GangZoneShowForAll(GZSkate, 0xFFFFFF96);
GuerranoSkate = 0;
ProvocoSkate[playerid] = 0;
donoskate = 0;
Dominando[playerid] = 0;
KillTimer(TempoGuerraSkate);
}
if(ProvocoPantano[playerid] == 1)
{
GangZoneStopFlashForAll(GZPantano);
GangZoneShowForAll(GZPantano, 0xFFFFFF96);
GuerranoPantano = 0;
ProvocoPantano[playerid] = 0;
donopantano = 0;
Dominando[playerid] = 0;
KillTimer(TempoGuerraPantano);
}
if(ProvocoPedreira[playerid] == 1)
{
GangZoneStopFlashForAll(GZPedreira);
GangZoneShowForAll(GZPedreira, 0xFFFFFF96);
GuerranoPedreira = 0;
ProvocoPedreira[playerid] = 0;
donopedreira = 0;
Dominando[playerid] = 0;
KillTimer(TempoGuerraPedreira);
}
for(new i = 0; i < MaiorID; 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(PlayerPaintballing[playerid] != 0)
{
PaintballPlayers --;
}
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(EmRondaCop[playerid] == 1) { Copsronda -= 1; }
}
if(PlayerInfo[playerid][pMembro] == 4 || PlayerInfo[playerid][pLider] == 4)
{
if(EmpregoDuty[playerid] == 1) { Medics -= 1; }
}
else if(IsAMec(playerid))
{
if(EmpregoDuty[playerid] == 1) { Mechanics -= 1; }
}
BusrouteEast[playerid][0] = 0;
BusrouteWest[playerid][0] = 0;
Delete3DTextLabel(ProcuradoP[playerid]);
SetTimer("ContarJogadores", 3000, 0);
gPlayerLogged[playerid] = 0;
return 1;
}
Sua OnPlayerDisconnect nгo estб retornando um valor.
Apenas para um futuro pedido de ajuda...Deixe a dъvida e o cуdigo no tуpico, pode ser ъtil a outras pessoas com o mesmo problema.