Sora Posted August 11, 2012 Posted August 11, 2012 (edited) hi , i want to know if there respawn in the map that started using this event onMapStarting https://wiki.multitheftauto.com/wiki/Resource:Race i wanna something like addEventHandler("onMapStarting",getRootElement(), function (mapOptions) if mapOptions.respawn == true then -- something here else -- something here end end) i mean how can i know if there respawn or no with this event? i've already solved this .. if you're facing the same issue then here's what i figured go to \race\modes\base.lua line 309 Edited July 9, 2013 by Guest
Sora Posted August 11, 2012 Author Posted August 11, 2012 i want when map start the script check if respawn is enabled in the map or not enabled that what i mean
Lloyd Logan Posted August 11, 2012 Posted August 11, 2012 i want when map startthe script check if respawn is enabled in the map or not enabled that what i mean Do you mean when you die, IF you respawn?
Sora Posted August 11, 2012 Author Posted August 11, 2012 yep see setting in meta.xml file ? name="#respawn" value='[ "none" ]' /> in every map the respawn is none(not enabled(disabled)) but in some maps it's timelimit(enabled) name="#respawn" value='[ "timelimit" ]'>> my question is , how can i know if the respawn is enabled in the map that been started or not enabled(disabled) with using the event onMapStarting
Sora Posted August 12, 2012 Author Posted August 12, 2012 one day from posting this topic , and there no helpful respond and i was think that there who will help me but this was my big mistake !
Lloyd Logan Posted August 12, 2012 Posted August 12, 2012 yepsee setting in meta.xml file ? name="#respawn" value='[ "none" ]' /> in every map the respawn is none(not enabled(disabled)) but in some maps it's timelimit(enabled) name="#respawn" value='[ "timelimit" ]'>> my question is , how can i know if the respawn is enabled in the map that been started or not enabled(disabled) with using the event onMapStarting Have you tried on player wasted?
unknooooown Posted August 12, 2012 Posted August 12, 2012 one day from posting this topic , and there no helpful respond and i was think that there who will help me but this was my big mistake ! ... That wont get you very far in here.
Anderl Posted August 12, 2012 Posted August 12, 2012 hi , i want to know if there respawn in the map that started using this event onMapStarting https://wiki.multitheftauto.com/wiki/Resource:Race i wanna something like addEventHandler("onMapStarting",getRootElement(), function (mapOptions) if mapOptions.respawn == true then -- something here else -- something here end end) i mean how can i know if there respawn or no with this event? mapOptions is second parameter, not first.
Sora Posted August 12, 2012 Author Posted August 12, 2012 so what i should use to know if respawn is enabled or disabled ?
Lloyd Logan Posted August 12, 2012 Posted August 12, 2012 so what i should use to know if respawn is enabled or disabled ? 1. You could die in the server and see if you respawn, 2. If it is a resource start it in the console and see if it is running? That is all I can think from what I understand you are meaning!
Sora Posted August 12, 2012 Author Posted August 12, 2012 lol! look below addEventHandler("onMapStarting",getRootElement(), function (map) if isRespawn(map) == true then -- this is fake function just to make you know ! outoutChatBox("Respawn is enabled") else outoutChatBox("Respawn is disabled") end end)
Lloyd Logan Posted August 12, 2012 Posted August 12, 2012 lol!look below addEventHandler("onMapStarting",getRootElement(), function (map) if isRespawn(map) == true then -- this is fake function just to make you know ! outoutChatBox("Respawn is enabled") else outoutChatBox("Respawn is disabled") end end) Ahh, I will try and make one then let you know!
Sora Posted August 12, 2012 Author Posted August 12, 2012 this one was created by my friend addEventHandler("onGamemodeMapStart",root,function(map) local something = getElementsByType("setting") if something then local respawn = getElementData(something,"respawn") if respawn ~= false then outputChatBox("respawn enabled") else outputChatBox("respawn disabled") end end end ) but also not works note : thank you so much for your respond and your help
Anderl Posted August 12, 2012 Posted August 12, 2012 lol!look below addEventHandler("onMapStarting",getRootElement(), function (map) if isRespawn(map) == true then -- this is fake function just to make you know ! outoutChatBox("Respawn is enabled") else outoutChatBox("Respawn is disabled") end end) function (_, gameOptions) if gameOptions.respawn then This should work.
Sora Posted August 12, 2012 Author Posted August 12, 2012 lol!look below addEventHandler("onMapStarting",getRootElement(), function (map) if isRespawn(map) == true then -- this is fake function just to make you know ! outoutChatBox("Respawn is enabled") else outoutChatBox("Respawn is disabled") end end) function (_, gameOptions) if gameOptions.respawn then This should work. thank you , but what is the usage way ? i mean like if gameOptions.respawn == ture then ... or something else?
Lloyd Logan Posted August 12, 2012 Posted August 12, 2012 this one was created by my friend addEventHandler("onGamemodeMapStart",root,function(map) local something = getElementsByType("setting") if something then local respawn = getElementData(something,"respawn") if respawn ~= false then outputChatBox("respawn enabled") else outputChatBox("respawn disabled") end end end ) but also not works note : thank you so much for your respond and your help Hope this helped!!!!! function getState( player, command, resourceName ) if resourceName then local resource = getResourceFromName( resourceName ) if resource then outputChatBox( "Resource State: " .. resourceName .. " is currently " .. getResourceState( resource ) .. ".", player, 0, 0, 255 ) else outputChatBox( "Error: No resource with name " .. resourceName .. " exists.", player, 255, 0, 0 ) end else outputChatBox( "Syntax: " .. command .. " [resource name]", player, 255, 0, 0 ) end end addCommandHandler( "state", getState ) And the obivious meta, but if you need help pm me!!
TAPL Posted August 12, 2012 Posted August 12, 2012 really? what the wiki example have to do with this topic?
Lloyd Logan Posted August 12, 2012 Posted August 12, 2012 Lloyd Logan , stop kidding Lol, I have ABSOLUTELY no clue what you mean, sorry, can someone explain what he means, and do you have Skype?
Sora Posted August 12, 2012 Author Posted August 12, 2012 Lloyd Logan , stop kidding Lol, I have ABSOLUTELY no clue what you mean, sorry, can someone explain what he means, and do you have Skype? yeah i'll pm you
Lloyd Logan Posted August 12, 2012 Posted August 12, 2012 Lloyd Logan , stop kidding Lol, I have ABSOLUTELY no clue what you mean, sorry, can someone explain what he means, and do you have Skype? yeah i'll pm you Okay
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