gbmv33

Members
  • Content Count

    22
  • Joined

  • Last visited

Community Reputation

0 Neutral

About gbmv33

  • Rank
    Civilian
  • Birthday 18/02/2001

Details

  • Location
    Brasil

Recent Profile Visitors

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

  1. eu usei o server side para setar o elementdata no alvo do taser, e chama-la em client side que iria bloquear o uso dos F`s então eu removo a linha 23? esqueci de falar que e esse error Bad Argument @ 'setElementData' [Expected element at argument 1,got nil] deu no client side nas linhas da data esqueci de falar que e esse error Bad Argument @ 'setElementData' [Expected element at argument 1,got nil] deu no client side nas linhas da data
  2. creio que seja por isso porque no seu script ele seta o elemento Ferro no player que ativa a animação, mas ele não remove essa data do player para que a animação seja cancelada tenta esse script então local ferro = {} addEvent("givePlayerferro",true) addEventHandler("givePlayerferro",getRootElement(),function(playerSource) if not isElement(ferro[playerSource]) then ferro[playerSource] = createObject(16304,0,0,0) setElementCollisionsEnabled(ferro[playerSource], false) exports.bone_attach:attachElementToBone(ferro[playerSource],playerSource,12,0,0.2,0.1,0,-90,65) setElementData(playerSource,"ferro",ferro[playerSource]) setPedAnimation(playerSource, "CARRY", "crry_prtial", 0, true, true, true, true) end end) addEvent("takePlayerferro",true) addEventHandler("takePlayerferro",getRootElement(),function(playerSource) if isElement(ferro[playerSource]) then exports.bone_attach:detachElementFromBone(ferro[playerSource]) destroyElement(ferro[playerSource]) ferro[playerSource] = false toggleControl(playerSource,"fire", true) toggleControl(playerSource,"sprint", true) toggleControl(playerSource,"crouch", true) toggleControl(playerSource,"jump", true) removeElementData(thePlayer, "Ferro") setPedAnimation(playerSource) end end)
  3. Tenta remover o elemento ferro addEvent("takePlayerferro",true) addEventHandler("takePlayerferro",getRootElement(),function(playerSource) if isElement(ferro[playerSource]) then exports.bone_attach:detachElementFromBone(ferro[playerSource]) destroyElement(ferro[playerSource]) ferro[playerSource] = false setPedAnimation(playerSource,false) toggleControl(playerSource,"fire", true) toggleControl(playerSource,"sprint", true) toggleControl(playerSource,"crouch", true) toggleControl(playerSource,"jump", true) removeElementData(playerSource, "Ferro") setPedAnimation(playerSource) end end)
  4. preciso de ajuda ainda kkk, não aparece nada mais no debug script mas ele não está setando o shock no player para não ativar os F's, nsei mais oq fazer vou deixar os scripts server e client side se alguem poder me ajudar agradeço Server-side local cFunc = {} local cSetting = {} -- FUNCTIONS -- setWeaponProperty("silenced", "pro", "weapon_range", 45.0) setWeaponProperty("silenced", "pro", "maximum_clip_ammo", 1) setWeaponProperty("silenced", "pro", "damage", 10) setWeaponProperty("silenced", "std", "weapon_range", 45.0) setWeaponProperty("silenced", "std", "maximum_clip_ammo", 1) setWeaponProperty("silenced", "std", "damage", 10) setWeaponProperty("silenced", "poor", "weapon_range", 45.0) setWeaponProperty("silenced", "poor", "maximum_clip_ammo", 1) setWeaponProperty("silenced", "poor", "damage", 10) -- EVENT HANDLERS -- function emshock (thePlayer) local player_alvo = getPlayerFromPartialName ( nick ) local nick_do_jogador = getPlayerName ( player_alvo ) local nick_do_agressor = getPlayerName ( thePlayer ) if player_alvo then setElementData (player_alvo, "shock", true) end end client-side --[[ ########################################################################## ## ## ## Project: 'Taser' - resource for MTA: San Andreas ## ## ## ########################################################################## [C] Copyright 2013-2014, Falke ]] local cFunc = {} local cSetting = {} cSetting["shots"] = {} cSetting["shot_calcs"] = {} local last_shot = 1 -- FUNCTIONS -- cFunc["render_shots"] = function() for index, tbl in pairs(cSetting["shots"]) do dxDraw:OedLine3D(tbl[1], tbl[2], tbl[3], tbl[4], tbl[5], tbl[6], tocolor(0, 255, 0)) end end cFunc["draw_shot"] = function(x1, y1, z1, x2, y2, z2) table.insert(cSetting["shots"], last_shot, {x1, y1, z1, x2, y2, z2}) -- SHOT CALCULATING local lastx, lasty, lastz = x1, y1, z1 local dis = getDistanceBetweenPoints3D(x1, y1, z1, x2, y2, z2) cSetting["shot_calcs"][last_shot] = {} for i = 1, dis, 0.5 do -- cSetting["shot_calcs"][i] = nx, ny, nz -- cSetting["shot_calcs"][last_shot][i] = end last_shot = last_shot+1 end cFunc["shot_weapon"] = function(hitX, hitY, hitZ, x, y, z) playSound3D("data/Fire.wav", x, y, z) local s = playSound3D("data/Fire.wav", hitX, hitY, hitZ) setSoundMaxDistance(s, 50) for i = 1, 5, 1 do fxAddPunchImpact(hitX, hitY, hitZ, 0, 0, 0) fxAddSparks(hitX, hitY, hitZ, 0, 0, 0, 8, 1, 0, 0, 0, true, 3, 1) end cFunc["draw_shot"](x, y, z, hitX, hitY, hitZ) fxAddPunchImpact(x, y, z, 0, 0, -3) end cFunc["wait_shot"] = function() toggleControl("fire", false) setTimer(function() toggleControl("fire", true) end, 350, 1) end cFunc["shot_check"] = function(wp, _, _, hitX, hitY, hitZ, element, startX, startY, startZ) if(wp == 23) then cFunc["shot_weapon"](hitX, hitY, hitZ, startX, startY, startZ) if(source == localPlayer) then cFunc["wait_shot"]() end end end dxDraw:OedLine3D = function(x1, y1, z1, x2, y2, z2, color) local dis = getDistanceBetweenPoints3D(x1, y1, z1, x2, y2, z2) local lastx, lasty, lastz = x1, y1, z1 --for i = 1, dis, 3 do -- dxDrawLine3D(x1, y1, z1, x2, y2, z2) --end end cFunc["anim_check"] = function(_, wep, bodypart) if(wep == 23) and (bodypart == 9) then setPedAnimation(source, "ped", "KO_shot_face", 30000, false, true, false) setElementData (source, "shock", true) setTimer (function () setElementData (source, "shock", false) end, 30000, 1) elseif(wep == 23) and (bodypart == 8) then setPedAnimation(source, "CRACK", "crckdeth2", 30000, false, true, false) setElementData (source, "shock", true) setTimer (function () setElementData (source, "shock", false) end, 30000, 1) elseif(wep == 23) and (bodypart == 7) then setPedAnimation(source, "CRACK", "crckdeth2", 30000, false, true, false) setElementData (source, "shock", true) setTimer (function () setElementData (source, "shock", false) end, 30000, 1) elseif(wep == 23) and (bodypart == 6) then setPedAnimation(source, "CRACK", "crckdeth2", 30000, false, true, false) setElementData (source, "shock", true) setTimer (function () setElementData (source, "shock", false) end, 30000, 1) elseif(wep == 23) and (bodypart == 5) then setPedAnimation(source, "CRACK", "crckdeth2", 30000, false, true, false) setElementData (source, "shock", true) setTimer (function () setElementData (source, "shock", false) end, 30000, 1) elseif(wep == 23) and (bodypart == 4) then setPedAnimation(source, "CRACK", "crckdeth3", 30000, false, true, false) setElementData (source, "shock", true) setTimer (function () setElementData (source, "shock", false) end, 30000, 1) elseif(wep == 23) and (bodypart == 3) then setPedAnimation(source, "ped", "KO_shot_stom", 30000, false, true, false) setElementData (source, "shock", true) setTimer (function () setElementData (source, "shock", false) end, 30000, 1) elseif(wep == 23) and (bodypart == 2) then setPedAnimation(source, "CRACK", "crckdeth2", 30000, false, true, false) setElementData (source, "shock", true) setTimer (function () setElementData (source, "shock", false) end, 30000, 1) elseif(wep == 23) and (bodypart == 1) then setPedAnimation(source, "CRACK", "crckdeth2", 30000, false, true, false) setElementData (source, "shock", true) setTimer (function () setElementData (source, "shock", false) end, 30000, 1) end end addEventHandler ("onClientKey", getRootElement(), function (button, press) if getElementData (source, "shock") then if button == "F1" or button == "F2" or button == "F3" or button == "F4" or button == "F5" or button == "F6" or button == "F7" or button == "F9" or button == "F10" or button == "F11" or button == "F12" or button == "t" then cancelEvent () end end end) -- EVENT HANDLER -- addEventHandler("onClientPlayerWeaponFire", getRootElement(), cFunc["shot_check"]) addEventHandler("onClientRender", getRootElement(), cFunc["render_shots"]) addEventHandler("onClientPedDamage", getRootElement(),cFunc["anim_check"]) addEventHandler("onClientPlayerDamage", getRootElement(),cFunc["anim_check"]) na real apareceu algo sim, quando eu levo o tiro aparece, Bad Argument @ 'setElementData' [Expected element at argument 1,got nil]
  5. consertei aq descobri o error no codigo tinha 2 sinais "??" invisiveis, eles so aparecem no notepad++ addEventHandler ("onClientKey", root, function (button, press) if getElementData (source, "shock") then if button == "F1" or button == "F2" or button == "F3" or button == "F4" or button == "F5" or button == "F6" or button == "F7" or button == "F9" or button == "F10" or button == "F11" or button == "F12" or button == "t" then cancelEvent () end end end)?? ------AQUI quando ativei o debug mod eu vi que deu error de sinais estranhos perto da linha ai eu não vi nada naquela linha, quando passei pro notepad++ esses sinais apareceram.
  6. o ultimo false desse codigo setPedAnimation(playerSource, "CARRY", "crry_prtial", 0, true, false, true, false) é para não freezar no ultimo frame da animação, se ficar true ele vai freezar fonte: bool setPedAnimation ( ped thePed [, string block = nil, string anim = nil, int time = -1, bool loop = true, bool updatePosition = true, bool interruptable = true, bool freezeLastFrame = true, int blendTime = 250, bool restoreTaskOnAnimEnd = false ] )
  7. troquei os source por localPlayer não houve mudanças Silenced tem a textura do taser apenas, mas age como uma silenced normal to achando que o problema pode ser server-side. o meu function está certo? function emshock (thePlayer) local player_alvo = getPlayerFromPartialName ( nick ) local nick_do_jogador = getPlayerName ( player_alvo ) local nick_do_agressor = getPlayerName ( thePlayer ) if player_alvo then setElementData (thePlayer, "shock", player_alvo ) end end
  8. tenta setPedAnimation(playerSource, "CARRY", "crry_prtial", 0, true, false, true, false)
  9. coloquei o getElementData que eu tinha removido sem querer mais continua a mesma coisa. está uma silenciada normal apenas com a textura do taser
  10. Mudei o function apenas para shock, ele não está mais como um "taser" está como a silenciada normal, apenas com a textura do taser cFunc["anim_check"] = function(_, wep, bodypart) if(wep == 23) and (bodypart == 9) then setPedAnimation(source, "ped", "KO_shot_face", 30000, false, true, false) setElementData (source, "shock", true) setTimer (function () setElementData (source, "shock", false) end, 30000, 1) elseif(wep == 23) and (bodypart == 8) then setPedAnimation(source, "CRACK", "crckdeth2", 30000, false, true, false) setElementData (source, "shock", true) setTimer (function () setElementData (source, "shock", false) end, 30000, 1) elseif(wep == 23) and (bodypart == 7) then setPedAnimation(source, "CRACK", "crckdeth2", 30000, false, true, false) setElementData (source, "shock", true) setTimer (function () setElementData (source, "shock", false) end, 30000, 1) elseif(wep == 23) and (bodypart == 6) then setPedAnimation(source, "CRACK", "crckdeth2", 30000, false, true, false) setElementData (source, "shock", true) setTimer (function () setElementData (source, "shock", false) end, 30000, 1) elseif(wep == 23) and (bodypart == 5) then setPedAnimation(source, "CRACK", "crckdeth2", 30000, false, true, false) setElementData (source, "shock", true) setTimer (function () setElementData (source, "shock", false) end, 30000, 1) elseif(wep == 23) and (bodypart == 4) then setPedAnimation(source, "CRACK", "crckdeth3", 30000, false, true, false) setElementData (source, "shock", true) setTimer (function () setElementData (source, "shock", false) end, 30000, 1) elseif(wep == 23) and (bodypart == 3) then setPedAnimation(source, "ped", "KO_shot_stom", 30000, false, true, false) setElementData (source, "shock", true) setTimer (function () setElementData (source, "shock", false) end, 30000, 1) elseif(wep == 23) and (bodypart == 2) then setPedAnimation(source, "CRACK", "crckdeth2", 30000, false, true, false) setElementData (source, "shock", true) setTimer (function () setElementData (source, "shock", false) end, 30000, 1) elseif(wep == 23) and (bodypart == 1) then setPedAnimation(source, "CRACK", "crckdeth2", 30000, false, true, false) setElementData (source, "shock", true) setTimer (function () setElementData (source, "shock", false) end, 30000, 1) end end addEventHandler ("onClientKey", root, function (button, press) if (localPlayer, "shock") then if button == "F1" or button == "F2" or button == "F3" or button == "F4" or button == "F5" or button == "F6" or button == "F7" or button == "F9" or button == "F10" or button == "F11" or button == "F12" or button == "t" then cancelEvent () end end end) -- EVENT HANDLER -- addEventHandler("onClientPlayerWeaponFire", getRootElement(), cFunc["shot_check"]) addEventHandler("onClientRender", getRootElement(), cFunc["render_shots"]) addEventHandler("onClientPedDamage", getRootElement(),cFunc["anim_check"]) addEventHandler("onClientPlayerDamage", getRootElement(),cFunc["anim_check"])
  11. ok, vou tentar fazer isso. Estou no caminho certo? -----Taser (server-side) local cFunc = {} local cSetting = {} -- FUNCTIONS -- setWeaponProperty("silenced", "pro", "weapon_range", 45.0) setWeaponProperty("silenced", "pro", "maximum_clip_ammo", 1) setWeaponProperty("silenced", "pro", "damage", 10) setWeaponProperty("silenced", "std", "weapon_range", 45.0) setWeaponProperty("silenced", "std", "maximum_clip_ammo", 1) setWeaponProperty("silenced", "std", "damage", 10) setWeaponProperty("silenced", "poor", "weapon_range", 45.0) setWeaponProperty("silenced", "poor", "maximum_clip_ammo", 1) setWeaponProperty("silenced", "poor", "damage", 10) -- EVENT HANDLERS -- function emshock (thePlayer) local player_alvo = getPlayerFromPartialName ( nick ) local nick_do_jogador = getPlayerName ( player_alvo ) local nick_do_agressor = getPlayerName ( thePlayer ) if player_alvo then setElementData (thePlayer, "shock", player_alvo ) end end --------taser Client Side cFunc["anim_check"] = function(_, wep, bodypart) getElementData( thePlayer, "shock" ) if(wep == 23) and (bodypart == 9) then setPedAnimation(source, "ped", "KO_shot_face", 30000, false, true, false) setElementData (thePlayer, "shock", false ) elseif(wep == 23) and (bodypart == 8) then setPedAnimation(source, "CRACK", "crckdeth2", 30000, false, true, false) setElementData (thePlayer, "shock", false ) elseif(wep == 23) and (bodypart == 7) then setPedAnimation(source, "CRACK", "crckdeth2", 30000, false, true, false) setElementData (thePlayer, "shock", false ) elseif(wep == 23) and (bodypart == 6) then setPedAnimation(source, "CRACK", "crckdeth2", 30000, false, true, false) setElementData (thePlayer, "shock", false ) elseif(wep == 23) and (bodypart == 5) then setPedAnimation(source, "CRACK", "crckdeth2", 30000, false, true, false) setElementData (thePlayer, "shock", false ) elseif(wep == 23) and (bodypart == 4) then setPedAnimation(source, "CRACK", "crckdeth3", 30000, false, true, false) setElementData (thePlayer, "shock", false ) elseif(wep == 23) and (bodypart == 3) then setPedAnimation(source, "ped", "KO_shot_stom", 30000, false, true, false) setElementData (thePlayer, "shock", false ) elseif(wep == 23) and (bodypart == 2) then setPedAnimation(source, "CRACK", "crckdeth2", 30000, false, true, false) setElementData (thePlayer, "shock", false ) elseif(wep == 23) and (bodypart == 1) then setPedAnimation(source, "CRACK", "crckdeth2", 30000, false, true, false) setElementData (thePlayer, "shock", false ) end end
  12. Entendi como funciona agora, muito obrigado só que tenho outra pergunta. Consigo usar essa mesma função no taser? eu achei um taser na internet, só que é AntiRP você toma um taser cai, ai usa o painel de animações pra cancelar a animação do taser.
  13. Estou tendo um problema muito anti-RP no meu server vou tentar explicar, uso um menu de animações no F4 só que tem um problema. Quando uma pessoa toma um taser, ativa uma animação que ele fica deitado no chão ou quando uma pessoa é algemada ativa outra animação que ele fica algemado, ai que está o problema, se a pessoa usar o painel de animações do F4 ele simplesmente cancela qualquer animação tanto de ser preso ou de tomar um taser ai eu estou tentando fazer adicionar uma função no script do taser e de algemar que ele não consiga user nenhum F do F1 ao F12 eu fiz um script mas estou errando em alguma coisa que não sei oq é -------- SCRIPT ORIGINAL PARA CANCELAR OS F'S addEventHandler("onClientKey", root, function (button, press) if getElementData(getLocalPlayer(),"preso") then if button == "F1" or button == "F2" or button == "F3" or button == "F4" or button == "F5" or button == "F6" or button == "F7" or button == "F9" or button == "F10" or button == "F11" or button == "F12" or button == "t" then cancelEvent() end end end ) -------- ElementData do script de Algemar setElementData(player_a_ser_algemado,"algemado", nick_do_jogador) -------- tentei implementar no script de algemar local screenW,screenH = guiGetScreenSize() -- Função de Reposicionar Largura e altura da tela local resW, resH = 1280, 720 -- Largura e altura da tela local x, y = (resW/screenW),(resH/screenH) -- juntar dois elementos em x, y local tempo, valor = 500, 60 -- Tempo de carregamento local startTick local pBarCurWidth, pBarWidth = 0, 368 -- largura e altura do dx addEvent("doShowDXProgressBar", true) -- Ativar um evento personalizado addEventHandler("doShowDXProgressBar", root, function() startTick = getTickCount() -- Começar contagem if addEventHandler("onClientRender", root, renderDXProgressBar) then -- se executar essa função fara alguma coisa, no caso n tera nada caso queira usar para desbugar script end end ) function renderDXProgressBar() local now = getTickCount() if (now - startTick) >= tempo then -- Aumentar a largura da barra pBarCurWidth = pBarCurWidth + valor startTick = getTickCount() if pBarCurWidth > pBarWidth then -- Barra de progresso cheia pBarCurWidth = pBarWidth removeEventHandler("onClientRender", root, renderDXProgressBar) startTick = nil end end dxDrawRectangle(x*354, y*312, pBarWidth, 38, tocolor(0, 0, 0, 255), false) dxDrawRectangle(x*358, y*316, pBarCurWidth, 29, tocolor(189, 0, 0, 255), false) dxDrawText( tostring( math.ceil((pBarCurWidth * 100) / pBarWidth) ).." %", x*358, y*316, (x*358) + pBarWidth, (y*316) + 29, tocolor(255,255,255), 2) end addEventHandler("onClientKey", root, function (button, press) if getElementData(player_a_ser_algemado,"algemado") then if button == "F1" or button == "F2" or button == "F3" or button == "F4" or button == "F5" or button == "F6" or button == "F7" or button == "F9" or button == "F10" or button == "F11" or button == "F12" or button == "t" then cancelEvent() end end end )
  14. Agora funcionou 10/10, muito obrigado! ❤️
  15. estou com outro problema a function de mudar a skin, está mudando a skin em todos os markers do server.