Jump to content

_SAXI_

Members
  • Posts

    80
  • Joined

  • Last visited

  • Days Won

    3

_SAXI_ last won the day on September 28 2023

_SAXI_ had the most liked content!

3 Followers

About _SAXI_

  • Birthday 13/09/1997

Recent Profile Visitors

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

_SAXI_'s Achievements

Transformer

Transformer (11/54)

12

Reputation

  1. Sería algo así... local puerta=createObject(...) local abierto=false addCommandHandler("abrir",function(jug,_) if not(abierto)then local x,y,z=getElementPosition(puerta) moveObject(puerta,1500,x,y,z-30) abierto=true end end) addCommandHandler("cerrar",function(jug,_) if(abierto)then local x,y,z=getElementPosition(puerta) moveObject(puerta,1500,x,y,z+30) abierto=false end end)
  2. You could try something like this: local elementFocus=createPed(...) function setMissionHandler(player) bindKey(player,"mouse1","down",function(src) if(getPedTarget(src)==elementFocus)then outputChatBox("You've taken a photo",src,255,255,0) end end,player) end
  3. Try this: function showTeamFunction(source) local playerTeam = getPlayerTeam ( source ) if ( playerTeam ) then local players = getPlayersInTeam ( playerTeam ) for playerKey, playerValue in ipairs ( players ) do outputChatBox ( getPlayerName(playerValue) ) end end end addCommandHandler ( "showTeam", showTeamFunction )
  4. function addPlayerToACLGroup(player,groupName) local account=getPlayerAccount(player); local group=aclGetGroup(groupName); if not(isGuestAccount(account))then if(group)then return aclGroupAddObject(group,"user."..getAccountName(account)); end end return false end function removePlayerFromACLGroup(player,groupName) local account=getPlayerAccount(player); local group=aclGetGroup(groupName); if not(isGuestAccount(account))and(group)then local accountName=getAccountName(account); if(isObjectInACLGroup("user"..accountName,group))then return aclGroupRemoveObject(group,"user."..accountName); end end return false end addCommandHandler("givePolice",function(admin,_,playerName) if(hasObjectPermissionTo(admin,"general.ModifyOtherObjects"))then local player=getPlayerFromName(playerName); if(player)then addPlayerToACLGroup(player,"police"); end end end); addCommandHandler("removePolice",function(admin,_,playerName) if(hasObjectPermissionTo(admin,"general.ModifyOtherObjects"))then local player=getPlayerFromName(playerName); if(player)then removePlayerFromACLGroup(player,"police"); end end end); addCommandHandler("give",function(admin,_,groupName,playerName) if(hasObjectPermissionTo(admin,"general.ModifyOtherObjects"))then local group=aclGetGroup(groupName); local player=getPlayerFromName(playerName); if(group)and(player)then addPlayerToACLGroup(player,group); end end end); addCommandHandler("remove",function(admin,_,groupName,playerName) if(hasObjectPermissionTo(admin,"general.ModifyOtherObjects"))then local group=aclGetGroup(groupName); local player=getPlayerFromName(playerName); if(group)and(player)then removePlayerFromACLGroup(player,group); end end end); I haven't tried this, but it should work. By default it is made for administrators who can assign groups in the acl, by default it would be for the "Admin" group
  5. Your error is not using the "state" parameter. Try this: function Panel:loginClick(button, state) if state == "down" then if self.show and self.hovered == 'buttons' and self.selectedbutton == 1 then for key, value in pairs(self.loginGuis) do if value.text == '' then if clickTick + (5000) > getTickCount() then return end exports.ml_notification:addNotification('All fields are required!', 'warning') destroyAnimation() break else triggerServerEvent('loginaccount', localPlayer, localPlayer, self.loginGuis[1].text, self.loginGuis[2].text) destroyAnimation() end end elseif self.show and self.hovered == 'buttons' and self.selectedbutton == 2 then for key, value in ipairs(self.registerGuis) do if value.text == '' then if clickTick + (5000) > getTickCount() then return end exports.notification:addNotification('All fields are required!', 'warning') break else if self.registerGuis[2].text == self.registerGuis[3].text then if isValidMail(self.registerGuis[4].text) then outputChatBox(self.registerGuis[1].text) triggerServerEvent("registeraccount", localPlayer, localPlayer, self.registerGuis[1].text, self.registerGuis[2].text, self.registerGuis[4].text) break else exports.notification:addNotification('Wrong email!', 'warning') break end else exports.notification:addNotification('The passwords do not match!', 'warning') break end end end end end end
  6. Try this: addEventHandler("onClientElementColShapeLeave",root,function(col,dim) if(source==localPlayer)then if(col==TheSensor)or(col==TheSensor1)then GateMenu=false end end end)
  7. _SAXI_

    [HELP] bindkey

    local swidth,sheight=guiGetScreenSize() local w,h=300,400 local myWindow function createPanel() myWindow = guiCreateWindow(swidth/2-w/2,sheight/2-h/2,w,h,"My Window",false) --... end bindKey("f6","down",function() if not(myWindow)then createPanel() else destroyElement(myWindow) myWindow = nil end end)
  8. replace: triggerServerEvent("afk", getLocalPlayer()) triggerServerEvent("notafk", getLocalPlayer())
  9. function Kamshodan() setTimer(function() for _,thePlayer in ipairs(getElementsByType("player"))do setPedStat(thePlayer, 23, getPedStat(thePlayer, 23) - 2) setPedStat(thePlayer, 22, getPedStat(thePlayer, 22) + 2) end end,3600,1) end addEventHandler('onResourceStart', getResourceRootElement(getThisResource()), Kamshodan)
  10. The creation components in DGS are not to be used by the "onClientRender" event. If you want to remove the components you must use the destroyElement function
  11. Explícate un poco, con la descripción que das es un poco difícil poder ayudarte
  12. La verdad no sé si sea posible crear un anti-kick con los eventos de mta. Lo que podrías hacer es modificar la función kickPlayer para establecer tus necesidades, pero eso sólo cubriría a ese único script.
  13. _SAXI_

    GridList

    You can try something like this dxGridList = { x = 0, y = 0, width = 300, height = 200, columns = {}, rows = {} } addColumn = function(name,size) table.insert(dxGridList.columns,{name,size}); end addRow = function(col,value) table.insert(dxGridList.rows,{col,value}); end local sx,sy = guiGetScreenSize(); addEventHandler("onClientRender",root,function() local x,y = sx/2-dxGridList.width/2,sy/2-dxGridList.height/2; local w,h = dxGridList.width,dxGridList.height; dxDrawRectangle(x,y,w,h,tocolor(70,70,70)); local colx = x; dxDrawRectangle(x,y,w,25,tocolor(10,10,10)) for i,col in ipairs(dxGridList.columns)do local cw = col[2]*w; dxDrawText(col[1],colx,y+4,100,20,tocolor(255,255,255),1,"default"); local ry = y+20; for j,row in ipairs(dxGridList.rows)do if(row[1] == i)then dxDrawRectangle(colx,ry,cw,20,tocolor(120,120,120)) dxDrawText(row[2],colx,ry,100,20,tocolor(255,255,255),1,"default"); ry = ry + 20; end end colx = colx+cw; end end); addColumn("Col 1",.1); addColumn("Col 2",.7); addColumn("Col 3",.2); for i=1,20 do addRow(math.random(1,3)," "..tostring(i)); end
  14. Aquí tienes un ejemplo de como hacerlo. ES UN ARCHIVO DE TIPO CLIENTE -- Escondes o muestras el chat local chatState = true; bindKey("0",function() chatState = not chatState; showChat(chatState); end); -- Escondes o muestras el HUD local hudState = true; bindKey("9",function() hudState = not hudState; setPlayerHudComponentVisible("all",hudState); end);
  15. function hola(jugador,_) if(isPedDead(jugador))then outputChatBox("¡Estás muerto!",jugador,255,0,0) else outputChatBox("¡Estás vivo!",jugador,0,255,0) end end addCommandHandler("meme",hola)
×
×
  • Create New...