Jump to content

SOLVED


spoty

Recommended Posts

hi there i downloaded a area51 protection script

and it was first like it shoot rocket on players without army skin

and now i have edited it to it only shoots on players that arent in army acl

but i dont have any error and it dont shoot

and it is running ingame

and i realy dont know what i did wrong

here is the script

g_base_col = createColCuboid ( 97.3376, 1800.0384, -32.0937, 250, 280, 120 ) 
createBlip ( 193.248, 1890.01, 17.234, 47 ) 
  
g_root = getRootElement () 
  
--rocketOne = createMarker ( -2931.5136, 454.4492, 17.3671, "corona", 1.5, 255, 0, 0, 150 ) --test marker 
--rocketTwo = createMarker ( -2931.5932, 487.1994, 17.3671, "corona", 1.5, 255, 0, 0, 150 ) --test marker 
  
function hit ( acc, dim ) 
    if getElementType ( acc ) == "account" then 
    local vehicle = getaccountOccupiedVehicle ( acc ) 
        if vehicle or not vehicle then 
        if isObjectInACLGroup("user."..getAccountName(getaccountname(source)), aclGetGroup("Army")) then 
        outputChatBox ( "Welcome Sir, "..getAccountName(acc).."!", acc, 0, 150, 0 ) 
            else 
                setElementData ( acc, "inRestrictedArea", "true" ) 
                triggerClientEvent ( acc, "destroyTrepassor", g_root, acc ) 
                outputChatBox ( "***Restricted Area***", acc, 255, 0, 0 ) 
                outputChatBox ( "* "..getAccountName(acc).." has entered Restricted Area!", g_root, 255, 0, 0 ) 
            end 
        end 
    end 
end 
addEventHandler ( "onColShapeHit", g_base_col, hit ) 
  
function leave ( acc, dim ) 
    if getElementType ( acc ) == "account" then 
    local vehicle = getaccountOccupiedVehicle ( acc ) 
        if vehicle or not vehicle then 
        if isObjectInACLGroup("user."..getAccountName(getaccountname(source)), aclGetGroup("Army")) then 
        outputChatBox ( "Good Bye Sir!", acc, 0, 100, 0 ) 
            else 
                setElementData ( acc, "inRestrictedArea", "false" ) 
                triggerClientEvent ( acc, "destroyTimers", g_root, acc ) 
                outputDebugString ( "*"..getAccountName(acc).." has left col shape" ) 
            end 
        end 
    end 
end 
addEventHandler ( "onColShapeLeave", g_base_col, leave ) 

Edited by Guest
Link to comment

its says this

WARNING: 1\area51\ad_base_c:44: Bad argument @ 'killtimer' [Expected lua-timer at argument 1,got nil]

WARNING: 1\area51\ad_base_c:45: Bad argument @ 'killtimer' [Expected lua-timer at argument 1,got nil]

WARNING: 1\area51\ad_base_c:46: Bad argument @ 'killtimer' [Expected lua-timer at argument 1,got nil]

WARNING: 1\area51\ad_base_c:47: Bad argument @ 'killtimer' [Expected lua-timer at argument 1,got nil]

here is the client part

g_loc_pla = getLocalPlayer () 
g_loc_root = getRootElement () 
  
