Jump to content

createVehicle(...)


undefined

Recommended Posts

Hi guys.

Im work on the spawn system. But i have a problem.

When the player wasted, the vehicle created for only wasted player.

Where is the problem?

Server-Side

local area69SpawnLocation = { 
    {425, 306, 2020, 32, 20, 90, 306, 2020, 17.6, 285}, 
    {425, 306, 2000, 32, 20, 90, 306, 2000, 17.6, 285}, 
    {425, 306, 1980, 32, 20, 90, 306, 1980, 17.6, 285}, 
    {425, 306, 1960, 32, 20, 90, 306, 1960, 17.6, 285}, 
    {425, 306, 1940, 32, 20, 90, 306, 1940, 17.6, 285}, 
    {425, 306, 1920, 32, 20, 90, 306, 1920, 17.6, 285} 
} 
  
addEventHandler( "onPlayerWasted", root, function(totalAmmo, killer, killerWeapon, bodypart, stealth) 
    local k = math.random(#area69SpawnLocation) 
    setTimer(createSpawnVehicle, 13500, 1, area69SpawnLocation[k][1], area69SpawnLocation[k][2], area69SpawnLocation[k][3], area69SpawnLocation[k][4], area69SpawnLocation[k][5], area69SpawnLocation[k][6], source, area69SpawnLocation[k][7], area69SpawnLocation[k][8], area69SpawnLocation[k][9], area69SpawnLocation[k][10]) 
end) 
  
addEventHandler( "onPlayerLogin", root, function( ) 
    local k = math.random(#area69SpawnLocation) 
    createSpawnVehicle( area69SpawnLocation[k][1], area69SpawnLocation[k][2], area69SpawnLocation[k][3], area69SpawnLocation[k][4], area69SpawnLocation[k][5], area69SpawnLocation[k][6], source, area69SpawnLocation[k][7], area69SpawnLocation[k][8], area69SpawnLocation[k][9], area69SpawnLocation[k][10]) 
end) 
  
function createSpawnVehicle(model, vehX, vehY, vehUpZ, vehDownZ, rotation, player, playerX, playerY, playerZ, skinID) 
    triggerClientEvent(player, "createSpawnVehicle", root, model, vehX, vehY, vehUpZ, vehDownZ, rotation, player, playerX, playerY, playerZ, skinID) 
end 

Client-Side

function createSpawnVehicle(model, vehX, vehY, vehUpZ, vehDownZ, rotation, player, playerX, playerY, playerZ, skinID) 
    vehicle = createVehicle(model, vehX, vehY, vehUpZ,  0, 0, rotation) 
end 
addEvent("createSpawnVehicle", true) 
addEventHandler("createSpawnVehicle", getRootElement(), createSpawnVehicle) 

Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...