addToWorld

From GTA Connected
Jump to: navigation, search

Function Server and Client All Games Online and Offline

Server 1.0.0, Client 1.0.0

unknown addToWorld(Element element)

Description

The addToWorld function is used to add the element to the game.
Currently, this function only needs to be called for elements created server-side, not for elements created client-side.

Parameters

Documentation Missing: Parameters

Returns

Success Returns

Documentation Missing: Success returns

Failure Returns

Documentation Missing: Failure returns

Notes

Examples

Example 1 - JavaScript - Server-Side:

addCommandHandler('vehicle', function(command, parameters, client)
{
    if(client.player && parameters.trim() != '') // ensure player is spawned and input text isn't blank
    {
        var model = parseInt(parameters);
        var vehicle = createVehicle(model, client.player.position);
        addToWorld(vehicle); // currently, if the element is created client-side, this line of code isn'
t needed.
    }
});

Compatibility

  • This function was previously named game.addToWorld in version 1.0.71.

Related

Server Related

addToWorld
gta.planesEnabled
gta.ssvBridgeEnabled
gta.trainsEnabled
world

world.forceWeather
world.hour
world.minute
world.planesEnabled
world.second
world.ssvBridgeEnabled
world.trainsEnabled
world.weather


Client Related

addToWorld
gta.findGroundZForCoord - Previous Name: findGroundZForCoord
gta.setPlanesEnabled - Previous Name: setPlanesEnabled
gta.setTrainsEnabled - Previous Name: setTrainsEnabled
removeFromWorld