Sex* Posted April 10, 2013 Share Posted April 10, 2013 in the end . Like this? It crashed this way btw. ------------------------------- addEvent("onMapStarting",true) addEventHandler("onMapStarting",getRootElement(), function ( ) if getResourceInfo(res, "type") == "map" then cancelEvent() end ) -------------------------- Link to comment
Kenix Posted April 10, 2013 Share Posted April 10, 2013 Yes but you need learn Lua anyway. And also 'res' variable is not defined. Link to comment
Sex* Posted April 10, 2013 Share Posted April 10, 2013 Yes but you need learn Lua anyway. And also 'res' variable is not defined. But why did it crash my script then?? Link to comment
Moderators IIYAMA Posted April 10, 2013 Moderators Share Posted April 10, 2013 (edited) Because it is an error. addEvent("onMapStarting",true) addEventHandler("onMapStarting",getRootElement(), function ( mapInfo, mapOptions, gameOptions ) --the parameters values are in tables. if getResourceInfo(source, "type") == "map" then --* cancelEvent() end end) -- "onMapStarting" we are already talking about maps.* -- source is the map. Maybe you should check this: https://wiki.multitheftauto.com/index.ph ... ource:Race Edited April 11, 2013 by Guest Link to comment
Sex* Posted April 11, 2013 Share Posted April 11, 2013 Because it is an error. addEvent("onMapStarting",true) addEventHandler("onMapStarting",getRootElement(), function ( mapInfo, mapOptions, gameOptions ) --the parameters values are in tables. if getResourceInfo(source, "type") == "map" then --* cancelEvent() end ) -- "onMapStarting" we are already talking about maps.* -- source is the map. Maybe you should check this: https://wiki.multitheftauto.com/index.ph ... ource:Race So the error is the event handlers? Link to comment
itoko Posted April 11, 2013 Share Posted April 11, 2013 Yes, you are actually cancelling the wrong event, which cause to cancel the map starting i guess. Link to comment
Moderators IIYAMA Posted April 11, 2013 Moderators Share Posted April 11, 2013 Yes this will cancel the map, because the map is the source. It is your code. addEvent("onMapStarting",true) addEventHandler("onMapStarting",getRootElement(), function ( ) if getResourceInfo(source, "type") == "map" then cancelEvent() end end) "onMapStarting" has nothing to do with the chatbox, I only finished the code that you made. Link to comment
Sex* Posted April 13, 2013 Share Posted April 13, 2013 Ah i want chatbox not to cancel the map starting... 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