Jack_Miller Posted December 1, 2010 Author Share Posted December 1, 2010 Why nobody can helps me with such a simple script? @BinSlayer1 you tested it right? but now there are other locations where the player will be teleport to...the coordinates are random choosed...what is the problem?^^ there must be a solution... Again: - Markers will be created (script will be loaded...) - Player will be teleported - Nope - gives a Chat output - Nope - debugscript show a error or warning or shice like that? - Nope... So the fail must be inside the function, right? Its not a scripting failure, because debugscript accept it... Maybe we should think about the: if (getElementType(player) == "player") and (isPedInVehicle(player) == false) then Link to comment
BinSlayer1 Posted December 1, 2010 Share Posted December 1, 2010 Just make a new resource, call it 'test' Put the following code in a test.lua file MillerTurmRauf = createMarker ( 0, 15, 4, "cylinder", 1, 255, 0, 0 ) MillerTurmRunter = createMarker ( 0, 0, 4, "cylinder", 1, 255, 0, 0 ) function turmrauf ( player ) if (getElementType(player) == "player") and (isPedInVehicle(player) == false) then setElementPosition ( player, 10, 0, 4 ) end end addEventHandler ( "onMarkerHit", MillerTurmRauf, turmrauf ) function turmrunter ( player ) if (getElementType(player) == "player") and (isPedInVehicle(player) == false) then setElementPosition ( player, 10, 15, 4 ) end end addEventHandler ( "onMarkerHit", MillerTurmRunter, turmrunter ) create a file called meta.xml and put the following in it: <meta> <script src="test.lua" /> </meta> Run the 'play' gamemode. Go to coordinates 0,0,0 You should see 2 markers nearby Test each of them out.. Then adjust the script to your needs.. But don't put the same x,y,z location from the markers to the setElementPosition argument PS: I tested the code and it works Link to comment
Aibo Posted December 1, 2010 Share Posted December 1, 2010 help yourself: test if event triggered, and that doesnt mean putting chat output near setElementPosition. if you have problems with such simple script (because others have even tested it and it works) — something is wrong on your side, and noone here can say with 100% certainty what exactly. Link to comment
Jack_Miller Posted December 1, 2010 Author Share Posted December 1, 2010 BinSlayer1, IT WORKS, HOLY F****** SHIT this fuck resource crashed my script....ohr yeah, nice... thanks to all who (tried) to help me 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