justcrow Posted May 16, 2017 Share Posted May 16, 2017 hi all. I'm writing this to get a piece of advice. I run my server and some users can hunt zeds very easily with campfire kit. Actually my server set the option "fire=off / spread=off" so, the only way to kill the mass is to use the campfire kit. I want to stop this but don't know where to start Deleting the code for campfire kit in script is too extreme. If you have great ideas about this, please help me. Link to comment Share on other sites More sharing options...
ProjectSky Posted May 17, 2017 Share Posted May 17, 2017 Some useful code. If MP, you must send the command to the server for execution. local zb = getWorld():getCell():getZombieList(); for i=0,zb:size() -1 do zb:get(i):setFireSpreadProbability(int FireSpreadProbability); --Fire spread probability. default value: 6, 0 = Fire will never be spread by zombies. zb:get(i):setFireKillRate(float FireKillRate); --Fire kill rate. default value: 0.003800000064074993, 0 = Fire can never kill zombies. end Link to comment Share on other sites More sharing options...
justcrow Posted May 17, 2017 Author Share Posted May 17, 2017 55 minutes ago, Sky_Orc_Mm said: Some useful code. If MP, you must send the command to the server for execution. local zb = getWorld():getCell():getZombieList(); for i=0,zb:size() -1 do zb:get(i):setFireSpreadProbability(int FireSpreadProbability); --Fire spread probability. default value: 6, 0 = Fire will never be spread by zombies. zb:get(i):setFireKillRate(float FireKillRate); --Fire kill rate. default value: 0.003800000064074993, 0 = Fire can never kill zombies. end Wow!! Great work! so this code must be in the server folder? Link to comment Share on other sites More sharing options...
justcrow Posted May 18, 2017 Author Share Posted May 18, 2017 9 hours ago, Sky_Orc_Mm said: Some useful code. If MP, you must send the command to the server for execution. local zb = getWorld():getCell():getZombieList(); for i=0,zb:size() -1 do zb:get(i):setFireSpreadProbability(int FireSpreadProbability); --Fire spread probability. default value: 6, 0 = Fire will never be spread by zombies. zb:get(i):setFireKillRate(float FireKillRate); --Fire kill rate. default value: 0.003800000064074993, 0 = Fire can never kill zombies. end well, that code causes an error Link to comment Share on other sites More sharing options...
ProjectSky Posted May 18, 2017 Share Posted May 18, 2017 6 hours ago, justcrow said: well, that code causes an error You must pass the command to the server to execute! Client code example: function ClientExample(self) sendClientCommand(self, "module", "selfcommand", { selfargs = "true" }) end Events.OnPlayerUpdate.Add(ClientExample) Servers code example: ServerExample = function(module, command, player, args) if command == "selfcommand" then if args.selfargs == "true" then local zb = getWorld():getCell():getZombieList() for i=0,zb:size() -1 do zb:get(i):setFireSpreadProbability(0) --Fire spread probability. default value: 6, 0 = Fire will never be spread by zombies. zb:get(i):setFireKillRate(0) --Fire kill rate. default value: 0.003800000064074993, 0 = Fire can never kill zombies. end end end end Events.OnClientCommand.Add(ServerExample) You should look at this topic, it should help you understand what commands are handled by the client, what is handled in the server side. Link to comment Share on other sites More sharing options...
justcrow Posted May 18, 2017 Author Share Posted May 18, 2017 2 minutes ago, Sky_Orc_Mm said: You must pass the command to the server to execute! Client code example: function ClientExample(self) sendClientCommand(self, "module", "command", { args = "true" }) end Events.OnPlayerUpdate.Add(ClientExample) Servers code example: ServerExample = function(module, command, player, args) if command == "selfcommand" then if args.selfargs == "true" then local zb = getWorld():getCell():getZombieList() for i=0,zb:size() -1 do zb:get(i):setFireSpreadProbability(0) --Fire spread probability. default value: 6, 0 = Fire will never be spread by zombies. zb:get(i):setFireKillRate(0) --Fire kill rate. default value: 0.003800000064074993, 0 = Fire can never kill zombies. end end end end Events.OnClientCommand.Add(ServerExample) You should look at this topic, it should help you understand what commands are handled by the client, what is handled in the server side. Great! Thanks for these perfect gifts! I'll try those codes in my server. Thank you my friend! Link to comment Share on other sites More sharing options...
ProjectSky Posted May 18, 2017 Share Posted May 18, 2017 I haven't not tested this code, it may not work. Link to comment Share on other sites More sharing options...
justcrow Posted May 18, 2017 Author Share Posted May 18, 2017 6 minutes ago, Sky_Orc_Mm said: I haven't not tested this code, it may not work. hmm.. well that's fine with me. I'll try and see if I can handle it ! Link to comment Share on other sites More sharing options...
justcrow Posted May 19, 2017 Author Share Posted May 19, 2017 15 hours ago, Sky_Orc_Mm said: I haven't not tested this code, it may not work. oh my goodness...sadly, it doesn't work Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.