Jump to content

AnnaBelle

Members
  • Posts

    88
  • Joined

  • Last visited

Details

  • Gang
    MTA DayZ
  • Location
    Brazil
  • Occupation
    sa
  • Interests
    help

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

AnnaBelle's Achievements

Transformer

Transformer (11/54)

0

Reputation

  1. function printManagment(player) if (player) then player = client end local group = getPlayerGroup(client) for ind, data in pairs(GAC) do if (data[1] == group) then local rank, warning, joined, lastTime = GAC[ind][2], GAC[ind][3],GAC[ind][4], GAC[ind][5] triggerClientEvent(client, "groupSystem.addToList", client, tostring(ind), rank, warning, joined, lastTime, getPlayerName(client), getAccountPlayer(getAccount(ind))) --Here is the error (Bad Argument @ getAccountPlayer) end end end addEvent("groupSystem.print", true) addEventHandler("groupSystem.print", root, printManagment) nick of group players does not appear, I tried to add getPlayerName but only appeared my nick
  2. -- Server-side addCommandHandler('vip',function() if getElementData(localPlayer,'isVIP') == 1 then triggerClientEvent(source,'PainelVIP',source) -- Para abrir o painel end end) addEventHandler("onPlayerQuit",getRootElement(),function() local account = getPlayerSerial(source) if account then setAccountData(account,'isVIP',getElementData(source,'isVIP')) -- Erro Aqui << end setElementData(source,"logedin",false) end) addEventHandler("onResourceStop",getRootElement(),function() for i,player in ipairs(getElementsByType("player")) do local account = getPlayerSerial(player) if account then setAccountData(account,'isVIP',getElementData(player,'isVIP')) -- Erro Aqui << end end end) -- Client-side addEvent('PainelVIP',true) addEventHandler('PainelVIP',root,function() if getElementData(localPlayer,"logedin") then if guiGetVisible(SistemaVIP) then guiSetVisible(SistemaVIP,false) showCursor(false) else guiSetVisible(SistemaVIP,true) showCursor(true) end end end) To tentando fazer essa função " if getElementData(localPlayer,'isVIP') == 1 then " salvar no serial do jogador problema que esta dando erro
  3. Entendi agora, mas não to conseguindo fazer o setElementData funcionar, não aparece erro no debugscript e nem no console
  4. aparece erro na linha 20, mas se deixo o codigo spawnar item assim ele n da erro tendaItens = { {"M107",10}, {"M4A1 CCO",20}, } só tem 1 item por classe porque to testando
  5. addCommandHandler("bau", function(thePlayer) local x,y,z = getElementPosition(thePlayer) local xr,yr,zr = getElementRotation(thePlayer) px,py,pz = getElementPosition(thePlayer) prot = getPedRotation(thePlayer) local offsetRot = math.rad(prot+90) local vx = px+1.5*math.cos(offsetRot) local vy = py+1.5*math.sin(offsetRot) local vz = pz+2 local vrot = prot+180 tent = createObject(964,vx,vy,z-1,0,0,vrot) setObjectScale(tent,1.0) tentCol = createColSphere(x,y,z,4) attachElements(tentCol,tent,0,0,0) setElementData(tentCol,"parent",tent) setElementData(tent,"parent",tentCol) setElementData(tentCol,"tent",true) setElementData(tentCol,"vehicle",true) item = tendaItens[math.random(#tendaItens)] aa,bb = item[1],item[2] setElementData(tentCol,aa,bb) end) tendaItens = { ["kitSniper"] = { {"M107",10}, }, ["kitRifler"] = { {"M4A1 CCO",20}, }, } como vocês pode ver acima /\ eu to tentando fazer varias classe de itens em um bau ,mas nessas classe os item vai ser diferente so que não conseguindo concluir isso
  6. To fazendo um painel para trocar senha e grupo da base porem toda vez que troco pelo painel de grupo não tenho mas acesso a base só se eu dar restart na resource, tentei usar setTimer, mas começa a da lagger por causa da verificação todo momento -- Server side function GroupMTA() for index, Cord in ipairs(Bases_Colisions) do local ColBase = createColCuboid(Cord[1],Cord[2],Cord[3],Cord[4],Cord[5],Cord[6]) -- x,y,z,rx,ry,rz addEventHandler( "onColShapeHit",ColBase,EnterInBase) addEventHandler( "onColShapeLeave",ColBase,ExitInBase) setElementData(ColBase,"GangCol",NameGroup) --Nome do clã/grupo end end addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),GroupMTA) to a procura de uma forma que não fique lagger no alarme e que automaticamente quando o player troca o nome do clã/grupo ele tenha acesso a base sem reiniciar a resource
  7. Queria saber se alguém sabe o motivo e a correção para isso http://imgur.com/a/gheVe,isso começou acontecer depois que eu fiz a base normal porem eu removi objeto do mapa e começou a ficar assim dependo como vc olha some uma parte do mapa do gta tentei até refiz a base pensando que tinha errado alguma coisa ,mas continuou do mesmo jeito...
  8. local groupTable = {} local logging = false local debugInfo = false local GAC = {} local users = {} local myGang = {} local char = "09azAZ" local rankCache = {} local db = dbConnect("sqlite", "database.db") dbExec(db, "CREATE TABLE IF NOT EXISTS groupmember (account TEXT, groupName TEXT, rank TEXT, joined TEXT, lastTime TEXT)") dbExec(db, "CREATE TABLE IF NOT EXISTS groups (name TEXT, leader TEXT, message TEXT, chatcolor TEXT, notecolor TEXT, date TEXT, turfcolor TEXT, cashflow TEXT)") dbExec(db, "CREATE TABLE IF NOT EXISTS groupRanks (groupName TEXT, name TEXT, permissions TEXT)") dbExec(db, "CREATE TABLE IF NOT EXISTS groupVault (groupName TEXT, leader TEXT)") playerTeam = createTeam("Player") _outputDebugString = outputDebugString function outputDebugString(string) if (debugInfo) then _outputDebugString(string) end end function getTheTime() local time = getRealTime() local date = string.format("%02d/%02d/%02d", time.monthday, (time.month+1), (time.year-100) ) local time = string.format("%02d:%02d", time.hour, time.minute) return date, time end MTAoutput = outputChatBox function outputChatBox(message, player, r, g, b, bool) if (isElement(message) and getElementType(message) == "player") then MTAoutput(player, message, r, g, b, bool) else MTAoutput(message, player, r, g, b, bool) end end function groupLog(group, message) if (logging) then outputServerLog("GROUP: "..group.." - "..message) end end local permToTable = { [1] = "permissionModifyRank", [2] = "permissionKickOut", [3] = "permissionInvitePlay", [4] = "permissionOfRank", [5] = "permissionMensegeofDay", } function GetAccount(plr) if (plr and isElement(plr)) then return getAccountName(getPlayerAccount(plr)) end end function loadGroupRanks(query) local the_table = dbPoll(query, 0) if (the_table) then for ind, data in pairs(the_table) do if (not rankCache[data.groupName]) then rankCache[data.groupName] = {} end if (not rankCache[data.groupName][data.name]) then rankCache[data.groupName][data.name] = {} end local JSONtable = fromJSON(data.permissions) for ind, value in pairs(JSONtable) do if (value and ind) then rankCache[data.groupName][data.name][ind] = true end end end end end dbQuery(loadGroupRanks, db, "SELECT * FROM groupRanks") function loadGroupStuff(query) local g_table = dbPoll(query, 0) if (not g_table) then return end for ind, data in ipairs(g_table) do groupTable[data.name] = {data.leader, data.message, data.chatcolor, data.notecolor, data.date, data.turfcolor, data.cashflow} end end dbQuery(loadGroupStuff, db, "SELECT * FROM groups") function loadClientGroup(query) local g_table = dbPoll(query, 0) if (not g_table) then return end for ind, data in ipairs(g_table) do if (getAccount(data.account)) then local player = getAccountPlayer(getAccount(data.account)) users[data.groupName] = {} table.insert(users[data.groupName], data.account) if (player) then setElementData(player, "Group", data.groupName) myGang[player] = data.groupName end GAC[data.account] = {data.groupName, data.rank, data.joined, data.lastTime or 0} end end end dbQuery(loadClientGroup, db, "SELECT * FROM groupmember") function addRank(group, rank, permissionTable) if (not rankCache[group]) then rankCache[group] = {} end dbExec(db, "INSERT INTO groupRanks VALUES (?, ?, ?)", tostring(group), tostring(rank), permissionTable) dbQuery(loadGroupRanks, db, "SELECT * FROM groupRanks") end function removeRank(group, rank) if (not rankCache[group]) then return true end if (rankCache[group][rank]) then rankCache[group][rank] = nil dbExec(db, "DELETE FROM groupRanks WHERE name=? AND groupName=?", tostring(rank), tostring(group)) dbQuery(loadGroupRanks, db, "SELECT * FROM groupRanks") return true end end function isRank(group, rank) if (not rankCache[group]) then return false end return rankCache[group][rank] end function groupMemberLogin() if (GAC[GetAccount(source)]) then myGang[source] = GAC[GetAccount(source)][1] setElementData(source, "Group", GAC[GetAccount(source)][1]) setPlayerTeam(source,playerTeam) local date, time = getTheTime() local date = date.." - "..time GAC[GetAccount(source)][5] = date end end addEventHandler("onPlayerLogin", root, groupMemberLogin) function groupMemberQuit() if (GAC[GetAccount(source)]) then local date, time = getTheTime() local date = date.." - "..time GAC[GetAccount(source)][5] = date end end addEventHandler("onPlayerQuit", root, groupMemberQuit) function getGroupMembers(group) local temp = {} for ind, data in pairs(users) do if (ind == group) then table.insert(temp, data[1]) end end return temp end function getPlayerGroup(player) if (not GAC[GetAccount(player)]) then return false end return GAC[GetAccount(player)][1] end function getPlayerGroupRank(player) if (not GAC[GetAccount(player)]) then return false end return GAC[GetAccount(player)][2] end --function getPlayerWarningLevel(player) -- if (not GAC[GetAccount(player)]) then return false end -- return GAC[GetAccount(player)][3] --end function getGroupBankAmount(group) if (not groupTable[group]) then return end return groupTable[group][7] end function getPlayerJoinDate(player) if (not GAC[GetAccount(player)]) then return false end return GAC[GetAccount(player)][4] end function getHexCode(r, g, b) if (r and g and b) then return string.format("#%.2X%.2X%.2X", r, g, b) end end function getGroupChatColor(group) if (not groupTable[group]) then return 255, 255, 255 end local color = fromJSON(groupTable[group][3]) return color[1], color[2], color[3] end function outputGroupMessage(message, group) for ind, data in pairs(GAC) do if (data[1] == group) then local acc = getAccount(ind) if (getAccountPlayer(acc)) then local color = fromJSON(groupTable[group][3]) local hex = getHexCode(color[1], color[2], color[3]) outputChatBox("#FF0000[#FFFFFFGroup System#FF0000]#FFFFFF "..message, getAccountPlayer(acc), 9,249,17, true) groupLog(group, message) end end end end function checkGroupAccess(player, actionID) local rank = getPlayerGroupRank(player) local group = getPlayerGroup(player) if (not rankCache[group]) then return false end if (rankCache[group] and rankCache[group][rank]) then if (tostring(actionID)) then for ind, data in pairs(permToTable) do if (data == actionID) then actionID = ind break end end end local actionID = tonumber(actionID) if (rankCache[group][rank][actionID]) then return true end end end function getPermissionCount(group, rank) if (not rankCache[group]) then return false end local count = 0 if (rankCache[group] and rankCache[group][rank]) then for ind, data in pairs(rankCache[group][rank]) do count = count + 1 end end return count end function getGroupRankCount(group) if (not rankCache[group]) then return end local count = 0 for ind, v in pairs(rankCache[group]) do count = count + 1 end return tonumber(count) or 1 end function doSomethingWithBank(stuff, amount) if (not stuff) then return end if (not tonumber(amount)) then outputChatBox(tostring(amount).. " is an invalid amount of money", client, 255, 0, 0) return end local group = getPlayerGroup(client) if (not group) then outputChatBox("You are not in a group at the moment", client, 255, 0, 0) return end if (stuff == "deposit") then if (getPlayerMoney(client) >= tonumber(amount)) then takePlayerMoney(client, amount) dbExec(db, "UPDATE groups SET cashflow=? WHERE name=?", tostring(getGroupBankAmount(group) + amount), tostring(group)) groupTable[group][7] = tostring(getGroupBankAmount(group) + amount) outputGroupMessage(getPlayerName(client).. " deposited $"..amount.." into "..group.." the total balance is now: $".. getGroupBankAmount(group), group) viewWindow(client) else outputChatBox("You are missing $" ..amount - getPlayerMoney(client).." therefor you are unable to withdraw.", client, 255, 0, 0) end elseif(stuff == "withdraw") then if (not checkGroupAccess(client, 16)) then outputChatBox("You are not allowed to perform this action.", client, 255, 0, 0) return end if (tonumber(amount) > tonumber(groupTable[group][7])) then outputChatBox("You are trying to withdraw too much, your group bank balance is: $" ..groupTable[group][7], client, 255, 255, 0) return end dbExec(db, "UPDATE groups SET cashflow=? WHERE name=?", tostring(getGroupBankAmount(group) - amount), tostring(group)) groupTable[group][7] = tostring(tonumber(getGroupBankAmount(group)) - amount) outputGroupMessage(getPlayerName(client).. " withdrew $"..amount.." from "..group.." bank, the total balance is now: $".. groupTable[group][7], group) viewWindow(client) end end addEvent("groupsys.doSomethingWithBank", true) addEventHandler("groupsys.doSomethingWithBank", root, doSomethingWithBank) function viewWindow(player) if (player) then client = player end local group = getPlayerGroup(client) local rank = getPlayerGroupRank(client) local dateJoined = getPlayerJoinDate(client) local cash = getGroupBankAmount(group) local permRank = false local msg = "" if (group and group ~= "none" and groupTable[group] and groupTable[group][2]) then msg = groupTable[group][2] end if (group and rank and rankCache[group] and rankCache[group][rank]) then permRank = rankCache[group][rank] end triggerClientEvent(client, "groupSystem.done", client, group, rank, dateJoined, msg, permRank, cash) end addEvent("groupSystem.viewWindow", true) addEventHandler("groupSystem.viewWindow", root, viewWindow) function attemptMakeGroup(name) if (isGuestAccount(getPlayerAccount(client))) then return end if (groupTable[name]) then outputChatBox("There is already a group with this name", client, 255, 0, 0) return end local name = string.gsub(name, char, "") if (#name > 20) then outputChatBox("#FF0000[#FFFFFFERRO#FF0000]#FFFFFF Só é permitido 20 caracteres no nome do grupo", client, 255, 0, 0,true) return end if (not getPlayerGroup(client) or getPlayerGroup(client) == "None" or getPlayerGroup == "nil") then local date, time = getTheTime() local date = date.." - "..time createGroup(name, client, date) setGroup(client, name, date, "Founder") outputChatBox("#FF0000[#FFFFFFGroup System#FF0000]#FFFFFF Grupo criado com sucesso! Nome: "..name, client, 0, 255, 0,true) end end addEvent("groupSystem.attemptMakeGroup", true) addEventHandler("groupSystem.attemptMakeGroup", root, attemptMakeGroup) function createGroup(name, creator, date) if (not users[name]) then users[name] = {} end local permissionsFounder = {1,2,3,4,5} local permissionsMembro = {} local color = {math.random(255), math.random(255), math.random(255)} addRank(name, "Founder", toJSON(permissionsFounder)) addRank(name, "Membro", toJSON(permissionsMembro)) groupTable[name] = {GetAccount(creator), "", toJSON(color), toJSON(color), date, toJSON(color)} myGang[creator] = name table.insert(users[name], GetAccount(creator)) dbQuery(loadGroupRanks, db, "SELECT * FROM groupRanks") dbExec(db, "INSERT INTO groups VALUES (?, ?, ?, ?, ?, ?, ?, ?)", name, GetAccount(creator), "", toJSON(color), toJSON(color), date, toJSON(color), 0) setPlayerTeam(creator,playerTeam) outputDebugString(getPlayerName(creator).." created group: "..name.." at: "..date) end function setGroup(player, group, date, rank) if (not users[group]) then users[group] = {} end local date, time = getTheTime() local date = date.." - "..time local color = {math.random(255), math.random(255), math.random(255)} myGang[player] = gang GAC[GetAccount(player)] = {group, rank, 0, date, 0} table.insert(users[group], GetAccount(player)) dbExec(db, "INSERT INTO groupmember VALUES (?, ?, ?, ?, ?)", tostring(GetAccount(player)), tostring(group), tostring(rank), "0", date, "0") viewWindow(player) outputDebugString(getPlayerName(player).." joined group: "..group.." as: "..rank.." at: "..date) setElementData(player, "Group", group) setPlayerTeam(player,playerTeam) end function leaveGroup(player) if (not player) then player = client end local group = getPlayerGroup(player) if (not group) then return end if (getPlayerGroupRank(player) == "Founder") then outputGroupMessage(getPlayerName(player):gsub('#%x%x%x%x%x%x',''):gsub('#%x%x%x%x%x%x','').." Fecho o grupo/clã!", group) for ind, data in pairs(GAC) do if (data[1] == group) then if (getAccountPlayer(getAccount(ind))) then setElementData(getAccountPlayer(getAccount(ind)), "Group", nil) end dbExec(db, "DELETE FROM groupmember WHERE account=?", tostring(ind)) GAC[ind] = nil end end dbExec(db, "DELETE FROM groupRanks WHERE groupName=?", tostring(group)) dbExec(db, "DELETE FROM groups WHERE name=?", tostring(group)) groupTable[group] = nil rankCache[group] = nil end dbExec(db, "DELETE FROM groupmember WHERE account=?", tostring(GetAccount(player))) GAC[GetAccount(player)] = nil viewWindow(player) myGang[player] = nil setPlayerTeam(player,nil) end addEvent("groupSystem.leaveGroup", true) addEventHandler("groupSystem.leaveGroup", root, leaveGroup) --------------------------------------------------------------------------//Permissao para expulsar jogador do grupo function kickAccount(account) if (not checkGroupAccess(client, 2)) then outputChatBox("#FF0000[System Group]#FFFFFF Permissão insuficiente.",client,255,0,0,true) return end dbExec(db, "DELETE FROM groupmember WHERE account=?", tostring(account)) GAC[account] = nil local plr = getAccountPlayer(getAccount(account)) if (plr) then myGang[plr] = nil viewWindow(plr) end end addEvent("groupSystem.kickFromGroup",true) addEventHandler("groupSystem.kickFromGroup",root,kickAccount) --------------------------------------------------------------------------//Permissao para expulsar jogador do grupo --------------------------------------------------------------------------//Permissao para editar mensagem do dia function updateMessage(message) local group = getPlayerGroup(client) if (not groupTable[group]) then return end if (not checkGroupAccess(client, 5)) then return end groupTable[group][2] = message viewWindow(client) dbExec(db, "UPDATE groups SET message=? WHERE name=?", tostring(message), tostring(group)) outputGroupMessage(getPlayerName(client).." has updated the encampment board!", group) end addEvent("groupSystem.updateMessage", true) addEventHandler("groupSystem.updateMessage", root, updateMessage) --------------------------------------------------------------------------//Permissao para editar mensagem do dia function printManagment(player) if (not player) then player = client end local group = getPlayerGroup(client) for ind, data in pairs(GAC) do if (data[1] == group) then local rank, joined, lastTime = GAC[ind][2], GAC[ind][3],GAC[ind][4], GAC[ind][5] triggerClientEvent(client, "groupSystem.addToList", client, tostring(ind), rank, joined, lastTime, getPlayerName(client):gsub('#%x%x%x%x%x%x',''):gsub('#%x%x%x%x%x%x',''), getAccountPlayer(getAccount(ind)), getGroupBankAmount(group)) end end end addEvent("groupSystem.print", true) addEventHandler("groupSystem.print", root, printManagment) ----------------------------------------------------------------------------------------------------//Convidar Membro function makeInvite(player) if (getPlayerGroup(player)) then return end if (not getPlayerGroup(client)) then return end if (not checkGroupAccess(client, 1)) then return end local group = getPlayerGroup(client) outputChatBox(getPlayerName(client):gsub('#%x%x%x%x%x%x',''):gsub('#%x%x%x%x%x%x','').." has sent an invitation to join his encampment: "..group, player, 0, 255, 0) outputChatBox("Sent an invite to "..getPlayerName(player).." to join "..group, client, 0, 255, 0) triggerClientEvent(player, "groupSystem.addInviteToList", player, group, getPlayerName(client), time) end addEvent("groupSystem.makeInvite", true) addEventHandler("groupSystem.makeInvite", root, makeInvite) ----------------------------------------------------------------------------------------------------//Convidar Membro function accepInvite(group) if (not groupTable[group]) then outputChatBox(tostring(group).." does no longer exist!", client, 255, 0, 0) return end setGroup(client, group, _, "Membro") outputGroupMessage(getPlayerName(client):gsub('#%x%x%x%x%x%x',''):gsub('#%x%x%x%x%x%x','').." has joined the encampment!", group) end addEvent("groupSystem.accepInvite", true) addEventHandler("groupSystem.accepInvite", root, accepInvite) function getGroupList() local count = {} for ind, data in pairs(groupTable) do for ind2, data2 in pairs(GAC) do if (data2[1] == ind) then if (not count[ind]) then count[ind] = 0 end count[ind] = count[ind] + 1 end end end triggerClientEvent(client, "groupSystem.addGroupList", client, groupTable, count) end addEvent("groupSystem.getGroupList", true) addEventHandler("groupSystem.getGroupList", root, getGroupList) function groupChat(message, messageType) cancelEvent() if (messageType == 2) then local group = getPlayerGroup(source) if not (group) then return end --outputGroupMessage(getPlayerName(source):gsub('#%x%x%x%x%x%x',''):gsub('#%x%x%x%x%x%x','')..": "..message, group) outputChatBox("#00FF00[CHAT GRUPO]#FFFFFF "..getPlayerName(source):gsub('#%x%x%x%x%x%x',''):gsub('#%x%x%x%x%x%x','').."#00FF00 : "..message:gsub('#%x%x%x%x%x%x',''):gsub('#%x%x%x%x%x%x',''),source,255,255,255,true) end end addEventHandler( "onPlayerChat", getRootElement(), groupChat ) ----------------------------------------------------------------------------------------------------//Can add/edit/remove ranks function showRanks() if (not checkGroupAccess(client, 1)) then return end local group = getPlayerGroup(client) triggerClientEvent(client, "groupSystem.doneWithRanks", client, rankCache[group] or {}) end addEvent("groupSystem.showRanks", true) addEventHandler("groupSystem.showRanks", root, showRanks) function addTheRank(name, selected) if (not checkGroupAccess(client, 1)) then return end local group = getElementData(client, "Group") if (not group) then return end local permissions = {false, false, false, false, false, false, false, false, false, false, false, false, false, false} addRank(group, name, toJSON(permissions)) outputChatBox("Added the rank "..name.." successfully", client, 0, 255, 0) triggerClientEvent(client, "groupSystem.doneWithRanks", client, rankCache[group] or {}, name) end addEvent("groupSystem.addTheRank", true) addEventHandler("groupSystem.addTheRank", root, addTheRank) function editRank(name, newPerm) if (not checkGroupAccess(client, 1)) then return end local group = getPlayerGroup(client) if (isRank(group, name)) then removeRank(group, name) else return end addRank(group, name, toJSON(newPerm)) outputChatBox("Edited permissions for rank '"..name.."'", client, 0, 255, 0) groupLog(group, getPlayerName(client):gsub('#%x%x%x%x%x%x',''):gsub('#%x%x%x%x%x%x','').." edited permissions for rank '"..name.."'") end addEvent("groupSystem.editRank", true) addEventHandler("groupSystem.editRank", root, editRank) function deleteRank(rank) if (not checkGroupAccess(client, 1)) then return end local group = getPlayerGroup(client) if (getGroupRankCount(group) == 1) then outputChatBox("Cannot delete the only rank you have", client, 255, 0, 0) return end if (isRank(group, rank)) then removeRank(group, rank) else return end outputGroupMessage(getPlayerName(client):gsub('#%x%x%x%x%x%x',''):gsub('#%x%x%x%x%x%x','').." deleted the rank: "..rank) groupLog(group, getPlayerName(client):gsub('#%x%x%x%x%x%x',''):gsub('#%x%x%x%x%x%x','').." deleted the rank: "..rank) triggerClientEvent(client, "groupSystem.doneWithRanks", client, rankCache[group] or {}) end addEvent("groupSystem.deleteRank", true) addEventHandler("groupSystem.deleteRank", root, deleteRank) function setTheRank(rank, account) if (not account or not getAccount(account)) then outputChatBox("No account was selected from the list", client, 255, 0, 0) return end local group = getPlayerGroup(client) local mine = getPermissionCount(group, getPlayerGroupRank(client)) local his = getPermissionCount(group, rank) if (not rankCache[group] or rankCache[group] and not rankCache[group][rank]) then outputChatBox("This rank ("..tostring(rank)..") was not found in your group", client, 255, 0, 0) return end local online = getAccountPlayer(getAccount(account)) if (not checkGroupAccess(client, 1)) then outputChatBox("Insufficient permission!",client,255,0,0,true) return end if (tonumber(his) > tonumber(mine)) then outputChatBox("You cannot set the rank of this account because it has more permissions attributes than you!", client, 255, 0, 0) return end if (not GAC[account]) then outputChatBox("No GAC[GetAccount]!",client,255,0,0,true) return end if (GAC[account][1] ~= group) then outputChatBox("No GAC[GetAccount][1] ~= group!",client,255,0,0,true) return end if (GAC[account][2] == rank) then outputChatBox("This account already has the rank "..rank, client, 255, 0, 0) return end if (online) then outputGroupMessage(getPlayerName(client):gsub('#%x%x%x%x%x%x',''):gsub('#%x%x%x%x%x%x','').." has set "..getPlayerName(online):gsub('#%x%x%x%x%x%x',''):gsub('#%x%x%x%x%x%x','').."'s rank to: "..rank, group) else outputGroupMessage(getPlayerName(client):gsub('#%x%x%x%x%x%x',''):gsub('#%x%x%x%x%x%x','').." has set account: "..account.."'s rank to: "..rank, group) end dbExec(db, "UPDATE groupmember SET rank=? WHERE account=?", tostring(rank), tostring(account)) outputChatBox("You have set the rank of account "..account.." to "..rank, client, 0, 255, 0) GAC[account][2] = rank end addEvent("groupSystem.setTheRank", true) addEventHandler("groupSystem.setTheRank", root, setTheRank) ----------------------------------------------------------------------------------------------------//Can add/edit/remove ranks ----------------------------------------------------------------------------------------------------//Permissao para dar cargo function getMyRanks() if (checkGroupAccess(client, 4)) then local group = getPlayerGroup(client) triggerClientEvent(client, "groupSystem.printTheRanks", client, rankCache[group] or {}) end end addEvent("groupSystem.getMyRanks", true) addEventHandler("groupSystem.getMyRanks", root, getMyRanks) ----------------------------------------------------------------------------------------------------//Permissao para dar cargo function changeGroupColor(plr, cmd, r, g, b) local r, g, b = r or 255, g or 255, b or 255 local group = getPlayerGroup(plr) if (not group) then return end if (not checkGroupAccess(plr, 12)) then return end if (not groupTable[group]) then return end local color = {r, g, b} dbExec(db, "UPDATE groups SET chatcolor=? WHERE name=?", toJSON(color), group) groupTable[group][3] = toJSON(color) outputGroupMessage(getPlayerName(plr).." has changed the group chat R: "..r.." G: "..g.." B: "..b, group) outputChatBox("Group colour changed to R: "..r.." G: "..g.." B: "..b, r, g, b, "default-bold", plr, true, 0.15) groupLog(group, getPlayerName(plr).." has set chat color to: "..r..", "..g..", "..b) end function changeTurfColor(plr, cmd, r, g, b) local r, g, b = r or 255, g or 255, b or 255 local group = getPlayerGroup(plr) if (not group) then return end if (not checkGroupAccess(plr, 12)) then return end if (not groupTable[group]) then return end local color = {r, g, b} dbExec(db, "UPDATE groups SET turfcolor=? WHERE name=?", toJSON(color), group) groupTable[group][6] = toJSON(color) outputChatBox("Turf colour changed to R: "..r.." G: "..g.." B: "..b, plr, r, g, b, "default-bold", true, 0.15) groupLog(group, getPlayerName(plr).." has set turf color to: "..r..", "..g..", "..b) end function setCorrectElementData() for ind, plr in pairs(getElementsByType("player")) do if (not GAC[GetAccount(plr)]) then setElementData(plr, "Group", false) end end end setTimer(setCorrectElementData, 2500, 0) function onPlayerOpenVault() outputChatBox("Success",root,255,0,0) end addEvent("onPlayerOpenVault",true) addEventHandler("onPlayerOpenVault",root,onPlayerOpenVault) Look at the complete code
  9. I modified code for this function printManagment(player) if (not player) then player = client end local group = getPlayerGroup(client) for ind, data in pairs(GAC) do if (data[1] == group) then local rank, joined, lastTime = GAC[ind][2], GAC[ind][3],GAC[ind][4], GAC[ind][5] triggerClientEvent(client, "groupSystem.addToList", client, tostring(ind), rank, joined, lastTime, getPlayerName(client):gsub('#%x%x%x%x%x%x',''):gsub('#%x%x%x%x%x%x',''), getAccountPlayer(getAccount(ind)), getGroupBankAmount(group)) end end end addEvent("groupSystem.print", true) addEventHandler("groupSystem.print", root, printManagment) but it did not work
  10. -- Client function printManagment() triggerServerEvent("groupSystem.print", root) end
  11. --Client function addToList(account, rank, joined, lastTime, nick, online) local row = guiGridListAddRow(adminMembsList) guiGridListSetItemText(adminMembsList, row, 1, tostring(nick), false, false) guiGridListSetItemText(adminMembsList, row, 2, tostring(account), false, false) guiGridListSetItemText(adminMembsList, row, 3, tostring(rank), false, false) guiGridListSetItemText(adminMembsList, row, 4, tostring(lastTime), false, false) if (online) then guiGridListSetItemColor(adminMembsList, row, 1, 0, 255, 0) guiGridListSetItemColor(adminMembsList, row, 2, 0, 255, 0) guiGridListSetItemColor(adminMembsList, row, 3, 0, 255, 0) guiGridListSetItemColor(adminMembsList, row, 4, 0, 255, 0) else guiGridListSetItemColor(adminMembsList, row, 1, 255, 0, 0) guiGridListSetItemColor(adminMembsList, row, 2, 255, 0, 0) guiGridListSetItemColor(adminMembsList, row, 3, 255, 0, 0) guiGridListSetItemColor(adminMembsList, row, 4, 255, 0, 0) end end addEvent("groupSystem.addToList", true) addEventHandler("groupSystem.addToList", root, addToList) --Server function printManagment(player) if (player) then player = client end local group = getPlayerGroup(client) for ind, data in pairs(GAC) do if (data[1] == group) then local rank, joined, lastTime = GAC[ind][2], GAC[ind][3],GAC[ind][4], GAC[ind][5] triggerClientEvent(client, "groupSystem.addToList", client, tostring(ind), rank, joined, lastTime, getAccountPlayer(getAccount(ind)), getGroupBankAmount(group)) end end end addEvent("groupSystem.print", true) addEventHandler("groupSystem.print", root, printManagment) http://prntscr.com/g4ef8q Two player connected, but shows my game name for two
  12. -- Server Log = {} local cover = "========================================" function Log:Time ( ) local _time = getRealTime ( ) local _second = _time.second local _minute = _time.minute local _hour = _time.hour local _date = _time.monthday local _month = getMonthName ( _time.month + 1 ) local _year = _time.year + 1900 return _year, _month, _date, _hour, _minute, _second end function Log:Write ( _str ) local _year, _month, _date, _hour, _minute, _second = Log:Time ( ) local filePath = "logs/" .. _year .. "/" .. _month .. "/" .. _date .. ".log" if not ( fileExists ( filePath ) ) then fileCreate ( filePath ) local file = fileOpen ( filePath ) fileWrite ( file, cover .. "\n=Log generated on " .. _date .. " of " .. _month .. ", " .. _year .. "=\n" .. cover .. "\n" ) fileClose ( file ) end local file = fileOpen ( filePath ) fileSetPos ( file, fileGetSize ( file ) ) local _str = tostring ( _str ) fileWrite ( file, "\n[" .. _hour .. ":" .. _minute .. ":" .. _second .. "] " .. _str ) fileFlush ( file ) fileClose ( file ) end months = {"January","February","March","April","May","June","July","August","September","October","November","December"} function getMonthName ( _month ) return months [ _month ] end function outputLog ( _str ) Log:Write ( _str ) end debugTypes = {"INFO","ERROR","WARNING","INFO"} function getDebugLevelFromID ( id ) return debugTypes [ id + 1 ] end addEventHandler("onDebugMessage", root, function ( _msg, _level, _file, _line ) if not _line then _line = "" Log:Write ( getDebugLevelFromID ( _level ) .. ": " .. _file .. ": " .. _line .. ": " .. _msg ) end end ) addEventHandler("onPlayerLogin", root, function ( _, _acc ) local _acc = getAccountName ( _acc ) local _clan = getIPFromName ( getElementData ( source,"Group" ) ) Log:Write ( "LOGIN: " .. getPlayerName(source) .. " successfully logged in as '" .. _acc .. "' (CLAN: ".._clan")" ) end ) function getIPFromName ( str ) return playerIPs [ str ] end -- Meta <script src = "Server.lua" type = "server" /> <export function = "outputLog" type = "server" /> Is not logging per day.
  13. http://prntscr.com/f0hksv[/img] alguem sabe como resolver
  14. isso já resolvi erra um problema de download de serves, quando jogador entrava em um server e voltava, pro outro acabava bugando. mas agora tem outro problema as parede fica sumindo e aparecendo, se você estiver longe ou perto.
×
×
  • Create New...