Jump to content

itHyperoX

Members
  • Posts

    522
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by itHyperoX

  1. Thank you. Can you show me something how to use the dxDrawText for relative res? Now its looks like this: Current code: local sX, sY = guiGetScreenSize() local mainWidth,mainHeight = 200, 10 --Main size for everything local mainX, mainY = (sX-250 / 2) - (mainWidth / 2), (sY-1800 / 2) - (mainHeight / 2) --Main position for everything. local healthW, healthH = (mainWidth / 2), (mainHeight / 2) --Work out the sizes for the health bar, based off the main sizes local armorW, armorH = (mainWidth / 2), (mainHeight / 2) --Same for the armor bar local healthX, healthY = mainX, mainY --Work out the position for the health bar, based off the main positions local armorX, armorY = mainX + (mainWidth / 2), mainY --Same for the armor bar local isHud = false local outlineThickness = 1 local outlineTopX, outlineTopY = mainX, mainY-outlineThickness local outlineTopWidth, outlineTopHeight = mainWidth, outlineThickness local outlineBottomX, outlineBottomY = mainX, mainY+mainHeight local outlineBottomWidth, outlineBottomHeight = mainWidth, outlineThickness local outlineLeftX, outlineLeftY = mainX-outlineThickness, mainY local outlineLeftWidth, outlineLeftHeight = outlineThickness, mainHeight local outlineRightX, outlineRightY = mainX+mainWidth, mainY local outlineRightWidth, outlineRightHeight = outlineThickness, mainHeight function drawHUD() dxDrawRectangle(mainX, mainY, mainWidth, mainHeight, tocolor(0,0,0,150)) dxDrawRectangle(healthX, healthY, healthW, healthH+5, tocolor(254, 39, 39, 150)) dxDrawRectangle(armorX, armorY, armorW, armorH+5, tocolor(38, 104, 254, 150)) dxDrawRectangle(outlineTopX, outlineTopY, outlineTopWidth, outlineTopHeight, tocolor(0,0,0,255)) dxDrawRectangle(outlineBottomX, outlineBottomY, outlineBottomWidth, outlineBottomHeight, tocolor(0,0,0,255)) dxDrawRectangle(outlineLeftX, outlineLeftY, outlineLeftWidth, outlineLeftHeight, tocolor(0,0,0,255)) dxDrawRectangle(outlineRightX, outlineRightY, outlineRightWidth, outlineRightHeight, tocolor(0,0,0,255)) end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),function() addEventHandler("onClientRender", root, drawHUD) isHud = true end)
  2. Hello. I'm still running into some problems with DX. When others playing lower resoulution, they not seeing the "outlines". Can anybody can please help me, how can i calculate the correct screenW, screenH for all players seeing the correct DXpanels. Also can somebody can give me example dxDrawRectangle and text for something for this just for learning. Currently its looks like this: Learned from one of youtube video, but its still not giving me the right relative value. dxDrawLine(834/aX*x - 1, 438/aY*y - 1, 834/aX*x - 1, 463/aY*y, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(1086/aX*x, 438/aY*y - 1, 834/aX*x - 1, 438/aY*y - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(834/aX*x - 1, 463/aY*y, 1086/aX*x, 463/aY*y, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(1086/aX*x, 463/aY*y, 1086/aX*x, 438/aY*y - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawRectangle(834/aX*x, 438/aY*y, 252/aX*x, 25/aY*y, tocolor(0, 0, 0, 150), false) dxDrawText("#FF6600"..exports["serverCore"]:ServerName().."#FFFFFF - Gambling", 833/aX*x, 437/aY*y, 1086/aX*x, 463/aY*y, tocolor(255, 255, 255, 255), 1.00,customFont, "center", "center", false, false, false, true, false)
  3. itHyperoX

    Logs

    you can create a export for @Tekken script. Simple add these to meta: <export function="log" type="shared" /> and call it like exports["resourceName"]:log("message") If its not working i'll send you mine with export functions.
  4. Working thank you, how can i add more? Like Tried: local skinTable = { --[SKINID] = EXCEPTION [301] = 1 [50] = 2 [49] = 11 } its flooding the message
  5. Hmm.. Now this working without any debug error, but i can still have the skin. Tried to set the skin instant 1, but didnt work. local skinTable = { --[SKINID] = EXCEPTION [301] = 1 } addEventHandler("onElementModelChange", getRootElement(), function(oldModel) local newModel = getElementModel(source) if skinTable[newModel] then if getElementData(source, "acc.accID") ~= skinTable[newModel] then iprint("ez a skinID accountID -re van védve") setElementModel(source,1) end end end)
  6. Yes for accountID. Example: My accountID is 1, and i want to add 303 skinID only for my account. So if anybody have that skin, the script change that to 0
  7. source = player outputChatBox ( "You gave " .. targetPlayer .. " " .. money .. "$", source, 0, 255, 0, true) -- LINE replace with this outputChatBox ( "You gave " .. targetPlayer .. " " .. money .. "$", source, 0, 255, 0, true) -- LINE outputChatBox (player .. "gave you " .. money .. "$", targetPlayer, 0, 255, 0, true ) -- LINE
  8. edit mine addCommandHandler("pay",function(player,cmd,targetPlayer,money) money = tonumber(money) and math.floor(tonumber(money)) or nil if not (targetPlayer) or not (money) then outputChatBox(syntax.." /" .. cmd .. " [Player] [Amount]",player,255,0,0,true) else local targetPlayer = getPlayerFromName (targetPlayer) if targetPlayer then if (targetPlayer==player) then outputChatBox(error.." You cant give money to yourself.",player,255,0,0,true) elseif money <= 0 then outputChatBox(error.." Minimum ammount is 0.",player,255,0,0,true) elseif getPlayerMoney(player) >= money then takePlayerMoney(player,money) givePlayerMoney(targetPlayer,money) else outputChatBox(error.." You dont have enough money.",player,177,9,45,true) end end end end)
  9. Hi, how can i get these shader name? I want to replace this too, but i cant find the texture / shader name with shader_tex_names. 0: Marker If higher than player: If lower than player: "
  10. itHyperoX

    Question

    is there any way to make a script like a default "/refresh" command with listing out what is the new resource which is loaded or failed? like this: addCommandHandler("refreshres",function(player) if tonumber(getElementData(player, "admin")) >= 5 then refreshResources(true) outputChatBox("Loaded new resource(s):",player) outputChatBox(newResources,player) end end)
  11. https://wiki.multitheftauto.com/wiki/TakePlayerScreenShot maybe
  12. When i change my model to 303 which is enabled to my accountID(1), i dont get the skin, and i dont get anything in debug. But when i try the 50 skinId which is enabled to AccountID 2 i got these: another account: (accountID: 2) Another account:
  13. So, now i tested again, i dont really know whats the problem.. My accountID is 1, In the table the 303 - skin is enabled only for my account. But, when i set my skin to 303, its not changing my model, so i thing something is conversely. The 50 - SkinID is enabled to accountID 4 , which is not me, and i can have that skin. When i change my model to 303 i dont get anything in the chat, but when i change the skin to 50, then i get all the messages from the script.. local enableSkinForAccount = { [1] = {303}, [4] = {50} } addEventHandler("onElementModelChange", root, function(oldModel) if (getElementType(source) == "player") then outputChatBox("1") local accountID = getElementData(source, "acc.accID") if accountID and enableSkinForAccount[accountID] then outputChatBox("2") local newModel = enableSkinForAccount[accountID] if newModel and tonumber(newModel[1]) then outputChatBox("3") setElementModel(source, newModel[1]) end else outputChatBox("4") setElementModel(source, 0) end else outputChatBox("5") setElementModel(source, oldModel) end end) I thing this is not that hard just for me.. What i want is very simple.. I store the accountID in "data". And i want to enable skins only for accountId. Like: your accountID is 1, your custom skin id is 303. I want to make thath, nobody can have that model only you.
  14. @Infinity# i gave a right data name. But still not working. Tried to run in runcode this: executed command: outputChatBox(getElementData(me, "acc.accID")) 1 Command results: true [boolean] i got my acc id which is 1. No debug error.. In the table the first is the AccountID, second is the skinID. local enableSkinForAccount = { [HERE IS The AccountID] = {Here is the skinID} } addEventHandler("onElementModelChange", root, function(oldModel) if (getElementType(source) == "player") then local accountID = getElementData(source, "acc.accID") if accountID and enableSkinForAccount[accountID] then local newModel = enableSkinForAccount[accountID] if newModel and tonumber(newModel[1]) then setElementModel(source, newModel[1]) end else setElementModel(source, 0) end else setElementModel(source, oldModel) end end)
  15. @DNL291 Example: Your AccountID is 2. I want to enable the 303 - skin id only for your accountID! So nobody can have 303 skin id only you. Something like this: Table for AccountID and skinID.. local enableSkinForAccount = { --AccountID, skinID {1,303}, {4,50}, } addEventHandler("onElementModelChange",root,function( oldModel ) -- the first partmer not player or element if (getElementType(source) == "player") then skinID = getElementModel(source) accountID = getElementData(source,"acc.accID") if not enableSkinForAccount[accountID] and enableSkinForAccount[skinID] then setElementModel(source,getElementModel(source)) outputChatBox("You cant use this skin.",source) else setElementModel(source,enableSkinForAccount[skinID]) end end end)
  16. Not working, no debug error.
  17. Now works, but the problem is when i add the skin, its not changing my skin to 303 I was wrong... I want to enable skins only for some accountId. How can i make that? I tried like this: local enableSkinForAccount = { --AccountID, skinID {1,303}, {4,50}, } addEventHandler("onElementModelChange",root,function( oldModel ) -- the first partmer not player or element if (getElementType(source) == "player") then skinID = getElementModel(source) accountID = getElementData(source,"acc.accID") if not enableSkinForAccount[accountID] and enableSkinForAccount[skinID] then setElementModel(source,1) else setElementModel(source,enableSkinForAccount[skinID]) end end end) I was wrong... I want to enable skins only for some accountId. How can i make that? I tried like this: local enableSkinForAccount = { --AccountID, skinID {1,303}, {4,50}, } addEventHandler("onElementModelChange",root,function( oldModel ) -- the first partmer not player or element if (getElementType(source) == "player") then skinID = getElementModel(source) accountID = getElementData(source,"acc.accID") if not enableSkinForAccount[accountID] and enableSkinForAccount[skinID] then setElementModel(source,getElementModel(source)) outputChatBox("You cant use this skin.",source) else setElementModel(source,enableSkinForAccount[skinID]) end end end)
×
×
  • Create New...