5150 Posted September 4, 2015 Share Posted September 4, 2015 how can i make these two scripts changed, so instead of being able to add an account to have access, i can add an entire team to have access. (theyre in the same .lua, but i figured itd be easier to split it). basically i dont want to have to add their account name every time i get a new gang member. i just want to change them to my team and thats it... function enterArea1(thePlayer) local posX, posY = getElementPosition(thePlayer) local inArea = isInsideRadarArea(radar1, posX, posY) if (inArea) then if hasObjectPermissionTo(thePlayer, "user.guitarist5150", true) then --Specify who can enter the zone primaryWeaponControl = isControlEnabled ( thePlayer, "fire" ) if ( primaryWeaponControl == true ) then toggleControl ( thePlayer, "fire", false ) -- change to true/false to allow/disallow shooting. outputChatBox("***Safe Zone***", thePlayer, 0, 255, 0, true) end else triggerClientEvent(thePlayer, "displayTimer1", thePlayer) end end end addEventHandler("onColShapeHit", Zone1, enterArea1) ^^^^^ thats the top part of the .lua function warp1() local posX, posY = getElementPosition(source) local inArea = isInsideRadarArea(radar1, posX, posY) if (inArea) then if hasObjectPermissionTo(source, "user.guitarist5150", false) then --Specify who can enter the zone outputChatBox("***CHECKER*** You are allowed in this zone.", source, 0, 255, 0, true) else outputChatBox("You are not allowed in this area, Sorry...", source, 255, 0, 0, true) outputChatBox("You have been warped.", source, 255, 0, 0, true) if isPedInVehicle ( source ) then local playerVehicle = getPedOccupiedVehicle ( source ) setElementPosition(playerVehicle, 2341.2072753906, -1658.8668212891, 13.379216194153) else setElementPosition(source, 2341.2072753906, -1658.8668212891, 13.379216194153) end end end end] ^^^^^^ theres whats important in the bottom part. any help is awesome, thanks. team name is Psycho Mans Gang caps included Link to comment
mint3d Posted September 4, 2015 Share Posted September 4, 2015 if hasObjectPermissionTo(thePlayer, "user.guitarist5150", true) then --Specify who can enter the zone if getTeamName(thePlayer, "Psycho Mans Gang") then Replace that line with the one above and that will work if the team is on the scoreboard Link to comment
Markeloff Posted September 4, 2015 Share Posted September 4, 2015 if hasObjectPermissionTo(thePlayer, "user.guitarist5150", true) then --Specify who can enter the zone if getTeamName(thePlayer, "Psycho Mans Gang") then Replace that line with the one above and that will work if the team is on the scoreboard Dude, those lines you wrote won't work. local team = getPlayerTeam(source) if team and getTeamName(team) == "Random Gang" then -- your crap end Link to comment
5150 Posted September 5, 2015 Author Share Posted September 5, 2015 if hasObjectPermissionTo(thePlayer, "user.guitarist5150", true) then --Specify who can enter the zone if getTeamName(thePlayer, "Psycho Mans Gang") then Replace that line with the one above and that will work if the team is on the scoreboard Dude, those lines you wrote won't work. local team = getPlayerTeam(source) if team and getTeamName(team) == "Random Gang" then -- your crap end thanks bro. so i replace what with this? or just add it Link to comment
Noki Posted September 5, 2015 Share Posted September 5, 2015 You replace: if hasObjectPermissionTo(thePlayer, "user.guitarist5150", true) then with: if getPlayerTeam(source) and getTeamName(getPlayerTeam(source)) == "teamName" then Link to comment
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