Jump to content

help me


PolGhost

Recommended Posts

Posted

@ Weapon model replace: It's not possible yet, but the function is coming in the next versions of Multi Theft Auto - I am waiting for it aswell.

If I helped you, please click the like button on the right ;) Thanks!

Posted

myonlake, you're outdated, weapon model replacement is already possible.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

-- script.lua:

local weapons = {{fileName="M4", model=356}} 
  
function load() 
    for index, weapon in pairs(weapons) do 
        txd = engineLoadTXD ( weapon.fileName.. ".txd" ) 
        engineImportTXD ( txd, weapon.model ) 
        dff = engineLoadDFF ( weapon.fileName.. ".dff", 0 ) 
        engineReplaceModel ( dff, weapon.model ) 
    end 
end 
  
addEventHandler("onClientResourceStart",resourceRoot, 
function () 
    local version = getVersion() 
    if version.mta == "1.1.1" then 
        setTimer ( load, 1000, 1) 
    end 
end) 

-- meta.xml:

    

NOTICE: To replace a weapon, you must use the WEAPON OBJECT MODEL not the WEAPON MODEL (Ex M4 = 31), but the M4 object model is 356 which is the one you must replace.

You can get the weapon OBJECT MODEL'S from here: https://wiki.multitheftauto.com/wiki/Weapons

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Dude, I gave you the script and the meta.xml... just create a new folder called "weapons" in resources folder at your server, then create two files: script.lua and meta.xml.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

For You Man :D

local weapons = {{fileName="M4", model=356}} 
local weapons = {{fileName="Sniper", model=358}} 
local weapons = {{fileName="Desert Eagle", model=348}} 
local weapons = {{fileName="Shotgun", model=349}} 
function load() 
    for index, weapon in pairs(weapons) do 
        txd = engineLoadTXD ( weapon.fileName.. ".txd" ) 
        engineImportTXD ( txd, weapon.model ) 
        dff = engineLoadDFF ( weapon.fileName.. ".dff", 0 ) 
        engineReplaceModel ( dff, weapon.model ) 
    end 
end 
  
addEventHandler("onClientResourceStart",resourceRoot, 
function () 
    local version = getVersion() 
    if version.mta == "1.1.1" then 
        setTimer ( load, 1000, 1) 
    end 
end) 

Posted
For You Man :D
local weapons = {{fileName="M4", model=356}} 
local weapons = {{fileName="Sniper", model=358}} 
local weapons = {{fileName="Desert Eagle", model=348}} 
local weapons = {{fileName="Shotgun", model=349}} 
function load() 
    for index, weapon in pairs(weapons) do 
        txd = engineLoadTXD ( weapon.fileName.. ".txd" ) 
        engineImportTXD ( txd, weapon.model ) 
        dff = engineLoadDFF ( weapon.fileName.. ".dff", 0 ) 
        engineReplaceModel ( dff, weapon.model ) 
    end 
end 
  
addEventHandler("onClientResourceStart",resourceRoot, 
function () 
    local version = getVersion() 
    if version.mta == "1.1.1" then 
        setTimer ( load, 1000, 1) 
    end 
end) 

Did not work.

Posted

hope it work :D

function xxx () 
outputChatBox ( "> replacing M4 Skin" ) 
  
txd = engineLoadTXD ( "m4.txd" ) 
engineImportTXD ( txd, 31 )---id of the weapon 
dff = engineLoadDFF ( "m4.dff", 31 )-- id of the weapon 
engineReplaceModel ( dff, 31 ) 
  
outputChatBox ( "> replacing Sniper Skin" ) 
  
txd = engineLoadTXD ( "sniper.txd" ) 
engineImportTXD ( txd, 34 ) 
dff = engineLoadDFF ( "sniper.dff", 34 ) 
engineReplaceModel ( dff, 34 ) 
  
outputChatBox ( "> replacing shotgun" ) 
  
txd = engineLoadTXD ( "shotgun.txd" ) 
engineImportTXD ( txd, 25 ) 
dff = engineLoadDFF ( "shotgun.dff", 25 ) 
engineReplaceModel ( dff, 25 ) 
  
outputChatBox ( "> replacing DesertEagle" ) 
  
txd = engineLoadTXD ( "DesertEagle.txd" ) 
engineImportTXD ( txd, 24 ) 
dff = engineLoadDFF ( "DesertEagle.dff", 24 ) 
engineReplaceModel ( dff, 25 ) 
  
addEventHandler( "onClientResourceStart", getRootElement( ),xxx ) 
  

8)

  • MTA Team
Posted
local weapons = { 
   {fileName="M4", model=356},{fileName="Sniper", model=358}, 
   {fileName="Desert Eagle", model=348},{fileName="Shotgun", model=349} 
} 
  
function load() 
    for index, weapon in pairs(weapons) do 
        txd = engineLoadTXD ( weapon.fileName.. ".txd" ) 
        engineImportTXD ( txd, weapon.model ) 
        dff = engineLoadDFF ( weapon.fileName.. ".dff", 0 ) 
        engineReplaceModel ( dff, weapon.model ) 
    end 
end 
  
addEventHandler("onClientResourceStart",resourceRoot, 
function () 
    local version = getVersion() 
    if version.mta == "1.1.1" then 
        setTimer ( load, 1000, 1) 
    end 
end) 

and btw DevPoint, when you said " 8) " all you were showing was that you are a complete fail.

Posted

why this script dont work in my server :/

i put the correct ID.. add to meta.. and idk what happen :/

Actual Nick: [XGN]BorderLine

Actual Clan: XLatino

Actual Status: Staff, Mod Level 1

(BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...