Jump to content

How to Make Gate Opened Only when Group Member are near that


Recommended Posts

But its dont work i try in my server its dont work

local allowedGroups = { ["THE_KING"]=true }

col1 = createColSphere (2838.8000488281, -1653.3000488281, 10.800000190735, 10 )

gate1 = createObject (971, 2846.6999511719,-1657.1999511719,13.300000190735,0,359.5,76)

function openGate1 ( player )

if ( allowedGroups [ getElementData ( player, "Group" ) ] ) then

moveObject (gate1, 3000,2846.6999511719,-1657.1999511719,3.5999999046326 )

end

end

addEventHandler("onColShapeHit", col1, openGate1)

function closeGate1()

moveObject(gate1, 3000,2846.6999511719,-1657.1999511719,13.300000190735)

end

addEventHandler("onColShapeLeave", col1, closeGate1)

Link to comment
Cause I don't know how group have been created, then I can't say how you can verify if the player is a group member.

And Josh, your code is wrong dude. Stop posting this.

Funny, because this is the way the Government/FBI/SAPD scripted their gates/markers..

Link to comment
Funny is: I corrected your code and you posted your wrong code again.

My misstake.

I just tried

  
local allowedGroups = { ["THE_KING"]=true } 
col1 = createColSphere (2838.8000488281, -1653.3000488281, 10.800000190735, 10 ) 
gate1 = createObject (971, 2846.6999511719,-1657.1999511719,13.300000190735,0,359.5,76) 
  
function openGate1 ( player ) 
if ( allowedGroups [ getElementData ( player, "Group" ) ] ) then 
moveObject (gate1, 3000,2846.6999511719,-1657.1999511719,3.5999999046326 ) 
end 
end 
addEventHandler("onColShapeHit", col1, openGate1) 
  
function closeGate1() 
moveObject(gate1, 3000,2846.6999511719,-1657.1999511719,13.300000190735) 
end 
addEventHandler("onColShapeLeave", col1, closeGate1) 
  

on my local, with a group resource running. created the gang THE_KING and the gate opens properly except the fact that it's placed in middle of a street.

easiest would be to connect to their irc, join #scripting and having a chat with them, if you ask nicely.

Link to comment
  • Moderators

He maybe created new group for his members and checked it with

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

I use it for members so they can use special commands without being a mod/smod/admin.

Link to comment
  • 1 month later...
Wait... do you wanna this script to put in a base for CIT Server? If yes, the CIT Server don't accept resources, only the .map file. Have you read the rules for "how to apply for a base" in CIT Forum? The resource is made by CIT team, you just must send the .map file.

Yeh i know its in past now i have my own server and whan't it for my server

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