Car-delete by the wrong person
#1

Hi Guys!

I have a problem since a couple of months ago but i cannot find whats wrong.
Its a command /car where you can get a car by carname. But you can only keep 1 car.

my code:


Definition:
Код:
new Vehicle[MAX_PLAYERS] = {INVALID_VEHICLE_ID,...};
OnPlayerDisconnect:
Код:
DestroyVehicle(Vehicle[playerid]);
Vehicle[playerid] = INVALID_VEHICLE_ID;
at the /car command:

Код:
if(Vehicle[playerid] != INVALID_VEHICLE_ID) DestroyVehicle(Vehicle[playerid]);
Vehicle[playerid] = CreateVehicle(vehicle, x, y, z, a+90, c1, c2, -1);

the problem is, that sometimes when someone spawn a car, the car from another person disappeared, so that they have the same slot, how can that be?

MfG CC
Reply
#2

did you destroying cars after player disconect?
Reply
#3

i am destroying the car yes, but the problem is, sometimes, when someone uses /car a car of another person gets destroyed

/edit: i asked so many persons about but all say, that there should be no problem?
Reply
#4

Push
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)