addEvent ( "destroyTrepassor", true ) 
addEventHandler ( "destroyTrepassor", g_loc_root, 
    function () 
         
        posX = 15.7054 
        posY =  1719.3632 
        posZ =  50.123 
         
        posX2 = 237.7176 
        posY2 =  1696.5727 
        posZ2 =  50.1087 
         
        posX3 = 354.6243 
        posY3 = 2028.3897 
        posZ3 = 50.1217 
         
        posX4 = 188.241 
        posY4 = 2081.3469 
        posZ4 = 50.1422 
         
        local isInResArea = getElementData ( g_loc_pla, "inRestrictedArea" ) 
         
        rotZ = getPedRotation ( g_loc_pla ) 
         
        if isInResArea == "true" then 
            timer1 = setTimer ( createProjectile, 2000, 0, g_loc_pla, 20, posX, posY, posZ, 1.0, g_loc_pla, 0, 0, rotZ, 0.1, 0.1, 0.1 ) 
            timer2 = setTimer ( createProjectile, 2000, 0, g_loc_pla, 20, posX2, posY2, posZ2, 1.0, g_loc_pla, 0, 0, rotZ, 0.1, 0.1, 0.1 ) 
            timer3 = setTimer ( createProjectile, 2000, 0, g_loc_pla, 20, posX3, posY3, posZ3, 1.0, g_loc_pla, 0, 0, rotZ, 0.1, 0.1, 0.1 ) 
            timer4 = setTimer ( createProjectile, 2000, 0, g_loc_pla, 20, posX4, posY4, posZ4, 1.0, g_loc_pla, 0, 0, rotZ, 0.1, 0.1, 0.1 ) 
        end 
         
    end 
) 
  
addEvent ( "destroyTimers", true ) 
addEventHandler ( "destroyTimers", g_loc_root, 
    function () 
         
    local isInResArea = getElementData ( g_loc_pla, "inRestrictedArea" ) 
        if isInResArea == "false" then 
            killTimer ( timer1 ) 
            killTimer ( timer2 ) 
            killTimer ( timer3 ) 
            killTimer ( timer4 ) 
        end 
         
    end 
) 
  

Link to comment

Try this ((not tested)):

g_loc_pla = getLocalPlayer () 
g_loc_root = getRootElement () 
  
addEvent ( "destroyTrepassor", true ) 
addEventHandler ( "destroyTrepassor", g_loc_root, 
    function () 
        
        posX = 15.7054 
        posY =  1719.3632 
        posZ =  50.123 
        
        posX2 = 237.7176 
        posY2 =  1696.5727 
        posZ2 =  50.1087 
        
        posX3 = 354.6243 
        posY3 = 2028.3897 
        posZ3 = 50.1217 
        
        posX4 = 188.241 
        posY4 = 2081.3469 
        posZ4 = 50.1422 
        
        local isInResArea = getElementData ( g_loc_pla, "inRestrictedArea" ) 
        
        rotZ = getPedRotation ( g_loc_pla ) 
        
        if isInResArea == "true" then 
            timer1 = setTimer ( createProjectile, 2000, 0, g_loc_pla, 20, posX, posY, posZ, 1.0, g_loc_pla, 0, 0, rotZ, 0.1, 0.1, 0.1 ) 
            timer2 = setTimer ( createProjectile, 2000, 0, g_loc_pla, 20, posX2, posY2, posZ2, 1.0, g_loc_pla, 0, 0, rotZ, 0.1, 0.1, 0.1 ) 
            timer3 = setTimer ( createProjectile, 2000, 0, g_loc_pla, 20, posX3, posY3, posZ3, 1.0, g_loc_pla, 0, 0, rotZ, 0.1, 0.1, 0.1 ) 
            timer4 = setTimer ( createProjectile, 2000, 0, g_loc_pla, 20, posX4, posY4, posZ4, 1.0, g_loc_pla, 0, 0, rotZ, 0.1, 0.1, 0.1 ) 
        end 
        
    end 
) 
  
addEvent ( "destroyTimers", true ) 
addEventHandler ( "destroyTimers", g_loc_root, 
    function ()   
    local isInResArea = getElementData ( g_loc_pla, "inRestrictedArea" ) 
        if isInResArea == "false" then 
            if ( isTimer ( timer1 ) ) then killTimer ( timer1 ) end 
            if ( isTimer ( timer2 ) ) then killTimer ( timer2 ) end 
            if ( isTimer ( timer3 ) ) then killTimer ( timer3 ) end 
            if ( isTimer ( timer4 ) ) then killTimer ( timer4 ) end 
        end 
        
    end 
) 
  

Link to comment
  • 1 month later...

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