Jump to content

Gates For My Squad


Sieghart70

Recommended Posts

Hi Ive Been Working On A Gate Script But I Want It To Be For My Squad Can U Add If Somethings Are Missing I Need It To Only For British Armed Forces Only But So Far This Is What I Created

object = createObject(980, 3283.3999023438, 261.10000610352, 14.10000038147) 
marker = createMarker(3284, 261.29998779297, 1, "cylinder", 2, 100, 0, 0, 100) 
function gateo(player) 
    moveObject(object, 2500, 3283.3999023438, 261.10000610352, 14.10000038147, 5) 
end 
addEventHandler("onMarkerHit",gateo) 
function gatec(player) 
    moveObject(object,3283.3999023438, 261.10000610352, 14.10000038147) 
end 
addEventHandler("onMarkerLeave",gatec) 

Link to comment
  
object = createObject(980, 3283.3999023438, 261.10000610352, 14.10000038147) 
marker = createMarker(3284, 261.29998779297, 1, "cylinder", 2, 100, 0, 0, 100) 
function gateo(thePlayer) 
    if (getTeamName(getPlayerTeam(thePlayer)) == "Team") then 
        moveObject(object, 2500, 3283.3999023438, 261.10000610352, 14.10000038147, 5) 
    end 
end 
addEventHandler("onMarkerHit",marker,gateo) 
function gatec(thePlayer) 
    if (getTeamName(getPlayerTeam(thePlayer)) == "Team") then 
        moveObject(object,3283.3999023438, 261.10000610352, 14.10000038147) 
    end 
end 
addEventHandler("onMarkerLeave",marker,gatec) 
  

Edited by Guest
Link to comment

LOL.

  
object = createObject(980, 3283.3999023438, 261.10000610352, 14.10000038147) 
marker = createMarker(3284, 261.29998779297, 1, "cylinder", 2, 100, 0, 0, 100) 
function gateo(thePlayer) 
    if (getTeamName(getPlayerTeam(thePlayer)) == "Team") then 
        moveObject(object, 2500, 3283.3999023438, 261.10000610352, 14.10000038147, 5) 
    end 
end 
addEventHandler("onMarkerHit",marker,gateo) 
function gatec(thePlayer) 
    if (getTeamName(getPlayerTeam(thePlayer)) == "Team") then 
        moveObject(object,3283.3999023438, 261.10000610352, 14.10000038147) 
    end 
end 
addEventHandler("onMarkerLeave",marker,gatec) 
  

addEventHandler's seconds argument would bad. !

Link to comment
  
object = createObject(980, 3283.3999023438, 261.10000610352, 14.10000038147) 
marker = createMarker(3284, 261.29998779297, 1, "cylinder", 2, 100, 0, 0, 100) 
  
function gateo(hitElement) 
   if getElementType ( hitElement ) == "player" and getTeamName(getPlayerTeam(hitElement)) == "Team" then 
  
        moveObject(object, 2500, 3283.3999023438, 261.10000610352, 14.10000038147, 5) 
    end 
end 
addEventHandler("onMarkerHit",marker,gateo) 
  
function gateo(hitElement) 
   if getElementType ( hitElement ) == "player" and getTeamName(getPlayerTeam(hitElement)) == "Team" then 
        moveObject(object,2500, 3283.3999023438, 261.10000610352, 14.10000038147) 
    end 
end 
addEventHandler("onMarkerLeave",marker,gatec) 
  

More checks, less chances for the script to fail.

Link to comment

well, there is a lots of ways u can make the gate opens for you squad only. i will tell u some of it

well for skins, you can use >>

hmm = getElementModel ( source ) 
if hmm == Skin ID then 
-- moveobject or whatevet 
else  
-- 

another way by team >>

local hmm = getPlayerTeam ( source ) 
local tname = getTeamName ( hmm ) 
if tname == "TeamNameHere" then 
-- moveobject or whatever 
else 
-- 

another way by ACL

local hmm = getAccountName ( getPlayerAccount ( source) ) 
if isObjectInACLGroup ("user."..hmm, aclGetGroup ( "ACLGroupHere" ) ) then 
--moveObject or whatever 
else 
-- 
  

Btw if the event is onColShapeHit or onMarkerHit dont forget to replace source with hitElement.

Edited by Guest
Link to comment
well, there is a lots of ways u can make the gate opens for you squad only. i will tell u some of it

well for skins, you can use >>

hmm = getElementModel ( source ) 
if hmm == "Skin ID" then 
-- moveobject or whatevet 
else  
-- 

another way by team >>

local hmm = getPlayerTeam ( source ) 
local tname = getTeamName ( hmm ) 
if tname == "TeamNameHere" then 
-- moveobject or whatever 
else 
-- 

another way by ACL

local hmm = getAccountName ( getPlayerAccount ( source) ) 
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "ACLGroupHere" ) ) then 
--moveObject or whatever 
else 
-- 
  

Btw if the event is onColShapeHit or onMarkerHit dont forget to replace source with hitElement.

Are you making examples for him?

* getElementModel return integer NOT string.

* You've used variable accName while you have it defined as hmm.

Link to comment
well, there is a lots of ways u can make the gate opens for you squad only. i will tell u some of it

well for skins, you can use >>

hmm = getElementModel ( source ) 
if hmm == "Skin ID" then 
-- moveobject or whatevet 
else  
-- 

another way by team >>

local hmm = getPlayerTeam ( source ) 
local tname = getTeamName ( hmm ) 
if tname == "TeamNameHere" then 
-- moveobject or whatever 
else 
-- 

another way by ACL

local hmm = getAccountName ( getPlayerAccount ( source) ) 
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "ACLGroupHere" ) ) then 
--moveObject or whatever 
else 
-- 
  

Btw if the event is onColShapeHit or onMarkerHit dont forget to replace source with hitElement.

Are you making examples for him?

* getElementModel return integer NOT string.

* You've used variable accName while you have it defined as hmm.

Edited !!

Link to comment
well, there is a lots of ways u can make the gate opens for you squad only. i will tell u some of it

well for skins, you can use >>

hmm = getElementModel ( source ) 
if hmm == "Skin ID" then 
-- moveobject or whatevet 
else  
-- 

another way by team >>

local hmm = getPlayerTeam ( source ) 
local tname = getTeamName ( hmm ) 
if tname == "TeamNameHere" then 
-- moveobject or whatever 
else 
-- 

another way by ACL

local hmm = getAccountName ( getPlayerAccount ( source) ) 
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "ACLGroupHere" ) ) then 
--moveObject or whatever 
else 
-- 
  

Btw if the event is onColShapeHit or onMarkerHit dont forget to replace source with hitElement.

Are you making examples for him?

* getElementModel return integer NOT string.

* You've used variable accName while you have it defined as hmm.

Edited !!

* getElementModel return integer NOT string.
Link to comment
what u mean .. i tested it like that and it is working ..

I meant what i wrote!

* getElementModel return integer NOT string.

Can't you see line 2?

hmm = getElementModel ( source ) 
if hmm == "Skin ID" then 
-- moveobject or whatevet 
else 
-- 

You are comparing integer with string. It's pretty clear.

Link to comment
TAPL i mean whith "Skin ID" that he replace it with any skin id, for example
if hmm == 0 then -- if thePlayer skin is CJ Skin then 

got what i mean ?

btw it's tested and working .. Thanks

We understood what you wrote but just think how will newbies understand? They'll use it as

if skin == "0" then 

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