SA-MP Forums Archive
"Variable" problem? - 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: "Variable" problem? (/showthread.php?tid=340903)



"Variable" problem? - Rinzler - 09.05.2012

Hello,

On my server when a player join any mini-game with cars or just spawn a vehicle, I use this variable:

Код:
DestroyVehicle(PlayerVehicle[playerid]);
PlayerVehicle[playerid] = CreateVehicle(.......
It works fine.. But it's buggy after 10/15mn of gameplay since the server is On. It seems that PlayerVehicle[MAX_PLAYERS]; become PlayerVehicle;

When a player spawn a vehicle, it destroy the vehicles of the others players :/

Any idea ?


Re: "Variable" problem? - Joe Staff - 09.05.2012

Make sure you Destroy the vehicle when a player disconnects


Re: "Variable" problem? - Rinzler - 09.05.2012

We was only two on the server, testing, so the problem can't be from there.
The vehicle is detroyed when players leaves, exit a minigame or spawn another one.

But it seems the problem is present on all server player variables :/


Re: "Variable" problem? - (SF)Noobanatior - 09.05.2012

change it to
pawn Код:
new PlayerVehicle[MAX_VEHICLES];
and it will go much better
as players max out at 500 and vehicles may go up to 2000