Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 20/03/20 in all areas

  1. Ta ae, amigo: destruir = createMarker (2445.2878417969, -957.39611816406, 80.04273223877 -2, "cylinder", 3.0, 128, 0, 0, 99) function destroi (thePlayer) outputChatBox ("Seu veiculo será destruido em 2 minutos!", thePlayer) setTimer (function () destroyElement (thePlayer) outputChatBox ("Veiculo destruido com sucesso!", thePlayer) end, 120000, 1) end addEventHandler ("onMarkerHit", destruir, destroi)
    2 points
  2. bengines provides custom engine sounds for vehicles. The resource is not focused to be ultra realistic, it is designed to use for casual servers. Not useful for me anymore so sharing with community. Used on old project. Sounds are copyrighted content not owned by me. Features: ready to use, chooses the best engine for vehicle depending on handling! easy to customize & expand for Lua programmers 30 soundpacks for vehicles (buses, bikes, sport cars etc.) stable code with quite high performance used on server with 600 players ALS effect (exhaust flames) Turbo (satisfying whistle and blow-off sounds) Videos: https://streamable.com/n7k40 https://streamable.com/lp14t https://streamable.com/q5e9g Download: Github: https://github.com/brzys/bengines (feel free to send pull requests) Community: to-do For programmers: --[[ Element datas used by resource [array] vehicle:engine - stores basic info about engine type, sound pack etc. (synced) [string] vehicle:type - used for engine calculation, useful for servers. Available: Bus, Truck, Sport, Casual, Muscle, Plane, Boat, Motorbike (synced) [string] vehicle:fuel_type - customized for each engine. Useful for servers. Available: "diesel", "petrol" (synced) You can use setElementData(vehicle, "vehicle:upgrades", {turbo=true, als=true}) to add turbo or ALS. --]] --[[ Exported functions --]] exports.bengines:getVehicleRPM(vehicle) -- returns RPM of given vehicle exports.bengines:getVehicleGear(vehicle) -- returns current gear of given vehicle exports.bengines:toggleEngines(bool) -- true / false, restore GTA engine sounds
    1 point
  3. @The_GTA Thank you again, you make me happy
    1 point
  4. Hello, I'm looking for a faction system with a good tuning panel... We are having trouble writing a tuning panel. I hope you can help me...
    1 point
  5. Like This Panel ? http://uplod.ir/dcu9dz8266jt/Tuning_IRM.jpg.htm
    1 point
  6. Hello iwalidza, since you do not provide any design wishes and I have no experience with inventory system design, I will limit my contribution to the technical side of inventory systems. You may want to create new kinds of items for roleplay such as keys or identity certificates that players have to collect and treasure. An inventory system is defined as a set of items that belong to peds or players. Items can be taken out or put in at wish. Thus we want to attach a table of items for at least each player on the server and synchronize the items with the clients. server.Lua -- We want to create items definitions here. local item_definitions = {}; local function register_item(id, name, description) local def = { ["name"] = name, ["id"] = id, ["description"] = description }; item_definitions[id] = def; end register_item(1, "Knife", "Sharp item to cut things"); register_item(2, "Sword", "Sharp weapon for slashing"); register_item(3, "Key", "Used to access secret areas in the game"); -- Item local player_inventories = {}; addEventHandler("onPlayerQuit", root, function() player_inventories[source] = nil; end ); local function find_existing_player_inv_slot(inv_items, item_id) for m,n in ipairs(inv_items) do if (n.item_id == item_id) then return n; end end return false; end local function give_item_to_player(player, item_id, count) local inv = player_inventories[player]; local item_carry = find_existing_player_inv_slot(inv, item_id); if (item_carry) then item_carry.count = item_carry.count + count; return true; end local new_carry = { ["item_id"] = item_id, ["count"] = count }; table.insert(inv, new_carry); return true; end addEventHandler("onPlayerJoin", root, function() local inventory = {}; player_inventories[source] = {}; give_item_to_player(source, 1, 1); give_item_to_player(source, 2, 1); give_item_to_player(source, 3, 1); end ); (code has not been tested) This is a sample system I just created. There is a knife, sword and key. At join time each player does receive a copy of any item. Now imagine that you have a marker that you can only enter with a key. server.Lua local function does_player_have_item(player, item_id) local inventory = player_inventories[player]; local slot = find_existing_player_inv_slot(inventory, item_id); if (slot) and (slot.count > 0) then return true; end return false; end local function remove_player_item(player, item_id, count) local inventory = player_inventories[player]; for m,n in ipairs(inventories) do if (n.item_id == item_id) and (n.count > 0) then local can_remove = math.min(count, n.count); n.count = n.count - can_remove; count = count - can_remove; if (count == 0) then break; end end end end local marker = createMarker(0, 0, 3, "cylinder"); addEventHandler("onMarkerHit", marker, function(hitElement) if not (getElementType(hitElement) == "player") then return; end; if not (does_player_have_item(hitElement, 3)) then outputChatBox("You cannot enter this zone because you have no key."); return; end outputChatBox("Using key to enter the zone."); remove_player_item(hitElement, 3, 1); end ); This script creates a marker in the middle of the map. If you hit the marker then you use a key. Once you have used your starting key then you cannot successfully hit the marker anymore. The message should change the second time you hit the marker. The marker does only work with players. I hope I could help you with this
    1 point
  7. function help (thePlayer) outputChatBox ("193 Você chamou o corpo de bombeiros aguarde...", thePlayer, 255, 0, 0) -- Manda essa mensagem pro jogador que executou o comando. for i, player in ipairs (getElementsByType ("player")) do -- Faz um loop por todos os jogadores conectados no servidor. if isObjectInACLGroup ("user."..getAccountName (getPlayerAccount (player)), aclGetGroup ("BOMBEIROS")) then -- Se o jogador do loop está na ACL Group "BOMBEIROS", então: outputChatBox ("O jogador "..getPlayerName (thePlayer).."#FF0000 solicitou o corpo de bombeiros.", player, 255, 0, 0, true) -- Manda essa mensagem pra ele. end end end addCommandHandler ("193", help) Dai a parte de "aguarde 15 minutos para chamar novamente" é com você.
    1 point
×
×
  • Create New...