-
Posts
1,239 -
Joined
-
Last visited
Everything posted by -.Paradox.-
-
dxDrawImage"Can't Load File"
-
So is there anyway to fix it?
-
But how i must define the location path?
-
okay so i made this script, this suppose to set an image for a specified level like example: if player lvl is 1 then draw lvl_1.png etc and the porblem is it wont draw the image icon and there is nothing in debug so here is my code Server side addEventHandler ( "onPlayerJoin", root, function ( ) setElementData ( source, "Rankicon",":Class\Rank\rank_0.png" ) end ) addEventHandler ( "onPlayerLogin", root, function ( _, acc ) local accName = getAccountName ( acc ) local LV = getAccountData(acc, "LV") if (LV >= 0) then setElementData ( source, "Rankicon", ":Class\Rank\rank_0.png" ) elseif (LV >= 1) then setElementData ( source, "Rankicon", ":Class\Rank\rank_1.png" ) elseif (LV >= 2) then setElementData ( source, "Rankicon", ":Class\Rank\rank_2.png" ) elseif (LV >= 3) then setElementData ( source, "Rankicon", ":Class\Rank\rank_3.png" ) elseif (LV >= 4) then setElementData ( source, "Rankicon", ":Class\Rank\rank_4.png" ) elseif (LV >= 5) then setElementData ( source, "Rankicon", ":Class\Rank\rank_5.png" ) elseif (LV >= 6) then setElementData ( source, "Rankicon", ":Class\Rank\rank_6.png" ) elseif (LV >= 7) then setElementData ( source, "Rankicon", ":Class\Rank\rank_7.png" ) elseif (LV >= -- s8) --> then setElementData ( source, "Rankicon", ":Class\Rank\rank_8.png" ) elseif (LV >= 9) then setElementData ( source, "Rankicon", ":Class\Rank\rank_9.png" ) elseif (LV >= 10) then setElementData ( source, "Rankicon", ":Class\Rank\rank_10.png" ) elseif (LV >= 11) then setElementData ( source, "Rankicon", ":Class\Rank\rank_11.png" ) elseif (LV >= 12) then setElementData ( source, "Rankicon", ":Class\Rank\rank_12.png" ) elseif (LV >= 13) then setElementData ( source, "Rankicon", ":Class\Rank\rank_13.png" ) elseif (LV >= 14) then setElementData ( source, "Rankicon", ":Class\Rank\rank_14.png" ) elseif (LV >= 15) then setElementData ( source, "Rankicon", ":Class\Rank\rank_15.png" ) elseif (LV >= 16) then setElementData ( source, "Rankicon", ":Class\Rank\rank_16.png" ) elseif (LV >= 17) then setElementData ( source, "Rankicon", ":Class\Rank\rank_17.png" ) elseif (LV >= 18) then setElementData ( source, "Rankicon", ":Class\Rank\rank_18.png" ) elseif (LV >= 19) then setElementData ( source, "Rankicon", ":Class\Rank\rank_19.png" ) elseif (LV >= 20) then setElementData ( source, "Rankicon", ":Class\Rank\rank_20.png" ) elseif (LV >= 21) then setElementData ( source, "Rankicon", ":Class\Rank\rank_21.png" ) elseif (LV >= 22) then setElementData ( source, "Rankicon", ":Class\Rank\rank_22.png" ) elseif (LV >= 23) then setElementData ( source, "Rankicon", ":Class\Rank\rank_23.png" ) elseif (LV >= 24) then setElementData ( source, "Rankicon", ":Class\Rank\rank_24.png" ) elseif (LV >= 25) then setElementData ( source, "Rankicon", ":Class\Rank\rank_25.png" ) elseif (LV >= 26) then setElementData ( source, "Rankicon", ":Class\Rank\rank_26.png" ) elseif (LV >= 27) then setElementData ( source, "Rankicon", ":Class\Rank\rank_27.png" ) elseif (LV >= 28) then setElementData ( source, "Rankicon", ":Class\Rank\rank_28.png" ) elseif (LV >= 29) then setElementData ( source, "Rankicon", ":Class\Rank\rank_29.png" ) elseif (LV >= 30) then setElementData ( source, "Rankicon", ":Class\Rank\rank_30.png" ) else setElementData ( source, "Rankicon", ":Class\Rank\rank_0.png" ) end end ) Client side addEventHandler("onClientRender", root, function() local Rankicon = getElementData(localPlayer,"Rankicon") local Level = getElementData(localPlayer,"Level") if Level and fileExists ( ":Class/Rank/rank_"..Rankicon..".png" ) then size = dxGetFontHeight((0.7/1366)*sWidth, "bankgothic") dxDrawImage((557/1024)*sWidth, (745/768)*sHeight, size, size, (":Class/Rank/rank_"..Rankicon..".png") end end )
-
Post you're code.
-
https://community.multitheftauto.com/index.php?p= ... ls&id=4019 https://community.multitheftauto.com/index.php?p= ... ls&id=1995 And follow instruction.
-
https://wiki.multitheftauto.com/wiki/GuiSetEnabled https://wiki.multitheftauto.com/wiki/OnClientGUIClick
-
Would this code even work? I mean, when the player triggers the command for the first time his data is nil towards "INV" so it wouldn't be false or true, which would cause the code not to work, I guess. If the code itself did automatically change the players element data to false, you've defined false as "false" meaning it's in a word-form, not recognizable by MTA, just a data definition. Suggestion, if what I say is correct: function onJoin() if (not getElementData(source, "INV") then setElementData(source, "INV", "false") end end addEventHandler("onPlayerJoin", root, onJoin) --Not tested Try my code you genius, it's working.
-
Server side function setInince(thePlayer) if (hasObjectPermissionTo(thePlayer, "function.banPlayer")) then if (getElementData(thePlayer, "INV") == "true") then setElementData(thePlayer,"INV", "false") outputChatBox("God mode OFF", thePlayer) else setElementData(thePlayer,"INV", "true") outputChatBox("God mode ON", thePlayer) end else outputChatBox("You do not have permission for this", thePlayer) end end addCommandHandler("god", setInince) Client side function noadmdamage() if (getElementData(source, "INV") == "true") then cancelEvent() else end end addEventHandler("onClientPlayerDamage", getRootElement(), noadmdamage)
-
Just a code, i want in it a table of music locations and command for it
-
Can somebody help me with a code, because idk how to get the command from table and location too.
-
Thanks working perfect
-
It's working good, but i want to reduce it into table and add a command /music [musicname] to get the music from table ['joker'] = ['music/joker.mp3'] or something like that
-
So i made this music player but i want to reduce it into a table, & play every sound with command /music test1 /music test2 etc thanks for helping Client ------americano function music10( name ) local sound = playSound("music/amricano.mp3") setSoundVolume(sound, 50) setSoundMaxDistance( sound, 5000 ) end addEvent( "amricano", true ) addEventHandler( "amricano", getRootElement(), music10 ) ------joker function music9( name ) local sound = playSound("music/joker.mp3") setSoundVolume(sound, 50) setSoundMaxDistance( sound, 5000 ) end addEvent( "joker", true ) addEventHandler( "joker", getRootElement(), music9 ) ------badboy function music8( name ) local sound = playSound("music/badboys.mp3") setSoundVolume(sound, 50) setSoundMaxDistance( sound, 5000 ) end addEvent( "badboys", true ) addEventHandler( "badboys", getRootElement(), music8 ) --------- boys ... ---------- function music7( name ) local sound = playSound("music/boysboysboys.mp3") setSoundVolume(sound, 50) setSoundMaxDistance( sound, 5000 ) end addEvent( "boysboysboys", true ) addEventHandler( "boysboysboys", getRootElement(), music7 ) Server ----americano function music(player, cmd) local name = getPlayerName(player) local r,g,b = getPlayerNametagColor (player) local accountname = getAccountName (getPlayerAccount(player)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "vip" ) ) then outputChatBox ( "" .. name .. ": #2600FF We No Speak Americano.", getRootElement(), r, g, b, true ) triggerClientEvent ("amricano", getRootElement()) else outputChatBox ( "this command for vip group", player, 255, 0, 0, true ) return end end addCommandHandler("amricano", music) ----joker function music(player, cmd) local name = getPlayerName(player) local r,g,b = getPlayerNametagColor (player) local accountname = getAccountName (getPlayerAccount(player)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "vip" ) ) then outputChatBox ( "" .. name .. ": #2600FF Giggle bitch.", getRootElement(), r, g, b, true ) triggerClientEvent ("joker", getRootElement()) else outputChatBox ( "this command for vip group", player, 255, 0, 0, true ) return end end addCommandHandler("joker", music) ----badboys function music(player, cmd) local name = getPlayerName(player) local r,g,b = getPlayerNametagColor (player) local accountname = getAccountName (getPlayerAccount(player)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "vip" ) ) then outputChatBox ( "" .. name .. ": #2600FF is a good boy.", getRootElement(), r, g, b, true ) triggerClientEvent ("badboys", getRootElement()) else outputChatBox ( "this command for vip group", player, 255, 0, 0, true ) return end end addCommandHandler("isagoodboy", music) -----boysboysboys-------- addCommandHandler("music.boysboysboys", function (player, cmd) local name = getPlayerName(player) local r,g,b = getPlayerNametagColor (player) local accountname = getAccountName (getPlayerAccount(player)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "vip" ) ) then outputChatBox ( "" .. name .. ": #2600FF boys boys boys.", getRootElement(), r, g, b, true ) triggerClientEvent ("boysboysboys", getRootElement()) else outputChatBox ( "this command for vip group", player, 255, 0, 0, true ) return end end ) I want it like that /music joker it play joker sound /music badboys it plays bad boys sound etc
-
Csmit195 said to me shaders can do it but i want know how to use them for that.
-
This add +1 for all stats, and i want to add only for the weapon i killed with the player/zombie
-
It's server side
-
Thanks working but there is a error in debug i will send you a pic in skype
-
Yes local phealth = math.floor (getElementHealth ( getLocalPlayer() ))
-
Hello, i want to create a dxRectangle and show in it the player health here is my code i got a error in debugscript 3 WARNING: Hud/hud.lua:65: Bad argument @ 'dxDrawRectangle' [Expected bool at argument 6, got number '-16745728'] dxDrawRectangle(1107, 54, 211, 13, tocolor(0, 0, 0, 255), true) dxDrawRectangle(" "..phealth.." ",1108, 55, 209, 11, tocolor(255, 0, 0, 255), true)
-
Yes and crosshair.fx too
-
Hello im asking wich events i can use or functions to get if player is parachuting or is in jetpack thanks for helping.
