#Al-Ha[J]aRii Posted February 23, 2013 Posted February 23, 2013 hi all what wrong with this script it's for window button Lock-Unlock addEventHandler( "onClientGUIClick", root, function () if ( source == Lock-UnLock ) then local playervehicle = getPedOccupiedVehicle ( thePlayer ) if playervehicle then setVehicleLocked ( playervehicle, true ) outputChatBox ( "Your Vehicle Lock !",255, 0, 0, true ) else setVehicleLocked ( playervehicle, false ) outputChatBox ( " Your Vehicle UnLock !",255, 0, 0, true ) end end end )
Jaysds1 Posted February 23, 2013 Posted February 23, 2013 Is this the full script??? Because the Lock-Unlock isn't defined!
Baseplate Posted February 23, 2013 Posted February 23, 2013 Lock-Unlock is a gui button, show us the gui script
Max+ Posted February 23, 2013 Posted February 23, 2013 (edited) Edited Thank's Fhoode addEventHandler( "onClientGUIClick", root, function () if ( source == Lock-UnLock ) then if (isPedInVehicle ) then local playervehicle = getPedOccupiedVehicle(localPlayer) if(isVehicleLocked ( playervehicle )) then setVehicleLocked ( playervehicle, false ) outputChatBox ( "Your Vehicle UnLocked !",255, 0, 0, true ) else setVehicleLocked ( playervehicle, true ) outputChatBox( " Your Vehicle Locked !", 255, 0, 0 , true) end end end end ) Edited February 23, 2013 by Guest
#Al-Ha[J]aRii Posted February 23, 2013 Author Posted February 23, 2013 Is this the full script???Because the Lock-Unlock isn't defined! it's for panel in button Lock-Unlock this is not full of the my script just the code lock unlock Car
iPrestege Posted February 23, 2013 Posted February 23, 2013 If You Use - Syntax The Script Won't Work And The Code Isn't Right .
Max+ Posted February 23, 2013 Posted February 23, 2013 If You Use - Syntax The Script Won't Work And The Code Isn't Right . if you use - as a Button Name well say error But if You Use it in onClientGUIClick wont say anyting
Baseplate Posted February 23, 2013 Posted February 23, 2013 addEventHandler( "onClientGUIClick", Lock-UnLock, function () local vehicle = getPedOccupiedVehicle(localPlayer) setVehicleLocked ( vehicle, true ) outputChatBox ( "Your Vehicle Lock !",255, 0, 0, true ) else setVehicleLocked ( vehicle, false ) outputChatBox ( "Your Vehicle unLock !",255, 0, 0, true ) end )
iPrestege Posted February 23, 2013 Posted February 23, 2013 If You Use - Syntax The Script Won't Work And The Code Isn't Right . if you use - as a Button Name well say error But if You Use it in onClientGUIClick wont say anyting Yes That's Right @ Max Also You're Script Won't Open The Vehilce After Locked It You Should To Check if isVehicleLocked or Not .
Max+ Posted February 23, 2013 Posted February 23, 2013 addEventHandler( "onClientGUIClick", Lock-UnLock, function () local vehicle = getPedOccupiedVehicle(localPlayer) setVehicleLocked ( vehicle, true ) outputChatBox ( "Your Vehicle Lock !",255, 0, 0, true ) else setVehicleLocked ( vehicle, false ) outputChatBox ( "Your Vehicle unLock !",255, 0, 0, true ) end ) Samer shortcut for it
Jaysds1 Posted February 23, 2013 Posted February 23, 2013 (edited) try this: addEventHandler( "onClientGUIClick",guiRoot,function() if ( source == Lock-UnLock ) then local playervehicle = getPedOccupiedVehicle (localPlayer) if playervehicle then if isVehicleLocked(playervehicle) then setVehicleLocked ( playervehicle, false ) outputChatBox ( " Your Vehicle UnLock !",255, 0, 0, true ) else setVehicleLocked ( playervehicle, true ) outputChatBox ( "Your Vehicle Lock !",255, 0, 0, true ) end else outputChatBox("Sorry, but you aren't in a vehicle!",255,0,0,true) end end end) Edited February 23, 2013 by Guest
#Al-Ha[J]aRii Posted February 23, 2013 Author Posted February 23, 2013 addEventHandler( "onClientGUIClick", Lock-UnLock, function () local vehicle = getPedOccupiedVehicle(localPlayer) setVehicleLocked ( vehicle, true ) outputChatBox ( "Your Vehicle Lock !",255, 0, 0, true ) else setVehicleLocked ( vehicle, false ) outputChatBox ( "Your Vehicle unLock !",255, 0, 0, true ) end ) lol ur code wrong samer thanx max and all
#Al-Ha[J]aRii Posted February 23, 2013 Author Posted February 23, 2013 How come?? did you test it? yea go check it in MTA Script editor there wrong in him
Max+ Posted February 23, 2013 Posted February 23, 2013 Samer i think because you forget this Part if vehicle then --Code And Jaysd1 it's Alredy sloved .
iPrestege Posted February 23, 2013 Posted February 23, 2013 Jaysd1 Script Should Work But You Should To Be in A Vehicle To Un-Lock it !
Max+ Posted February 23, 2013 Posted February 23, 2013 Mr.Pres[T]ege My Script Worked But it's Stupied if you lock it and out and want to get in car you cant lol
Jaysds1 Posted February 23, 2013 Posted February 23, 2013 ok, the problem is already solved, it's done!
iPrestege Posted February 23, 2013 Posted February 23, 2013 ok, the problem is already solved, it's done! No it,s not you know why? Becuase if he wasn't on the vehicle the vehicle won't open again ^ .
Max+ Posted February 23, 2013 Posted February 23, 2013 Yeah Tha'ts Right He Should make an bind key or you know what i will make it right now .
iPrestege Posted February 23, 2013 Posted February 23, 2013 Yeah Tha'ts Right He Should make an bind key or you know what i will make it right now . You're Script Also Have The Same Fu Ck Ing Problem ^^
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