iFoReX Posted April 8, 2012 Posted April 8, 2012 why the setElementPosition is bad ? local money = getPlayerMoney ( source ) local name = getPlayerName ( source ) if name == "ElMota[Gold]~x" then setElementPosition( source, -1960.53528, 127.29656, 27.68750 ) else if ( money >= 10000 ) then takePlayerMoney ( source, 10000 ) setElementPosition( source, -1960.53528, 127.29656, 27.68750 ) else outputChatBox ( "No Tienes Suficiente Dinero", source ) end end end addEvent( "qd2", true ) addEventHandler( "qd2", getRootElement(), qm2 ) local table = {{2851.87793, 1290.40491, 11.39063},{1433.50720, 2620.47266, 11.39261}} -- Una tabla con diferentes modelos de vehiculos. function qm4 ( ) local money = getPlayerMoney ( source ) local name = getPlayerName ( source ) if name == "ElMota[Gold]~x" then setElementPosition ( source, table[ math.random ( #table ) ] ) else if ( money >= 10000 ) then takePlayerMoney ( source, 10000 ) setElementPosition ( source, table[ math.random ( #table ) ] ) else outputChatBox ( "No Tienes Suficiente Dinero", source ) end end end addEvent( "qd4", true ) addEventHandler( "qd4", getRootElement(), qm4 ) addEventHandler("onResourceStart",Vehiculocrear) function qm3 ( ) local money = getPlayerMoney ( source ) local name = getPlayerName ( source ) if name == "ElMota[Gold]~x" then setElementPosition( source, 1056.44568, -2724.47437, 8.48407 ) else if ( money >= 10000 ) then takePlayerMoney ( source, 10000 ) setElementPosition( source, 1056.44568, -2724.47437, 8.48407 ) else outputChatBox ( "No Tienes Suficiente Dinero", source ) end end end addEvent( "qd3", true ) addEventHandler( "qd3", getRootElement(), qm3 ) elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
Jaysds1 Posted April 8, 2012 Posted April 8, 2012 Sorry, What lua editor are you using? My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
iFoReX Posted April 8, 2012 Author Posted April 8, 2012 the LuaEdit but u can say me what is bad ? please elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
Guest Guest4401 Posted April 8, 2012 Posted April 8, 2012 (edited) Because in your case, the 2nd argument in setElementPosition is a table. It's not unpacking the x,y,z positions as you're trying to do. EDIT : There are a lot of other basic errors too, you must try to fix those first. (No offense) Edited April 8, 2012 by Guest4401
iFoReX Posted April 8, 2012 Author Posted April 8, 2012 ando how I can unpack ? elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
Jaysds1 Posted April 8, 2012 Posted April 8, 2012 You have addEventHandler("onResourceStart",Vehiculocrear) Which triggers nothing... EDIT: parameters = unpack(Table) in your case, you use: x,y,z = unpack(Table[math.random(#Table)]) try this: addEvent( "qd2", true ) addEventHandler( "qd2", root,function() local money = getPlayerMoney ( source ) local name = getPlayerName ( source ) if name == "ElMota[Gold]~x" then setElementPosition( source, -1960.53528, 127.29656, 27.68750 ) else if ( money >= 10000 ) then takePlayerMoney ( source, 10000 ) setElementPosition( source, -1960.53528, 127.29656, 27.68750 ) else outputChatBox ( "No Tienes Suficiente Dinero", source ) end end end) local table = {{2851.87793, 1290.40491, 11.39063},{1433.50720, 2620.47266, 11.39261}} -- Una tabla con diferentes modelos de vehiculos. addEvent( "qd4", true ) addEventHandler( "qd4", root,function() local money = getPlayerMoney ( source ) local name = getPlayerName ( source ) if name == "ElMota[Gold]~x" then setElementPosition ( source, table[ math.random ( #table ) ] ) else if ( money >= 10000 ) then takePlayerMoney ( source, 10000 ) x,y,z = unpack(table[math.random(#table)]) setElementPosition ( source, x,y,z) else outputChatBox ( "No Tienes Suficiente Dinero", source ) end end end) addEventHandler("onResourceStart",resourceRoot,Vehiculocrear) addEvent( "qd3", true ) addEventHandler( "qd3", root,function() local money = getPlayerMoney ( source ) local name = getPlayerName ( source ) if name == "ElMota[Gold]~x" then setElementPosition( source, 1056.44568, -2724.47437, 8.48407 ) else if ( money >= 10000 ) then takePlayerMoney ( source, 10000 ) setElementPosition( source, 1056.44568, -2724.47437, 8.48407 ) else outputChatBox ( "No Tienes Suficiente Dinero", source ) end end end) My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
iFoReX Posted April 8, 2012 Author Posted April 8, 2012 ?? local table = {{2851.87793, 1290.40491, 11.39063},{1433.50720, 2620.47266, 11.39261}} -- Una tabla con diferentes modelos de vehiculos. function qm4 ( ) local money = getPlayerMoney ( source ) local name = getPlayerName ( source ) if name == "ElMota[Gold]~x" then setElementPosition ( source, unpack(table)table[ math.random ( #table ) ] ) else if ( money >= 10000 ) then takePlayerMoney ( source, 10000 ) setElementPosition ( source, unpack(table)table[ math.random ( #table ) ] ) else outputChatBox ( "No Tienes Suficiente Dinero", source ) end end end addEvent( "qd4", true ) addEventHandler( "qd4", getRootElement(), qm4 ) elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
Jaysds1 Posted April 8, 2012 Posted April 8, 2012 no, like this: local table = {{2851.87793, 1290.40491, 11.39063},{1433.50720, 2620.47266, 11.39261}} -- Una tabla con diferentes modelos de vehiculos. addEvent( "qd4", true ) addEventHandler( "qd4", root,function() local money = getPlayerMoney ( source ) local name = getPlayerName ( source ) local x,y,z = unpack(table[math.random(#table)]) if name == "ElMota[Gold]~x" then setElementPosition ( source,x,y,z ) else if ( money >= 10000 ) then takePlayerMoney ( source, 10000 ) setElementPosition ( source, x,y,z) else outputChatBox ( "No Tienes Suficiente Dinero", source ) end end end) My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
iFoReX Posted April 8, 2012 Author Posted April 8, 2012 thnx man now work to 100% and why u ask me what lua editor I used? elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
Jaysds1 Posted April 8, 2012 Posted April 8, 2012 thnx man now work to 100% and why u ask me what lua editor I used? I suggest using Notepad++, is that lua editor from MTA it self? My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
iFoReX Posted April 8, 2012 Author Posted April 8, 2012 what is the better lua editor ? elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
Jaysds1 Posted April 8, 2012 Posted April 8, 2012 Notepad++, You can organize your script and you can get help for some of the functions. My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
drk Posted April 8, 2012 Posted April 8, 2012 Use MTA Script Editor from 50p. It have some bugs, but it's better than Notepad++ EPT Team Server Development: 0% Learning C++ | C++ is amazing
Jaysds1 Posted April 8, 2012 Posted April 8, 2012 Use MTA Script Editor from 50p. It have some bugs, but it's better than Notepad++ Well, it needs to be updated right now. My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
iFoReX Posted April 8, 2012 Author Posted April 8, 2012 @offtopic : what tool in MTA Script Editor is better than notepad ? elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
Jaysds1 Posted April 8, 2012 Posted April 8, 2012 Well, MTA Script Editor shows has everything you need to make a resource/script, but needs to be updated. My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
iFoReX Posted April 8, 2012 Author Posted April 8, 2012 ok man , now How I can do a script for fugitives What functions I need ? elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
Jaysds1 Posted April 8, 2012 Posted April 8, 2012 ok man , now How I can do a script for fugitives What functions I need ? like criminals? It depends on what you want? My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
iFoReX Posted April 8, 2012 Author Posted April 8, 2012 I want when theKiller had 6 stars in wanted level appear a blip in he and appear in chatbox to all the manhunt and the player to kill and the money, and if he again kill to RandomPlayer he when stop the manhunt give more money, if a RandomPlayer kill to theKiller giveMoney 10000 elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
Jaysds1 Posted April 8, 2012 Posted April 8, 2012 try these: setPlayerWantedLevel() getPlayerWantedLevel() outputChatBox() createBlipAttachedTo() My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
Kenix Posted April 8, 2012 Posted April 8, 2012 addEventHandler("onResourceStart",Vehiculocrear) omg ... I did give you links for learning, but you not want learn. Ok http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
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