tim260 Posted September 29, 2011 Posted September 29, 2011 first off can someone see what wrong to the code below so thats the first question function createTeamsOnStart () teamPolice = createTeam ( "Police", 0, 0, 255 ) teamRobber = createTeam ( "Robber", 255, 0, 0 ) teamMechanics = createTeam ( "Mechanics", 0, 255, 0 ) teamWhores = createTeam ( "Whores", 255, 0, 255 ) teamPilot = createTeam ( "Pilot", 255, 255, 0 ) teamTruker = createTeam ( "Trucker", 192, 192, 192 ) teamNubcaker = createTeam ( "Nubcaker INC.", 192, 192, 192 ) teamDealers = createTeam ( "Dealers", 255, 0, 0 ) teamMilitary = createTeam ( "Military", 0, 255, 0 ) teamNaval = createTeam ( "Naval", 0, 255, 0 ) teamSecurity = createTeam ( "Security", 0, 255, 0 ) teamSecurity = createTeam ( "investors", 255, 255, 0 ) teamGuests = createTeam ( "Guests", 255, 255, 0 ) end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), createTeamsOnStart ) Second question, Is it possible to replace weapons i tried it with the engineLoadDFF engineLoadTXD but it didnt work so can someone explain it to me.
bandi94 Posted September 29, 2011 Posted September 29, 2011 can you tell what error you get in the team script (use /debugscript 3)
Castillo Posted September 29, 2011 Posted September 29, 2011 1): Check if your meta.xml in the script of teams is type="server". 2): Use this: function load() txd = engineLoadTXD ("m4.txd" ) engineImportTXD ( txd, 356 ) dff = engineLoadDFF ( "m4.dff", 0 ) engineReplaceModel ( dff, 356 ) end addEventHandler("onClientResourceStart",resourceRoot, function () local version = getVersion() if string.find(version.mta, "1.1.1") then setTimer ( load, 1000, 1) end end) The script for weapon replacement must be type="client" in meta.xml. You can only replace weapons, skin models in MTA 1.1.1, not 1.1.
tim260 Posted September 29, 2011 Author Posted September 29, 2011 Thanks solid snake the create teams works ( i should have someone like you in my team for the server LOl ) , but the weapon replacement isnt working
Castillo Posted September 30, 2011 Posted September 30, 2011 I'm guessing you changed the weapon model, file name(s), right? Post your new script + meta.xml of it.
tim260 Posted September 30, 2011 Author Posted September 30, 2011 Yes i changed it ;p function load() txd = engineLoadTXD("gun.txd", 31 ) engineImportTXD(txd, 31) dff = engineLoadDFF("gun.dff", 31 ) engineReplaceModel(dff, 31) end addEventHandler("onClientResourceStart",resourceRoot, function () local version = getVersion() if string.find(version.mta, "1.1.1") then setTimer ( load, 1000, 1) end end) type="script" version="1.0" author="tim"/>
Castillo Posted September 30, 2011 Posted September 30, 2011 See? you changed my script, you didn't read how it worked. You must use the weapon OBJECT model ID's not the weapon model ID. You can find weapon OBJECT model in this link: https://wiki.multitheftauto.com/wiki/Weapons -- client.lua function load() txd = engineLoadTXD("gun.txd", 356 ) engineImportTXD(txd, 356) dff = engineLoadDFF("gun.dff", 0 ) -- IT HAS TO BE 0 IF NOT REPLACING A VEHICLE. engineReplaceModel(dff, 356) end addEventHandler("onClientResourceStart",resourceRoot, function () local version = getVersion() if string.find(version.mta, "1.1.1") then setTimer ( load, 1000, 1) end end) -- meta.xml: type="script" version="1.0" author="tim"/>
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now