-
Posts
100 -
Joined
-
Last visited
Everything posted by Soapbosnia
-
I knew u needed it and u would like it :3 Enjoy bro ^^,and im quiting scripting
-
Hello MTA Community,today i am bringing you my resource called Ultimate Clan Panel Its a simple clan panel+Auto Clan Adder+Clan Chat Basically replace the name "Soap" in these lines in client.lua with your Nickname if getElementData(localPlayer, "clan.rank") == "leader" or getElementData(localPlayer, "player.key") == "Soap" or getElementData(localPlayer, "player.key") == "danksta" or getElementData(localPlayer, "player.key") == "[ET]Mohamed" or getElementData(localPlayer, "player.key") == "[ET]Mohamed" or getElementData(localPlayer, "player.key") == "Mohamed" then guiSetEnabled(Clan.Button[3], true) guiSetEnabled(Clan.Button[4], true) else guiSetEnabled(Clan.Button[3], false) guiSetEnabled(Clan.Button[4], false) end function toggleClanControl( source ) if getElementData(localPlayer, "player.key") == "Soap" or getElementData(localPlayer, "player.key") == "[ET]Soap" or getElementData(localPlayer, "player.key") == "danksta" or getElementData(localPlayer, "player.key") == "[ET]Danksta" or getElementData(localPlayer, "player.key") == "Danksta" then if not guiGetVisible( Clan.Window[1] ) then showCursor ( true ) guiSetVisible( Clan.Window[1], true ) guiGridListClear ( Clan.Gridlist[1] ) if ( column ) then guiGridListClear ( Clan.Gridlist[1] ) for _,v in ipairs(getElementsByType("player"))do local row = guiGridListAddRow(Clan.Gridlist[1]) local playerName = getPlayerName(v) guiGridListSetItemText(Clan.Gridlist[1],row,column,playerName,false,false) end end if getElementData(localPlayer, "clan.rank") == "leader" or getElementData(localPlayer, "player.key") == "Soap" or getElementData(localPlay And if u want clans to be created on resource start then edit the following lines in server.lua,example edit clan Forever with your own clan name,you can add more clans if u want function createTeamsOnStart () createTeam ( "Lords of War", 100, 0, 0 ) createTeam ( "Forever", 255, 0, 0 ) createTeam ( "Avalanche", 255, 255, 255 ) createTeam ( "Firestorm", 255, 100, 0 ) createTeam ( "Silent Fart", 0, 0,255 ) createTeam ( "The Keks", 0, 0, 0 ) createTeam ( "Phantom", 67, 0, 234 ) createTeam ( "Quantum", 100, 0, 0 ) end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), createTeamsOnStart ) Note:The script has teamsaver and teamcolor in it,so when u add yourself in any clan ur name color changes immediatly Link To Clan Panel:https://www.mediafire.com/file/9ifd41m6p9egq1p/Ultimate Clan Panel.zip Note:The Default key which the clan panel is bound to is "H" and the command to open clan panel is /clan
-
Hello guys,i got a problem which annoys me for a while,i wanna change font of my custom radio script,but when i change it the font looks small and its just a default font,not the 1 i choose,PLS HELP! lol i forgot heres the settigns.xml of the custom radio script <settings> <color r="255" g="255" b="255"/> <font>sa-header</font> <realism enabled="false"/> <stations> <station name="The Beat" URL="http://listen.181fm.com/181-beat_64k.aac"/> <station name="181 FM" URL="http://listen.181fm.com/181-party_64k.aac"/> <station name="The Vibe of Vegas" URL="http://listen.181fm.com/181-vibe_64k.aac"/> <station name="Power 181" URL="http://www.181.fm/winamp.pls?station=181-power&style=mp3&description=Power%20181%20(Top%2040)&file=181-power.pls"/> <station name="Star 90's" URL="http://relay.181.fm:8012/"/> <station name="Awesome 80's" URL="http://relay.181.fm:8000/"/> <station name="Rock 181" URL="http://listen.181fm.com/181-rock_64k.aac"/> <station name="UK Top 40" URL="http://listen.181fm.com/181-uktop40_64k.aac"/> </stations> </settings> client.lua local xml = xmlLoadFile ( "settings.xml" ) local nodeColor = xmlFindChild ( xml, "color", 0 ) local nodeFont = xmlFindChild ( xml, "font", 0 ) local nodeRealism = xmlFindChild ( xml, "realism", 0 ) local nodeStations = xmlFindChild ( xml, "stations", 0 ) local label = guiCreateLabel ( 0, 0, 1, 0.1, "Radio Off", true ) guiLabelSetColor ( label, xmlNodeGetAttribute ( nodeColor, "r" ), xmlNodeGetAttribute ( nodeColor, "g" ), xmlNodeGetAttribute ( nodeColor, "b" ) ) guiLabelSetHorizontalAlign ( label, "center" ) guiSetFont ( label, xmlNodeGetValue ( nodeFont ) ) guiSetVisible ( label, false ) addEventHandler ( "onClientResourceStart", getResourceRootElement (), function () setPlayerHudComponentVisible ( "radio", false ) setElementData ( getLocalPlayer (), "liveradio.radio", 0 ) for k, v in ipairs ( getElementsByType ( "vehicle" ) ) do setElementData ( v, "liveradio.radio0", false ) setElementData ( v, "liveradio.radio1", false ) setElementData ( v, "liveradio.radio2", false ) setElementData ( v, "liveradio.radio3", false ) end end ) addEventHandler ( "onClientResourceStop", getResourceRootElement (), function () setPlayerHudComponentVisible ( "radio", true ) end ) addEventHandler ( "onClientPlayerVehicleEnter", getLocalPlayer (), function ( vehicle, seat ) setRadioChannel ( 0 ) setElementData ( getLocalPlayer (), "liveradio.seat", seat ) if sound then if isElement ( sound ) then destroyElement ( sound ) end end if xmlNodeGetAttribute ( nodeRealism, "enabled" ) == "true" then if getElementData ( vehicle, "liveradio.radio0" ) then setElementData ( getLocalPlayer (), "liveradio.radio", getElementData ( vehicle, "liveradio.radio0" ) ) else for k, v in ipairs ( xmlNodeGetChildren ( nodeStations ) ) do setElementData ( getLocalPlayer (), "liveradio.radio", k ) end setElementData ( getLocalPlayer (), "liveradio.radio", math.random ( getElementData ( getLocalPlayer (), "liveradio.radio" ) ) ) setElementData ( vehicle, "liveradio.radio0", getElementData ( getLocalPlayer (), "liveradio.radio" ) ) setElementData ( vehicle, "liveradio.radio1", getElementData ( getLocalPlayer (), "liveradio.radio" ) ) setElementData ( vehicle, "liveradio.radio2", getElementData ( getLocalPlayer (), "liveradio.radio" ) ) setElementData ( vehicle, "liveradio.radio3", getElementData ( getLocalPlayer (), "liveradio.radio" ) ) end else if getElementData ( vehicle, "liveradio.radio" .. seat ) then setElementData ( getLocalPlayer (), "liveradio.radio", getElementData ( vehicle, "liveradio.radio" .. seat ) ) else for k, v in ipairs ( xmlNodeGetChildren ( nodeStations ) ) do setElementData ( getLocalPlayer (), "liveradio.radio", k ) end setElementData ( getLocalPlayer (), "liveradio.radio", math.random ( getElementData ( getLocalPlayer (), "liveradio.radio" ) ) ) setElementData ( vehicle, "liveradio.radio" .. seat, getElementData ( getLocalPlayer (), "liveradio.radio" ) ) end end local nodeStation = xmlFindChild ( nodeStations, "station", getElementData ( vehicle, "liveradio.radio" .. seat ) - 1 ) if nodeStation then local radioName = xmlNodeGetAttribute ( nodeStation, "name" ) local radioURL = xmlNodeGetAttribute ( nodeStation, "URL" ) sound = playSound ( radioURL ) guiSetText ( label, radioName ) guiSetVisible ( label, true ) if isTimer ( timerLabel ) then killTimer ( timerLabel ) end timerLabel = setTimer ( guiSetVisible, 5000, 1, label, false ) else guiSetText ( label, "Radio Off" ) guiSetVisible ( label, true ) setElementData ( getLocalPlayer (), "liveradio.radio", 0 ) if isTimer ( timerLabel ) then killTimer ( timerLabel ) end timerLabel = setTimer ( guiSetVisible, 5000, 1, label, false ) end timerVehicle = setTimer ( function ( vehicle ) if isPedInVehicle ( getLocalPlayer () ) == false or getPedOccupiedVehicle ( getLocalPlayer () ) ~= vehicle or getElementHealth ( getLocalPlayer () ) <= 0 then if sound then if isElement ( sound ) then destroyElement ( sound ) end end killTimer ( timerVehicle ) guiSetVisible ( label, false ) setElementData ( getLocalPlayer (), "liveradio.radio", 0 ) end end , 50, 0, vehicle ) end ) addEventHandler ( "onClientPlayerRadioSwitch", getLocalPlayer (), function ( station ) if station ~= 0 then cancelEvent () end if xmlNodeGetAttribute ( nodeRealism, "enabled" ) ~= "true" or getElementData ( getLocalPlayer (), "liveradio.seat" ) == 0 or getPedOccupiedVehicle ( getLocalPlayer () ) == false then if station == 1 then setElementData ( getLocalPlayer (), "liveradio.radio", getElementData ( getLocalPlayer (), "liveradio.radio" ) + 1 ) elseif station == 12 then setElementData ( getLocalPlayer (), "liveradio.radio", getElementData ( getLocalPlayer (), "liveradio.radio" ) - 1 ) if getElementData ( getLocalPlayer (), "liveradio.radio" ) == -1 then for k, v in ipairs ( xmlNodeGetChildren ( nodeStations ) ) do setElementData ( getLocalPlayer (), "liveradio.radio", k ) end end end if sound then if isElement ( sound ) then destroyElement ( sound ) end end if getPedOccupiedVehicle ( getLocalPlayer () ) then setElementData ( getPedOccupiedVehicle ( getLocalPlayer () ), "liveradio.radio" .. getElementData ( getLocalPlayer (), "liveradio.seat" ), getElementData ( getLocalPlayer (), "liveradio.radio" ) ) end local nodeStation = xmlFindChild ( nodeStations, "station", getElementData ( getLocalPlayer (), "liveradio.radio" ) - 1 ) if nodeStation then local radioName = xmlNodeGetAttribute ( nodeStation, "name" ) local radioURL = xmlNodeGetAttribute ( nodeStation, "URL" ) sound = playSound ( radioURL ) guiSetText ( label, radioName ) guiSetVisible ( label, true ) if isTimer ( timerLabel ) then killTimer ( timerLabel ) end timerLabel = setTimer ( guiSetVisible, 5000, 1, label, false ) else guiSetText ( label, "Radio Off" ) guiSetVisible ( label, true ) setElementData ( getLocalPlayer (), "liveradio.radio", 0 ) if isTimer ( timerLabel ) then killTimer ( timerLabel ) end timerLabel = setTimer ( guiSetVisible, 5000, 1, label, false ) end if xmlNodeGetAttribute ( nodeRealism, "enabled" ) == "true" and getPedOccupiedVehicle ( getLocalPlayer () ) then setElementData ( getPedOccupiedVehicle ( getLocalPlayer () ), "liveradio.radio0", getElementData ( getLocalPlayer (), "liveradio.radio" ) ) setElementData ( getPedOccupiedVehicle ( getLocalPlayer () ), "liveradio.radio1", getElementData ( getLocalPlayer (), "liveradio.radio" ) ) setElementData ( getPedOccupiedVehicle ( getLocalPlayer () ), "liveradio.radio2", getElementData ( getLocalPlayer (), "liveradio.radio" ) ) setElementData ( getPedOccupiedVehicle ( getLocalPlayer () ), "liveradio.radio3", getElementData ( getLocalPlayer (), "liveradio.radio" ) ) triggerServerEvent ( "onPlayerRadioSwitch", getLocalPlayer (), getPedOccupiedVehicle ( getLocalPlayer () ) ) end end end ) addEventHandler ( "onClientVehicleStartExit", getRootElement (), function ( player ) if player == getLocalPlayer () then if sound then if isElement ( sound ) then destroyElement ( sound ) end end if isTimer ( timerVehicle ) then killTimer ( timerVehicle ) end guiSetVisible ( label, false ) setElementData ( player, "liveradio.radio", 0 ) end end ) addEvent ( "switchRadioChannel", true ) addEventHandler ( "switchRadioChannel", getLocalPlayer (), function () if sound then if isElement ( sound ) then destroyElement ( sound ) end end local nodeStation = xmlFindChild ( nodeStations, "station", getElementData ( getPedOccupiedVehicle ( getLocalPlayer () ), "liveradio.radio0" ) - 1 ) if nodeStation then local radioName = xmlNodeGetAttribute ( nodeStation, "name" ) local radioURL = xmlNodeGetAttribute ( nodeStation, "URL" ) sound = playSound ( radioURL ) guiSetText ( label, radioName ) guiSetVisible ( label, true ) setElementData ( getLocalPlayer (), "liveradio.radio", getElementData ( getPedOccupiedVehicle ( getLocalPlayer () ), "liveradio.radio0" ) ) if isTimer ( timerLabel ) then killTimer ( timerLabel ) end timerLabel = setTimer ( guiSetVisible, 5000, 1, label, false ) else guiSetText ( label, "Radio Off" ) guiSetVisible ( label, true ) setElementData ( getLocalPlayer (), "liveradio.radio", 0 ) if isTimer ( timerLabel ) then killTimer ( timerLabel ) end timerLabel = setTimer ( guiSetVisible, 5000, 1, label, false ) end end ) server.lua addEvent ( "onPlayerRadioSwitch", true ) addEventHandler ( "onPlayerRadioSwitch", getRootElement (), function ( vehicle ) for k, v in ipairs ( getElementsByType ( "player" ) ) do if getPedOccupiedVehicle ( v ) == vehicle and v ~= source then triggerClientEvent ( v, "switchRadioChannel", v ) end end end )
-
resources [BUG]Sniper Scope Bugged! (Please Help)
Soapbosnia replied to Soapbosnia's topic in Scripting
I didnt find any I got a question,whenever i change font in my scripts it doesnt work,can u help me -
resources [BUG]Sniper Scope Bugged! (Please Help)
Soapbosnia replied to Soapbosnia's topic in Scripting
Um bro sorry this isnt a question related to shaders but,how do i make the radar size bigger? -
Hello guys,i made something which replaces explosion sounds,weapon sounds,weapon models,sniper scope,rocket crosshair and disables default weapon sounds in 1 script,now the problem is whenever i shoot with my gun it makes me lag,i dont use any custom effects or stuff.Pls help. Thank You.Btw heres the code if u need local distance = 75 --distance from where you can hear the shot local explostionDistance = 150 local cSoundsEnabled = true local reloadSoundEnabled = false local explosionEnabled = true ----RIP function replaceWeapon() txd = engineLoadTXD ( "Weapons/knife.txd" ) engineImportTXD ( txd, 335) dff = engineLoadDFF ( "Weapons/knife.dff") -- use weapon model ID, not GTA weapon ID (model ID from https://wiki.multitheftauto.com/wiki/Weapons) engineReplaceModel ( dff, 335) -- Likewise, model ID, for M4 as example it's 356 end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceWeapon) ----RIP function replaceWeapon() txd = engineLoadTXD ( "Weapons/pistol.txd" ) engineImportTXD ( txd, 346) dff = engineLoadDFF ( "Weapons/pistol.dff") -- use weapon model ID, not GTA weapon ID (model ID from https://wiki.multitheftauto.com/wiki/Weapons) engineReplaceModel ( dff, 346) -- Likewise, model ID, for M4 as example it's 356 end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceWeapon) ----RIP function replaceWeapon() txd = engineLoadTXD ( "Weapons/silenced.txd" ) engineImportTXD ( txd, 347) dff = engineLoadDFF ( "Weapons/silenced.dff") -- use weapon model ID, not GTA weapon ID (model ID from https://wiki.multitheftauto.com/wiki/Weapons) engineReplaceModel ( dff, 347) -- Likewise, model ID, for M4 as example it's 356 end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceWeapon) ----RIP function replaceWeapon() txd = engineLoadTXD ( "Weapons/deagle.txd" ) engineImportTXD ( txd, 348) dff = engineLoadDFF ( "Weapons/deagle.dff") -- use weapon model ID, not GTA weapon ID (model ID from https://wiki.multitheftauto.com/wiki/Weapons) engineReplaceModel ( dff, 348) -- Likewise, model ID, for M4 as example it's 356 end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceWeapon) ----RIP function replaceWeapon() txd = engineLoadTXD ( "Weapons/shotgun.txd" ) engineImportTXD ( txd, 349) dff = engineLoadDFF ( "Weapons/shotgun.dff") -- use weapon model ID, not GTA weapon ID (model ID from https://wiki.multitheftauto.com/wiki/Weapons) engineReplaceModel ( dff, 349) -- Likewise, model ID, for M4 as example it's 356 end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceWeapon) ----RIP function replaceWeapon() txd = engineLoadTXD ( "Weapons/sawnoff.txd" ) engineImportTXD ( txd, 350) dff = engineLoadDFF ( "Weapons/sawnoff.dff") -- use weapon model ID, not GTA weapon ID (model ID from https://wiki.multitheftauto.com/wiki/Weapons) engineReplaceModel ( dff, 350) -- Likewise, model ID, for M4 as example it's 356 end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceWeapon) ----RIP function replaceWeapon() txd = engineLoadTXD ( "Weapons/striker.txd" ) engineImportTXD ( txd, 351) dff = engineLoadDFF ( "Weapons/striker.dff") -- use weapon model ID, not GTA weapon ID (model ID from https://wiki.multitheftauto.com/wiki/Weapons) engineReplaceModel ( dff, 351) -- Likewise, model ID, for M4 as example it's 356 end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceWeapon) ----RIP function replaceWeapon() txd = engineLoadTXD ( "Weapons/uzi.txd" ) engineImportTXD ( txd, 352) dff = engineLoadDFF ( "Weapons/uzi.dff") -- use weapon model ID, not GTA weapon ID (model ID from https://wiki.multitheftauto.com/wiki/Weapons) engineReplaceModel ( dff, 352) -- Likewise, model ID, for M4 as example it's 356 end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceWeapon) ----RIP function replaceWeapon() txd = engineLoadTXD ( "Weapons/mp5.txd" ) engineImportTXD ( txd, 353) dff = engineLoadDFF ( "Weapons/mp5.dff") -- use weapon model ID, not GTA weapon ID (model ID from https://wiki.multitheftauto.com/wiki/Weapons) engineReplaceModel ( dff, 353) -- Likewise, model ID, for M4 as example it's 356 end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceWeapon) ----RIP function replaceWeapon() txd = engineLoadTXD ( "Weapons/tec9.txd" ) engineImportTXD ( txd, 372) dff = engineLoadDFF ( "Weapons/tec9.dff") -- use weapon model ID, not GTA weapon ID (model ID from https://wiki.multitheftauto.com/wiki/Weapons) engineReplaceModel ( dff, 372) -- Likewise, model ID, for M4 as example it's 356 end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceWeapon) ----RIP function replaceWeapon() txd = engineLoadTXD ( "Weapons/ak47.txd" ) engineImportTXD ( txd, 355) dff = engineLoadDFF ( "Weapons/ak47.dff") -- use weapon model ID, not GTA weapon ID (model ID from https://wiki.multitheftauto.com/wiki/Weapons) engineReplaceModel ( dff, 355) -- Likewise, model ID, for M4 as example it's 356 end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceWeapon) ----RIP function replaceWeapon() txd = engineLoadTXD ( "Weapons/m4.txd" ) engineImportTXD ( txd, 356) dff = engineLoadDFF ( "Weapons/m4.dff") -- use weapon model ID, not GTA weapon ID (model ID from https://wiki.multitheftauto.com/wiki/Weapons) engineReplaceModel ( dff, 356) -- Likewise, model ID, for M4 as example it's 356 end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceWeapon) ----RIP function replaceWeapon() txd = engineLoadTXD ( "Weapons/rifle.txd" ) engineImportTXD ( txd, 357) dff = engineLoadDFF ( "Weapons/rifle.dff") -- use weapon model ID, not GTA weapon ID (model ID from https://wiki.multitheftauto.com/wiki/Weapons) engineReplaceModel ( dff, 357) -- Likewise, model ID, for M4 as example it's 356 end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceWeapon) ----RIP function replaceWeapon() txd = engineLoadTXD ( "Weapons/sniper.txd" ) engineImportTXD ( txd, 358) dff = engineLoadDFF ( "Weapons/sniper.dff") -- use weapon model ID, not GTA weapon ID (model ID from https://wiki.multitheftauto.com/wiki/Weapons) engineReplaceModel ( dff, 358) -- Likewise, model ID, for M4 as example it's 356 end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceWeapon) ----RIP function replaceWeapon() txd = engineLoadTXD ( "Weapons/launcher.txd" ) engineImportTXD ( txd, 359) dff = engineLoadDFF ( "Weapons/launcher.dff") -- use weapon model ID, not GTA weapon ID (model ID from https://wiki.multitheftauto.com/wiki/Weapons) engineReplaceModel ( dff, 359) -- Likewise, model ID, for M4 as example it's 356 end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceWeapon) ----RIP function replaceWeapon() txd = engineLoadTXD ( "Weapons/hlauncher.txd" ) engineImportTXD ( txd, 360) dff = engineLoadDFF ( "Weapons/hlauncher.dff") -- use weapon model ID, not GTA weapon ID (model ID from https://wiki.multitheftauto.com/wiki/Weapons) engineReplaceModel ( dff, 360) -- Likewise, model ID, for M4 as example it's 356 end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceWeapon) ----RIP function replaceWeapon() txd = engineLoadTXD ( "Weapons/minigun.txd" ) engineImportTXD ( txd, 362) dff = engineLoadDFF ( "Weapons/minigun.dff") -- use weapon model ID, not GTA weapon ID (model ID from https://wiki.multitheftauto.com/wiki/Weapons) engineReplaceModel ( dff, 362) -- Likewise, model ID, for M4 as example it's 356 end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceWeapon) ----RIP function replaceWeapon() txd = engineLoadTXD ( "Weapons/grenade.txd" ) engineImportTXD ( txd, 342) dff = engineLoadDFF ( "Weapons/grenade.dff") -- use weapon model ID, not GTA weapon ID (model ID from https://wiki.multitheftauto.com/wiki/Weapons) engineReplaceModel ( dff, 342) -- Likewise, model ID, for M4 as example it's 356 end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceWeapon) ----RIP function replaceWeapon() txd = engineLoadTXD ( "Weapons/teargas.txd" ) engineImportTXD ( txd, 343) dff = engineLoadDFF ( "Weapons/teargas.dff") -- use weapon model ID, not GTA weapon ID (model ID from https://wiki.multitheftauto.com/wiki/Weapons) engineReplaceModel ( dff, 343) -- Likewise, model ID, for M4 as example it's 356 end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceWeapon) ----RIP function replaceWeapon() txd = engineLoadTXD ( "Weapons/molotov.txd" ) engineImportTXD ( txd, 344) dff = engineLoadDFF ( "Weapons/molotov.dff") -- use weapon model ID, not GTA weapon ID (model ID from https://wiki.multitheftauto.com/wiki/Weapons) engineReplaceModel ( dff, 344) -- Likewise, model ID, for M4 as example it's 356 end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceWeapon) function replaceWeapon() txd = engineLoadTXD ( "Weapons/satchel.txd" ) engineImportTXD ( txd, 363) dff = engineLoadDFF ( "Weapons/satchel.dff") -- use weapon model ID, not GTA weapon ID (model ID from https://wiki.multitheftauto.com/wiki/Weapons) engineReplaceModel ( dff, 363) -- Likewise, model ID, for M4 as example it's 356 end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceWeapon) ----RIP function replaceWeapon() txd = engineLoadTXD ( "Weapons/parachute.txd" ) engineImportTXD ( txd, 371) dff = engineLoadDFF ( "Weapons/parachute.dff") -- use weapon model ID, not GTA weapon ID (model ID from https://wiki.multitheftauto.com/wiki/Weapons) engineReplaceModel ( dff, 371) -- Likewise, model ID, for M4 as example it's 356 end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceWeapon) ----RIP function replaceWeapon() txd = engineLoadTXD ( "Weapons/bomb.txd" ) engineImportTXD ( txd, 364) dff = engineLoadDFF ( "Weapons/bomb.dff") -- use weapon model ID, not GTA weapon ID (model ID from https://wiki.multitheftauto.com/wiki/Weapons) engineReplaceModel ( dff, 364) -- Likewise, model ID, for M4 as example it's 356 end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceWeapon) ----Adds New Explosion Sounds addEventHandler("onClientExplosion", getRootElement(), function(x,y,z, theType) local Sdimension = getElementDimension(source) local Sinterior = getElementInterior(source) if(explosionEnabled)then if(theType == 0)then--Grenade local explSound = playSound3D("Explosions/explosion1.mp3", x,y,z) setSoundMaxDistance(explSound, explostionDistance) setElementDimension(explSound, Sdimension) setElementInterior(explSound, Sinterior) elseif(theType == 4 or theType == 5 or theType == 6 or theType == 7)then --car, car quick, boat, heli local explSound = playSound3D("Explosions/explosion3.mp3", x,y,z) setSoundMaxDistance(explSound, explostionDistance) setElementDimension(explSound, Sdimension) setElementInterior(explSound, Sinterior) elseif(theType == 1)then else local explSound = playSound3D("Explosions/explosion2.mp3", x,y,z) setSoundMaxDistance(explSound, explostionDistance) setElementDimension(explSound, Sdimension) setElementInterior(explSound, Sinterior) end end end) ----Adds New Weapon Sounds function playSounds(weapon, ammo, ammoInClip) if(cSoundsEnabled)then local x,y,z = getElementPosition(source) if weapon == 31 then --m4 if(ammoInClip == 0 and reloadSoundEnabled)then mgReload("Sounds/m4.wav", x,y,z) else local sound = playSound3D("Sounds/m4.wav", x,y,z) setSoundMaxDistance(sound, distance) end elseif weapon == 22 then --pistol if(ammoInClip == 0 and reloadSoundEnabled)then pistolReload("Sounds/pistole.wav", x,y,z) else local sound = playSound3D("Sounds/pistole.wav", x,y,z) setSoundMaxDistance(sound, distance) end elseif weapon == 23 then --silenced if(ammoInClip == 0 and reloadSoundEnabled)then pistolReload("Sounds/silenced.wav", x,y,z) else local sound = playSound3D("Sounds/silenced.wav", x,y,z) setSoundMaxDistance(sound, distance) end elseif weapon == 24 then --deagle if(ammoInClip == 0 and reloadSoundEnabled)then pistolReload("Sounds/deagle.wav", x,y,z) else local sound = playSound3D("Sounds/deagle.wav", x,y,z) setSoundMaxDistance(sound, distance) end elseif weapon == 25 then --shotgun if(weapon == 25)then local sound = playSound3D("Sounds/shotgun.wav", x,y,z) setSoundMaxDistance(sound, distance) shotgunReload(x,y,z) else local sound = playSound3D("Sounds/shotgun.wav", x,y,z) setSoundMaxDistance(sound, distance) end elseif weapon == 28 then --uzi if(ammoInClip == 0)then mgReload("Sounds/uzi.wav", x,y,z) else local sound = playSound3D("Sounds/uzi.wav", x,y,z) setSoundMaxDistance(sound, distance) end elseif weapon == 38 then --minigun if(ammoInClip == 0)then mgReload("Sounds/minigun.wav", x,y,z) else local sound = playSound3D("Sounds/minigun.wav", x,y,z) setSoundMaxDistance(sound, distance) end elseif weapon == 29 then --mp5 if(ammoInClip == 0 and reloadSoundEnabled)then mgReload("Sounds/mp5.wav", x,y,z) else local sound = playSound3D("Sounds/mp5.wav", x,y,z) setSoundMaxDistance(sound, distance) end elseif weapon == 26 then --sawnoff if(ammoInClip == 0 and reloadSoundEnabled)then mgReload("Sounds/sawnoff.wav", x,y,z) else local sound = playSound3D("Sounds/sawnoff.wav", x,y,z) setSoundMaxDistance(sound, distance) end elseif weapon == 27 then --sawnoff if(ammoInClip == 0 and reloadSoundEnabled)then mgReload("Sounds/striker.wav", x,y,z) else local sound = playSound3D("Sounds/striker.wav", x,y,z) setSoundMaxDistance(sound, distance) end elseif weapon == 32 then --tec-9 if(ammoInClip == 0)then tec9Reload(x,y,z) else local sound = playSound3D("Sounds/tec-9.wav", x,y,z) setSoundMaxDistance(sound, distance) end elseif weapon == 30 then --ak if(ammoInClip == 0 and reloadSoundEnabled)then mgReload("Sounds/ak.wav", x,y,z) else local sound = playSound3D("Sounds/ak.wav", x,y,z) setSoundMaxDistance(sound, distance) end elseif weapon == 33 then --rifle if(ammoInClip == 0 and reloadSoundEnabled)then mgReload("Sounds/rifle.wav", x,y,z) else local sound = playSound3D("Sounds/rifle.wav", x,y,z) setSoundMaxDistance(sound, distance) end elseif weapon == 34 then --sniper local sound = playSound3D("sounds/sniper.wav", x,y,z) setSoundMaxDistance(sound, distance) end end end addEventHandler("onClientPlayerWeaponFire", getRootElement(), playSounds) ----Disables Default Explosion And Weapon Sounds setWorldSoundEnabled(5, false) function removeWorldSounds() setWorldSoundEnabled(5, 3, false) setWorldSoundEnabled(5, 4, false) setWorldSoundEnabled(5, 5, false) setWorldSoundEnabled(5, 6, false) setWorldSoundEnabled(5, 7, false) setWorldSoundEnabled(5, 8, false) setWorldSoundEnabled(5, 11, false) setWorldSoundEnabled(5, 12, false) setWorldSoundEnabled(5, 13, false) setWorldSoundEnabled(5, 14, false) setWorldSoundEnabled(5, 15, false) setWorldSoundEnabled(5, 16, false) setWorldSoundEnabled(5, 17, false) setWorldSoundEnabled(5, 18, false) setWorldSoundEnabled(5, 21, false) setWorldSoundEnabled(5, 22, false) setWorldSoundEnabled(5, 23, false) setWorldSoundEnabled(5, 24, false) setWorldSoundEnabled(5, 26, false) setWorldSoundEnabled(5, 27, false) setWorldSoundEnabled(5, 29, false) setWorldSoundEnabled(5, 32, false) setWorldSoundEnabled(5, 33, false) setWorldSoundEnabled(5, 52, false) setWorldSoundEnabled(5, 55, false) setWorldSoundEnabled(5, 63, false) setWorldSoundEnabled(5, 73, false) setWorldSoundEnabled(5, 76, false) setWorldSoundEnabled(5, 83, false) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), removeWorldSounds) ----Replaces The Sniper Crosshair table = { -- you can add more stuff here :) -- Crosshair {"files/siterocket.png", "siterocket"}, {"files/SNIPERcrosshair.png", "SNIPERcrosshair"}, } addEventHandler( "onClientResourceStart", resourceRoot, function() for i = 1, #table do local shader, tec = dxCreateShader ( "texreplace.fx" ) local tex = dxCreateTexture ( ""..table[i][1].."" ) engineApplyShaderToWorldTexture ( shader, table[i][2] ) engineApplyShaderToWorldTexture ( shader, table[i][2].."lod" ) dxSetShaderValue ( shader, "gTexture", tex ) end end)
-
resources [BUG]Sniper Scope Bugged! (Please Help)
Soapbosnia replied to Soapbosnia's topic in Scripting
Ok bro thanks for the help -
resources [BUG]Sniper Scope Bugged! (Please Help)
Soapbosnia replied to Soapbosnia's topic in Scripting
K bro il try,thx anyway Another question how do i replace vehicles with shaders i mean i got .png files of hydra skins,i want to use the .png files to replace the hydra,possible? -
resources [BUG]Sniper Scope Bugged! (Please Help)
Soapbosnia replied to Soapbosnia's topic in Scripting
Pls bro,can u put an example,or can u explain me how to fix it? -
Hello,i got a script which replaces the default sniper scope with a custom one by using shaders,now i got the bug that my scope doesnt draw correctly,it draws 4 scopes Here is the code table = { {"files/siterocket.png", "siterocket"}, {"files/SNIPERcrosshair.png", "SNIPERcrosshair"}, } addEventHandler( "onClientResourceStart", resourceRoot, function() for i = 1, #table do local shader, tec = dxCreateShader ( "texreplace.fx" ) local tex = dxCreateTexture ( ""..table[i][1].."" ) engineApplyShaderToWorldTexture ( shader, table[i][2] ) engineApplyShaderToWorldTexture ( shader, table[i][2].."lod" ) dxSetShaderValue ( shader, "gTexture", tex ) end end)
-
E.E Kako ste bracale,dosao sm ds pitam imal neki scripter koji bi mi pomogao sa serverom Dobiti cete admin i vip na mojim serveru
-
Mega os mi pomoc sa serverom?Xeon me poslo,dobit ces admin
-
Such Such Late Reply but can u show me how to draw an image when i enter rhino and attach it to misc_c? I got the png of that inage in the imgur link.
-
Hey guys,i think its not possible,but is there any way to replace the sniper scope without replacing the whole gun?
-
Hey Mohamed Please give me that script,im a grafuroam cloner Server name DizzyRoam Ur welcome to join and i will give u admin. Btw sup Realfriend my old loved bro Remember the old times on grafuroam :(? I need the script lol MAN Hollow is my 2nd account,when the :O was this?
-
Hello dear mta community,Please help me, i made a login panel with gui editor and now it says this error "Unexpected symbol near "*" line:48 Here is the code,please help guys GUIEditor = { button = {}, edit = {}, checkbox = {}, label = {} } GUIEditor.button[1] = guiCreateButton(577, 515, 137, 52, "Login", false) guiSetFont(GUIEditor.button[1], "default-bold-small") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") GUIEditor.button[2] = guiCreateButton(729, 520, 143, 41, "Register an Account", false) guiSetFont(GUIEditor.button[2], "default-bold-small") guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA") GUIEditor.button[3] = guiCreateButton(439, 521, 123, 40, "Play as Guest", false) guiSetFont(GUIEditor.button[3], "default-bold-small") guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFAAAAAA") GUIEditor.label[1] = guiCreateLabel(613, 369, 82, 18, "Account Name", false) guiSetFont(GUIEditor.label[1], "default-bold-small") GUIEditor.label[2] = guiCreateLabel(602, 421, 103, 15, "Account Password", false) guiSetFont(GUIEditor.label[2], "default-bold-small") GUIEditor.label[3] = guiCreateLabel(573, 481, 146, 17, "Remember Account Name", false) guiSetFont(GUIEditor.label[3], "default-bold-small") GUIEditor.checkbox[1] = guiCreateCheckBox(552, 481, 15, 14, "", false, false) guiSetFont(GUIEditor.checkbox[1], "default-bold-small") GUIEditor.edit[1] = guiCreateEdit(546, 387, 204, 28, "", false) guiSetAlpha(GUIEditor.edit[1], 0.82) GUIEditor.edit[2] = guiCreateEdit(546, 440, 204, 28, "", false) guiSetAlpha(GUIEditor.edit[2], 0.82) addEventHandler(*onClientGUIClick*,GUIEditor.button[1]), function ( ) local User = guiGuiText ( GUIEditor.edit[1] ) local Password = guiGetText ( Edit_Password ) if User and password then triggerServerEvent(*onPlayerTryingToLogin*,localPlayer,User,Password) end end,false ) addEvent (onPlayerTryingToLogin*) addEventHandler (*onPlayerTryingToLogin*, source, Login)
-
Hey guys,im a noob which knows only 1% of scripting.I need help with editing freeroam resource,how can i edit it to make the rpg heat seeking rpg and minigun be paid,i mean if i double click on minigun it gives me minigun but takes 50000 money from me?Please help me and thanks