FlorjanMTARP Posted August 13, 2014 Posted August 13, 2014 Client; local gate = createObject(17951, 1556.36, -2348.79, 13.54, 0, 0, 180) local marker = createMarker(1554, -2348.79, 12.54, "cylinder", 2, 255, 255, 255, 255) local garage = createObject(17950, 1560.36, -2348.79, 13.54, 0, 0, 90) function moveGate() if getAccountName(getPlayerAccount(player)) == "Florjan22" then moveObject(gate, 5000, 1556.36, -2348.79, 16.54) end end addEventHandler("onMarkerHit", marker, moveGate) function moveBack() moveObject(gate, 5000, 1556.36, -2348.79, 13.54) end addEventHandler("onMarkerLeave", marker, moveBack) It doesn't move when I enter the marker A complete new RP server is being developed from scratch! http://www.mta-roleplay.com
Et-win Posted August 13, 2014 Posted August 13, 2014 function moveGate() if getAccountName(getPlayerAccount(source)) == "Florjan22" then moveObject(gate, 5000, 1556.36, -2348.79, 16.54) end end addEventHandler("onPlayerMarkerHit", marker, moveGate) EDIT: Changed 'onPlayerMarkerHit' so it only activates when a player enters. In your function you forgot to define 'player' in the function. ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
FlorjanMTARP Posted August 13, 2014 Author Posted August 13, 2014 (edited) EDIT) It still does nothing Edited August 13, 2014 by Guest A complete new RP server is being developed from scratch! http://www.mta-roleplay.com
Et-win Posted August 13, 2014 Posted August 13, 2014 ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
FlorjanMTARP Posted August 13, 2014 Author Posted August 13, 2014 It does nothing doesn't work, I go in marker and I'm logged in and won't work. local gate = createObject(17951, 1556.36, -2348.79, 13.54, 0, 0, 180) local marker = createMarker(1554, -2348.79, 12.54, "cylinder", 2, 255, 255, 255, 255) local garage = createObject(17950, 1560.36, -2348.79, 13.54, 0, 0, 90) function moveGate() if getAccountName(getPlayerAccount(source)) == "Florjan22" then moveObject(gate, 5000, 1556.36, -2348.79, 16.54) end end addEventHandler("onPlayerMarkerHit", marker, moveGate) function moveBack() if getAccountName(getPlayerAccount(source)) == "Florjan22" then moveObject(gate, 5000, 1556.36, -2348.79, 13.54) end end addEventHandler("onPlayerMarkerHit", marker, moveBack) A complete new RP server is being developed from scratch! http://www.mta-roleplay.com
Et-win Posted August 13, 2014 Posted August 13, 2014 Because you are starting both 'moveGate' and 'moveBack' functions when you hit the marker. ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
Max+ Posted August 13, 2014 Posted August 13, 2014 (edited) --serverSide , local gate = createObject(17951, 1556.36, -2348.79, 13.54, 0, 0, 180) local marker = createMarker(1554, -2348.79, 12.54, "cylinder", 2, 255, 255, 255, 255) local garage = createObject(17950, 1560.36, -2348.79, 13.54, 0, 0, 90) addEventHandler ( 'onMarkerHit', marker, function ( hitElement ) if ( getElementType ( hitElement ) == 'player' and not isPedInVehicle ( hitElement )) then if ( getAccountName(getPlayerAccount(hitElement)) == 'Florjan22') then moveObject(gate, 5000, 1556.36, -2348.79, 16.54) end end end ) addEventHandler ( 'onMarkerLeave', marker, function ( LeaveElement ) if ( getElementType ( LeaveElement ) == 'player' and not isPedInVehicle ( LeaveElement )) then if ( getAccountName(getPlayerAccount(LeaveElement)) == 'Florjan22') then moveObject(gate, 5000, 1556.36, -2348.79, 13.54) end end end ) Edited , Edited August 14, 2014 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
FlorjanMTARP Posted August 14, 2014 Author Posted August 14, 2014 It still doesn't go up, neither down. I get in the marker and nothing happens. No errors and stuff. server: local gate = createObject(17951, 1556.36, -2348.79, 13.54, 0, 0, 180) local marker = createMarker(1554, -2348.79, 12.54, "cylinder", 2, 255, 255, 255, 255) local garage = createObject(17950, 1560.36, -2348.79, 13.54, 0, 0, 90) addEventHandler ( 'onPlayerMarkerHit', marker, function ( ) if ( getAccountName(getPlayerAccount(source)) == 'Florjan22') then moveObject(gate, 5000, 1556.36, -2348.79, 16.54) end end ) addEventHandler ( 'onPlayerMarkerLeave', marker, function ( ) if ( getAccountName(getPlayerAccount(source)) == 'Florjan22') then moveObject(gate, 5000, 1556.36, -2348.79, 13.54) end end ) A complete new RP server is being developed from scratch! http://www.mta-roleplay.com
Max+ Posted August 14, 2014 Posted August 14, 2014 It still doesn't go up, neither down. I get in the marker and nothing happens. No errors and stuff.server: local gate = createObject(17951, 1556.36, -2348.79, 13.54, 0, 0, 180) local marker = createMarker(1554, -2348.79, 12.54, "cylinder", 2, 255, 255, 255, 255) local garage = createObject(17950, 1560.36, -2348.79, 13.54, 0, 0, 90) addEventHandler ( 'onPlayerMarkerHit', marker, function ( ) if ( getAccountName(getPlayerAccount(source)) == 'Florjan22') then moveObject(gate, 5000, 1556.36, -2348.79, 16.54) end end ) addEventHandler ( 'onPlayerMarkerLeave', marker, function ( ) if ( getAccountName(getPlayerAccount(source)) == 'Florjan22') then moveObject(gate, 5000, 1556.36, -2348.79, 13.54) end end ) I have Edited My Post , Copy it again , - 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
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