Jack_Miller Posted November 28, 2010 Posted November 28, 2010 Hi guys, im new in scripting and i just want to create a workin PLayer Teleport in the same Interior... But it don't Teleport the Client... Heres my Script, i've tested out many versions... MillerTurmRauf = createMarker ( -1145.0408935547, 714.76519775391, 3.4228067398071, "cylinder", 1, 255, 0, 0 ) MillerTurmRunter = createMarker ( -1137.5888671875, 713.9228515625, 46.747257232666, "cylinder", 1, 255, 0, 0 ) function turmrauf ( player ) if getPedOccupiedVehicle ( player ) == false then setElementPosition ( player, -1137.5888671875, 713.9228515625, 46.747257232666 ) end end addEventHandler ( "onMarkerHit", MillerTurmRauf, turmrauf ) function turmrunter ( player ) if getPedOccupiedVehicle ( player ) == false then setElementPosition ( player, -1145.0408935547, 714.76519775391, 3.4228067398071 ) end end addEventHandler ( "onMarkerHit", MillerTurmRunter, turmrunter ) I hope you can help me with this Problem^^
BinSlayer1 Posted November 28, 2010 Posted November 28, 2010 https://wiki.multitheftauto.com/wiki/OnMarkerHit read up again ^ Your parameter is not neccessarily a player.. It's just an element, hence you'll need an extra check to see if the element is indeed a player.. Change this: if getPedOccupiedVehicle ( player ) == false then To this: if (getElementType(player) == "player") and (isPedInVehicle(player) == false) then
Jack_Miller Posted November 28, 2010 Author Posted November 28, 2010 server side.... 2. question, do i need the (isPedInVehicle(player) == false) ? im right with that if im forget this it will be teleport vehicles, too? or wont it work then cpmpletly?
Jack_Miller Posted November 28, 2010 Author Posted November 28, 2010 But it don't work...i've changed it but...
BinSlayer1 Posted November 28, 2010 Posted November 28, 2010 The script itself works.. (I tested) but what you're doing is send the player to a location where there (exactly there) is ANOTHER marker that would send again the player to the previous marker , this is why it looks like it doesn't work because you get sent back from where u came I believe you should reconsider the x,y,z location of where you want to teleport the player
Jack_Miller Posted November 28, 2010 Author Posted November 28, 2010 It dont work anyway function turmrauf ( player ) if (getElementType(player) == "player") and (isPedInVehicle(player) == false) then setElementPosition ( player, 1140.5888671875, 780.9228515625, 30.747257232666 ) end end addEventHandler ( "onMarkerHit", MillerTurmRauf, turmrauf ) function turmrunter ( player ) if (getElementType(player) == "player") and (isPedInVehicle(player) == false) then setElementPosition ( player, 195.0408935547, 765.76519775391, 8.4228067398071 ) end end addEventHandler ( "onMarkerHit", MillerTurmRunter, turmrunter ) the positions are random now...
BinSlayer1 Posted November 29, 2010 Posted November 29, 2010 is that the full code? You still need createMarker() and is your meta.xml set up right? it needs to have this line:
Jack_Miller Posted November 29, 2010 Author Posted November 29, 2010 the createMarker is in my codeline above...in my first post... and the meta.xml... heres my line to the script_:
BinSlayer1 Posted November 29, 2010 Posted November 29, 2010 https://wiki.multitheftauto.com/wiki/Debugging Use the debugging strategies described in the link above to see what goes wrong
Aibo Posted November 29, 2010 Posted November 29, 2010 https://wiki.multitheftauto.com/wiki/DebuggingUse the debugging strategies described in the link above to see what goes wrong actually, people should use debugging before posting a problem here :3
Jack_Miller Posted November 29, 2010 Author Posted November 29, 2010 It don't work: when i type debugscript 3 in the console: Incorrect client type for this command Info; all tested on ma local server
dzek (varez) Posted November 29, 2010 Posted November 29, 2010 "Incorrect client type for this command" o_O reinstall mta (download it from https://mtasa.com/ dont use another sources), there is something wrong with it.
Jack_Miller Posted November 29, 2010 Author Posted November 29, 2010 Here... When i try to exec it ingame...it dosn't work...acl shit...im in the acl groups, but it dont accept me ingame... <group name="Admin"> <acl name="Moderator" /> <acl name="SuperModerator" /> <acl name="Admin" /> <acl name="RPC" /> <object name="resource.admin" /> <object name="resource.webadmin" /> <object name="user.[GGR]Jack_Miller" /> </group> <group name="Console"> <acl name="Moderator" /> <acl name="SuperModerator" /> <acl name="Admin" /> <acl name="RPC" /> <object name="user.Console" /> <object name="user.[GGR]Jack_Miller" />
dzek (varez) Posted November 29, 2010 Posted November 29, 2010 debugscript is in-game (client) thing, not server.. put yourself only in Admin, not in console! are you sure that "[GGR]Jack_Miller" is your LOGIN. This should be login you use while logging in, NOT nickname
[STM]Metalhero Posted November 29, 2010 Posted November 29, 2010 stupid post have you login with the account or regisertert with [GGR]Jack_Miller
Jack_Miller Posted November 30, 2010 Author Posted November 30, 2010 its on my local server...there are no login or a account system...thats the problem^^
dzek (varez) Posted November 30, 2010 Posted November 30, 2010 just do /register [GGR]Jack_Miller password then /login [GGR]Jack_Miller password
Jack_Miller Posted November 30, 2010 Author Posted November 30, 2010 The Debugger shows no error or something...just nothing... heres the code of the lua again: MillerTurmRauf = createMarker ( -1145.0408935547, 714.76519775391, 3.4228067398071, "cylinder", 1, 255, 0, 0 ) MillerTurmRunter = createMarker ( -1137.5888671875, 713.9228515625, 46.747257232666, "cylinder", 1, 255, 0, 0 ) --[[function turmrauf (player, dim) if getElementType ( player ) == "player" then setElementInterior ( player, 1, -1138.5888671875, 713.9228515625, 46.747257232666 ) end end addEventHandler ("onMarkerHit", MillerTurmRauf, turmrauf) function turmrunter (player, dim) if getElementType ( player ) == "player" then setElementInterior ( player, 1, -1146.0408935547, 714.76519775391, 3.0 ) end end addEventHandler ("onMarkerHit", MillerTurmRunter, turmrunter) function turmrauf ( player, dim ) if dim == true and getPedOccupiedVehicle ( player ) == false then setElementPosition ( player, 894.5888671875, 71.9228515625, 25.747257232666 ) end end addEventHandler ( "onMarkerHit", MillerTurmRauf, turmrauf ) function turmrunter ( player, dim ) if dim == true and getPedOccupiedVehicle ( player ) == false then setElementPosition ( player, 516.0408935547, 780.76519775391, 15.4228067398071 ) end end addEventHandler ( "onMarkerHit", MillerTurmRunter, turmrunter )]] function turmrauf ( player ) if (getElementType(player) == "player") and (isPedInVehicle(player) == false) then setElementPosition ( player, 1140.5888671875, 780.9228515625, 30.747257232666 ) end end addEventHandler ( "onMarkerHit", MillerTurmRauf, turmrauf ) function turmrunter ( player ) if (getElementType(player) == "player") and (isPedInVehicle(player) == false) then setElementPosition ( player, 195.0408935547, 765.76519775391, 8.4228067398071 ) end end addEventHandler ( "onMarkerHit", MillerTurmRunter, turmrunter ) Remember: the first function won't be readed....its just my other version of the script...but it don't work, too... heres the meta.xml: <meta> <info type="map" version="1.0.0" /> <map src="Miller_Island.map" dimension="0" /> <settings> <setting name="#minplayers" value="[ 0 ]" /> <setting name="#maxplayers" value="[ 128 ]" /> <setting name="#gravity" value="[ 0.008000 ]" /> <setting name="#weather" value="[ 0 ]" /> <setting name="#time" value="10:0" /> <setting name="#locked_time" value="[ false ]" /> <setting name="#waveheight" value="[ 0 ]" /> <setting name="#gamespeed" value="[ 1 ]" /> </settings> <script src="MillerTore.lua" type="server" /> <script src="TurmPort.lua" /> </meta>
dzek (varez) Posted November 30, 2010 Posted November 30, 2010 your function comment has NO END. idk if this will trigger syntax error or just IGNORE ALL FUNCTIONS!
Aibo Posted November 30, 2010 Posted November 30, 2010 it ends on line 36, am i wrong? anyway, is you script even runs? do you see your markers? place some output to debug/chat/console in various parts to check is event even triggered or where it stalls. do something.
Jack_Miller Posted November 30, 2010 Author Posted November 30, 2010 (edited) Jap, the end is on line 36 the script itself will be loaded....i see the marker's ingame... Äähm...here, i add a chat output...but no debugscript error or a output, just nothing... function turmrauf ( player ) if (getElementType(player) == "player") and (isPedInVehicle(player) == false) then setElementPosition ( player, 1140.5888671875, 780.9228515625, 30.747257232666 ) outputChatBox ( "lolol", player, 125, 0, 0 ) end end addEventHandler ( "onMarkerHit", MillerTurmRauf, turmrauf ) function turmrunter ( player ) if (getElementType(player) == "player") and (isPedInVehicle(player) == false) then setElementPosition ( player, 195.0408935547, 765.76519775391, 8.4228067398071 ) outputChatBox ( "upupup", player, 125, 0, 0 ) end end addEventHandler ( "onMarkerHit", MillerTurmRunter, turmrunter ) Edited November 30, 2010 by Guest
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