Genius Posted June 4, 2012 Posted June 4, 2012 Bad argument @: addEventHandler[Expected element at argument 2 ] function createpick () if ( source == GUIEditor_Button[1] ) then x, y, z = getElementPosition ( source ) housepick = createPickup( x, y, z, 2, 1273, 1 ) addEventHandler ( "onClientPickupHit", housepick, hitpick ) -- Here is problem end end addEventHandler("onClientGUIClick",root,createpick ) MTA Scripter. If you want scripter PM me and i will accept every job for fair price.
Guest Guest4401 Posted June 4, 2012 Posted June 4, 2012 Try function createpick () if ( source == GUIEditor_Button[1] ) then x, y, z = getElementPosition ( localPlayer ) housepick = createPickup( x, y, z, 2, 1273, 1 ) addEventHandler ( "onClientPickupHit", housepick, hitpick ) end end addEventHandler("onClientGUIClick",root,createpick ) And make sure that hitpick is a function.
Genius Posted June 4, 2012 Author Posted June 4, 2012 Try function createpick () if ( source == GUIEditor_Button[1] ) then x, y, z = getElementPosition ( localPlayer ) housepick = createPickup( x, y, z, 2, 1273, 1 ) addEventHandler ( "onClientPickupHit", housepick, hitpick ) end end addEventHandler("onClientGUIClick",root,createpick ) And make sure that hitpick is a function. I have that function, but its dont work MTA Scripter. If you want scripter PM me and i will accept every job for fair price.
myonlake Posted June 4, 2012 Posted June 4, 2012 function hitpick(player, matchingDimension) if matchingDimension then outputChatBox("You hit a pickup.", player, 0, 255, 0, false) end end addEventHandler("onClientGUIClick", root, function() if source == GUIEditor_Button[1] then local x, y, z = getElementPosition(localPlayer) local housepick = createPickup(x, y, z, 2, 1273, 1) addEventHandler("onClientPickupHit", housepick, hitpick) end end, false ) If I helped you, please click the like button on the right Thanks!
Genius Posted June 4, 2012 Author Posted June 4, 2012 function hitpick(player, matchingDimension) if matchingDimension then outputChatBox("You hit a pickup.", player, 0, 255, 0, false) end end addEventHandler("onClientGUIClick", root, function() if source == GUIEditor_Button[1] then local x, y, z = getElementPosition(localPlayer) local housepick = createPickup(x, y, z, 2, 1273, 1) addEventHandler("onClientPickupHit", housepick, hitpick) end end, false ) Dont work MTA Scripter. If you want scripter PM me and i will accept every job for fair price.
Castillo Posted June 4, 2012 Posted June 4, 2012 What exactly doesn't work? does the pickup get created? P.S: outputChatBox client side has no visibleTo argument. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Genius Posted June 4, 2012 Author Posted June 4, 2012 What exactly doesn't work? does the pickup get created?P.S: outputChatBox client side has no visibleTo argument. Pickup isnt created MTA Scripter. If you want scripter PM me and i will accept every job for fair price.
Castillo Posted June 4, 2012 Posted June 4, 2012 Are you sure that isn't created? because you are creating it in the same position you're standing, so you'll pick it when it get's created. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Genius Posted June 4, 2012 Author Posted June 4, 2012 Are you sure that isn't created? because you are creating it in the same position you're standing, so you'll pick it when it get's created. Yes and pickup will be respawned MTA Scripter. If you want scripter PM me and i will accept every job for fair price.
Castillo Posted June 4, 2012 Posted June 4, 2012 You may be using wrong arguments, does the debugscript say something? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Genius Posted June 5, 2012 Author Posted June 5, 2012 You may be using wrong arguments, does the debugscript say something? Debugscript says nothing MTA Scripter. If you want scripter PM me and i will accept every job for fair price.
Guest Guest4401 Posted June 5, 2012 Posted June 5, 2012 housepick = createPickup( x, y, z, 2, 1273, 1 ) local housepick = createPickup(x, y, z, 2, weaponID, 1273, 1) -- you forgot to write weapon id. https://wiki.multitheftauto.com/wiki/Weapon
Genius Posted June 5, 2012 Author Posted June 5, 2012 local housepick = createPickup(x, y, z, 2, weaponID, 1273, 1) -- you forgot to write weapon id. https://wiki.multitheftauto.com/wiki/Weapon Yes i forgot it my keypad is epic sh it MTA Scripter. If you want scripter PM me and i will accept every job for fair price.
X-SHADOW Posted June 5, 2012 Posted June 5, 2012 Try This , local housepick = createPickup(x, y, z, 2, 31, 1273, 1) function pickup1 () outputChatBox('You Have Picked up the god damn pickup !',255,255,0) end addEventHandler('onClientPickupHit', housepick, pickup1) addEvent('onClientGUIClick', root, function() if ( source == GUIEditor_Button[1] ) then local x, y, z = getElementPosition(source) end end) My ingame nickname : Ops! -DeathMatch GameMode By Ops! : 5%
Alpha Posted June 5, 2012 Posted June 5, 2012 I think he solved it, didn't he? My Resources: [REL] Support System v1.0.2
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