Bigjhow
Members-
Posts
8 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
Bigjhow's Achievements
Newbie (4/54)
0
Reputation
-
ajuda Como exportar um Custom Marker para essa função do CreateMarker?
Bigjhow replied to Bigjhow's topic in Programação em Lua
quero exportar export["TB_marker"]:createMarker("door", Vector3 {x, y, z-0.3}) essa export, para que na hora que o marker for criado ele seja personalizado e não o marker padrão do jogo só que não consigo , está dando esse erro no script: ERROR: [RPPOLICIAL]Script_Arsenal/kakaS.lua30 attempt to perform arithmetic on field ? (a nil value) um exemplo do que eu quero fazer em outro script é esse o : function() for i, v in ipairs(config["Markers"].Conce) do marker_conce[i] = exports["vanish_marker"]:createMarker("carshop", Vector3 {v[1], v[2], v[3]-0.9}) addEventHandler("onMarkerHit", marker_conce[i], function(player) triggerClientEvent(player, "JOAO.openConce", player) end) end for i, v in ipairs(config["Markers"].Garagem) do marker_garagem[i] = exports["vanish_marker"]:createMarker("get_car", Vector3 {v[1], v[2], v[3]-0.9}) addEventHandler("onMarkerHit", marker_garagem[i], function(player) triggerClientEvent(player, "JOAO.openGaragem", player) local result = dbPoll(dbQuery(db, 'SELECT * FROM Veiculos WHERE Conta = ?', getAccountName(getPlayerAccount(player))), -1) triggerClientEvent(player, 'JOAO.resultVehiclesGaragemC', player, result) end) end end) -
-- Gostaria de Inserir uma Custom marker nessa parte do '' Markers" createMarker... com exports -- exports["TB_marker"]:createMarker("door", Vector3 {x, y, z-0.3}) @Shady1 @Burak5312 function createEvent(name, func) addEvent(name, true); addEventHandler(name, root, func); end --\Utils local spawns = createElement ("KK:onScriptMarkerCorp") local propriedades = { } function getPlayerACLGroup (elemento, acl) if aclGetGroup (acl) then local accName = getAccountName (getPlayerAccount (elemento)) if isObjectInACLGroup ("user." ..accName, aclGetGroup (acl)) then return true else return false end else return false end end for i,v in pairs(global['Markers']) do marker = createMarker( v.posx, v.posy, v.posz -1, "cylinder", 1.5, 0, 159, 255, 50) setElementParent(marker, spawns) propriedades[marker] = {acl = global["Markers"][i].acl}
-
Na hora que clico no Vip para comprar da esse erro no debugscript 3 Linha 183: Bad Argument @ 'aclGroupAddObject' [expected acl-group at argument 1, got boolean] vehicle = {} delay = {} delay['Skin'] = {} delay['Arma'] = {} delay['Veiculo'] = {} delay['Vida'] = {} delay['Colete'] = {} delay['Inventario'] = {} function getVipPlayer (player) local vips = {} for i, v in pairs(config.vips) do if aclGetGroup(i) and isObjectInACLGroup('user.'..getAccountName(getPlayerAccount(player)), aclGetGroup(i)) then vips[i] = true end end return vips end connection = dbConnect('sqlite', 'assets/dados/sqlite.db') dbExec(connection, 'CREATE TABLE IF NOT EXISTS DelayActions (Action, Account, Timer)') dbExec(connection, 'CREATE TABLE IF NOT EXISTS EstoqueShopCoins (Nome, Quantidade)') dbExec(connection, 'CREATE TABLE IF NOT EXISTS Vip (User, Type, Dias, DateAtivation, DateVencimento)') dbExec(connection, 'CREATE TABLE IF NOT EXISTS Armas (User, Nome, Arma, Skin)') dbExec(connection, 'CREATE TABLE IF NOT EXISTS Equipe (User, Nome, Arma, Skin)') for i, v in pairs(config.loja) do for index, value in ipairs(v.products) do if tonumber(value.estoque) then if #dbPoll(dbQuery(connection, 'SELECT * FROM EstoqueShopCoins WHERE Nome = ?', value.nome), - 1) == 0 then dbExec(connection, 'INSERT INTO EstoqueShopCoins (Nome, Quantidade) VALUES(?, ?)', value.nome, value.estoque) end end end end function getEstoque (nome) local result = dbPoll(dbQuery(connection, 'SELECT * FROM EstoqueShopCoins WHERE Nome = ?', nome), - 1) if #result ~= 0 then local quantidade = result[1]['Quantidade'] if tonumber(quantidade) > 0 then return true, quantidade end end return false end function diminuirEstoque (nome) local result = dbPoll(dbQuery(connection, 'SELECT * FROM EstoqueShopCoins WHERE Nome = ?', nome), - 1) if #result ~= 0 then local quantidade = result[1]['Quantidade'] if tonumber(quantidade) > 0 then dbExec(connection, 'UPDATE EstoqueShopCoins SET Quantidade = ? WHERE Nome = ?', quantidade - 1, nome) return true end end return false end function isArmaPlayer (player, arma) local result = dbPoll(dbQuery(connection, 'SELECT * FROM Armas WHERE User = ?', getAccountName(getPlayerAccount(player))), - 1) if (#result ~= 0) then for i, v in ipairs(result) do if v['Skin'] == arma then return true end end end return false end function getPlayerByLogin (login) for _, player in ipairs(getElementsByType('player')) do if getAccountName(getPlayerAccount(player)) == tostring(login) then return player end end return false end addEvent('equipeWeaponShader', true) addEventHandler('equipeWeaponShader', root, function (item) if item and type(item) == 'table' then local shader = config.weapons_shader[item.nome].shader local texture = config.weapons_shader[item.nome].texture if isArmaPlayer(source, shader) then if (getPedWeapon(source) == config.weapons_shader[item.nome].weapon) then if item.action == 'Equipar' then if (#dbPoll(dbQuery(connection, 'SELECT * FROM Equipe WHERE User = ? AND Skin = ?', getAccountName(getPlayerAccount(source)), shader), - 1) ~= 0) then dbExec(connection, 'DELETE FROM Equipe WHERE User = ? AND Skin = ?', getAccountName(getPlayerAccount(source)), shader) end dbExec(connection, 'INSERT INTO Equipe (User, Nome, Arma, Skin) VALUES(?, ?, ?, ?)', getAccountName(getPlayerAccount(source)), item.nome, string.upper(texture), shader) triggerClientEvent(root, 'setArmaSticker', root, source, texture, shader) config.notify(source, 'success', 'Você equipou a arma com sucesso.') elseif item.action == 'Desequipar' then triggerClientEvent(root, 'removerArmaSticker', root, source) local result = dbPoll(dbQuery(connection, 'SELECT * FROM Equipe WHERE User = ?', getAccountName(getPlayerAccount(source))), - 1) if (#result ~= 0) then for i, v in ipairs(result) do dbExec(connection, 'DELETE FROM Equipe WHERE User = ? AND Arma = ?', getAccountName(getPlayerAccount(source)), v['Arma']) end end config.notify(source, 'success', 'Você desequipou a arma com sucesso.') end triggerClientEvent(source, 'updateArmas', source, dbPoll(dbQuery(connection, 'SELECT * FROM Armas WHERE User = ?', getAccountName(getPlayerAccount(source))) , - 1), dbPoll(dbQuery(connection, 'SELECT * FROM Equipe WHERE User = ?', getAccountName(getPlayerAccount(source))) , - 1)) else config.notify(source, 'error', 'Equipe a arma para '..(item.action == 'Desequipar' and 'des' or '')..'equipar esta skin de arma.') end else config.notify(source, 'error', 'Você não possui essa skin de arma.') end end end) addEventHandler('onPlayerLogin', root, function (_, acc) local result = dbPoll(dbQuery(connection, 'SELECT * FROM Equipe WHERE User = ?', getAccountName(acc)), - 1) if (#result ~= 0) then for i, v in ipairs(result) do local shader = config.weapons_shader[v['Nome']].shader local texture = config.weapons_shader[v['Nome']].texture triggerClientEvent(root, 'setArmaSticker', root, source, texture, shader) end end local resultDados = dbPoll(dbQuery(connection, 'SELECT * FROM Equipe'), - 1) if (#resultDados ~= 0) then for i, v in ipairs(resultDados) do local player = getPlayerByLogin(v['User']) if isElement(player) then local shader = config.weapons_shader[v['Nome']].shader local texture = config.weapons_shader[v['Nome']].texture triggerClientEvent(source, 'setArmaSticker', source, player, texture, shader) end end end end) setTimer(function() for i, v in ipairs(dbPoll(dbQuery(connection, 'SELECT * FROM Vip'), - 1)) do if (v['Dias'] ~= 'Permanente') then if ((tonumber(v['Dias'])-15000) < 0) then aclGroupRemoveObject(aclGetGroup(v['Type']), 'user.'..v['User']) dbExec(connection, 'DELETE FROM Vip WHERE User = ? AND Type = ?', v['User'], v['Type']) local player = getPlayerByLogin(v['User']) if isElement(player) then config.notify(player, 'info', 'A Pulseira '..v['Type']..' acabou de ser removido pois o tempo acabou.') end else dbExec(connection, 'UPDATE Vip SET Dias = ? WHERE User = ? AND Type = ?', (tonumber(v['Dias']) - 15000), v['User'], v['Type']) end end end end, 15000, 0) addEvent('buyItemCoin', true) addEventHandler('buyItemCoin', root, function (item) if item and type(item) == 'table' then local coins = getElementData(source, config.datacoin) or 0 if (item.loja == 'Skins de Armas') then local shader = config.weapons_shader[item.nome].shader if not isArmaPlayer(source, shader) then local texture = config.weapons_shader[item.nome].texture if shader and texture then if coins >= tonumber(item.price) then dbExec(connection, 'INSERT INTO Armas (User, Nome, Arma, Skin) values(?, ?, ?, ?)', getAccountName(getPlayerAccount(source)), item.nome, string.upper(texture), shader) setElementData(source, config.datacoin, coins - item.price) config.notify(source, 'success', 'Você comprou uma skin de arma.') triggerClientEvent(source, 'updateArmas', source, dbPoll(dbQuery(connection, 'SELECT * FROM Armas WHERE User = ?', getAccountName(getPlayerAccount(source))) , - 1), dbPoll(dbQuery(connection, 'SELECT * FROM Equipe WHERE User = ?', getAccountName(getPlayerAccount(source))) , - 1)) else return config.notify(source, 'error', 'Você não possui Acoins suficiente.') end else return config.notify(source, 'error', 'Ocorreu um erro ao comprar a skin de arma.') end else return config.notify(source, 'error', 'Você já possui esta skin de armas.') end elseif (item.loja == 'Vips') then if #dbPoll(dbQuery(connection, 'SELECT * FROM Vip WHERE User = ? AND Type = ?', getAccountName(getPlayerAccount(source)), item.informations.vip), - 1) == 0 then if coins >= tonumber(item.price) then setElementData(source, config.datacoin, coins - item.price) config.notify(source, 'success', 'Você assinou VIP '..item.nome..', obrigado pelo apoio! ') dbExec(connection, 'INSERT INTO Vip (User, Type, Dias, DateAtivation, DateVencimento) Values(?, ?, ?, ?, ?)', getAccountName(getPlayerAccount(source)), item.informations.vip, (item.informations.dias == 'Permanente' and 'Permanente' or (item.informations.dias * 86400000)), getDate('hoje'), getDate('vencimento', item.informations.dias)) aclGroupAddObject(aclGetGroup(item.informations.vip), 'user.'..getAccountName(getPlayerAccount(source))) givePlayerMoney(source, tonumber(item.informations.ativation_money)) config.notify(root, string.gsub(string.gsub(getPlayerName(source), '#%x%x%x%x%x%x', ''), '_', ' ')..' assinou o plano '..item.nome..' com sucesso!', 'info') triggerClientEvent(source, 'updateVips', source, getVipPlayer(source), dbPoll(dbQuery(connection, 'SELECT * FROM Vip WHERE User = ?', getAccountName(getPlayerAccount(source))) , - 1)) else return config.notify(source, 'error', 'Você não possui ACoins suficiente.') end else return config.notify(source, 'error', 'Você já possui um VIP '..item.informations.vip..' ativado, aguarde o vencimento para poder comprar outro.') end elseif (item.loja == 'Passaporte') then if coins >= tonumber(item.price) then if tonumber(item.estoque) then if getEstoque(item.nome) then if diminuirEstoque(item.nome) then setElementData(source, config.datacoin, coins - item.price) config.notify(source, 'error', 'Você comprou o ID '..item.id..'.') triggerEvent('buyId', source, getElementData(source, 'ID'), item.id) else return config.notify(source, 'error', 'Ocorreu um erro ao diminuir o estoque do item.') end else return config.notify(source, 'warning', 'Acabou o estoque desse item.') end end else return config.notify(source, 'error', 'Você não possui ACoins suficiente.') end elseif (item.loja == 'Mascaras') then if coins >= tonumber(item.price) then local inv = config.inventario.nome local giveInv = config.inventario.giveItem setElementData(source, config.datacoin, coins - item.price) exports.CzInventory:sendItem(source, item.informations.id, 1) config.notify(source, 'success', 'Você comprou um(a) '..item.nome..'') end end end end) monthdays = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } function getDate (action, dias) time = getRealTime() local day = time.monthday local month = time.month + 1 local year = time.year + 1900 if action == 'hoje' then local day = tonumber(day) < 10 and '0'..day or day local month = tonumber(month) < 10 and '0'..month or month return day..'/'..month..'/'..year else if dias == 'Permanente' then return 'Permanente' else if (day+dias) > monthdays[month] then day = day+dias day = day-monthdays[month] if month < 12 then month = month + 1 else month = 1 year = year + 1 end else day = day + dias end local day = tonumber(day) < 10 and '0'..day or day local month = tonumber(month) < 10 and '0'..month or month return day..'/'..month..'/'..year end end end for i,v in ipairs(dbPoll(dbQuery(connection, 'SELECT * FROM DelayActions'), - 1)) do if delay[v['Action']] then delay[v['Action']][v['Account']] = setTimer(function() end, tonumber(v['Timer']), 1) dbExec(connection, 'DELETE FROM DelayActions WHERE Action = ? AND Account = ?', v['Action'], v['Account']) end end addEventHandler('onResourceStop', resourceRoot, function() for i, _ in pairs(delay) do for user, timer in pairs(delay[i]) do if isTimer(timer) then local remaining, _, _ = getTimerDetails(timer) dbExec(connection, 'INSERT INTO DelayActions (Action, Account, Timer) VALUES(?, ?, ?)', i, user, remaining) end end end end) addEventHandler('onResourceStart', resourceRoot, function () for i, v in ipairs(getElementsByType('player')) do if not isGuestAccount(getPlayerAccount(v)) then bindKey(v, config.panel.key, config.panel.state, function (player) local armas = dbPoll(dbQuery(connection, 'SELECT * FROM Armas WHERE User = ?', getAccountName(getPlayerAccount(player))) , - 1) local armasequipadas = dbPoll(dbQuery(connection, 'SELECT * FROM Equipe WHERE User = ?', getAccountName(getPlayerAccount(player))) , - 1) local vencimentos = dbPoll(dbQuery(connection, 'SELECT * FROM Vip WHERE User = ?', getAccountName(getPlayerAccount(player))) , - 1) local estoque = dbPoll(dbQuery(connection, 'SELECT * FROM EstoqueShopCoins'), - 1) triggerClientEvent(player, 'onPanelDraw', player, getVipPlayer(player), (1), armas, armasequipadas, vencimentos, estoque) end) end end end) addEventHandler('onPlayerLogin', root, function() bindKey(source, config.panel.key, config.panel.state, function (player) local armas = dbPoll(dbQuery(connection, 'SELECT * FROM Armas WHERE User = ?', getAccountName(getPlayerAccount(player))) , - 1) local armasequipadas = dbPoll(dbQuery(connection, 'SELECT * FROM Equipe WHERE User = ?', getAccountName(getPlayerAccount(player))) , - 1) local vencimentos = dbPoll(dbQuery(connection, 'SELECT * FROM Vip WHERE User = ?', getAccountName(getPlayerAccount(player))) , - 1) local estoque = dbPoll(dbQuery(connection, 'SELECT * FROM EstoqueShopCoins'), - 1) triggerClientEvent(player, 'onPanelDraw', player, getVipPlayer(player), 1, armas, armasequipadas, vencimentos, estoque) end) end) addEvent('coletarBeneficioVip', true) addEventHandler('coletarBeneficioVip', root, function (beneficio, vip, group) local account = getAccountName(getPlayerAccount(source)) if aclGetGroup(group) and isObjectInACLGroup('user.'..account, aclGetGroup(group)) then if (beneficio) then if delay[beneficio[3]] and delay[beneficio[3]][account] and isTimer(delay[beneficio[3]][account]) then return config.notify(source, 'error', 'Você já pegou uma '..beneficio[3]..' recentemente.') end if (beneficio[3] == 'Skin') then setElementModel(source, beneficio[4]) config.notify(source, 'info', 'Você pegou o beneficio '..beneficio[2]..'.') delay[beneficio[3]][account] = setTimer(function() end, vip.delay*60000, 1) elseif (beneficio[3] == 'Arma') then exports['CzInventory']:sendItem(source, beneficio[4], 1) exports['CzInventory']:sendItem(source, beneficio[5][1], beneficio[5][2]) config.notify(source, 'info', 'Você pegou o beneficio '..beneficio[2]..'.') delay[beneficio[3]][account] = setTimer(function() end, vip.delay*3600000, 1) elseif (beneficio[3] == 'Veiculo') then if not isElement(vehicle[source]) then local x, y, z = getElementPosition(source) local _, _, r = getElementRotation(source) vehicle[source] = createVehicle(beneficio[4], x+1.5, y+1.5, z, 0, 0, r, 'Trinity') config.notify(source, 'info', 'Você pegou o beneficio '..beneficio[2]..'.') delay[beneficio[3]][account] = setTimer(function() end, vip.delay*60000, 1) setElementData(vehicle[source], 'Owner', source) setElementData(vehicle[source], 'fuel', 100) else destroyElement(vehicle[source]) --config.notify(source, 'Você já possui um veículo spawnado, digite /vehiclevip para guardar.', 'warning') end elseif (beneficio[3] == 'Vida') then if getElementHealth(source) < 100 then setElementHealth(source, getElementHealth(source) + beneficio[4]) config.notify(source, 'info', 'Você pegou o beneficio '..beneficio[2]..'.') delay[beneficio[3]][account] = setTimer(function() end, vip.delay*60000, 1) else config.notify(source, 'warning', 'Você já está com a vida cheia.') end elseif (beneficio[3] == 'Colete') then if getPedArmor(source) < 100 then setPedArmor(source, getPedArmor(source) + beneficio[4]) config.notify(source, 'info', 'Você pegou o beneficio '..beneficio[2]..'.') delay[beneficio[3]][account] = setTimer(function() end, vip.delay*60000, 1) else config.notify(source, 'warning', 'Você já esta com colete.') end elseif (beneficio[3] == 'Inventario') then exports['CzInventory']:sendItem(source, beneficio[4], 1) config.notify(source, 'info', 'Você pegou o beneficio '..beneficio[2]..'.') delay[beneficio[3]][account] = setTimer(function() end, vip.delay*60000, 1) elseif (beneficio[3] == 'Rainbow') then local vehicle = getPedOccupiedVehicle(source) if vehicle then if getElementData(source, 'rainbow.car') then setElementData(source, 'rainbow.car', false) else setElementData(source, 'rainbow.car', true) end end elseif (beneficio[3] == 'Blindar') then local vehicle = getPedOccupiedVehicle(source) if vehicle then setVehicleDamageProof(vehicle, true) config.notify(source, 'info', 'Você pegou o beneficio '..beneficio[2]..'.') --exports['FR_DxMessages']:addBox(player, 'Pacote de '..type..' coletado com sucesso', 'success') end end end end end) addCommandHandler('vehiclevip', function (player) if isElement(vehicle[player]) then destroyElement(vehicle[player]) config.notify(player, 'success', 'Você guardou seu veículo VIP.') else config.notify(player, 'error', 'Você não possui um veículo VIP spawnado.') end end) addEventHandler('onPlayerQuit', root, function () if isElement(vehicle[source]) then destroyElement(vehicle[source]) end end )
-
-- Gostaria de Inserir uma Custom marker nessa parte do '' marker = createMarker... com exports -- exports["TB_marker"]:createMarker("door", Vector3 {x, y, z-0.3}) function createEvent(name, func) addEvent(name, true); addEventHandler(name, root, func); end --\Utils local spawns = createElement ("KK:onScriptMarkerCorp") local propriedades = { } function getPlayerACLGroup (elemento, acl) if aclGetGroup (acl) then local accName = getAccountName (getPlayerAccount (elemento)) if isObjectInACLGroup ("user." ..accName, aclGetGroup (acl)) then return true else return false end else return false end end for i,v in pairs(global['Markers']) do marker = createMarker( v.posx, v.posy, v.posz -1, "cylinder", 1.5, 0, 159, 255, 50) setElementParent(marker, spawns) propriedades[marker] = {acl = global["Markers"][i].acl} end
-
local screenW, screenH = guiGetScreenSize() local x, y = (screenW/1336), (screenH/768) function dxMaconha() exports["Blur"]:dxDrawBluredRectangle(screenW * 0.0000, screenH * 0.0013, screenW * 1.0000, screenH * 0.9987, tocolor(255, 255, 255, 150)) dxDrawImage(screenW * 0.0000, screenH * 0.0013, screenW * 1.0000, screenH * 0.9987, "files/efeito.png", 0, 0, 0, tocolor(0, 254, 6, 255), false) end function UsarMaconha(player) sound = playSound( "files/reggae_music.mp3", true ) addEventHandler ( "onClientRender", root, dxMaconha ) setPedControlState(player, "walk", true) setWindVelocity(100, 100, 0) setCameraShakeLevel(255) setGameSpeed(0.5) setTimer(function() stopSound( sound ) resetWindVelocity() setCameraShakeLevel(1) setGameSpeed(1) removeEventHandler ( "onClientRender", root, dxMaconha ) end,player*4000,1) end addEvent("TB:UsarMaconha", true) addEventHandler ("TB:UsarMaconha", root, UsarMaconha ) function onClientResourceStart () setPedWalkingStyle ( localPlayer , 0 ) -- localPlayer, não "player" stopSound ( som ) resetWindVelocity () setCameraShakeLevel ( 1 ) setGameSpeed ( 1 ) removeEventHandler ( "onClientRender" , root , dxMaconha ) end addEventHandler ( "onClientResourceStart" , resourceRoot , onClientResourceStart )
-
local screenW, screenH = guiGetScreenSize() local x, y = (screenW/1336), (screenH/768) function dxMaconha() exports["Blur"]:dxDrawBluredRectangle(screenW * 0.0000, screenH * 0.0013, screenW * 1.0000, screenH * 0.9987, tocolor(255, 255, 255, 150)) dxDrawImage(screenW * 0.0000, screenH * 0.0013, screenW * 1.0000, screenH * 0.9987, "files/efeito.png", 0, 0, 0, tocolor(0, 254, 6, 255), false) end function UsarMaconha(player) sound = playSound( "files/reggae_music.mp3", true ) addEventHandler ( "onClientRender", root, dxMaconha ) setPedControlState(player, "walk", true) setWindVelocity(100, 100, 0) setCameraShakeLevel(255) setGameSpeed(0.5) setTimer(function() stopSound( sound ) resetWindVelocity() setCameraShakeLevel(1) setGameSpeed(1) removeEventHandler ( "onClientRender", root, dxMaconha ) end,player*4000,1) end addEvent("TB:UsarMaconha", true) addEventHandler ("TB:UsarMaconha", root, UsarMaconha ) function onClientResourceStart() setPedWalkingStyle(player, 0) stopSound( sound ) resetWindVelocity() setCameraShakeLevel(1) setGameSpeed(1) removeEventHandler ( "onClientRender", root, dxMaconha ) end addEventHandler("onClientResourceStart",resourceRoot, onClientResourceStart) -- ERROS -- [RPINV]\CzInventory\cTeoBeack.lua30: Bad Argument @'SetPedWalkingStyle' [Expected element at argument 1, got nil]