Need some PLZ

Helmet

New Member
I wrote a simple spawn script for players to use and I need to refine it so the players stop spamming the feature. Players can spawn a vehicle in every 5 mins and the vehicle is then deleted, but the players found that if they log out and then back in, the vehicle stays on the server. I need an global Array to add newly spawned vehicles to a list and a eventhandler to update the list on the client/server side and when the player logs out, I can exe. a script to access the array, ID the player and deletevehicle from the array and remove that element.

_spwnd = [playerID, _vehicle];

SpawnedObjects = [_spwnd,_spwnd];
or
SpawnedObjects = [[playerID, _vehicle],[playerID, _vehicle],[playerID, _vehicle]]

Im familiar with arrays but not eventhandlers, any help plz!
 
You could use a simple action so players need something to MAKE the car/bike. And if you want,put that item in the default loadout? :)
I would use : Toolbox to make a bike and players spawn with ONE toolbox ;)
 
You could setVariable the owner name on an object when it is published, or the owners characterID. Then do a foreach for each vehicle of that classname on the map using getVariable, stick all defined results into an array, and then compare the players playerid to the array.

If the playersid is in the array, dont allow them to build a vehicle.
 
thx for the reply, I'm painting a picture of what u are saying. could u plot me a small example?
 
fn_selfActions
Code:
if (isAlive and _canDo) then {
    _carArray = [];
    {
        _carArray = _x getVariable "carOwnerID";
    } foreach Entities "VWGolf";
   
    _ownsCar = ((getPlayerUID) in _carArray);
    if (!_ownsCar) then {
        Add actions to create a car and setVariable the carOwnerID = to getPlayerID
    };
};

Very rough code but you should get the idea.
 
Back
Top