11.09.2012, 13:14
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..
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
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