Erknneto

Members
  • Content count

    26
  • Joined

  • Last visited

Community Reputation

1 Neutral

About Erknneto

  • Rank
    Advanced Member
  • Birthday 29/03/1998

Details

  • Gang
    MTA Evo:Rust
  • Location
    Brazil
  • Occupation
    Scripter
  • Interests
    Women

Recent Profile Visitors

386 profile views
  1. Help with Login panel

    function createLoginGui () wdwLogin = guiCreateWindow(529, 206, 488, "Login Panel", false) guiWindowSetMovable (wdwLogin, false) guiWindowSetSizable (wdwLogin, false) guiSetAlpha(wdwLogin, 1.00) guiSetProperty(wdwLogin,"CaptionColour","FFFEFEFE") lblMainLogin = guiCreateLabel(7, 14, 293, 48,"Testing server",true,wdwLogin) lblUsernameLogin = guiCreateLabel (11, 77, 124, 24, "Username", true, wdwLogin) edtUsernameLogin = guiCreateEdit (11, 106, 279, 34, "", true, wdwLogin) lblPasswordLogin = guiCreateLabel (16, 147, 128, 24, "Password", true, wdwLogin) edtPasswordLogin = guiCreateEdit (11, 171, 279, 34, "", true, wdwLogin) btnLogin = guiCreateButton (10, 308, 114, 34, "Register", true, wdwLogin) end createLoginGui() Try now.
  2. skin problem

    function playerLogin () local account = getPlayerAccount(source) if ( account ) then --check if the account exists local skin = (getAccountData(account,"skin") or 0) --get the skin from the account data local money = (getAccountData(account,"money") or 0) --get the money acount from the account data setElementModel(source,skin) --set the skin saved setPlayerMoney(source,money) --set the money acount saved end end addEventHandler("onPlayerLogin",getRootElement(),playerLogin) function playerLeaves () local account = getPlayerAccount(source) --get the player's account if ( account ) then --check if the acc exists local skin = getElementModel(source) --get the current skin local money = getPlayerMoney(source) --get the current money count setAccountData(account,"skin",skin) --save the skin model in the account data setAccountData(account,"money",money) --save the money acount in the account data end end addEventHandler("onPlayerQuit",getRootElement(),playerLeaves) This might work. (must be serverside)
  3. Help with Login panel

    function createLoginGui () wdwLogin = guiCreateWindow(529, 206, 488, "Login Panel", false) guiWindowSetMovable (wdwLogin, false) guiWindowSetSizable (wdwLogin, false) guiSetAlpha (wdwLogin, 1.00) guiSetProperty (wdwLogin, "CaptionColour", "FFFEFEFE") lblMainLogin = guiCreateLabel (7, 14, 293, 48, "Testing server", true, wdwLogin) guiSetFont (lblMainLogin, "clear-normal") guiLabelSetColor(lblMainLogin, "center", true) guiLabelSetHorizontalAlign (lblMainLogin, "center", true) guiLabelSetVerticalAlign (lblMainLogin, "center", true) guiLabelSetVerticalAlign (lblMainLogin, "center") lblUsernameLogin = guiCreateLabel (11, 77, 124, 24, "Username", true, wdwLogin) edtUsernameLogin = guiCreateEdit (11, 106, 279, 34, "", true, wdwLogin) lblPasswordLogin = guiCreateLabel (16, 147, 128, 24, "Password", true, wdwLogin) edtPasswordLogin = guicreateEdit (11, 171, 279, 34, "", true, wdwLogin) btnLogin = guiCreateButton (10, 308, 114, 34, "Register", true, wdwLogin) guiSetVisible (wdwLogin, false) end addEventHandler ("onClientResourceStart", getRootElement(), function () createLoginGui () outputChatbox ("Welcome to the testing server") if (wdwLogin == nil) then guiSetVisible (wdwLogin, true) else outputChatbox ("Failed to create login panel") end showCursor (true) guiSetInputEnabled (true) end ) createLoginGui () --when the client finish the resource download, it will create the login panel Try this.
  4. Check From Skin

    This may should work: function check () for i,player in ipairs(getElementsByType("player")) do local account = getPlayerAccount(player) local id = getElementModel(player) if ( account ) then local accountName = getAccountName(account) if not ( accountName == "AccountName" ) and ( id == 17 ) then setElementModel(player,312) outputChatBox("#FF0000ERROR: #FFF00Private Skin.", player, 255, 255, 255, true) end end end end setTimer(check,3000,0) You must tell the script which player you want to check. I made a loop that will check all the players.
  5. [HELP] DX Bug

    It's working perfectly now, thanks!
  6. [HELP] DX Bug

    Hi! I have a problem with my DX script. I made a DX screen that gets the items in a table and display it on the rectangle The problem is, it's multiplying everything that is related with the text. This is how the issue looks in game, look at the rectangle with the texts, it's multiplying everything! And here is my code: ------------------------------------------------------- local itemList = { {"Wooden Wall"}, {"Wooden Doorway"}, {"Wooden Window"}, {"Wooden Floor"}, {"Wooden Floorport"}, {"Wooden Stairs"}, {"Wooden Fence"}, {"Wooden Door"}, {"Wooden Gate"}, {"Metal Wall"}, {"Metal Doorway"}, {"Metal Window"}, {"Metal Floor"}, {"Metal Floorport"}, {"Metal Stairs"}, {"Metal Fence"}, {"Metal Door"}, {"Metal Gate"}, {"Concrete Wall"}, {"Concrete Doorway"}, {"Concrete Window"}, {"Concrete Floor"}, {"Concrete Floorport"}, {"Concrete Stairs"}, {"Concrete Fence"}, {"Reinforced Door"}, {"Reinforced Gate"}, } ------------------------------------------------------- function returnTableCount (tab) count = 1 if ( getLocalPlayer() ) then for i,item in ipairs(tab) do if ( item ) then count = count + 1 end end return count end return false end ------------------------------------------------------- local totalRows = returnTableCount(itemList) local iRows = totalRows local iVisibleRows = 20 local iCurrentCell = 0 ------------------------------------------------------- local screenWidth,screenHeight = guiGetScreenSize() local screenW, screenH = guiGetScreenSize() local sx,sy = guiGetScreenSize() local px,py = 1366,768 local x,y = (sx/px), (sy/py) ------------------------------------------------------- function isCursorOverRectangle(x,y,w,h) if isCursorShowing() then local mx,my = getCursorPosition() cursorx,cursory = mx*px,my*py if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then return true end end return false end function drawInventory () if ( getElementData(getLocalPlayer(),"viewingInv") ) then titleTable = dxDrawRectangle(x*050, y*040, x*350, y*45, tocolor(0, 77, 126, 170), false) titleText = dxDrawText("Building",x*060, y*055, x*250, y*30,tocolor(255,255,255, 255)) mainTable = dxDrawRectangle(x*050, y*090, x*350, y*640, tocolor(0, 0, 0, 170), false) for i,item in ipairs(itemList) do for ki = iCurrentCell, iVisibleRows+iCurrentCell-1 do visibleI = ki - iCurrentCell dxDrawRectangle(x*050+x*350, y*090+y*640/iRows*iCurrentCell, 5, y*640/iRows*iVisibleRows) itemBackground = dxDrawRectangle(x*060, y*100+visibleI*31, x*200, y*30, tocolor(0, 0, 0, 200), false) itemText = dxDrawText(item[1],x*070, y*107+visibleI*31, x*250, y*30,tocolor(255,255,255, 255)) --Problem is here :C useBackground = dxDrawRectangle(x*265, y*100+visibleI*31, x*60, y*30, tocolor(0, 0, 0, 200), false) useText = dxDrawText("Text",x*282, y*107+visibleI*31, x*250, y*30,tocolor(255,255,255, 255)) dropBackground = dxDrawRectangle(x*330, y*100+visibleI*31, x*60, y*30, tocolor(0, 0, 0, 200), false) dropText = dxDrawText("Text",x*347, y*107+visibleI*31, x*250, y*30,tocolor(255,255,255, 255)) if isCursorOverRectangle(x*060, y*100+visibleI*31, x*200, y*30) or isCursorOverRectangle(x*265, y*100+visibleI*31, x*60, y*30) or isCursorOverRectangle(x*330, y*100+visibleI*31, x*60, y*30) then dxDrawRectangle(x*060, y*100+visibleI*31, x*200, y*30, tocolor(0, 77, 126,20)) dxDrawRectangle(x*265, y*100+visibleI*31, x*60, y*30, tocolor(0, 77, 126,20)) dxDrawRectangle(x*330, y*100+visibleI*31, x*60, y*30, tocolor(0, 77, 126,20)) end end end end end addEventHandler("onClientRender",getRootElement(),drawInventory) function rustCraftScrollUp () if ( getElementData(getLocalPlayer(),"viewingInv") ) then if isCursorOverRectangle(x*050, y*090, x*350, y*640) then iCurrentCell = iCurrentCell - 1 if iCurrentCell < 0 then iCurrentCell = 0 end end end end bindKey("mouse_wheel_up","down",rustCraftScrollUp) function rustCraftScrollDown () if ( getElementData(getLocalPlayer(),"viewingInv") ) then if isCursorOverRectangle(x*050, y*090, x*350, y*640) then iCurrentCell = iCurrentCell + 1 if iCurrentCell > iRows-iVisibleRows then iCurrentCell = iRows-iVisibleRows end end end end bindKey("mouse_wheel_down","down",rustCraftScrollDown) function showInventory () if ( getElementData(getLocalPlayer(),"viewingInv") ) then setElementData(getLocalPlayer(),"viewingInv",false) showCursor(false) showChat(true) else setElementData(getLocalPlayer(),"viewingInv",true) showCursor(true) showChat(false) end end bindKey("k","down",showInventory) How can I get the items in that table 'itemList' and put it in the screen that the dxGridList works without multiplying those stuff? I hope you guys undestand my problem :v pls help
  7. [WANNA BUY] DX Inventory System

    Hello! I wanna buy an Inventory system for my server. I wanna it like this: I want it to be 2 screens. One for the items in the ground and another for the player's items. And I also want a scroll bar (like a gridlist with the items) EVERYTHING ON DXDRAW. Send me your price on a PRIVATE MESSAGE or on my STEAM: steamcommunity.com/id/erknnetobr Sorry for my bad english. I can pay with PAYPAL or a Steam Game.
  8. [HELP] DX functions

    Thanks for your help! I think I understand, I'm going to try, thank you.
  9. [HELP] DX functions

    Thank you! The buttons are working now! But I need one more thing, can you help me with the button getting the right item? It appears on the chat for example "Took Assault Rifle" in the "Map" button. How can I fix it so it can take the Map instead of the Assault Rifle, or like the GPS instead of the AK-47? Here is a screenshot of what I'm trying to do And here is the new code: local newInvItems = { {"Assault Rifle"}, {"AK-47"}, {"Sniper"}, {"Pump Shotgun"}, {"Crossbow"}, {"Custom SMG"}, {"Shotgun"}, {"Semi-Automatic Pistol"}, {"Machete"}, {"5.56 Rifle Ammo"}, {"Sniper Rifle Ammo"}, {"12 Gauge"}, {"Pistol Bullet"}, {"Wooden Arrow"}, {"SMG Ammo"}, {"Apple"}, {"Banana"}, {"Orange"}, {"Tomato"}, {"Cereal Box"}, {"Juice Box"}, {"Milk Bottle"}, {"Water Bottle"}, {"Raw Meat"}, {"Cooked Meat"}, {"Battery"}, {"Gallon (Fuel)"}, {"Gallon (Empty)"}, {"Bottle (Empty)"}, {"Medical Satchel"}, {"Rags"}, {"Cloth"}, {"Gun Powder"}, {"Alcohol Bottle"}, {"Wood"}, {"Metal"}, {"Stone"}, {"Building Tool"}, {"Fishing Rod"}, {"Cannabis Seed"}, {"Cannabis Medicinal"}, {"Sulphur"}, {"Charcoal"}, {"Axe"}, {"Pickaxe"}, {"C4"}, {"Lock"}, {"Map"}, {"GPS"}, {"Watch"}, {"Toolbox"}, {"Medium Backpack"}, {"Large Backpack"}, {"Top Hat"}, {"Witch Hat"}, {"Horn Hat"}, {"Pizza Hat"}, {"Police Hat"}, {"SWAT Hat"}, {"SWAT Armour"}, {"Chicken Head"}, {"Gas Mask"}, {"Eyepatch"}, {"Motorcycle Helmet"}, } local screenW, screenH = guiGetScreenSize() local inventoryLimit = 28 local playerItems = {} inventoryShowing = false function renderInventory () mainTable = dxDrawRectangle(10, (screenH - 583) / 2, 260, 598, tocolor(0, 0, 0, 170), false) lootTable = dxDrawRectangle(10, (screenH - 670) / 2, 260, 38, tocolor(0, 77, 126, 150), false) takeText = dxDrawText("Loot (0/24)",25, (screenH - 644) / 2, 260, 38,tocolor(255,255,255, 255)) rowNumber = 0 for i,item in ipairs(newInvItems) do if ( getElementData(getLocalPlayer(),item[1]) >= 1 ) then if not ( rowNumber > inventoryLimit ) then rowNumber = rowNumber + 1 itemBackground = dxDrawRectangle(20, 85+rowNumber*20, 185, 15, tocolor(0, 77, 126, 150), false) takeBackground = dxDrawRectangle(210, 85+rowNumber*20, 50, 15, tocolor(0, 77, 126, 150), false) itemText = dxDrawText(item[1].." ("..getElementData(getLocalPlayer(),item[1]).."x)",25,85+rowNumber*20,tocolor(255,255,255, 255)) takeText = dxDrawText("Take",221,85+rowNumber*20,tocolor(255,255,255, 255)) end end end end function inventoryClickDetect (button,state,x,y) for i=1,rowNumber do if ( button == "left" ) then if ( state == "down" ) then if ( inventoryShowing ) then if ( x >= 210 and x <= 210 + 50 and y >= 85+i*20 and y <= 85+i*20 + 15 ) then outputChatBox("Took "..newInvItems[i][1]) return end end end end end end function showInventory () if ( inventoryShowing ) then removeEventHandler("onClientRender", root, renderInventory) removeEventHandler("onClientClick",root,inventoryClickDetect) inventoryShowing = false showChat(true) showCursor(false) else addEventHandler("onClientRender", root, renderInventory) addEventHandler("onClientClick",root,inventoryClickDetect) inventoryShowing = true showChat(false) showCursor(true) end end bindKey("K","down",showInventory)
  10. [HELP] DX functions

    Hello everyone. I need some help here. I wan't to create a DX Inventory for my server, with some buttons. I created a script that creates the inventory but only 1 button is working. local newInvItems = { {"Assault Rifle"}, {"AK-47"}, {"Sniper"}, {"Pump Shotgun"}, {"Crossbow"}, {"Custom SMG"}, {"Shotgun"}, {"Semi-Automatic Pistol"}, {"Machete"}, {"5.56 Rifle Ammo"}, {"Sniper Rifle Ammo"}, {"12 Gauge"}, {"Pistol Bullet"}, {"Wooden Arrow"}, {"SMG Ammo"}, {"Apple"}, {"Banana"}, {"Orange"}, {"Tomato"}, {"Cereal Box"}, {"Juice Box"}, {"Milk Bottle"}, {"Water Bottle"}, {"Raw Meat"}, {"Cooked Meat"}, {"Battery"}, {"Gallon (Fuel)"}, {"Gallon (Empty)"}, {"Bottle (Empty)"}, {"Medical Satchel"}, {"Rags"}, {"Cloth"}, {"Gun Powder"}, {"Alcohol Bottle"}, {"Wood"}, {"Metal"}, {"Stone"}, {"Building Tool"}, {"Fishing Rod"}, {"Cannabis Seed"}, {"Cannabis Medicinal"}, {"Sulphur"}, {"Charcoal"}, {"Axe"}, {"Pickaxe"}, {"C4"}, {"Lock"}, {"Map"}, {"GPS"}, {"Watch"}, {"Toolbox"}, {"Medium Backpack"}, {"Large Backpack"}, {"Top Hat"}, {"Witch Hat"}, {"Horn Hat"}, {"Pizza Hat"}, {"Police Hat"}, {"SWAT Hat"}, {"SWAT Armour"}, {"Chicken Head"}, {"Gas Mask"}, {"Eyepatch"}, {"Motorcycle Helmet"}, } local screenW, screenH = guiGetScreenSize() local inventoryLimit = 28 showCursor(true) function renderInventory () mainTable = dxDrawRectangle(10, (screenH - 583) / 2, 260, 598, tocolor(0, 0, 0, 170), false) lootTable = dxDrawRectangle(10, (screenH - 670) / 2, 260, 38, tocolor(0, 77, 126, 150), false) rowNumber = 0 for i,item in ipairs(newInvItems) do if ( getElementData(getLocalPlayer(),item[1]) >= 1 ) then if not ( rowNumber > inventoryLimit ) then rowNumber = rowNumber + 1 itemBackground = dxDrawRectangle(20, 85+rowNumber*20, 185, 15, tocolor(0, 77, 126, 150), false) takeBackground = dxDrawRectangle(210, 85+rowNumber*20, 50, 15, tocolor(0, 77, 126, 150), false) itemText = dxDrawText(item[1].." ("..getElementData(getLocalPlayer(),item[1]).."x)",25,85+rowNumber*20,tocolor(255,255,255, 255)) takeText = dxDrawText("Take",221,85+rowNumber*20,tocolor(255,255,255, 255)) end end end end addEventHandler("onClientRender", root, renderInventory) function inventoryClickDetect (button,state,x,y) if ( button == "left" ) then if ( state == "down" ) then if ( x >= 210 and x <= 210 + 50 and y >= 85+rowNumber*20 and y <= 85+rowNumber*20 + 15 ) then outputChatBox("Test!") end end end end addEventHandler("onClientClick",root,inventoryClickDetect) It creates all buttons and all things, but only the last button created is working. How can I make for every button to work? sorry for my bad english, I'm brazilian
  11. [HELP] OBJECT HEALTH

    Hey, guys. I'm creating a Craft System for my server, but I really need a Helth System for the Object, for example: If a player damage the object with his arm or a weapon the object will lose his health, if the health reaches in 0, the object will be destroyed. I tryed to make it, but I can't, it never destroys the object. Can you guys help me? I really need that. Look what I did: function objDoesntBreak () --THIS FUNCTION WORKS, THE SECOND FUNCTION DOESN'T WORKS! if getElementData(source,"craftedObject") == true then cancelEvent() end end addEventHandler("onClientObjectBreak", root, objDoesntBreak) function objDamageStart () currentHealth = getElementHealth(source) if getElementData(source,"craftedObject") == true then if currentHealth <= 0 then destroyElement(source) end end setElementHealth(source,getElementHealth(source)-20) end addEventHandler("onClientObjectDamage", root, objDamageStart)
  12. Hi guys.. I have a problem in a Linux DayZ MTA Server. If happens everytime when a serverEvent is called... Error: Error: Client (Juquinha) triggered serverside event onPlayerChangeSkin, but event is not marked as remotly triggerable Code: client side elseif itemInfo == "Put clothes on" then triggerServerEvent("onPlayerChangeSkin",getLocalPlayer(),itemName) server side function addPlayerSkin (skin) local current = getElementData(source,"skin") local name = getSkinNameFromID(current) setElementData(source,name,getElementData(source,name)+1) setElementData(source,skin,getElementData(source,skin)-1) local id = getSkinIDFromName(skin) setElementData(source,"skin",id) setPedSkin(source,id) triggerClientEvent(source,"refreshInventoryManual",source) end addEvent("onPlayerChangeSkin",true) addEventHandler("onPlayerChangeSkin",getRootElement(),addPlayerSkin) Can someone help me to solve this problem? I happens only in the linux server.
  13. [Solved] Help with greenzone godmode

    The 'problem' is caused when you check if the element who is entering the area is different than a player (in line 13) just make other check (elseif) to know if it is a vehicle. It works! Thanks dude.
  14. [Solved] Help with greenzone godmode

    Thanks man, it works . But, if I'm out of the vehicle and drag the vehicle outside of the colshape the vehicle will stay with godmode, and if I drag the vehicle inside, the vehicle doesn't will get godmode! But it works anyway, but you know a way to solve this problem?
  15. Hey, sup guys... I need some help with my greenzone godmode system, I created everythink, it's a base protector, but I need a godmode for cars inside the base, I tried, but I can't. Can someone help me? -Just add a godmode for the vehicle if it's inside of the base (colshape) -And add a setting like (godmodeveh = true or false) if you can Server -- // Settings \\ -- shadyisback = createColCuboid(353.8819, 2450.4045, 14.984375, 25.5, 28, 10) --Base location (colshape) local x,y,z = 363.466796875,2495.1606445313,16.484375 --Player teleport location local xc,yc,zc = 325.2177734375,2527.9711914063,25.934555053711 --Car teleport location local groupName = "SkyBreaker" -- Group name local reason = "Você entrou na Área da Base do grupo "..groupName.."." --Kick message kickarplayer = false -- Enable player kick if he got a vehicle (True or False) // Default: False // -- // Settings \\ -- function shadyisbackEnter ( thePlayer, matchingDimension ) if getElementType( thePlayer ) ~= "player" then return end local gangName = getElementData(thePlayer, "gang") if isPedInVehicle(thePlayer) then --If the invader try to enter with a vehicle if gangName ~= groupName then local vehcara = getPedOccupiedVehicle(thePlayer) if kickarplayer == true then kickPlayer(thePlayer, reason) --Kick the player if 'kickarplayer' = true setElementPosition(vehcara, xc,yc,zc) --Set the vehicle position to a safe place elseif kickarplayer == false then setElementPosition(vehcara, xc,yc,zc) --Set the vehicle position to a safe place end end end if gangName == groupName then --Player enter successfully else setElementPosition(thePlayer, x,y,z) --Set player position to a safe location outputChatBox("Você não é membro do grupo "..groupName.." para entrar nessa base.", thePlayer) --Message on the player's chat end end addEventHandler ( "onColShapeHit", shadyisback, shadyisbackEnter )