Jump to content

Gates For My Squad


Sieghart70

Recommended Posts

Posted

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) 

Posted (edited)
  
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
Posted

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

Posted

Argument "time" is missing at moveObject, in event "onMarkerLeave".

moveObject(object, 2500, 3283.3999023438, 261.10000610352, 14.10000038147) 

Please do not PM me with scripting related question nor support, use the forums instead.

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

Posted (edited)

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

CiTLh.png
Posted
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 !!

Posted
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.
CiTLh.png
Posted
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.

CiTLh.png
Posted

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

Posted
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 

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