#1ERuPTiON Posted July 5, 2014 Share Posted July 5, 2014 Hey , I don't know if this should go to scripting section or maps, but more scripting So on every map change i want it to say who changed the map in the chatbox. But in the wiki, it doesn't have any event for mapchange , if you find it please send me Link to comment
Addlibs Posted July 5, 2014 Share Posted July 5, 2014 I don't think it is possible to find out who changed the map unless you do some extra scripting to make a custom event being called when someone starts a resource / changes the map. Link to comment
Max+ Posted July 6, 2014 Share Posted July 6, 2014 Exactly it's a custom event , what gameMode do you to get the map Changing ? Link to comment
#1ERuPTiON Posted July 7, 2014 Author Share Posted July 7, 2014 Exactly it's a custom event ,what gameMode do you to get the map Changing ? tdma , or even tactics .. aren't maps counted as resources? if so I want it to be on the resource start .. I don't know how to do this Link to comment
Max+ Posted July 7, 2014 Share Posted July 7, 2014 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
Arnold-1 Posted July 7, 2014 Share Posted July 7, 2014 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
Max+ Posted July 7, 2014 Share Posted July 7, 2014 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
Arnold-1 Posted July 7, 2014 Share Posted July 7, 2014 I gave him the script, no actual need for onGamemodeMapStart, but anyway, it's a map manager event, and almost every scripter includes it in his gamemode. Link to comment
#DRAGON!FIRE Posted July 7, 2014 Share Posted July 7, 2014 u mean if change from admin panel ? Link to comment
Max+ Posted July 7, 2014 Share Posted July 7, 2014 u mean if change from admin panel ? no he mean like BaseMode if the admin start the map in f8 like / arena 20 outputChatBox(adminName.. has Started the map ) he want get the name of the admin started the map .. Link to comment
#1ERuPTiON Posted October 13, 2015 Author Share Posted October 13, 2015 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
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