18.02.2014, 19:36
you might want to be able to determine which playerid a vehicle belongs to...
...and also using a /lock command on a vehicle, retrieved by the playerid:
by having a "2-way" array of players and vehicles, you have all possibilities to enhance the behavior.
any vehicle spawned (at server (re)start / or ingame created), will have no owner - a player logging in doesnt own a vehicle, unless the f.ex. <playername>.ini also includes the vehicleid, its' position and rotation, maybe colors aswell, and, last but not least, the playerid.
when a vehicle blows up, dont forget to either reset its ownerID, or ignore it.
when a player disconnects, save that vehicle, and destroy it, OR reset the owner so other players can use it (if the vehicle is not auto-locked).
Код:
new VehicleIDOwner[2000];
Код:
new PlayerOwnsVehicleID[Max-players];
any vehicle spawned (at server (re)start / or ingame created), will have no owner - a player logging in doesnt own a vehicle, unless the f.ex. <playername>.ini also includes the vehicleid, its' position and rotation, maybe colors aswell, and, last but not least, the playerid.
when a vehicle blows up, dont forget to either reset its ownerID, or ignore it.
when a player disconnects, save that vehicle, and destroy it, OR reset the owner so other players can use it (if the vehicle is not auto-locked).