Jump to content

Restricted Area


yMassai

Recommended Posts

Posted

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?

Community Profile MTA:SA = Click Here

Posted

That script will never work.

if skin =={ [287] then ; [286] then ; } 

That's highly wrong.

Should be:

if ( skin == 287 or skin == 286 ) then 

For wanted level use: setPlayerWantedLevel.

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

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?

Community Profile MTA:SA = Click Here

Posted

No, that won't work, you have to set the wanted level IF they are not using the desired skins.

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

My Projects!

No one.

Posted

@GanJaRuleZ: That's wrong, you're giving wanted level even when he's using the skins allowed. Also, I want him to do it, is really simple.

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

Then, script it by yourself. This is the basic of Lua. If you don't know how to do that, better start learning.

EPT Team Server Development: 0%

Learning C++ | C++ is amazing xD

Posted
setTimer ( setPlayerWantedLevel, 60000, 1, pla, 0 ) 

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

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?

Community Profile MTA:SA = Click Here

Posted

Yes, but as far as I know, you want to reset it to 0.

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

Just change the '1' to '0'.

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

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 ) 

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