Jump to content

random vehicle chage pick up


meh

Recommended Posts

okay, guys, thanx i got this. now another question. i'm still trying to create a map with random vehicle chage pick up. so used this code:

    local randomPickup_vehicleID = 513 -- this is the stuntplane's vehicleID. when you place a stuntplane vehiclechange pickup, then it will give you a random vehicle instead of stuntplane. if not stuntplane, write some other vehicleID here 
    local randomVehicleIDS = { 429, 411, 541, 559, 415, 561, 480, 560, 562, 506, 565, 451, 434, 558, 494, 555, 502, 477, 503 } -- these are the random vehicle ids. when you hit the random vehicle pickup, it gives you one of these vehicles. 
      
    addEvent("onPlayerPickUpRacePickup", true) 
    addEventHandler("onPlayerPickUpRacePickup", getRootElement(), 
        function(pickupID, pickupType, vehicleModel) 
            if pickupType == "vehiclechange" and vehicleModel == randomPickup_vehicleID then 
                setElementModel(getPedOccupiedVehicle(source), randomVehicleIDS[math.random(1, #randomVehicleIDS)]) 
            end 
        end 
    ) 

and i did put a stuntplane vehicle change pickup. but it still doesn't work. :? do i need to use some additional files\scripts\etc apart from random.map, meta.xml and script.lua?

this is how meta looks like btw:

<meta> 
    <info gamemodes="race" type="map" name="Lucky luc" author="meh" version="1.0.0" description="wtf"></info> 
    <map src="random.map" dimension="0"></map> 
    <settings> 
        <script src="server.lua" type="server" /> 
        <setting name="#minplayers" value="[ 0 ]"></setting> 
        <setting name="#maxplayers" value="[ 128 ]"></setting> 
        <setting name="#gravity" value="[ 0.008000 ]"></setting> 
        <setting name="#weather" value="[ 0 ]"></setting> 
        <setting name="#time" value="12:0"></setting> 
        <setting name="#locked_time" value="[ false ]"></setting> 
        <setting name="#waveheight" value="[ 0 ]"></setting> 
        <setting name="#gamespeed" value="[ 1 ]"></setting> 
    </settings> 
</meta> 
  

Link to comment
Guest Guest4401
>    gamemodes="race" type="map" name="Lucky luc" author="meh" version="1.0.0" description="wtf">>    src="random.map" dimension="0">>    >        name="#minplayers" value="[ 0 ]">>        name="#maxplayers" value="[ 128 ]">>        name="#gravity" value="[ 0.008000 ]">>        name="#weather" value="[ 0 ]">>        name="#time" value="12:0">>        name="#locked_time" value="[ false ]">>        name="#waveheight" value="[ 0 ]">>        name="#gamespeed" value="[ 1 ]">>    >    ="server.lua" type="server" />>

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