Jump to content

koragg

Members
  • Posts

    730
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by koragg

  1. OptionalArguments index : An integer representing an individual sound within the group
  2. An easy way is to position the dxdraw things using just number values so that it looks as you want it to on your resolution. And after that use this example to convert the number values to floating point ones and multiply by screen width and height. The dxDrawRectangle you posted will look like this: local x, y = guiGetScreenSize() dxDrawRectangle ( x* 0,2604166667 , y* 0,2314814815 , x* 0,2604166667, y* 0,462962963 , tocolor ( 0, 0, 0, 155 ) ) And it will stay same size and on same position on any screen resolution. What i did was: I divided the first number by my pc screen resolution width so 500/1920. The second number i divided by the height so 500/1080. Then the third number again divided by screen width and forth number-by screen height. After this i just multiply each result of each division with the corresponding screen dimension. x = screen width y = screen height
  3. Yea, I just commented the other file, didn't delete it, but thx for the tip
  4. OK I didn't wanna do this but it left me no choice. I merged the file responsible for buying maps into racevoting_server.lua, did few conditions and now works perfect! But I'm pretty sure I'll forget where everything is, that's why I didn't want to merge it but, oh well, fixed.
  5. @LoPollo, I meant normal chatbox msg ;d Easy way to cancel buying map and to show chatbox msg if a player tries to buy a map but the already bought one (by somebody else) has not started yet. That way nobody will be able to buy a map unless the already bought one (by somebody else) starts, then data for boughtmap goes to nil and pretty much as in the votemanager thing.
  6. if getElementData(source, "data.hasBoughtNextmap") == false then take coins buy map and set as next else outputChatBox("A map is already set. Please wait until it's played first!", source, 255,153,0) end Thanks to this part of the code noone can buy a map as long as there is a bought one waiting to be played. (But this gets reset on map start) Well yea, I need some easy way to just show a chatbox msg saying that a map cannot be bought before the already bought one starts.
  7. OK, now if I buy a map and we replay the current one, another player can just buy other map when we're at the second round of the current map and rip mine wtf This is how people buy maps: addEvent("onPlayerFinish", true) addEventHandler("onPlayerFinish", getRootElement(), function(rank) if rank == 1 then for i,v in ipairs(getElementsByType("player"))do setElementData(v, "data.hasWon", false) setElementData(source, "data.hasBoughtNextmap", false) end setElementData(source, "data.hasWon", true) setElementData(source, "data.hasBoughtNextmap", false) end end) ------------------------------------------------------------------------------------------------------------------------- function setNextMap(mapName) local playername = getPlayerName(source) local playeraccount = getPlayerAccount(source) local res = getResourceFromName("cw") if getResourceState(res) == "running" then outputChatBox("You are not allowed to buy maps while the ClanWarSystem is active!", source, 255, 0, 0, true) return end if isGuestAccount(playeraccount) then outputChatBox("You need to register and login in order to buy a map as next!", source, 255,153,0) return end if not isGuestAccount(playeraccount) then if not getElementData(source, "data.hasWon") then outputChatBox("You need to win in order to buy a map as next!", source, 255,153,0) return end if ( playeraccount ) and not isGuestAccount ( playeraccount ) then coins = tonumber(getAccountData(playeraccount, "knightcoins") or 0) if getElementData(source, "data.hasBoughtNextmap") == false then if coins >= 500 then coins = coins - 500 executeCommandHandler("mapSatinAl", source, mapName) setAccountData ( playeraccount, "knightcoins", coins ) setElementData ( source ,"data.knightcoins", coins, true) setElementData(source, "data.hasBoughtNextmap", true) else outputChatBox("You don't have enough KnightCoins to buy a map as next!", source, 255,153,0) setElementData(source, "data.hasBoughtNextmap", false) end else outputChatBox("A map is already set. Please wait until it's played first!", source, 255,153,0) end end end end addEvent("mapSatinAlServer", true) addEventHandler("mapSatinAlServer", getRootElement(),setNextMap) Don't think I can compare maps as before here (tried and didn't work, no errors though).
  8. addEvent("onMapStarting") function nilMapData() if exports.mapmanager:getRunningGamemodeMap() == getElementData(resourceRoot, "keepnextmap") then setElementData(resourceRoot, "keepnextmap", nil) end end addEventHandler("onMapStarting", getRootElement(), nilMapData) This worked
  9. I don't, no. If I set it to 'nil' on vote end then what if current map gets replayed 2 times. The bought one will get reset to nil after the first time current map ends so rip coins for player who bought map + the map he bought just won't start then as data will be 'nil'. By not setting data to 'nil' on pol end, i assure people that their map will continue to be the vote option even if the current map gets played 2 times in a roll But yea...infinitely same vote bug happens then. Can't i try to somehow compare the maps? Like: if currentmap ~= getElementData(blahblah) then setelementdata(resroot, nil) end Here is 00:44 so you forgive me for the lazy code typing I'm sleepy..
  10. Yes, everything that you described works. It's just that, for example: I am currently playing a map called "Warm Up 2", I win it and buy another map called "An Xmas Present". When the map vote window shows the two options are "[Maps-Center] An Xmas Present" and "Play Again". This works perfectly. I am currently playing a map called "Warm Up 2", I buy a map ("An Xmas Present"), but people vote for play again on the current map. When the second round of the map "Warm Up 2" ends, the votemanager puts "[Maps-Center] An Xmas Present" and "Play Again" as vote options. This works perfectly. And now, I am playing the map "Warm Up 2", which was bought by someone. There is no next map bought now. When "Warm Up 2" ends, the votemanager puts as vote options the following things: "[Maps-Center] Warm Up 2" and "Play Again". Now this is the problem I'm facing. I need the elementdata to reset to 'nil' when a map other than the bought one starts. Explanation: If I have bought a map but people vote 1 and that map does not get replayed 2 times (which in most cases it won't), after that the voter should show a randomly picked map as the first option. Right now it always adds the bought map as next until it gets replayed 2 times and a random one auto-starts (then the elementdata becomes 'nil').
  11. I got almost everything working, but there is one bug I can't seem to fix myself. When a player buys a map, it gets imported into the map voter forever meaning every time it's the same map as a voting choice. setElementData(resourceRoot, "keepnextmap", g_ForcedNextMap) This^ is how I got the bought map to include it into the voter system. setElementData(resourceRoot, "keepnextmap", nil) This^ resets the map data but I don't know where to put it (or what condition to create) so that when the bought map starts and players finish it, voter would work as normal and show a random map into it. Here is the part of code I made: if not getElementData(resourceRoot, "keepnextmap") then local mapName = getResourceInfo(_nextMap, "name") or getResourceName(_nextMap) table.insert(poll, {mapName , 'nextMapVoteResult', getRootElement(), _nextMap}) end local currentMap = exports.mapmanager:getRunningGamemodeMap() local currentRes = currentMap if currentMap then if not times[currentMap] or times[currentMap] < maxPlayAgain+1 then if getElementData(resourceRoot, "keepnextmap") then local NextMapData = getElementData(resourceRoot, "keepnextmap") local NextMapFix = getResourceInfo(NextMapData, "name") or getResourceName(NextMapData) NextMapFix = "[Maps-Center] "..NextMapFix table.insert(poll, {NextMapFix , 'nextMapVoteResult', getRootElement(), NextMapData}) end table.insert(poll, {"Play Again", 'nextMapVoteResult', getRootElement(), currentMap}) elseif times[currentMap] >= maxPlayAgain+1 then if getElementData(resourceRoot, "keepnextmap") then local NextMapData = getElementData(resourceRoot, "keepnextmap") local NextMapFix = getResourceName(NextMapData) local StartNextMap = getResourceFromName(NextMapFix) startResource(StartNextMap) setElementData(resourceRoot, "keepnextmap", nil) outputChatBox("Maximum 'Play Again' times ("..maxPlayAgain..") was reached. Starting next map from Maps-Center.", root, 255, 255, 255, true) else startRandomMap() setElementData(resourceRoot, "keepnextmap", nil) outputChatBox("Maximum 'Play Again' times ("..maxPlayAgain..") was reached. Changing to a random map...", root, 255, 255, 255, true) return end end end Hope I get some help with this, the above thing is the only bug left PS I tried to compare "currentMap" with "getElementData(resourceRoot, "keepnextmap")" but didn't work.
  12. https://wiki.multitheftauto.com/wiki/GuiGetScreenSize
  13. Help... g_ForcedNextMap in votemanager.
  14. Apparently the .txd names are same as the textures inside them... So I fixed it this way: First, add all radar minimap textures in a table. local snowRemoveFromRadarMinimap = { "radar00", "radar01", "radar02", "radar03", "radar04", "radar05", "radar06", "radar07", "radar08", "radar09", "radar10", "radar11", "radar12", "radar13", "radar14", "radar15", "radar16", "radar17", "radar18", "radar19", "radar20", "radar21", "radar22", "radar23", "radar24", "radar25", "radar26", "radar27", "radar28", "radar29", "radar30", "radar31", "radar32", "radar33", "radar34", "radar35", "radar36", "radar37", "radar38", "radar39", "radar40", "radar41", "radar42", "radar43", "radar44", "radar45", "radar46", "radar47", "radar48", "radar49", "radar50", "radar51", "radar52", "radar53", "radar54", "radar55", "radar56", "radar57", "radar58", "radar59", "radar60", "radar61", "radar62", "radar63", "radar64", "radar65", "radar66", "radar67", "radar68", "radar69", "radar70", "radar71", "radar72", "radar73", "radar74", "radar75", "radar76", "radar77", "radar78", "radar79", "radar80", "radar81", "radar82", "radar83", "radar84", "radar85", "radar86", "radar87", "radar88", "radar89", "radar90", "radar91", "radar92", "radar93", "radar94", "radar95", "radar96", "radar97", "radar98", "radar99", "radar100", "radar13", "radar101", "radar102", "radar103", "radar104", "radar105", "radar106", "radar107", "radar108", "radar109", "radar110", "radar111", "radar112", "radar113", "radar114", "radar115", "radar116", "radar117", "radar118", "radar119", "radar120", "radar121", "radar122", "radar123", "radar124", "radar125", "radar126", "radar127", "radar128", "radar129", "radar130", "radar131", "radar132", "radar133", "radar134", "radar135", "radar136", "radar137", "radar138", "radar139", "radar140", "radar141", "radar142", "radar143", } And then go through each of them with a loop and remove the snow shader. -- Process snow remove list from radar (minimap) for _,removeFromRadarMinimap in ipairs(snowRemoveFromRadarMinimap) do engineRemoveShaderFromWorldTexture ( snowShader, removeFromRadarMinimap ) end Thanks to @Bierbuikje who helped me with this
  15. So @LoPollo, I can't use performanceBrowser My connection always times out. Anyway :
  16. I want to exclude the whole radar from a snow effect (done with shaders ) which gets toggled by pressing F9. I did this and it worked (it's just part of code): -- List of radar textures to exclude from this effect local snowRemoveFromRadarList = { "arrow","radardisc", "radar_airYard", "radar_ammugun", "radar_barbers", "radar_BIGSMOKE", "radar_boatyard", "radar_bulldozer", "radar_burgerShot", "radar_cash","radar_CATALINAPINK", "radar_centre", "radar_CESARVIAPANDO", "radar_chicken", "radar_CJ", "radar_CRASH1", "radar_dateDisco", "radar_dateDrink", "radar_dateFood", "radar_diner", "radar_emmetGun", "radar_enemyAttack", "radar_fire", "radar_Flag", "radar_gangB", "radar_gangG", "radar_gangN", "radar_gangP", "radar_gangY", "radar_girlfriend", "radar_gym", "radar_hostpital", "radar_impound", "radar_light", "radar_LocoSyndicate", "radar_MADDOG", "radar_mafiaCasino", "radar_MCSTRAP", "radar_modGarage", "radar_north", "radar_OGLOC", "radar_pizza", "radar_police", "radar_propertyG", "radar_propertyR", "radar_qmark", "radar_race", "radar_runway", "radar_RYDER", "radar_saveGame", "radar_school", "radar_spray", "radar_SWEET", "radar_tattoo", "radar_THETRUTH", "radar_TORENO", "radar_TorenoRanch", "radar_triads", "radar_triadsCasino", "radar_truck", "radar_tshirt", "radar_waypoint", "radar_WOOZIE", "radar_ZERO", "siteM16", "siterocket", } -- Process snow remove list from radar for _,removeFromRadar in ipairs(snowRemoveFromRadarList) do engineRemoveShaderFromWorldTexture ( snowShader, removeFromRadar ) end BUT, that fixed only the arrow, radardisc and blip icons, the minimap images are still bugged. Now explanation: - I'm using a custom GTA V Radar which (also) uses shaders to achieve its effect, but as soon as the snow effect is turned on (note, just turning it on bugs radar, making snow off works fine) the radar minimap shows default images (not the ones from the GTA V Radar, although it is enabled). - If I press F9 to turn snow off, the GTA V Radar comes back, when I press F9 again to show snow, default radar comes on. The part of code I posted above fixed this for the blips but not the minimap itself. What I need is to know if the minimap images can be ignored by the snow resource the same way as I did with the blips or they cannot be shaders? If they can get excluded as the blips, a list with all their texture names would be appreciated so that I can make another table with them and another "for" loop which makes the snow resource ignore them.
  17. I have no idea but now it works I'll answer your questions in the coming days as now i just wanna play mta after a hard maths test lol
  18. I tried your code and it works even without event handlers lol I think first you need to use this setPlayerHudComponentVisible("radio", false) to hide the default gtasa radio hud and then try draw your own custom radio station text.
  19. As far as I know it loads them just once when I click the checkbox, not non-stop (onClientRender-ish style ). I also didn't get any lag but I'll test tomorrow with a real player other than me and will check the load if he experiences lag.
  20. Finally fixed it. I loaded the default textures as shaders in the "radaroff" function. This way they overwrite the gta v shaders and radar looks like default one (it kinda is). And since I had trouble with unloading, I decided that I'll only load shaders and it worked Thanks to @Wojak, @LoPollo and @xiti for the help. Now everything's running fine! As always I'll post my working code below so that if others have the same problem or just wanna learn stuff, they'll be able to from it: local tiles = {} local timer local visible = true local ROW_COUNT = 12 --# Textures table local blips_textures = { { "arrow", "blips/arrow.png" }, { "radardisc", "blips/radardisc.png" }, { "radar_airYard", "blips/radar_airYard.png" }, { "radar_ammugun", "blips/radar_ammugun.png" }, { "radar_barbers", "blips/radar_barbers.png" }, { "radar_BIGSMOKE", "blips/radar_BIGSMOKE.png" }, { "radar_boatyard", "blips/radar_boatyard.png" }, { "radar_bulldozer", "blips/radar_bulldozer.png" }, { "radar_burgerShot", "blips/radar_burgerShot.png" }, { "radar_cash", "blips/radar_cash.png" }, { "radar_CATALINAPINK", "blips/radar_CATALINAPINK.png"}, { "radar_centre", "blips/radar_centre.png" }, { "radar_CESARVIAPANDO", "blips/radar_CESARVIAPANDO.png" }, { "radar_chicken", "blips/radar_chicken.png" }, { "radar_CJ", "blips/radar_CJ.png" }, { "radar_CRASH1", "blips/radar_CRASH1.png" }, { "radar_dateDisco", "blips/radar_dateDisco.png" }, { "radar_dateDrink", "blips/radar_dateDrink.png" }, { "radar_dateFood", "blips/radar_dateFood.png" }, { "radar_diner", "blips/radar_diner.png" }, { "radar_emmetGun", "blips/radar_emmetGun.png" }, { "radar_enemyAttack", "blips/radar_enemyAttack.png" }, { "radar_fire", "blips/radar_fire.png" }, { "radar_Flag", "blips/radar_Flag.png" }, { "radar_gangB", "blips/radar_gangB.png" }, { "radar_gangG", "blips/radar_gangG.png" }, { "radar_gangN", "blips/radar_gangN.png" }, { "radar_gangP", "blips/radar_gangP.png" }, { "radar_gangY", "blips/radar_gangY.png" }, { "radar_girlfriend", "blips/radar_girlfriend.png" }, { "radar_gym", "blips/radar_gym.png" }, { "radar_hostpital", "blips/radar_hostpital.png" }, { "radar_impound", "blips/radar_impound.png" }, { "radar_light", "blips/radar_light.png" }, { "radar_LocoSyndicate", "blips/radar_LocoSyndicate.png" }, { "radar_MADDOG", "blips/radar_MADDOG.png" }, { "radar_mafiaCasino", "blips/radar_mafiaCasino.png" }, { "radar_MCSTRAP", "blips/radar_MCSTRAP.png" }, { "radar_modGarage", "blips/radar_modGarage.png" }, { "radar_north", "blips/radar_north.png" }, { "radar_OGLOC", "blips/radar_OGLOC.png" }, { "radar_pizza", "blips/radar_pizza.png" }, { "radar_police", "blips/radar_police.png" }, { "radar_propertyG", "blips/radar_propertyG.png" }, { "radar_propertyR", "blips/radar_propertyR.png" }, { "radar_qmark", "blips/radar_qmark.png" }, { "radar_race", "blips/radar_race.png" }, { "radar_runway", "blips/radar_runway.png" }, { "radar_RYDER", "blips/radar_RYDER.png" }, { "radar_saveGame", "blips/radar_saveGame.png" }, { "radar_school", "blips/radar_school.png" }, { "radar_spray", "blips/radar_spray.png" }, { "radar_SWEET", "blips/radar_SWEET.png" }, { "radar_tattoo", "blips/radar_tattoo.png" }, { "radar_THETRUTH", "blips/radar_THETRUTH.png" }, { "radar_TORENO", "blips/radar_TORENO.png" }, { "radar_TorenoRanch", "blips/radar_TorenoRanch.png" }, { "radar_triads", "blips/radar_triads.png" }, { "radar_triadsCasino", "blips/radar_triadsCasino.png" }, { "radar_truck", "blips/radar_truck.png" }, { "radar_tshirt", "blips/radar_tshirt.png" }, { "radar_waypoint", "blips/radar_waypoint.png" }, { "radar_WOOZIE", "blips/radar_WOOZIE.png" }, { "radar_ZERO", "blips/radar_ZERO.png" }, { "siteM16", "blips/siteM16.png" }, { "siterocket", "blips/siterocket.png" } } local old_blips_textures = { { "arrow", "oldblips/arrow.png" }, { "radardisc", "oldblips/radardisc.png" }, { "radar_airYard", "oldblips/radar_airYard.png" }, { "radar_ammugun", "oldblips/radar_ammugun.png" }, { "radar_barbers", "oldblips/radar_barbers.png" }, { "radar_BIGSMOKE", "oldblips/radar_BIGSMOKE.png" }, { "radar_boatyard", "oldblips/radar_boatyard.png" }, { "radar_bulldozer", "oldblips/radar_bulldozer.png" }, { "radar_burgerShot", "oldblips/radar_burgerShot.png" }, { "radar_cash", "oldblips/radar_cash.png" }, { "radar_CATALINAPINK", "oldblips/radar_CATALINAPINK.png"}, { "radar_centre", "oldblips/radar_centre.png" }, { "radar_CESARVIAPANDO", "oldblips/radar_CESARVIAPANDO.png" }, { "radar_chicken", "oldblips/radar_chicken.png" }, { "radar_CJ", "oldblips/radar_CJ.png" }, { "radar_CRASH1", "oldblips/radar_CRASH1.png" }, { "radar_dateDisco", "oldblips/radar_dateDisco.png" }, { "radar_dateDrink", "oldblips/radar_dateDrink.png" }, { "radar_dateFood", "oldblips/radar_dateFood.png" }, { "radar_diner", "oldblips/radar_diner.png" }, { "radar_emmetGun", "oldblips/radar_emmetGun.png" }, { "radar_enemyAttack", "oldblips/radar_enemyAttack.png" }, { "radar_fire", "oldblips/radar_fire.png" }, { "radar_Flag", "oldblips/radar_Flag.png" }, { "radar_gangB", "oldblips/radar_gangB.png" }, { "radar_gangG", "oldblips/radar_gangG.png" }, { "radar_gangN", "oldblips/radar_gangN.png" }, { "radar_gangP", "oldblips/radar_gangP.png" }, { "radar_gangY", "oldblips/radar_gangY.png" }, { "radar_girlfriend", "oldblips/radar_girlfriend.png" }, { "radar_gym", "oldblips/radar_gym.png" }, { "radar_hostpital", "oldblips/radar_hostpital.png" }, { "radar_impound", "oldblips/radar_impound.png" }, { "radar_light", "oldblips/radar_light.png" }, { "radar_LocoSyndicate", "oldblips/radar_LocoSyndicate.png" }, { "radar_MADDOG", "oldblips/radar_MADDOG.png" }, { "radar_mafiaCasino", "oldblips/radar_mafiaCasino.png" }, { "radar_MCSTRAP", "oldblips/radar_MCSTRAP.png" }, { "radar_modGarage", "oldblips/radar_modGarage.png" }, { "radar_north", "oldblips/radar_north.png" }, { "radar_OGLOC", "oldblips/radar_OGLOC.png" }, { "radar_pizza", "oldblips/radar_pizza.png" }, { "radar_police", "oldblips/radar_police.png" }, { "radar_propertyG", "oldblips/radar_propertyG.png" }, { "radar_propertyR", "oldblips/radar_propertyR.png" }, { "radar_qmark", "oldblips/radar_qmark.png" }, { "radar_race", "oldblips/radar_race.png" }, { "radar_runway", "oldblips/radar_runway.png" }, { "radar_RYDER", "oldblips/radar_RYDER.png" }, { "radar_saveGame", "oldblips/radar_saveGame.png" }, { "radar_school", "oldblips/radar_school.png" }, { "radar_spray", "oldblips/radar_spray.png" }, { "radar_SWEET", "oldblips/radar_SWEET.png" }, { "radar_tattoo", "oldblips/radar_tattoo.png" }, { "radar_THETRUTH", "oldblips/radar_THETRUTH.png" }, { "radar_TORENO", "oldblips/radar_TORENO.png" }, { "radar_TorenoRanch", "oldblips/radar_TorenoRanch.png" }, { "radar_triads", "oldblips/radar_triads.png" }, { "radar_triadsCasino", "oldblips/radar_triadsCasino.png" }, { "radar_truck", "oldblips/radar_truck.png" }, { "radar_tshirt", "oldblips/radar_tshirt.png" }, { "radar_waypoint", "oldblips/radar_waypoint.png" }, { "radar_WOOZIE", "oldblips/radar_WOOZIE.png" }, { "radar_ZERO", "oldblips/radar_ZERO.png" } } local shaders = {} function radaron() visible = true if visible then for i = 2, #blips_textures do shaders[i] = dxCreateShader("texture.fx") engineApplyShaderToWorldTexture(shaders[i], blips_textures[i][1]) dxSetShaderValue(shaders[i], "gTexture", dxCreateTexture(blips_textures[i][2])) end handleTileLoading() if isTimer(timer) then killTimer(timer) end timer = setTimer(handleTileLoading, 500, 0) end visible = false end addCommandHandler("on", radaron) function radaroff() if visible == false then for i = 2, #old_blips_textures do shaders[i] = dxCreateShader("texture.fx") engineApplyShaderToWorldTexture(shaders[i], old_blips_textures[i][1]) dxSetShaderValue(shaders[i], "gTexture", dxCreateTexture(old_blips_textures[i][2])) end if isTimer(timer ) then killTimer(timer) end for name, data in pairs(tiles) do unloadTile(name) end end end addCommandHandler("off", radaroff) function handleTileLoading ( ) local visibleTileNames = table.merge ( engineGetVisibleTextureNames ( "radar??" ), engineGetVisibleTextureNames ( "radar???" ) ) for name, data in pairs ( tiles ) do if not table.find ( visibleTileNames, name ) then unloadTile ( name ) end end for index, name in ipairs ( visibleTileNames ) do loadTile ( name ) end end function table.merge ( ... ) local ret = { } for index, tbl in ipairs ( {...} ) do for index, val in ipairs ( tbl ) do table.insert ( ret, val ) end end return ret end function table.find ( tbl, val ) for index, value in ipairs ( tbl ) do if ( value == val ) then return index end end return false end function loadTile ( name ) if type ( name ) ~= "string" then return false end if ( tiles[name] ) then return true end local id = tonumber ( name:match ( "%d+" ) ) if not ( id ) then return false end local row = math.floor ( id / ROW_COUNT ) local col = id - ( row * ROW_COUNT ) local posX = -3000 + 500 * col local posY = 3000 - 500 * row local file = string.format ( "sattelite/sattelite_%d_%d.png", row, col ) local texture = dxCreateTexture ( file ) if not ( texture ) then outputChatBox ( string.format ( "Failed to load texture for %q (%q)", tostring ( name ), tostring ( file ) ) ) return false end local shader = dxCreateShader ( "texreplace.fx" ) if not ( shader ) then outputChatBox ( "Failed to load shader" ) destroyElement ( texture ) return false end dxSetShaderValue ( shader, "gTexture", texture ) engineApplyShaderToWorldTexture ( shader, name ) tiles[name] = { shader = shader, texture = texture } return true end function unloadTile ( name ) local tile = tiles[name] if not ( tile ) then return false end if isElement ( tile.shader ) then destroyElement ( tile.shader ) end if isElement ( tile.texture ) then destroyElement ( tile.texture ) end tiles[name] = nil return true end
  21. I'll give you my function(s) I made few days ago. Take a look at them and you'll get how it works, probably function snowonmsg() local screenW, screenH = guiGetScreenSize() local px,py = 1600,900 local x,y = (screenW/px), (screenH/py) dxDrawText(snowOnMessage, (screenW * 0.0000) - 1, (screenH * 0.1417) - 1, (screenW * 1.0000) - 1, (screenH * 0.3815) - 1, tocolor(0, 0, 0, 255), 3*y, "default", "center", "center", false, false, false, true, false) dxDrawText(snowOnMessage, (screenW * 0.0000) + 1, (screenH * 0.1417) - 1, (screenW * 1.0000) + 1, (screenH * 0.3815) - 1, tocolor(0, 0, 0, 255), 3*y, "default", "center", "center", false, false, false, true, false) dxDrawText(snowOnMessage, (screenW * 0.0000) - 1, (screenH * 0.1417) + 1, (screenW * 1.0000) - 1, (screenH * 0.3815) + 1, tocolor(0, 0, 0, 255), 3*y, "default", "center", "center", false, false, false, true, false) dxDrawText(snowOnMessage, (screenW * 0.0000) + 1, (screenH * 0.1417) + 1, (screenW * 1.0000) + 1, (screenH * 0.3815) + 1, tocolor(0, 0, 0, 255), 3*y, "default", "center", "center", false, false, false, true, false) dxDrawText(snowOnMessage, screenW * 0.0000, screenH * 0.1417, screenW * 1.0000, screenH * 0.3815, tocolor(255, 255, 0, 255), 3*y, "default", "center", "center", false, false, false, true, false) if isEventHandlerAdded("onClientRender", root, snowoffmsg) == true then removeEventHandler("onClientRender", root, snowoffmsg) end if isEventHandlerAdded("onClientRender", root, snowonmsg) == false then addEventHandler("onClientRender", root, snowonmsg) end setTimer(snowonnomsg,7000,1) end function snowonnomsg() removeEventHandler("onClientRender", root, snowonmsg) end ------------------------------------------------------------------------------------------------------------------------------------------------------------ function isEventHandlerAdded(sEventName, pElementAttachedTo, func) if type(sEventName) == 'string' and isElement(pElementAttachedTo) and type(func) == 'function' then local aAttachedFunctions = getEventHandlers(sEventName, pElementAttachedTo) if type(aAttachedFunctions) == 'table' and #aAttachedFunctions > 0 then for i, v in ipairs(aAttachedFunctions) do if v == func then return true end end end end return false end Where 'snowOnMessage' is a string defined at the top of my script and 'isEventHandlerAdded' is a function which gets rid of annoying debug spam warning messages
  22. OK, I just did it with executeCommandHandler and result is same. Minimap images unload fine but the shaders do not if they have been set to on the last time you've been on the server and try to disable them now. Player needs to untick the checkbox and then reconnect to see the complete old radar.
  23. koragg

    [HELP]Mods

    I don't know about skins but I'll give you a tip for vehicle mods. Open the big txd files with TXDWorkshop and try to find images which aren't seen in game at all. Delete them and save your txd. Also sometimes the author of the mod makes it super high definition, meaning he makes images for absolutely everything in the car interior. My suggestion is to remove some of these images as well and test. If the car looks ok without them then it's fine. ALWAYS HAVE A BACKUP OF THE LAST WORKING FILE ON YOUR PC That's what i did and it reduced a txd from 15 to 7 mb once so it's safe to say that it works in most cases.
  24. Unfortunately that resource is made to work only with functions, the executecmd can't work there. Btw, you're 100% correct about the exports, but that specific resource which I use for the settings uses the format I mentioned before Soo..only fix would be to somehow fix the unloading in the function when it's called. @Wojak help please
×
×
  • Create New...