SA-MP Forums Archive
Car-delete by the wrong person - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Car-delete by the wrong person (/showthread.php?tid=404801)



Car-delete by the wrong person - ULLLIIK - 04.01.2013

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


Re: Car-delete by the wrong person - mineralo - 04.01.2013

did you destroying cars after player disconect?


AW: Car-delete by the wrong person - ULLLIIK - 04.01.2013

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?


AW: Car-delete by the wrong person - ULLLIIK - 04.01.2013

Push