Jump to content

Bullyn

Members
  • Posts

    48
  • Joined

  • Last visited

Details

  • Gang
    ProPlayer
  • Location
    Brasil
  • Occupation
    Ajudar
  • Interests
    Evoluir

Recent Profile Visitors

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

Bullyn's Achievements

Rat

Rat (9/54)

2

Reputation

  1. Bom, seguinte. Eu possuo um código em que a arma fica no corpo do personagem quando não está nas mãos dele, mas, quando o player não possui mais a arma ela continua em seu corpo. Eu queria verificar se o player possui a arma em seu inventário, e se ele não possuir, eu quero remover o objeto do seu corpo. Aqui está o exports de verificar o item do inventário. exports["Inventario"]:GiveAndTakeAndGetItem("get", player, "m4a1", "1") Abaixo está a função " útil " para destruir o objeto do player. Client-side. function destruirArma(jug,slot) destroyElement(jugadores[jug][slot]) jugadores[jug][slot] = nil end Eu queria saber, como eu posso verificar se o player possui a arma em seu inventário, se caso ele não possua, eu quero remover a arma do seu corpo.
  2. Eu preciso de uma ajuda, eu queria saber, como eu posso verificar nestá função abaixo, se o player está na Acl de " Staff ". Ao invés de " account:staff " OBS: ( Está na parte do cliente. ) button = function() if visible == false then visible = true addEventHandler("onClientRender",root,render) for i ,v in ipairs(getElementsByType("player")) do local name = getPlayerName(v) local staff = v:getData("account:staff") local avatar = v:getData("account:avatar") or 0 local ID = v:getData("ID") or 'N/A' if staff then table.insert(players,{name = name, staff = staff , ID = ID , avatars = avatar}) end end for i ,v in ipairs(getElementsByType("player")) do local name = getPlayerName(v) local staff = v:getData("account:staff") local ID = v:getData("ID") or 'N/A' local avatar = v:getData("account:avatar") or 0 if not staff then table.insert(players,{name = name, staff = staff , ID = ID , avatars = avatar}) end end else visible = false removeEventHandler("onClientRender",root,render) players = {} end end bindKey ("TAB","both",button)
  3. Funcionou androski, muito obrigado, e outra... SOU TEU FÃ !!
  4. Eu tenho um script de chat diferente do chat padrão do Gta A menssagem deveria ser para o chat local, mas ela aparece para todos no chat! Código na partde de lua: Chatbox = { }; cLocal = { }; cTwitter = { }; cOlx = { }; cAnonymous = { }; addEventHandler( "onClientResourceStart", resourceRoot, function( ) local showC = showChat( false ) if showC == true then showChat( false ) addEventHandler( "onClientRender", root, chatbox ) end Animationtick = getTickCount( ) pagechat = 'local' selectchat = pagechat digit = guiCreateEdit( chatPosition[ 1 ], chatPosition[ 2 ] + 28 * 10, 344, 30, "dsadasd", false ) guiSetAlpha( digit, 0 ) guiSetVisible( digit, false ) guiEditSetMaxLength( digit, 50 ) end ) function cancel( button ) if showdigit then if button == "p" or "F1" or "F2" or "F3" or "F4" or "F5" or "F6" or "F7" or "F8" or "F9" or "F10" or "F11" or "b" or "enter" then cancelEvent() end end end addEventHandler("onClientKey", getRootElement(), cancel) function chatbox( ) dxDrawRectangle( chatPosition[ 1 ], chatPosition[ 2 ], 344, 36, tocolor( 41, 41, 41, 255 ), false ) if showdigit then if isElement( digit ) then dxDrawTextDigit( guiGetText( digit ), chatPosition[ 1 ], chatPosition[ 2 ] + 28 * 10, 344, 26, tocolor( 0, 0, 0, 120 ), "default-bold" ) end end for i, v in ipairs( chat ) do if export:cursorOnElement( chatPosition[ 1 ] + i * 86 - 86, chatPosition[ 2 ], 86, 36 ) or selectchat == v then dxDrawRectangle( chatPosition[ 1 ] + i * 86 - 86, chatPosition[ 2 ], 86, 36, tocolor( 0, 0, 0, 50 ), false ) dxDrawRectangle( chatPosition[ 1 ] + i * 86 - 86, chatPosition[ 2 ] + 6 * 6 - 2, 86, 2, tocolor( 0,255,127, 255 ), false ) end dxDrawImage( chatPosition[ 1 ] + i * 86 - 86, chatPosition[ 2 ], 86, 36, "assets/icons/"..v..".png", 0, 0, 0, tocolor( 255, 255, 255, 255 ), false ) end if pagechat == 'local' then for iloc, loc in ipairs( cLocal ) do if iloc > 12 then table.remove( cLocal, 1 ) end if loc.visible then loc.alpha = loc.alpha + 10 if loc.alpha > 255 then loc.alpha = 255 end end dxDrawTextCenter( loc.message, chatPosition[ 1 ], chatPosition[ 2 ] + iloc * 20 + 20, 344, 20, { 247, 178, 94, loc.alpha }, { 255, 255, 255, loc.alpha }, "default-bold" ) end elseif pagechat == 'twitter' then for itw, twi in ipairs( cTwitter ) do if twi.visible then twi.alpha = twi.alpha + 10 if twi.alpha > 255 then twi.alpha = 255 end end if itw > 12 then table.remove( cTwitter, 1 ) end dxDrawTextCenter( twi.message, chatPosition[ 1 ], chatPosition[ 2 ] + itw * 20 + 20, 344, 20, { 93, 155, 226, twi.alpha }, { 255, 255, 255, twi.alpha }, "default-bold" ) end elseif pagechat == 'olx' then for iol, vol in ipairs( cOlx ) do if vol.visible then vol.alpha = vol.alpha + 10 if vol.alpha > 255 then vol.alpha = 255 end end if iol > 12 then table.remove( cOlx, 1 ) end dxDrawTextCenter( vol.message, chatPosition[ 1 ], chatPosition[ 2 ] + iol * 20 + 20, 344, 20, { 171, 245, 98, vol.alpha }, { 255, 255, 255, vol.alpha }, "default-bold" ) end elseif pagechat == 'anonymous' then for iav, van in ipairs( cAnonymous ) do if van.visible then van.alpha = van.alpha + 10 if van.alpha > 255 then van.alpha = 255 end end if iav > 12 then table.remove( cAnonymous, 1 ) end dxDrawTextCenter( van.message, chatPosition[ 1 ], chatPosition[ 2 ] + iav * 20 + 20, 344, 20, { 255, 60, 60, van.alpha }, { 255, 255, 255, van.alpha }, "default-bold" ) end end end addEventHandler( "onClientClick", root, function( button, state ) if ( button == "left" and state == "down" ) then for i, v in ipairs( chat ) do if export:cursorOnElement( chatPosition[ 1 ] + i * 86 - 86, chatPosition[ 2 ], 86, 36 ) then selectchat = v pagechat = selectchat end end end end ) addEventHandler( "onClientKey", root, function( key, press ) if key == "t" then if showdigit == false then showdigit = true guiSetVisible( digit, true ) guiFocus( digit ) setTimer( function( ) guiSetText( digit, "" ) end, 4, 1 ) showCursor( true ) end elseif key == "enter" then if pagechat then if showdigit == true then local text = guiGetText(digit) if text ~= "" then if (string.sub(text,1,1) == "/") then text = text:sub(2, #text) if (text:gsub("%s", "") == "")then return end local command = text:split(" ") local args = "" for i=2, #command do args = args.." "..command[i] end executeCommandHandler(command[1], args) triggerServerEvent("executePlayerCommand", resourceRoot, command[1], args) else while (text:find("@@@@@@@@@@")) do text = msg:gsub("@@@@@@@@@@", "@@@") end triggerServerEvent( "getChatMessage", resourceRoot, guiGetText( digit ), pagechat ) end end showdigit = false guiSetVisible( digit, false ) showCursor( false ) end end end end ) function setChatMessage( message, page ) if message and page then local self = setmetatable( { message = message, pagechat = page, color = { }, alpha = 0, visible = true, }, Chatbox ) if self then if self.pagechat == 'local'then table.insert( cLocal, self ) elseif self.pagechat == 'twitter' then table.insert( cTwitter, self ) elseif self.pagechat == 'olx' then table.insert( cOlx, self ) elseif self.pagechat == 'anonymous' then table.insert( cAnonymous, self ) end end end return self; end addEvent( "setChatMessage", true ) addEventHandler( "setChatMessage", resourceRoot, setChatMessage ) A parte do server que eu tentei fazer!!!! function getChatMessage( message, page ) if message then if page == "anonymous" then triggerClientEvent( root, "setChatMessage", resourceRoot, "Anonimo: " .. message, page ) else triggerClientEvent( root, "setChatMessage", resourceRoot, getPlayerName( client ) .. ": " .. message, page ) end end end addEvent( "getChatMessage", true ) addEventHandler( "getChatMessage", resourceRoot, getChatMessage ) function distancia( message, page ) if message then if page == "local" then local posX1, posY1, posZ1 = getElementPosition(source) for id, player in ipairs(getElementsByType("player")) do local posX2, posY2, posZ2 = getElementPosition(player) if getDistanceBetweenPoints3D(posX1, posY1, posZ1, posX2, posY2, posZ2) <= 10 then triggerClientEvent( root, "setChatMessage", resourceRoot, getPlayerName( client ) .. ": " .. message, page ) end end end end end addEvent("executePlayerCommand", true) addEventHandler("executePlayerCommand", resourceRoot, function(command, args) if (hasObjectPermissionTo(client, "command."..command, true)) then executeCommandHandler(command, client, args) end end ) (OBS): Eu tentei adicionar essa função que tá nomeada como "distancia" para fazer com o que a menssagem aparecesse de acordo com certa distância. Não deu certo, preciso da ajuda de alguém!
  5. Eu tentei entender, quebrei cabeça, e não consegui... Eu queria que o objeto fosse destruido quando não o player não estivesse mais com arma. Como o objeto fica: OBS:(Quando eu removo a arma de um player, ele continua com a arma no peito, mesmo não tendo ela no slot ou etc...) O script: --local ammoRifle = getPedTotalAmmo ( k, 5 ) local jugadores = {} local lplayer = getLocalPlayer() local info = {} local sx,sy = guiGetScreenSize() function crearArma(jug,arma) local model = obtenerObjeto(arma) local slot = getSlotFromWeapon(arma) jugadores[jug][slot] = createObject(model,0,0,0) setElementCollisionsEnabled(jugadores[jug][slot],false) end function destruirArma(jug,slot) destroyElement(jugadores[jug][slot]) jugadores[jug][slot] = nil end addEventHandler("onClientResourceStart",getResourceRootElement(),function() for k,v in ipairs(getElementsByType("player",root,true)) do jugadores[v] = {} info[v] = {true,isPedInVehicle(v)} end end,false) addEventHandler("onClientPlayerQuit",root,function() if jugadores[source] and source ~= lplayer then for k,v in pairs(jugadores[source]) do destroyElement(v) end jugadores[source] = nil info[source] = nil end end) addEventHandler("onClientElementStreamIn",root,function() if getElementType(source) == "player" and source ~= lplayer then jugadores[source] = {} info[source] = {true,isPedInVehicle(source)} end end) addEventHandler("onClientElementStreamOut",root,function() if jugadores[source] and source ~= lplayer then for k,v in pairs(jugadores[source]) do destroyElement(v) end jugadores[source] = nil info[source] = nil end end) function nascer() if jugadores[source] then info[source][1] = true end end addEventHandler("onClientPlayerSpawn",root, nascer) function sumirArma() if jugadores[source] then for k,v in pairs(jugadores[source]) do destruirArma(source,k) end info[source][1] = false end end addEventHandler("onClientPlayerWasted",root, sumirArma) function sumirArma2() local ammoRifle = getPedTotalAmmo(localPlayer, 5) local ammoSniper = getPedTotalAmmo(localPlayer, 6) local armaa = getPedWeapon(localPlayer, 5) local armaaSniper = getPedWeapon(localPlayer, 6) if ammoRifle >= 1 then if armaa == 30 or armaa == 31 then setElementData ( localPlayer, "Arma", sim ) end else setElementData ( localPlayer, "Arma", false ) end if ammoSniper >= 1 then if armaaSniper == 34 then setElementData ( localPlayer, "ArmaSniper", sim ) end else setElementData ( localPlayer, "ArmaSniper", false ) end end addEventHandler("onClientPreRender",root, sumirArma2) function sumirArma3() if jugadores[source] then for k,v in pairs(jugadores[source]) do destruirArma(source,k) end end end addEventHandler("onClientPlayerVehicleEnter",root, sumirArma3) addEventHandler("onClientPlayerDamage",root, sumirArma3) addEventHandler("onClientPlayerVoiceStop",root, sumirArma3) addEventHandler("onClientPlayerPickupHit",root, sumirArma3) addEventHandler("onClientPlayerVehicleEnter",root,function() if jugadores[source] then for k,v in pairs(jugadores[source]) do destruirArma(source,k) end info[source][2] = true end end) addEventHandler("onClientPlayerVehicleExit",root,function() if jugadores[source] then info[source][2] = false end end) addEventHandler("onClientPreRender",root,function() for k,v in pairs(jugadores) do local x,y,z = getPedBonePosition(k,3) local rot = math.rad(90-getPedRotation(k)) local i = 15 local wep = getPedWeaponSlot(k) local ox,oy = math.cos(rot+2.4)*0.22,-math.sin(rot+2.4)*0.22 local alpha = getElementAlpha(k) for q,w in pairs(v) do if q == wep then destruirArma(k,q) else setElementRotation(w,0,70,getPedRotation(k)+90) setElementAlpha(w,alpha) if q==2 then elseif q==4 then else setElementPosition(w,x+ox,y+oy,z+0.1) setElementRotation(w,5,58,getPedRotation(k)) i=i+15 end end end local armado = getElementData( k, "Arma" ) local armadoSniper = getElementData( k, "ArmaSniper" ) if info[k][1] and not info[k][2] and armado == sim then for i=1,7 do local arma = getPedWeapon(k,i) if arma~=wep and arma>0 and not jugadores[k][i] then if arma == 30 or arma == 31 then crearArma(k,arma) end end end end if info[k][1] and not info[k][2] and armadoSniper == sim then for i=1,7 do local arma = getPedWeapon(k,i) if arma~=wep and arma>0 and not jugadores[k][i] then if arma == 34 then crearArma(k,arma) end end end end end end) function obtenerObjeto(arma) local m if arma > 1 and arma < 9 then m = 331 + arma elseif arma == 9 then m = 341 elseif arma == 15 then m = 326 elseif (arma > 21 and arma < 30) or (arma > 32 and arma < 39) or (arma > 40 and arma < 44) then m = 324 + arma elseif arma > 29 and arma < 32 then m = 325 + arma elseif arma == 32 then m = 372 end return m end
  6. Eu tenho um script de chat padrão do MTA. Eu queria saber se é possível mudar a font do chat.
  7. Uma dúvida, os marker's aparecem para todos os jogadores ou para quem digitou o comando ??? No caso eu queria para quem digitou o comando...
  8. Eu tenho uma função em que o player digita um comando, e um mark aparece no mapa, nesse script, existem 4 marker's, oque eu posso fazer pra quando ele usar o comando, aparecer um desses 4 marker's aleatorio ??? Eu espero que tenha dado pra entender kkkk ME AJUDEMMM !
  9. Mesmo eu usando um Mod de voice ??
  10. Eu tô com um script de voice aqui, ele tá meio baixo, como eu consigo aumentar o volume da voz dos players ?
  11. Eu queria saber, como eu posso verificar se o player está portando uma m4, se ele estiver, ai eu quero que dê procedência a função. Alguém poderia me audar ??
×
×
  • Create New...