#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 ) Try a little harder to be a little better I Can Made To You Any Script For $ Skype : alhajarii-mtasa
Jaysds1 Posted February 23, 2013 Posted February 23, 2013 Is this the full script??? Because the Lock-Unlock isn't defined! 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/
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 - New , Kill System - New, GameMode Intro - Leve / Exp System - New nametag showing style - New , Hud For Players - Skin Selection from SA-MP - Money System / Buy Weapons - Drop Weapons - New, Flood System - New , Group Assign - Gun license For Weapons - Random Rule System For Money
#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 Try a little harder to be a little better I Can Made To You Any Script For $ Skype : alhajarii-mtasa
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 - New , Kill System - New, GameMode Intro - Leve / Exp System - New nametag showing style - New , Hud For Players - Skin Selection from SA-MP - Money System / Buy Weapons - Drop Weapons - New, Flood System - New , Group Assign - Gun license For Weapons - Random Rule System For Money
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 - New , Kill System - New, GameMode Intro - Leve / Exp System - New nametag showing style - New , Hud For Players - Skin Selection from SA-MP - Money System / Buy Weapons - Drop Weapons - New, Flood System - New , Group Assign - Gun license For Weapons - Random Rule System For Money
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 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/
#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 Try a little harder to be a little better I Can Made To You Any Script For $ Skype : alhajarii-mtasa
Max+ Posted February 23, 2013 Posted February 23, 2013 Your Welcome Dont Forget to Copy My Last Post - New , Kill System - New, GameMode Intro - Leve / Exp System - New nametag showing style - New , Hud For Players - Skin Selection from SA-MP - Money System / Buy Weapons - Drop Weapons - New, Flood System - New , Group Assign - Gun license For Weapons - Random Rule System For Money
#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 Try a little harder to be a little better I Can Made To You Any Script For $ Skype : alhajarii-mtasa
Jaysds1 Posted February 23, 2013 Posted February 23, 2013 Try my script I posted! 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/
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 . - New , Kill System - New, GameMode Intro - Leve / Exp System - New nametag showing style - New , Hud For Players - Skin Selection from SA-MP - Money System / Buy Weapons - Drop Weapons - New, Flood System - New , Group Assign - Gun license For Weapons - Random Rule System For Money
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 - New , Kill System - New, GameMode Intro - Leve / Exp System - New nametag showing style - New , Hud For Players - Skin Selection from SA-MP - Money System / Buy Weapons - Drop Weapons - New, Flood System - New , Group Assign - Gun license For Weapons - Random Rule System For Money
Jaysds1 Posted February 23, 2013 Posted February 23, 2013 ok, the problem is already solved, it's done! 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/
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 . - New , Kill System - New, GameMode Intro - Leve / Exp System - New nametag showing style - New , Hud For Players - Skin Selection from SA-MP - Money System / Buy Weapons - Drop Weapons - New, Flood System - New , Group Assign - Gun license For Weapons - Random Rule System For Money
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