Jump to content

Help with localPlayer


Recommended Posts

Posted

Hello, i've created a tower for my server,

I created a gate marker but, when a source hit the marker all player are teleported to the player in the marker and go inside the gate.

It's client side (not full codes):

addEventHandler ( "onClientMarkerHit", root, 
    function ( ) 
        if not isPedInVehicle ( localPlayer ) then 
            if source == enter then 
               setElementInterior ( localPlayer, 1 ) 
               setElementPosition ( localPlayer, 2233.845703125, 1710.0625, 1011.0922851563 ) 
               outputChatBox ( "* welcome to Drrb's Tower", 255, 255, 0 ) 

Also all markers exactly have problem like this.

To Visit Us

Press Here: mtasa://5.9.206.180:22002

b648040241b8f01.png

0d0a7bb38ca13e5.png

Posted
addEventHandler ( "onClientMarkerHit", root,  
    function ( hitElement )  
        if hitElement == localPlayer and not isPedInVehicle ( localPlayer ) then  
            -- the rest of your code wich I was too lazy to copy 
  

Owner of [HUN]Magyar Play Szerver 1.4, IP: 31.220.43.153:22003

Posted
No't working.

It should work, if you put mine and your code well together and you don't have any other problems.

Owner of [HUN]Magyar Play Szerver 1.4, IP: 31.220.43.153:22003

Posted
addEventHandler ( "onClientMarkerHit", root, 
    function ( ) 
        if not isPedInVehicle ( localPlayer ) == 1 then 
            if source == 1 then 
               setElementInterior ( localPlayer, 1 ) 
               setElementDimension ( localPlayer, 0 ) 
               setElementPosition ( localPlayer, 2233.845703125, 1710.0625, 1011.0922851563 ) 
               outputChatBox ( "* welcome to Drrb's Tower", 255, 255, 0 ) 

I've noticed you haven't set a dimension...

setElementDimension ( localPlayer, 0 ) <-- Change the 0 value to whatever dimension you're TPing to

No nudity in signatures -Moderators

( . ) ( . ) <-- Breasts or eyes, use your imagination. Wowzas *childish giggle*

Posted

The fck InVision? O_O"

if source == 1 then 

You should explain that to me...

anyway try this;

addEventHandler ( "onClientMarkerHit", root, 
    function ( hitElement ) 
        if ( isPedInVehicle ( getLocalPlayer() ) ) then return; end 
        if not ( getElementType( hitElement ) == "player" ) then return; end -- just to be sure! 
        if ( source == and hitElement == getLocalPlayer() ) then 
            setElementInterior ( getLocalPlayer(), 1 ); 
            setElementDimension ( getLocalPlayer(), 0 ); 
            setElementPosition ( getLocalPlayer() , 2233.845703125, 1710.0625, 1011.0922851563 ); 
            outputChatBox ( "* welcome to Drrb's Tower", 255, 255, 0 ) 
        end 
    end 
); 

logo-small.png?v=3 tiny-sapdfr.png

 

If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]

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