Jump to content

Restricted Area


yMassai

Recommended Posts

g_base_col = createColCuboid ( 97.3376, 1800.0384, -32.0937, 250, 280, 120 ) 
  
g_root = getRootElement () 
  
--rocketOne = createMarker ( -2931.5136, 454.4492, 17.3671, "corona", 9.5, 255, 0, 0, 150 ) --test marker 
--rocketTwo = createMarker ( -2931.5932, 487.1994, 17.3671, "corona", 9.5, 255, 0, 0, 150 ) --test marker 
  
function hit ( pla, dim ) 
    if getElementType ( pla ) == "player" then 
    local vehicle = getPlayerOccupiedVehicle ( pla ) 
        if vehicle or not vehicle then 
            local skin = getPlayerSkin ( pla ) 
            if skin =={ [287] then ; [286] then ; } 
                setElementData ( pla, "inRestrictedArea", "true" ) 
                triggerClientEvent ( pla, "destroyTrepassor", g_root, pla ) 
                outputChatBox ( "***Restricted Area***", pla, 255, 0, 0 ) 
                outputChatBox ( "* "..getClientName(pla).." has entered Restricted Area!", g_root, 255, 0, 0 ) 
            end 
        end 
    end 
end 
addEventHandler ( "onColShapeHit", g_base_col, hit ) 

This script shows when someone enters the military base.

This script tells the player that he occupies the place is restricted.

Can put for when a player enter the restricted area without skin 287 without taking a star?

Link to comment

g_base_col = createColCuboid ( 97.3376, 1800.0384, -32.0937, 250, 280, 120 ) 
  
g_root = getRootElement () 
  
--rocketOne = createMarker ( -2931.5136, 454.4492, 17.3671, "corona", 9.5, 255, 0, 0, 150 ) --test marker 
--rocketTwo = createMarker ( -2931.5932, 487.1994, 17.3671, "corona", 9.5, 255, 0, 0, 150 ) --test marker 
  
function hit ( pla, dim ) 
    if getElementType ( pla ) == "player" then 
    local vehicle = getPlayerOccupiedVehicle ( pla ) 
        if vehicle or not vehicle then 
            local skin = getPlayerSkin ( pla ) 
            if ( skin == 287 or skin == 286 ) then 
                setElementData ( pla, "inRestrictedArea", "true" ) 
                triggerClientEvent ( pla, "destroyTrepassor", g_root, pla ) 
                outputChatBox ( "***Restricted Area***", pla, 255, 0, 0 ) 
                outputChatBox ( "* "..getClientName(pla).." has entered Restricted Area!", g_root, 255, 0, 0 ) 
            end 
        end 
    end 
end 
function policeStationHit ( thePlayer ) 
setPlayerWantedLevel ( thePlayer , 1 ) 
addEventHandler ( "onColShapeHit", policeStation, policeStationHit ) 
addEventHandler ( "onColShapeHit", g_base_col, hit ) 

maybe this?

Link to comment
  
g_base_col = createColCuboid ( 97.3376, 1800.0384, -32.0937, 250, 280, 120 ) 
  
g_root = getRootElement () 
  
--rocketOne = createMarker ( -2931.5136, 454.4492, 17.3671, "corona", 9.5, 255, 0, 0, 150 ) --test marker 
--rocketTwo = createMarker ( -2931.5932, 487.1994, 17.3671, "corona", 9.5, 255, 0, 0, 150 ) --test marker 
  
function hit ( pla, dim ) 
    if getElementType ( pla ) == "player" then 
    local vehicle = getPlayerOccupiedVehicle ( pla ) 
        if vehicle or not vehicle then 
            local skin = getPlayerSkin ( pla ) 
            if ( skin == 287 or skin == 286 ) then 
                setElementData ( pla, "inRestrictedArea", "true" ) 
                triggerClientEvent ( pla, "destroyTrepassor", g_root, pla ) 
                outputChatBox ( "***Restricted Area***", pla, 255, 0, 0 ) 
                outputChatBox ( "* "..getClientName(pla).." has entered Restricted Area!", g_root, 255, 0, 0 ) 
                setPlayerWantedLevel(pla,1) 
            end 
        end 
    end 
end 
addEventHandler ( "onColShapeHit", g_base_col, hit ) 

Link to comment

g_base_col = createColCuboid ( 97.3376, 1800.0384, -32.0937, 250, 280, 120 ) 
  
g_root = getRootElement () 
  
--rocketOne = createMarker ( -2931.5136, 454.4492, 17.3671, "corona", 9.5, 255, 0, 0, 150 ) --test marker 
--rocketTwo = createMarker ( -2931.5932, 487.1994, 17.3671, "corona", 9.5, 255, 0, 0, 150 ) --test marker 
  
function hit ( pla, dim ) 
    if getElementType ( pla ) == "player" then 
    local vehicle = getPlayerOccupiedVehicle ( pla ) 
        if vehicle or not vehicle then 
            local skin = getPlayerSkin ( pla ) 
            if ( skin == 287 or skin == 286 ) then 
                setElementData ( pla, "inRestrictedArea", "true" ) 
                triggerClientEvent ( pla, "destroyTrepassor", g_root, pla ) 
                outputChatBox ( "***Restricted Area***", pla, 255, 0, 0 ) 
                outputChatBox ( "* "..getClientName(pla).." has entered Restricted Area!", g_root, 255, 0, 0 ) 
                setPlayerWantedLevel(pla,1) 
                setTimer ( setPlayerWantedLevel, 60000, 1, pla, 1 ) 
            end 
        end 
    end 
end 
addEventHandler ( "onColShapeHit", g_base_col, hit ) 

this?

Link to comment

Don't you read? you only have to change 1 to 0 at:

g_base_col = createColCuboid ( 97.3376, 1800.0384, -32.0937, 250, 280, 120 ) 
  
g_root = getRootElement () 
  
--rocketOne = createMarker ( -2931.5136, 454.4492, 17.3671, "corona", 9.5, 255, 0, 0, 150 ) --test marker 
--rocketTwo = createMarker ( -2931.5932, 487.1994, 17.3671, "corona", 9.5, 255, 0, 0, 150 ) --test marker 
  
function hit ( pla, dim ) 
    if getElementType ( pla ) == "player" then 
    local vehicle = getPlayerOccupiedVehicle ( pla ) 
        if vehicle or not vehicle then 
            local skin = getPlayerSkin ( pla ) 
            if ( skin == 287 or skin == 286 ) then 
                setElementData ( pla, "inRestrictedArea", "true" ) 
                triggerClientEvent ( pla, "destroyTrepassor", g_root, pla ) 
                outputChatBox ( "***Restricted Area***", pla, 255, 0, 0 ) 
                outputChatBox ( "* "..getClientName(pla).." has entered Restricted Area!", g_root, 255, 0, 0 ) 
                setPlayerWantedLevel(pla,1) 
                setTimer ( setPlayerWantedLevel, 60000, 1, pla, 1 ) -- Here. 
            end 
        end 
    end 
end 
addEventHandler ( "onColShapeHit", g_base_col, hit ) 

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