justn Posted February 21, 2014 Share Posted February 21, 2014 (edited) function onResourceStart() if (getPlayerTeam(localPlayer) == "New World Order") then txd = engineLoadTXD ( "infernus.txd" ) engineImportTXD ( txd, 411 ) dff = engineLoadDFF ( "infernus.dff", 411 ) engineReplaceModel ( dff, 411 ) end end addCommandHandler( "infernus", onResourceStart) I want if player in team 'New World order' and he do command, it will give him infernus Edited February 21, 2014 by Guest Link to comment
Anubhav Posted February 21, 2014 Share Posted February 21, 2014 function onResourceStart() if getElementData ( hitElement, "Occupation" ) == "New World Order" then txd = engineLoadTXD ( "infernus.txd" ) engineImportTXD ( txd, 411 ) dff = engineLoadDFF ( "infernus.dff", 411 ) engineReplaceModel ( dff, 411 ) end end addCommandHandler( "infernus", onResourceStart) Link to comment
Karuzo Posted February 21, 2014 Share Posted February 21, 2014 function onResourceStart() if getElementData ( hitElement, "Occupation" ) == "New World Order" then txd = engineLoadTXD ( "infernus.txd" ) engineImportTXD ( txd, 411 ) dff = engineLoadDFF ( "infernus.dff", 411 ) engineReplaceModel ( dff, 411 ) end end addCommandHandler( "infernus", onResourceStart) What ? That doesn't even makes sense. Link to comment
Karuzo Posted February 21, 2014 Share Posted February 21, 2014 function onResourceStart() if getElementData ( hitElement, "Occupation" ) == "New World Order" then txd = engineLoadTXD ( "infernus.txd" ) engineImportTXD ( txd, 411 ) dff = engineLoadDFF ( "infernus.dff", 411 ) engineReplaceModel ( dff, 411 ) end end addCommandHandler( "infernus", onResourceStart) What ? That doesn't even makes sense. Link to comment
justn Posted February 21, 2014 Author Share Posted February 21, 2014 e.e Am I gonna get actual help or what? Link to comment
Anubhav Posted February 21, 2014 Share Posted February 21, 2014 Did you tried my? If it didn't work give me the debugscript 3 errors. Link to comment
justn Posted February 21, 2014 Author Share Posted February 21, 2014 Did you tried my?If it didn't work give me the debugscript 3 errors. You know this has nothing to do with 'Occupations' and stuff right? All I want is if the player is in the team. he will be able to use the command and get a infernus mod Link to comment
Saml1er Posted February 21, 2014 Share Posted February 21, 2014 Your script should work fine. Post your meta.xml code here. Link to comment
justn Posted February 21, 2014 Author Share Posted February 21, 2014 Here you go. "Miley Cyrus" description="Twerk" type="script" version="1.3" /> Link to comment
Saml1er Posted February 21, 2014 Share Posted February 21, 2014 Here you go. "Miley Cyrus" description="Twerk" type="script" version="1.3" /> Got the problem getTeamName addCommandHandler( "infernus", function () if getTeamName(getPlayerTeam(LocalPlayer)) == "New World Order") then txd = engineLoadTXD ( "infernus.txd" ) engineImportTXD ( txd, 411 ) dff = engineLoadDFF ( "infernus.dff", 411 ) engineReplaceModel ( dff, 411 ) end end ) Link to comment
Anubhav Posted February 21, 2014 Share Posted February 21, 2014 Saml1er you have mistake in your script. addCommandHandler( "infernus", function () if (getTeamName(getPlayerTeam(LocalPlayer)) == "New World Order") then txd = engineLoadTXD ( "infernus.txd" ) engineImportTXD ( txd, 411 ) dff = engineLoadDFF ( "infernus.dff", 411 ) engineReplaceModel ( dff, 411 ) end end ) You forget to add this ( before getTeamName. Link to comment
justn Posted February 21, 2014 Author Share Posted February 21, 2014 Got 2 errors in debugscript. WARNING: Infernus/client.lua:3: Bad argument @ 'getPlayerTeam' [Expected player at argument 1, got nil] WARNING: Infernus/client.lua:3: Bad argument @ 'getTeamName' Link to comment
Anubhav Posted February 21, 2014 Share Posted February 21, 2014 1. You didn't create team that's why its nil. 2. Replace LocalPlayer with localPlayer Link to comment
Saml1er Posted February 21, 2014 Share Posted February 21, 2014 Saml1er you have mistake in your script. addCommandHandler( "infernus", function () if (getTeamName(getPlayerTeam(LocalPlayer)) == "New World Order") then txd = engineLoadTXD ( "infernus.txd" ) engineImportTXD ( txd, 411 ) dff = engineLoadDFF ( "infernus.dff", 411 ) engineReplaceModel ( dff, 411 ) end end ) You forget to add this ( before getTeamName. I removed brackets because I don't like to use unnecessary crap in script. Brackets is not a requirement in such cases. Brackets are compulsory for tables, event handlers, command handlers and functions and when calling them. Test this script, you'll see it works. Link to comment
Anubhav Posted February 21, 2014 Share Posted February 21, 2014 Still it got problem which i fixed there. Its not LocalPlayer its localPlayer Link to comment
justn Posted February 21, 2014 Author Share Posted February 21, 2014 1. You didn't create team that's why its nil.2. Replace LocalPlayer with localPlayer Lol I was in the team and thanks ! I replaced LocalPlayer with localPlayer and it worked, thanks to you and sam1ler <3 I appreciate the help Link to comment
Anubhav Posted February 21, 2014 Share Posted February 21, 2014 No problem. If you need help you can ask me in PM or post it here:) Link to comment
Saml1er Posted February 21, 2014 Share Posted February 21, 2014 Still it got problem which i fixed there. Its not LocalPlayer its localPlayer Yeah, its a typo. YOU WIN *sarcasm* Link to comment
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