Sign in to follow this  
yMassai

Car

Recommended Posts

--Create Stuff 
function carCreateTrainStuff ( ) 
    car_marker_request = createMarker( 1507.69433, -1714.55761, 13.04687, "cylinder", 1.5, 250, 150, 50, 170) 
end 
addEventHandler ( "onResourceStart", resourceRoot, carCreateTrainStuff ) 
addEventHandler ( "onClientPedDamage", ped, function ( ) cancelEvent ( ) end ) 
  
--Test Gui 
function carCreateTestGUI ( hitElement ) 
    if ( source == car_marker_request ) then 
        triggerClientEvent ( hitElement, "carCreateTestGUI", hitElement ) 
    end 
end 
addEventHandler ( "onMarkerHit", root, carCreateTestGUI ) 

--Create GUI 
function carCreateTestGUI ( ) 
    car_window_main = guiCreateWindow(0.3,0.2,0.2,0.3,"Criador de Carros",true) 
    car_window_main_button_criar = guiCreateButton(0.010,0.85,0.6,0.130,"Criar",true,car_window_main) 
    car_window_main_button_x = guiCreateButton(0.85,0.140,0.120,0.10,"X",true,car_window_main) 
    showCursor ( true ) 
  
function createPlayerList () 
local playerList = guiCreateGridList ( 0.80, 0.10, 0.15, 0.60, true ) 
local column = guiGridListAddColumn( playerList, "Player", 0.85 ) 
    if ( column )  
        for id, player in ipairs(getElementsByType("player")) do 
            local row = guiGridListAddRow ( playerList ) 
            guiGridListSetItemText ( playerList, row, column, getPlayerName ( player ), false, false ) 
end 
addEvent ( "carCreateTestGUI", true ) 
addEventHandler ( "carCreateTestGUI", root, carCreateTestGUI ) 
  
--Destroy GUI 
function carDestroyTestGUI ( ) 
    if isElement ( car_window_main ) then 
        destroyElement ( car_window_main ) 
    end 
  
    if isElement ( car_window_main_button_criar ) then 
        destroyElement ( car_window_main_button_criar ) 
    end 
    if isElement ( car_window_main_button_x ) then 
        destroyElement ( car_window_main_button_x ) 
    end 
    showCursor ( false ) 
end 
  
--On test Window Click 
function carOnTestWindowClick ( ) 
   if ( source == car_window_main_button_criar ) then 
        triggerServerEvent ( "carCreateTest", localPlayer ) 
        carDestroyTestGUI ( ) 
   elseif ( source == car_window_main_button_x ) then 
        carDestroyTestGUI ( ) 
    end 
end 
addEventHandler ( "onClientGUIClick", root, carOnTestWindowClick ) 

This creates cars.

Someone could help me?

I wanted when the car is created automatically enter the car.

Share this post


Link to post
getElementPosition 
createVehicle 
warpPedIntoVehicle 
  

Share this post


Link to post

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.