Jump to content

[ solved ] onMapStarting know if there respawn ..


Sora

Recommended Posts

Posted (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 by Guest
Posted

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

Posted

black-and-white-sad-face-md.png

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 !

Posted
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

Have you tried on player wasted?

Posted
black-and-white-sad-face-md.png

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.

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

Posted
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!

Posted

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) 

Posted
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!

Posted

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

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

Posted
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?

Posted
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!!

Posted
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

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