Jump to content

Sleeping :D


Multi

Recommended Posts

Posted

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) 

Posted (edited)

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

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

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) 

It's fine to celebrate success but it is more important to heed the lessons of failure.

Posted

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) 

Posted
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 ) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Have you set the script as client side in the meta.xml?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

I found the problem, it had a typo on the event name, instead of "onClientMarkerHit" it was "onClientMarkerhit", lowercause "h".

Copy my code again.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

It works on my server, so it has to work on yours.

Post your .lua script and the meta.xml.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

He want on Marker Hit ...

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

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 ?

Posted

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"

Posted

You must use the following functions:

addCommandHandler 
getElementColShape 
isElementWithinColShape 
outputChatBox 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Why don't you try to do it?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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