Jump to content

help with onMapResourseStart (Solved)


shikaru

Recommended Posts

hi all, i have a problem my code, i just want that a function get triggered when a map resourse start

here is what i have tried

local myMapElement = getElementByIndex("resource",10) --My map resource 
local qq =getElementID(myMapElement) 
outputChatBox(qq) --show de ID of my map to verify 
  
addEventHandler("onResourceStart", ee, do_something) 

but it doesnt work

i want to do specially this

addEventHandler("onResourceStart", myMapElement, do_something)

how can i give my Map as element to that event?

there is a way to doit without have this code in my map resource?

Edited by Guest
Link to comment

i found a 2nd solution!!. :)

there is a event named "onGamemodeMapStart" but there is no information abouth this in wiki.

for example, this code print the name of the resourcemap started

  
function loadMap(startedMap) 
    mapRoot = getResourceRootElement(startedMap) 
    outputChatBox(getElementID(mapRoot)) 
end 
  
addEventHandler("onGamemodeMapStart", getRootElement(), loadMap) 
  

:)

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