Jump to content

Aircraft Spawn Problem


justn

Recommended Posts

So i have made a group base for my group and there's a problem. when the player spawns maverick ( 487 ) it doesnt spawn in the location below, can anyone help me? No errors in debugscript 3

Client-Side

addEventHandler ("onClientGUIClick", TMZGroup_Spawn, 
function (button, state, absoluteX, absoluteYe) 
trigger(getLocalPlayer()) 
local name = guiGridListGetItemText( TMZGroup_Gridlist, guiGridListGetSelectedItem ( TMZGroup_Gridlist ), 1 ) 
triggerServerEvent('TMZ', getLocalPlayer(), name) 
end) 

Server-Side

AircraftIdSpawn = { 
{ 2254.8168945313, 547.88562011719, 25.22902}, 
{ 2334.2194824219, 544.73132324219, 25.261749267578}, 
} 
  
TableCars = {} 
  
addEvent('TMZ', true) 
addEventHandler('TMZ', root, 
function( nameCar ) 
if isElement( TableCars[source] ) then destroyElement( TableCars[source] ) end 
local id = getVehicleModelFromName( nameCar ) 
if id == 487 then  
local x, y, z = unpack( AircraftIdSpawn[math.random(#AircraftIdSpawn)] ) 
TableCars[source] = createVehicle( id, x, y, z )  
if not TableCars[source] then  
return end  
warpPedIntoVehicle ( source, TableCars[source] )  
setVehicleColor(veh[source], 0, 0, 150) 
return end 
local x,y,z = getElementPosition( source ) 
TableCars[source] = createVehicle( id, x,y,z ) 
if not TableCars[source] then return end 
warpPedIntoVehicle ( source, TableCars[source] )    
addVehicleUpgrade(TableCars[source], 1147) 
addVehicleUpgrade(TableCars[source], 1041) 
addVehicleUpgrade(TableCars[source], 1035) 
addVehicleUpgrade(TableCars[source], 1010) 
addVehicleUpgrade(TableCars[source], 1171) 
addVehicleUpgrade(TableCars[source], 1149) 
end 
) 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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