mercredi 26 mars 2014

[Release] Silently Secure loot (client and host) topic




So im not a big fan of spawning bags because then it looks obvious that you r cheating. So i turned to securing bags instead. securing bags is nice because you dont have to move bags around. the game just gives you money. however i didnt like that the game still "announced" that you secured bags (when it says "Secured Loot: Gold 0,000".

so thats why i created this:

Code:


function inGame()
  if not game_state_machine then return false end
  return string.find(game_state_machine:current_state_name(), "game")
end

function secure(name, amount, silent)
    for i = 1, amount, 1 do
        if Network:is_server() then
            managers.loot:server_secure_loot( name, managers.money:get_bag_value(name), silent )
        else
            managers.network:session():send_to_peers_synched( "sync_secure_loot", name, managers.money:get_bag_value(name), silent )
            managers.loot:sync_secure_loot( name, managers.money:get_bag_value(name), silent )
        end
    end
   

end

if inGame() then
    secure("turret", 100, true)
end


this will secure 100 Turret part bags silently. the only way to tell that they have been secured is by holding TAB (on the left hand side it shows how many bags have been secured).





Aucun commentaire:

Enregistrer un commentaire