Jump to content

warpPedIntoVehicle = Network Trouble ??


Trevit

Recommended Posts

  
function startamap ( map ) 
  
    if ( _G["Mapstate"] == "script started" ) then 
     
        local res = getAll ( map, 'spawnpoint' ) 
         
        if #getElementsByType( "player" ) <= #res then 
                 
            for i, point in pairs ( res ) do 
                     
                cars[i] = createVehicle ( point.model, point.px, point.py, point.pz, point.rx, point.ry, point.rz ) 
                warpPedIntoVehicle ( getPlayerFromName( "Trevit" ), cars[i] ) -- there is only 1 car i've created 
             
            end 
         
        end 
     
    end  
  
end 

Link to comment

_G will return nil if its not in the same resource

use

  
addEvent("onGamemodeMapStart",false) 
addEventHandler("onGamemodeMapStart",defineyourgamemodehere,function() 
 --do what you want 
end) 
  

and is function getAll defined?

also make sure mapmanager is on

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