Trevit Posted June 8, 2011 Share Posted June 8, 2011 Hi, Whenever I use this function, there are a "Network Trouble". I hope you can help me. Link to comment
Trevit Posted June 8, 2011 Author Share Posted June 8, 2011 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
karlis Posted June 9, 2011 Share Posted June 9, 2011 _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
UAEpro Posted June 9, 2011 Share Posted June 9, 2011 small question can i know what is _G ?? Link to comment
Castillo Posted June 9, 2011 Share Posted June 9, 2011 This may tell you what it does: http://lua-users.org/wiki/CoreFunctionsTutorial Link to comment
AGENT_STEELMEAT Posted June 9, 2011 Share Posted June 9, 2011 warpPedIntoVehicle was causing network trouble in a MTA 1.1 nightly a week or two ago, but it's been fixed. If you are using a 1.1 nightly, make sure it's the latest. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now