Jump to content

Sleeping :D


Multi

Recommended Posts

Welcome.

My problem is that the script is trying to do that as we enter the marker and you're in a car that gives you a Freeze for 1 minute, but it does not work i dont know why.

Debug shows nothing.

and in meta i was do server side and client side and still nothing, help

mojmarker = createMarker (-1984.6114501953, 248.5777130127, 34.171875, 'cylinder', 5, 0, 0, 190) 
  
function spanie() 
if source == mojmarker then 
if isPedInVehicle (player) then 
setPedFrozen ( player, true ) 
setTimer( setPedFrozen, 1000,1, player, false ) 
end 
end 
end 
addEventHandler ("onClientMarkerhit", mojmarker, spanie) 

Link to comment

try

EDIT:

mojmarker = createMarker (-1984.6114501953, 248.5777130127, 34.171875, 'cylinder', 5, 0, 0, 190) 
  
function spanie(player) 
if source == mojmarker then 
if isPedInVehicle (player) then 
setPedFrozen ( player, true ) 
setTimer( setPedFrozen, 1000,1, player, false ) 
end 
end 
end 
addEventHandler ("onClientMarkerhit", mojmarker, spanie) 

Edited by Guest
Link to comment

Try this. (( NOT TESTED ))

mojmarker = createMarker (-1984.6114501953, 248.5777130127, 34.171875, 'cylinder', 5, 0, 0, 190) 
  
function spanie(player) 
if source == mojmarker then 
if isPedInVehicle (player) then 
player = theplayer 
setPedFrozen ( player, true ) 
setTimer( function () setPedFrozen(theplayer,false)end,10000,1 ) 
end 
end 
end 
addEventHandler ("onClientMarkerhit", mojmarker, spanie) 

Link to comment

Try this (untested)

    local mojmarker = createMarker (-1984.6114501953, 248.5777130127, 34.171875, 'cylinder', 5, 0, 0, 190) 
     
    function spanie(player) 
        if source == mojmarker then 
            if isPedInVehicle (player) then 
            setPedFrozen ( player, true ) 
            setElementFrozen(getPedOccupiedVehicle(player),true) 
            setTimer( function ()  
                setPedFrozen(player,false) 
                setElementFrozen(getPedOccupiedVehicle(player),false) 
                end, 
                60000,1 ) --60.000 is one minute 
            end 
        end 
    end 
    addEventHandler ("onClientMarkerhit", resourceRoot, spanie) 

Link to comment
local mojmarker = createMarker ( -1984.6114501953, 248.5777130127, 34.171875, 'cylinder', 5, 0, 0, 190 ) 
  
function spanie ( player ) 
    if ( player == localPlayer ) then 
        if isPedInVehicle ( player ) then 
            setElementFrozen ( getPedOccupiedVehicle ( player ), true ) 
        else 
            setElementFrozen ( player, true ) 
        end 
        setTimer ( 
            function ( ) 
                setElementFrozen ( player, false ) 
                setElementFrozen ( getPedOccupiedVehicle ( player ), false ) 
            end, 
            60000, 1 
        ) 
    end 
end 
addEventHandler ( "onClientMarkerHit", mojmarker, spanie ) 

Link to comment

Solidsnake soryy thats was my false i think that was something with meta but marker works, but can you help me to add 3 functions i know that for you is eas but for me is hard the 3 functions is that the marker Freez Car and Player because now its only Freez Car + if you go to ther marker if the 1 minute will end you teleport you witch car to diffren place ?

Link to comment

Desater thanks, i fix it the meta but i dont know what was wrong :D because the marker was work but the function not.

and can you add a function that if you are in marker and you write /sleep then freezing you and car ?? and if you are not in marker then its text on Chat " you are not in marker"

Link to comment

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