Sieghart70 Posted March 10, 2014 Posted March 10, 2014 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)
mr.Extreme Posted March 10, 2014 Posted March 10, 2014 (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 March 10, 2014 by Guest
Anubhav Posted March 10, 2014 Posted March 10, 2014 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. !
DNL291 Posted March 10, 2014 Posted March 10, 2014 Argument "time" is missing at moveObject, in event "onMarkerLeave". moveObject(object, 2500, 3283.3999023438, 261.10000610352, 14.10000038147)
Saml1er Posted March 10, 2014 Posted March 10, 2014 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.
Hell-Mate Posted March 10, 2014 Posted March 10, 2014 (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 March 15, 2014 by Guest
Sieghart70 Posted March 13, 2014 Author Posted March 13, 2014 Can Someone Make The Gate Script For Me Im A Bit Confused On It
Anubhav Posted March 13, 2014 Posted March 13, 2014 FaDyJo in your seconds example why to get player name? I think you should use getTeamName instead of it.
Hell-Mate Posted March 14, 2014 Posted March 14, 2014 FaDyJo in your seconds example why to get player name? I think you should use getTeamName instead of it. oh my bad, EDITED. Thanks
TAPL Posted March 14, 2014 Posted March 14, 2014 well, there is a lots of ways u can make the gate opens for you squad only. i will tell u some of itwell 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.
Hell-Mate Posted March 14, 2014 Posted March 14, 2014 well, there is a lots of ways u can make the gate opens for you squad only. i will tell u some of itwell 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 !!
TAPL Posted March 15, 2014 Posted March 15, 2014 well, there is a lots of ways u can make the gate opens for you squad only. i will tell u some of itwell 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.
Hell-Mate Posted March 15, 2014 Posted March 15, 2014 what u mean .. i tested it like that and it is working ..
TAPL Posted March 15, 2014 Posted March 15, 2014 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.
Hell-Mate Posted March 15, 2014 Posted March 15, 2014 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
Saml1er Posted March 15, 2014 Posted March 15, 2014 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
Hell-Mate Posted March 15, 2014 Posted March 15, 2014 uhh, i got it. all what i meant with "" is to place the id here nither more nor less any way thanks TAPL and Saml1er. EDITED
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now