Jump to content

[HELP] Anti Camp for DDerby


Imposter

Recommended Posts

Can someone help me out with this? cant get it to work!!

  
addEvent("onMapStarting") 
  
minTime = 10*1000 
maxTime = 15*1000 
  
function killHim () 
    if thePlayer then 
        if theIdleTime > minTime then 
            if theIdleTime > maxTime then 
                if theSpeed < 5 then 
                    blowVehicle( theVehicle ) 
                else 
                    outputChatBox( getPlayerName(getRootElement()) .. " has beed killed for camping!" ) 
                end 
            end 
        else 
            outputChatBox( "If you do not move in 5 seconds, you will be killed!", thePlayer ) 
        end 
    end 
end 
  
function onMapLoad () 
    loadTimer = setTimer ( startTimer, 15000, 0 ) 
end 
addEventHandler ( "onMapStarting", getRootElement(), onMapLoad ) 
  
function startTimer () 
    thePlayer = getRootElement() 
    theVehicle = getPedOccupiedVehicle ( thePlayer ) 
    theIdleTime = getPlayerIdleTime( thePlayer ) 
    theSpeed = getElementVelocity ( theVehicle ) 
    checkTimer = setTimer ( killHim, 100, 0 ) 
end 
  

Link to comment

I see many errors there:

function startTimer () 
    thePlayer = getRootElement() 
    theVehicle = getPedOccupiedVehicle ( thePlayer ) 
    theIdleTime = getPlayerIdleTime( thePlayer ) 
    theSpeed = getElementVelocity ( theVehicle ) 
    checkTimer = setTimer ( killHim, 100, 0 ) 
end 

You can't get the vehicle from root element.

Link to comment
I see many errors there:
function startTimer () 
    thePlayer = getRootElement() 
    theVehicle = getPedOccupiedVehicle ( thePlayer ) 
    theIdleTime = getPlayerIdleTime( thePlayer ) 
    theSpeed = getElementVelocity ( theVehicle ) 
    checkTimer = setTimer ( killHim, 100, 0 ) 
end 

You can't get the vehicle from root element.

i thought that would be a problem, and im still getting a bunch of warnings in the console, do you thnk i should change the handler? it keeps giving warnings for getPedOccupiedVehicle, getPlayerIdleTime( thePlayer ), getElementVelocity ( theVehicle )

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