Jump to content

On Map Change


Recommended Posts

i Created This , Dont Know if it will work or not ,

addEventHandler ( 'onResourceStart',root, 
    function (  resource    ) 
        if getResourceInfo ( resource,'gamemodes' ) == 'race' and getResourceInfo ( resource,'type' ) == 'map' then 
         if hasObjectPermissionTo(player, "function.setPlayerMuted", false) and getResourceState ( resource ) == 'starting' then 
         triggerEvent ( 'onServerMapStart',resourceRoot ) 
       end 
     end 
   end 
) 
  
 addEventHandler ( 'onServerMapStart',root, 
 function (  ) 
    outputChatBox(getPlayerName(getPlayerAccount(getAccountName( source )).. 'Started The Map ' ,255, 255, 0 )) 
    end  
  ) 

--ServerSide , and Change this 'race'

to your GameMode type ,

Link to comment
i Created This , Dont Know if it will work or not ,

addEventHandler ( 'onResourceStart',root, 
    function (  resource    ) 
        if getResourceInfo ( resource,'gamemodes' ) == 'race' and getResourceInfo ( resource,'type' ) == 'map' then 
         if hasObjectPermissionTo(player, "function.setPlayerMuted", false) and getResourceState ( resource ) == 'starting' then 
         triggerEvent ( 'onServerMapStart',resourceRoot ) 
       end 
     end 
   end 
) 
  
 addEventHandler ( 'onServerMapStart',root, 
 function (  ) 
    outputChatBox(getPlayerName(getPlayerAccount(getAccountName( source )).. 'Started The Map ' ,255, 255, 0 )) 
    end  
  ) 

--ServerSide , and Change this 'race'

to your GameMode type ,

This is bullshit, please learn more before teaching other people.

just use onGamemodeMapStart, but, if you want it to output who changed the map, you must make some extra scripting.

add to the function of the button you're using for map set this:

check the map name variable and replace it with mapName variable in the script.

  
triggerServerEvent("mapChangeOutput",localPlayer,mapName) 
  

and add this anywhere serverside:

  
function outputMapChange(name) 
outputChatBox(getPlayerName(source).."Changed the map to: "..name..".",root,200,100,100) 
end 
addEvent("mapChangeOutput",true) 
addEventHandler("mapChangeOutput",root,outputMapChange) 
  

Link to comment
i Created This , Dont Know if it will work or not ,

addEventHandler ( 'onResourceStart',root, 
    function (  resource    ) 
        if getResourceInfo ( resource,'gamemodes' ) == 'race' and getResourceInfo ( resource,'type' ) == 'map' then 
         if hasObjectPermissionTo(player, "function.setPlayerMuted", false) and getResourceState ( resource ) == 'starting' then 
         triggerEvent ( 'onServerMapStart',resourceRoot ) 
       end 
     end 
   end 
) 
  
 addEventHandler ( 'onServerMapStart',root, 
 function (  ) 
    outputChatBox(getPlayerName(getPlayerAccount(getAccountName( source )).. 'Started The Map ' ,255, 255, 0 )) 
    end  
  ) 

--ServerSide , and Change this 'race'

to your GameMode type ,

This is :~, please learn more before teaching other people.

just use onGamemodeMapStart, but, if you want it to output who changed the map, you must make some extra scripting.

add to the function of the button you're using for map set this:

check the map name variable and replace it with mapName variable in the script.

  
triggerServerEvent("mapChangeOutput",localPlayer,mapName) 
  

and add this anywhere serverside:

  
function outputMapChange(name) 
outputChatBox(getPlayerName(source).."Changed the map to: "..name..".",root,200,100,100) 
end 
addEvent("mapChangeOutput",true) 
addEventHandler("mapChangeOutput",root,outputMapChange) 
  

onGamemodeMapStart ؟

and if he doesn't have this event ?

i suggest he call the mapManger to check if the map changed or not ,

Link to comment
  • 1 year later...
i Created This , Dont Know if it will work or not ,

addEventHandler ( 'onResourceStart',root, 
    function (  resource    ) 
        if getResourceInfo ( resource,'gamemodes' ) == 'race' and getResourceInfo ( resource,'type' ) == 'map' then 
         if hasObjectPermissionTo(player, "function.setPlayerMuted", false) and getResourceState ( resource ) == 'starting' then 
         triggerEvent ( 'onServerMapStart',resourceRoot ) 
       end 
     end 
   end 
) 
  
 addEventHandler ( 'onServerMapStart',root, 
 function (  ) 
    outputChatBox(getPlayerName(getPlayerAccount(getAccountName( source )).. 'Started The Map ' ,255, 255, 0 )) 
    end  
  ) 

--ServerSide , and Change this 'race'

to your GameMode type ,

well I took long to reply, but now I need this script again and it's not working for the gamemode tactics. Or you can say Basemode.

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