Jump to content

[Help]leavemarker


Black2

Recommended Posts

Hello, I found this race script and it works to hit the mark, but leave the marking and is well away from her the race starts, I want you to work only when the marking, Can anyone help me? Thank you very much in advance :)

I do not know how, maybe if it is false

setElementData (hitElement, "race_isSignedUp", true)

for

setElementData (hitElement, "race_isSignedUp", false)

but I could not someone have any idea, thx :)

function onSignUpMarkerHit( hitElement ) 
    if getElementType ( hitElement ) == "player" then 
        if not getElementData ( hitElement, "race_isSignedUp" ) then 
            if getPedOccupiedVehicle ( hitElement ) then     
                if getVehicleController ( getPedOccupiedVehicle ( hitElement ) ) == hitElement then 
                    local playerTeamName = getTeamName ( getPlayerTeam( hitElement ) ) 
                    if not copTeams[playerTeamName] then 
                        table.insert ( signedUpPlayers, hitElement )  
                        exports.DENdxmsg:createNewDxMessage ( hitElement, "You succesfully signed up!", 0, 255, 0 ) 
                        setElementData ( hitElement, "race_isSignedUp", true ) 
                    else 
                        exports.DENdxmsg:createNewDxMessage ( hitElement, "Law can't sign up for a street race!", 255, 0, 0 )        
                    end  
                end      
            else 
                exports.DENdxmsg:createNewDxMessage ( hitElement, "You need a vehicle to sign up!", 255, 0, 0 ) 
            end 
        end 
    end 
end 

Link to comment

maybe check

  
function onSignUpMarkerHit( hitElement ) 
    if getElementType ( hitElement ) == "player" then 
        --if not getElementData ( hitElement, "race_isSignedUp" ) then 
            if getPedOccupiedVehicle ( hitElement ) then    
                if getVehicleController ( getPedOccupiedVehicle ( hitElement ) ) == hitElement then 
                    local playerTeamName = getTeamName ( getPlayerTeam( hitElement ) ) 
                    if not copTeams[playerTeamName] then 
                        table.insert ( signedUpPlayers, hitElement ) 
                        exports.DENdxmsg:createNewDxMessage ( hitElement, "You succesfully signed up!", 0, 255, 0 ) 
                       -- setElementData ( hitElement, "race_isSignedUp", true ) 
                    else 
                        exports.DENdxmsg:createNewDxMessage ( hitElement, "Law can't sign up for a street race!", 255, 0, 0 )       
                    end  
                end     
            else 
                exports.DENdxmsg:createNewDxMessage ( hitElement, "You need a vehicle to sign up!", 255, 0, 0 ) 
            end 
        --end 
    end 
end 
  
  

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