Jump to content

how to make car spawn


Recommended Posts

Posted

Here is a basic code to get you started:

local maker = createMarker ( 0, 0, 11, "cylinder", 2, 255, 255, 255 ,255 ) 
local vehicles = { } 
  
addEventHandler ( "onMarkerHit", marker, function ( p ) 
    if ( p and getElementType ( p ) == "player" and not isPedInVehicle ( p ) ) then 
         
        -- destroy their old vehicle, if it exists 
        if ( isElement ( vehicles [ p ] ) ) then 
            destroyElement ( vehicles [ p ] ) 
        end 
  
        -- create the new vehicle 
        vehicles [ p ] = createVehicle ( 411, 0, 0, 20 ) 
    end  
end ) 

Posted
Here is a basic code to get you started:
local maker = createMarker ( 0, 0, 11, "cylinder", 2, 255, 255, 255 ,255 ) 
local vehicles = { } 
  
addEventHandler ( "onMarkerHit", marker, function ( p ) 
    if ( p and getElementType ( p ) == "player" and not isPedInVehicle ( p ) ) then 
         
        -- destroy their old vehicle, if it exists 
        if ( isElement ( vehicles [ p ] ) ) then 
            destroyElement ( vehicles [ p ] ) 
        end 
  
        -- create the new vehicle 
        vehicles [ p ] = createVehicle ( 411, 0, 0, 20 ) 
    end  
end ) 

so on line 1.local maker = createMarker ( 0, 0, 11, "cylinder", 2, 255, 255, 255 ,255 )

what does it mean ? sorry for too much questions but im new scriptor can u explane that language

Posted

local maker = createMarker 

to make a marker if you hit the marker and your not in a vehicle then show the gui window to Select Cars . . .

- New , Kill System

- New, GameMode Intro

- Leve / Exp System

- New nametag showing style

- New , Hud For Players

- Skin Selection from SA-MP

- Money System / Buy Weapons

- Drop Weapons

- New, Flood System

- New , Group Assign

- Gun license For Weapons

- Random Rule System For Money

Posted
Here is a basic code to get you started:
local maker = createMarker ( 0, 0, 11, "cylinder", 2, 255, 255, 255 ,255 ) 
local vehicles = { } 
  
addEventHandler ( "onMarkerHit", marker, function ( p ) 
    if ( p and getElementType ( p ) == "player" and not isPedInVehicle ( p ) ) then 
         
        -- destroy their old vehicle, if it exists 
        if ( isElement ( vehicles [ p ] ) ) then 
            destroyElement ( vehicles [ p ] ) 
        end 
  
        -- create the new vehicle 
        vehicles [ p ] = createVehicle ( 411, 0, 0, 20 ) 
    end  
end ) 

so on line 1.local maker = createMarker ( 0, 0, 11, "cylinder", 2, 255, 255, 255 ,255 )

what does it mean ? sorry for too much questions but im new scriptor can u explane that language

Line 1 is telling the script to create a maker element, and define it to the variable marker.

If you want to get a better understanding of Lua, you can try reading this to help you out:

viewtopic.php?f=148&t=75501

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...