Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/11/23 in all areas

  1. Multi Theft Auto:Source Roleplay By MittellBuurman Roleplay on brand new source_rp resources For over 10 years, a roleplay resource has taught a lot of young aspiring scripters how to move a gate. Your very first challenge. It has been the staple of the roleplay community, where thousands of server have greatly benefited of the capabilities, but also had to face it's limitations. On Jun 11 2022, I started this project. With the ambition to create a new brand new roleplay engine from scratch, with new techniques and features, all wrapped up in a complex database system that is built to last. Gamemode status: Development Expected Launch: tbd We are currently looking for members looking to participate in the dev_sandbox server. We are looking for testers. If you're interested in the build status of the server and like to participate. You can join our Discord here. IMPORTANT NOTE: The server is NOT ready for launch and is in Early development stages. A lot of features may not work as expected and should be reported. This page is still a work in progress and will be aptly updated. Image gallery
    2 points
  2. The following examples are part of a project I have build before. You will have to set-up: 2 export function (one each resource) For sending (as you have now) And for receiving You will have to generate an unique identifier for each query, so that each request can be wired back to where you want the data. -- Resource A Identifier = {} function Identifier:newGenerator() return setmetatable( { index = 0 }, { __index = Identifier } ) end function Identifier:generate() local index = self.index + 1 self.index = index return "id:" .. getTickCount() .. "|" .. index end -- For new ID's local identifierGenerator = Identifier:newGenerator() -- function () local id = identifierGenerator:generate() -- end Before you send a request you make sure that there is a destination: -- Resource A callbacks = {} -- function () local id = identifierGenerator:generate() -- Set-up the callback destination, anonymous func if you want to keep going where you left of. callbacks[id] = function (...) iprint(...) end exports.database_connection:db_query(id, "SELECT * FROM `players`") -- end Add wiring for receiving and calling back your callback function: -- Resource A function dbResponse (id, ...) if not callbacks[id] then return end callbacks[id](...) end Keep the wiring going in the db resource, so that the ID goes ping pong: -- Resource B function db_query(id, ...) -- The source resource that made this call (important to rename the pre-defined variable, else it will be lost) local theSourceResource = sourceResource if (db_settings.db_connection) then dbQuery(function(query_handle) local result, num_affected_rows, last_insert_id = dbPoll(query_handle, 0) call( theSourceResource, "dbResponse", id, result, num_affected_rows, last_insert_id ) end, db_settings.db_connection, ...) end end
    1 point
  3. Fora do painel P ou sem mexer no acl.xml você não tem como. A não ser que você desenvolva um resource só para fazer isso via comando. (mas obviamente este resource precisará de permissão admin para poder fazer isso) Outra coisa mais inteligente a se fazer é configurar seu resource para solicitar sozinho as permissões que ele precisa. Por exemplo, se o seu resource precisa de permissão admin só para usar a função de KickPlayer, basta você fazer este resource solicitar essa permissão específica em vez de dar acesso total de admin para ele. Para fazer um resource solicitar permissões específicas, basta adicionar isto no meta.xml dele: <aclrequest> <right name="function.kickPlayer" access="true" /> </aclrequest> Depois de iniciar o resource, deve aparecer a solicitação no Debug Console (use /debugscript 3 para mostrá-lo). Para aceitar a solicitação, só precisa que um Staff autorize com /aclrequest allow NomeDoResource all A solicitação também pode ser aceita no Server Console, usando o mesmo comando porém sem a barra.
    1 point
×
×
  • Create New...