Sign in to follow this  
DANY12

Please Help On My Mta Dayz Server

Recommended Posts

i need help in 2 things

1 : base protection : that only group members can go near the base

Please help me with this ;)

2 : only group member or admin can open the gate

for admin i use this :

if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) then

but when iam do the code in the console it says

[10:16:59] WARNING: raced4\Hangar.lua:15: Bad argument @ 'getPlayerAccount' [Exp

ected element at argument 1, got nil]

[10:16:59] WARNING: raced4\Hangar.lua:15: Bad argument @ 'getAccountName' [Expec

ted account at argument 1, got boolean]

[10:16:59] ERROR: raced4\Hangar.lua:15: attempt to concatenate a boolean value

Please Help :)

Share this post


Link to post

For the first thing you want you can make a big unvisible marker (set alpha to 0) around the base. And when a player is not a team member (use the same as in the gate function) and hits the marker he will get teleported away from the base ..

And here is a gate function:

gateMoving = false 
gateMoved = false 
Gate = createObject ( id, x, y, z, rx, ry, rz ) -- The gate as a object 
  
  
function gatefunc ( thePlayer ) 
   local accName = getAccountName (getPlayerAccount (thePlayer)) 
   local fac = getElementData(thePlayer,"Faction") -- This is a example for factions ... you can also use the team functions .. 
   if getDistanceBetweenPoints3D ( x, y, z, getElementPosition ( thePlayer ) ) < 10 then -- if the distance between the player and the object is 10 
   if (tonumber(fac) == 1) or isObjectInACLGroup ("user."..accName, aclGetGroup ("Admin")) then -- when thePlayer is in faction = 1 or admin 
            if LSPDgateMoved == false then 
                moveObject ( Gate, id, wx, wy, wy ) -- where should it be moved to ? 
                LSPDgateMoved = true 
            else 
                moveObject ( Gate, id, x, y, z ) -- standart position 
                LSPDgateMoved = false 
            end 
        end 
    end 
    end 
addCommandHandler ( "gate", gatefunc ) 

You can also use this for the gate function:

setPlayerTeam 

createTeam 

Share this post


Link to post

i made the big marker around my base now i got the gate script its like that

brama = createObject ( 16773, -2046.6999511719,-102,38.200000762939 )

garaz = createObject ( 8240, -16.39999961853, 2438.3000488281, 28.89999961853 )

function bo()

moveObject (brama, 1200,-2046.6999511719,-102,38.200000762939)

end

addCommandHandler("sf1", bo)

function bc()

moveObject (brama, 3500,-2046.6999511719,-102,2)

end

addCommandHandler("sf", bc)

iam not very good at english i know type but i dont know read as well as you .. can you tell me where to add the stuff you told me please ? and i will do this ?

Share this post


Link to post
i made the big marker around my base now i got the gate script its like that

brama = createObject ( 16773, -2046.6999511719,-102,38.200000762939 )

garaz = createObject ( 8240, -16.39999961853, 2438.3000488281, 28.89999961853 )

function bo()

moveObject (brama, 1200,-2046.6999511719,-102,38.200000762939)

end

addCommandHandler("sf1", bo)

function bc()

moveObject (brama, 3500,-2046.6999511719,-102,2)

end

addCommandHandler("sf", bc)

iam not very good at english i know type but i dont know read as well as you .. can you tell me where to add the stuff you told me please ? and i will do this ?

gateMoved = false 
brama = createObject ( 16773, -2046.6999511719,-102,38.200000762939 ) 
  
  
function gatefunc ( thePlayer ) 
   local accName = getAccountName (getPlayerAccount (thePlayer)) 
   local fac = getElementData(thePlayer,"Faction") -- This is a example for factions ... you can also use the team functions .. 
   if getDistanceBetweenPoints3D ( x, y, z, getElementPosition ( thePlayer ) ) < 10 then -- if the distance between the player and the object is 10 
   if (tonumber(fac) == 1) or isObjectInACLGroup ("user."..accName, aclGetGroup ("Admin")) then -- when thePlayer is in faction = 1 or admin 
            if gateMoved == false then 
                moveObject (brama, 16773, 1200,-2046.6999511719,-102,38.200000762939) 
                gateMoved = true 
            else 
                moveObject (brama, 16773, -2046.6999511719,-102,38.200000762939) 
                gateMoved = false 
            end 
        end 
    end 
    end 
addCommandHandler ( "sf1", gatefunc ) 

Do this with the other one

Share this post


Link to post

it dosent work :( i dont want to make you head hurt becus of me

gate open only by group members dosent work can you just help me know how to make a base protection ? ( only group member can go near

Share this post


Link to post
clanGate = createObject(10828,1588.4,2335.5,18, 0,0,90) 
  
 function openGate(thePlayer) 
 local playerClan = getElementData(thePlayer, "...GROUP OR GANG....") or "No Clan" 
 if playerClan == "....NAMECLAN...." then 
 moveObject (clanGate, 2500, 1588.4, 2335.5, 5) 
    end 
 end 
 addCommandHandler("....PASSWORDOPEN....", openGate) 
  
  
 function closeGate(thePlayer) 
 local playerClan = getElementData(thePlayer, "....GROUP OR GANG....") or "No Clan" 
 if playerClan == "......NAMECLAN....." then 
 moveObject(clanGate, 2500,1588.4,2335.5,18) 
    end 
 end 
 addCommandHandler("....PASSWORDCLOSE....", closeGate) 

Share this post


Link to post

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.