Jump to content

Need Help: Player Teleport!


Jack_Miller

Recommended Posts

Posted

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^^

blue2.png
Posted

is this server side or client side?

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

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? :D

blue2.png
Posted

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 xD

I believe you should reconsider the x,y,z location of where you want to teleport the player

Posted

It dont work anyway :o

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...

blue2.png
Posted

"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.

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

q9wgzhwc4icx.jpg

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" /> 

blue2.png
Posted

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

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

just do

/register [GGR]Jack_Miller password

then

/login [GGR]Jack_Miller password

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

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> 

blue2.png
Posted

your function comment has NO END. idk if this will trigger syntax error or just IGNORE ALL FUNCTIONS!

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

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.

?

Posted (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 by Guest
blue2.png
Posted

uh, right, im blind o_O

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...