Jump to content

How can I stop this?


justcrow

Recommended Posts

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

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

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

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...