justn Posted February 21, 2014 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 Datastore - Store data to a database quickly. (Useful for saving scripted tables)
Anubhav Posted February 21, 2014 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) See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
Karuzo Posted February 21, 2014 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.
Karuzo Posted February 21, 2014 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.
justn Posted February 21, 2014 Author Posted February 21, 2014 e.e Am I gonna get actual help or what? Datastore - Store data to a database quickly. (Useful for saving scripted tables)
Anubhav Posted February 21, 2014 Posted February 21, 2014 Did you tried my? If it didn't work give me the debugscript 3 errors. See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
justn Posted February 21, 2014 Author 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 Datastore - Store data to a database quickly. (Useful for saving scripted tables)
Saml1er Posted February 21, 2014 Posted February 21, 2014 Your script should work fine. Post your meta.xml code here.
justn Posted February 21, 2014 Author Posted February 21, 2014 Here you go. "Miley Cyrus" description="Twerk" type="script" version="1.3" /> Datastore - Store data to a database quickly. (Useful for saving scripted tables)
Saml1er Posted February 21, 2014 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 )
Anubhav Posted February 21, 2014 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. See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
justn Posted February 21, 2014 Author 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' Datastore - Store data to a database quickly. (Useful for saving scripted tables)
Anubhav Posted February 21, 2014 Posted February 21, 2014 1. You didn't create team that's why its nil. 2. Replace LocalPlayer with localPlayer See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
Saml1er Posted February 21, 2014 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.
Anubhav Posted February 21, 2014 Posted February 21, 2014 Still it got problem which i fixed there. Its not LocalPlayer its localPlayer See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
justn Posted February 21, 2014 Author 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 Datastore - Store data to a database quickly. (Useful for saving scripted tables)
Anubhav Posted February 21, 2014 Posted February 21, 2014 No problem. If you need help you can ask me in PM or post it here:) See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
Saml1er Posted February 21, 2014 Posted February 21, 2014 Still it got problem which i fixed there. Its not LocalPlayer its localPlayer Yeah, its a typo. YOU WIN *sarcasm*
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