18.02.2013, 16:39
Hy everyone,in my car system i put a function,when a player disconnect from server, his personal car(s) just destroy and when they connect back,the car reapper(because for 400+ cars it makes lag ...so..)
The car destroyes fine when a player disconnect but the problem si with creating the car when they came back.
at OnPlayerConnect i putt this:
This is just for personal car 1,i do the same for 2 and 3 but i did not post the rest here.
And at OnPlayerDisconnect i put:
SO,what is the problem guys?
The car destroyes fine when a player disconnect but the problem si with creating the car when they came back.
at OnPlayerConnect i putt this:
Код:
LoadCar(); new carkey = PlayerInfo[playerid][pPcarkey]; if(PlayerInfo[playerid][pPcarkey] > -1) { AddStaticVehicleEx(CarInfo[carkey][cModel],CarInfo[carkey][cLocationx],CarInfo[carkey][cLocationy],CarInfo[carkey][cLocationz]+1.0,CarInfo[carkey][cAngle],CarInfo[carkey][cColorOne],CarInfo[carkey][cColorTwo],60000); LoadComponents(carkey); }
And at OnPlayerDisconnect i put:
Код:
if(PlayerInfo[playerid][pPcarkey] != -1) { DestroyVehicle(carkey); } if(PlayerInfo[playerid][pPcarkey2] != -1) { DestroyVehicle(carkey2); } if(PlayerInfo[playerid][pPcarkey3] != -1) { DestroyVehicle(carkey3); }