HoLsTeN Posted January 27, 2013 Share Posted January 27, 2013 (edited) hello i have problem here my problem in trigger i don't post the full script because i'm scare to stole my idea i just post example for what i want to do Client pc1 = createColSphere(482.31958, -23.93058 ,1003.10938,0.5) pc2 = createColSphere(483.46457, -24.80609 ,1003.10938,0.5) function ClubBind( theElement ) if ( theElement == getLocalPlayer() ) then if source == pc1 then WTF = "pc1" bindKey("action", "down", SitAtChair,WTF) outputChatBox(WTF,255,0,0) elseif source == pc2 then WTF = "pc2" bindKey("action", "down", SitAtChair,WTF) outputChatBox(WTF,255,0,0) end end end addEventHandler( "onClientColShapeHit", getRootElement(), ClubBind ) function SitAtChair(WTF) triggerServerEvent ("SitForm", getLocalPlayer() , WTF) end server addEvent("SitForm", true) addEventHandler("SitForm", rootElement, function(WTF) if WTF == pc1 then outputChatBox("pc1",255,0,0) elseif WTF == pc2 then outputChatBox("pc2",255,0,0) end end ) sorry for my poor English .. Edited January 27, 2013 by Guest Link to comment
Castillo Posted January 27, 2013 Share Posted January 27, 2013 You're checking if "WTF" is equal to pc1, not to "pc1". Link to comment
HoLsTeN Posted January 27, 2013 Author Share Posted January 27, 2013 if i remove the string == same problem .. it is output at Chat Box WTF == action how is that ? Link to comment
Castillo Posted January 27, 2013 Share Posted January 27, 2013 addEvent ( "SitForm", true ) addEventHandler ( "SitForm", root, function ( WTF ) if ( WTF == "pc1" ) then outputChatBox ( "pc1", 255, 0, 0 ) elseif ( WTF == "pc2" ) then outputChatBox ( "pc2", 255, 0, 0 ) end end ) Link to comment
HoLsTeN Posted January 27, 2013 Author Share Posted January 27, 2013 the problem was in function SitAtChair(ChairNmr) change it to function SitAtChair(_,_,ChairNmr) thank you anyway Link to comment
Castillo Posted January 27, 2013 Share Posted January 27, 2013 Oh, I actually didn't notice you were using bindKey. 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