OnPlayerDisconnect(unsure why)
#5

I really have no idea about the pings at the time this occurred, but yeah i also think its a client sided connection issue (their poo internet)

The player partially loses connection.. still playing but "OnPlayerDisconnect" has been called.


small example.. very poor but an example..
pawn Код:
}

public OnPlayerDisconnect(playerid, reason)
{
    gPlayerDisconnect[playerid] = 1;
    UpdatePlayerAccount(playerid); // within this function (UpdatePlayerVehicle) is called
    return 1;
}

pawn Код:
//this is at the end of the vehicle saving function "UpdatePlayerVehicle"..after all mods have been saved.
if(gPlayerDisconnect[playerid] != 0)//apparently leaving
{
    if(gPlayerPurchasedCar[playerid] != 0)//their vehicleid
    {
        DestroyVehicle(gPlayerPurchasedCar[playerid]);//delete that vehicleid
    }
}

So basically the car can only be destroyed when gPlayerDisconnect doesn't equal 0.. but that doesn't explain to me how sometimes the car gets destroyed and the player is still connected, then the next joining player obtains that players vehicleid.. an now both players can /lock, /telecar an so on.. and it screws everything up...

gPlayerDisconnect is set to 0 in OnPlayerConnect an to 1 in OnPlayerDisconnect, these are the only two times this variable changes. So for now i have made a little function on a non looping 3 second timer.. which is called just after the players vehicle is deleted.. so now if gPlayerDisconnect equals 1 (the vehicle was deleted) and the player is still connected... kick!

Its my only option atm.


PS:could a moderator move this thread to scripting discussion please..
thank you and sorry for posting in the wrong section mb
Reply


Messages In This Thread
OnPlayerDisconnect(unsure why) - by Killa[DGZ] - 11.09.2012, 04:07
Re: OnPlayerDisconnect(unsure why) - by Glint - 11.09.2012, 07:22
Re: OnPlayerDisconnect(unsure why) - by Jay_ - 11.09.2012, 10:50
Re: OnPlayerDisconnect(unsure why) - by Glint - 11.09.2012, 11:01
Re: OnPlayerDisconnect(unsure why) - by Killa[DGZ] - 11.09.2012, 13:14
Re: OnPlayerDisconnect(unsure why) - by Glint - 11.09.2012, 13:33
Re: OnPlayerDisconnect(unsure why) - by Killa[DGZ] - 11.09.2012, 14:07
Re: OnPlayerDisconnect(unsure why) - by SAMP_Luke - 11.09.2012, 14:09
Re: OnPlayerDisconnect(unsure why) - by Killa[DGZ] - 11.09.2012, 14:33
Re: OnPlayerDisconnect(unsure why) - by SuperViper - 11.09.2012, 14:36

Forum Jump:


Users browsing this thread: 1 Guest(s)