Jump to content

Problem with freezing player


Michcio

Recommended Posts

Posted

I have problem with freezing player.

function wypadek (loss) 
    local gracz = getVehicleOccupant(source) 
    if(gracz) then 
        if loss >= 100 then 
            if countPlayersInTeam(getTeamFromName("Pogotowie")) == 0 then 
            outputChatBox("***| Masz wypadek! Aktualnie nie ma lekarzy na serwerze! Za 20 sekund sam się ockniesz! |***", gracz, 255,255,255,true) 
            setElementFrozen(gracz,true) 
            setTimer(unfreeze,20000,1,gracz,false) 
            else 
            outputChatBox("***| Masz wypadek! Zaraz przyjedzie pogotowie! |***", gracz, 255,255,255,true) 
            setElementFrozen(gracz,true) 
            end 
        end 
    end 
end 
  
addEventHandler("onVehicleDamage", getRootElement(), wypadek) 
  
function unfreeze (co,jak) 
setElementFrozen ( co,jak ) 
end 
  

Posted

What is the problem? errors in debug?

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

That's because you are freezing the player, but you should freeze the vehicle instead.

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

You can disable his controls, so he can't drive the vehicle.

Use:

toggleControl 

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