HoLsTeN Posted March 15, 2011 Posted March 15, 2011 hi can any one help me i want to createObject in same player intruor ? I Am HoLsTeN !
proracer Posted March 15, 2011 Posted March 15, 2011 https://wiki.multitheftauto.com/wiki/GetElementInterior https://wiki.multitheftauto.com/wiki/CreateObject
HoLsTeN Posted March 15, 2011 Author Posted March 15, 2011 thanks see this addEvent("buy2", true) addEventHandler("buy2", getRootElement(), function() if ( getPlayerMoney (source) >= 2000 ) then takePlayerMoney(source, 2000) local x,y,z = getElementPosition ( source ) local i = getElementInterior ( source) trolley = createObject (i ,2780, x, y, z, 0, 0, 0 ) outputChatBox(""..getPlayerName(source).." Bought SMoke !", getRootElement(), 0, 255, 0, true) else outputChatBox(" No Money !", source, 255, 0, 0, true) end end ) but it is not work I Am HoLsTeN !
Kenix Posted March 15, 2011 Posted March 15, 2011 thanks see this addEvent("buy2", true) addEventHandler("buy2", getRootElement(), function() if ( getPlayerMoney (source) >= 2000 ) then takePlayerMoney(source, 2000) local x,y,z = getElementPosition ( source ) local i = getElementInterior ( source) trolley = createObject (i ,2780, x, y, z, 0, 0, 0 ) outputChatBox(""..getPlayerName(source).." Bought SMoke !", getRootElement(), 0, 255, 0, true) else outputChatBox(" No Money !", source, 255, 0, 0, true) end end ) but it is not work may be this addEvent("buy2", true) addEventHandler("buy2", getRootElement(), function() if ( getPlayerMoney (source) >= 2000 ) then takePlayerMoney(source, 2000) local x,y,z = getElementPosition ( source ) local trolley1 = getElementInterior ( trolley ) trolley = createObject (2780, x, y, z, 0, 0, 0 ) outputChatBox(""..getPlayerName(source).." Bought SMoke !", getRootElement(), 0, 255, 0, true) else outputChatBox(" No Money !", source, 255, 0, 0, true) end end ) http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
Wojak Posted March 15, 2011 Posted March 15, 2011 (edited) @volk-rus: no comment... @AZOZE: trolley = createObject (i ,2780, x, y, z, 0, 0, 0 ) function createObject expect obiect id as 1 parameter, not interior id... you set interior with this: https://wiki.multitheftauto.com/wiki/SetElementInterior Edited March 15, 2011 by Guest create your teleports and interiors in MTA map editor want more excitment in your race map? - add a killer bot you may also add some peds (NPC) - CARMAGEDDON STYLE! 2paq MTA:SA Race Server
Kenix Posted March 15, 2011 Posted March 15, 2011 @volk-rus: no coment... not understand ? http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
Moderators Citizen Posted March 15, 2011 Moderators Posted March 15, 2011 @volk-rus: no coment... not understand ? He want to set the same interior that the player so where is your setElementInterior ?? @AZOZE: The full code with the setElementInterior: addEvent("buy2", true) addEventHandler("buy2", getRootElement(), function() if ( getPlayerMoney (source) >= 2000 ) then takePlayerMoney(source, 2000) local x,y,z = getElementPosition ( source ) local i = getElementInterior ( source) trolley = createObject (2780, x, y, z, 0, 0, 0 ) setElementInterior( trolley, i ) outputChatBox(""..getPlayerName(source).." Bought SMoke !", getRootElement(), 0, 255, 0, true) else outputChatBox(" No Money !", source, 255, 0, 0, true) end end ) The rEvolution is coming ...
Castillo Posted March 16, 2011 Posted March 16, 2011 thanks see this addEvent("buy2", true) addEventHandler("buy2", getRootElement(), function() if ( getPlayerMoney (source) >= 2000 ) then takePlayerMoney(source, 2000) local x,y,z = getElementPosition ( source ) local i = getElementInterior ( source) trolley = createObject (i ,2780, x, y, z, 0, 0, 0 ) outputChatBox(""..getPlayerName(source).." Bought SMoke !", getRootElement(), 0, 255, 0, true) else outputChatBox(" No Money !", source, 255, 0, 0, true) end end ) but it is not work may be this addEvent("buy2", true) addEventHandler("buy2", getRootElement(), function() if ( getPlayerMoney (source) >= 2000 ) then takePlayerMoney(source, 2000) local x,y,z = getElementPosition ( source ) local trolley1 = getElementInterior ( trolley ) trolley = createObject (2780, x, y, z, 0, 0, 0 ) outputChatBox(""..getPlayerName(source).." Bought SMoke !", getRootElement(), 0, 255, 0, true) else outputChatBox(" No Money !", source, 255, 0, 0, true) end end ) This makes totally no sense... i suposed you learned more San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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