Samking

Help radar Area for acl group

Recommended Posts

x, y, size = -2095.97632, -280.48669, 120
local greenzone = createColRectangle ( -2095.97632, -280.48669,85, 200)
local greenzonemaparea = createRadarArea (-2095.97632, -280.48669,85, 200, 255,215,0, 120)
 
function greenzoneEnter ( thePlayer, matchingDimension )
if getElementType( thePlayer ) ~= "player" then return end
outputChatBox ( "* You Entered The VIP Vehicle recover Area", thePlayer, 0, 255, 0 )
toggleControl ( thePlayer, "fire", false )
toggleControl ( thePlayer, "next_weapon", true )
toggleControl ( thePlayer, "previous_weapon", true )
setPedWeaponSlot ( thePlayer, 0 )
toggleControl ( thePlayer, "aim_weapon", false )
toggleControl ( thePlayer, "vehicle_fire", false )
toggleControl ( thePlayer, "vehicle_secondary_fire", false )
end
addEventHandler ( "onColShapeHit", greenzone, greenzoneEnter )
 
function greenzoneExit ( thePlayer, matchingDimension )
if getElementType( thePlayer ) ~= "player" then return end
outputChatBox ( "* You Left The VIP Vehicle recover Area", thePlayer, 0, 255, 0 )
toggleControl ( thePlayer, "fire", true )
toggleControl ( thePlayer, "next_weapon", true )
toggleControl ( thePlayer, "previous_weapon", true )
toggleControl ( thePlayer, "aim_weapon", true )
toggleControl ( thePlayer, "vehicle_fire", true )
toggleControl ( thePlayer, "vehicle_secondary_fire", true )
end
 
addEventHandler ( "onColShapeLeave", greenzone, greenzoneExit )

How I can make this Area  

That Only ACL group "VIP"

can enter? 

Edited by Samking

Share this post


Link to post
x, y, size = -2095.97632, -280.48669, 120
local greenzone = createColRectangle ( -2095.97632, -280.48669,85, 200)
local greenzonemaparea = createRadarArea (-2095.97632, -280.48669,85, 200, 255,215,0, 120)
 
function greenzoneEnter ( thePlayer, matchingDimension )
if getElementType( thePlayer ) ~= "player" then return end
  if (isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Owner"))) then
outputChatBox ( "* You Entered The VIP Vehicle recover Area", thePlayer, 0, 255, 0 )
toggleControl ( thePlayer, "fire", false )
toggleControl ( thePlayer, "next_weapon", true )
toggleControl ( thePlayer, "previous_weapon", true )
setPedWeaponSlot ( thePlayer, 0 )
toggleControl ( thePlayer, "aim_weapon", false )
toggleControl ( thePlayer, "vehicle_fire", false )
toggleControl ( thePlayer, "vehicle_secondary_fire", false )
end
  end
else outputChatBox("exit your not allowed here xd leave madafaker",root,255,0,0)
addEventHandler ( "onColShapeHit", greenzone, greenzoneEnter )
 
function greenzoneExit ( thePlayer, matchingDimension )
if getElementType( thePlayer ) ~= "player" then return end
outputChatBox ( "* You Left The VIP Vehicle recover Area", thePlayer, 0, 255, 0 )
toggleControl ( thePlayer, "fire", true )
toggleControl ( thePlayer, "next_weapon", true )
toggleControl ( thePlayer, "previous_weapon", true )
toggleControl ( thePlayer, "aim_weapon", true )
toggleControl ( thePlayer, "vehicle_fire", true )
toggleControl ( thePlayer, "vehicle_secondary_fire", true )
end
 
addEventHandler ( "onColShapeLeave", greenzone, greenzoneExit )

@Samking not tested
Enjoy

Share this post


Link to post
On 12/09/2018 at 18:13, KnucklesSAEG said:

x, y, size = -2095.97632, -280.48669, 120
local greenzone = createColRectangle ( -2095.97632, -280.48669,85, 200)
local greenzonemaparea = createRadarArea (-2095.97632, -280.48669,85, 200, 255,215,0, 120)
 
function greenzoneEnter ( thePlayer, matchingDimension )
if getElementType( thePlayer ) ~= "player" then return end
  if (isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Owner"))) then
outputChatBox ( "* You Entered The VIP Vehicle recover Area", thePlayer, 0, 255, 0 )
toggleControl ( thePlayer, "fire", false )
toggleControl ( thePlayer, "next_weapon", true )
toggleControl ( thePlayer, "previous_weapon", true )
setPedWeaponSlot ( thePlayer, 0 )
toggleControl ( thePlayer, "aim_weapon", false )
toggleControl ( thePlayer, "vehicle_fire", false )
toggleControl ( thePlayer, "vehicle_secondary_fire", false )
end
  end
else outputChatBox("exit your not allowed here xd leave madafaker",root,255,0,0)
addEventHandler ( "onColShapeHit", greenzone, greenzoneEnter )
 
function greenzoneExit ( thePlayer, matchingDimension )
if getElementType( thePlayer ) ~= "player" then return end
outputChatBox ( "* You Left The VIP Vehicle recover Area", thePlayer, 0, 255, 0 )
toggleControl ( thePlayer, "fire", true )
toggleControl ( thePlayer, "next_weapon", true )
toggleControl ( thePlayer, "previous_weapon", true )
toggleControl ( thePlayer, "aim_weapon", true )
toggleControl ( thePlayer, "vehicle_fire", true )
toggleControl ( thePlayer, "vehicle_secondary_fire", true )
end
 
addEventHandler ( "onColShapeLeave", greenzone, greenzoneExit )


@Samking not tested
Enjoy

Error 

Excepted Near 'else

Share this post


Link to post
x, y, size = -2095.97632, -280.48669, 120
local greenzone = createColRectangle ( -2095.97632, -280.48669,85, 200)
local greenzonemaparea = createRadarArea (-2095.97632, -280.48669,85, 200, 255,215,0, 120)
 
function greenzoneEnter ( thePlayer, matchingDimension )
  if getElementType( thePlayer ) ~= "player" then return end
  if (isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Owner"))) then
    outputChatBox ( "* You Entered The VIP Vehicle recover Area", thePlayer, 0, 255, 0 )
    toggleControl ( thePlayer, "fire", false )
    toggleControl ( thePlayer, "next_weapon", true )
    toggleControl ( thePlayer, "previous_weapon", true )
    setPedWeaponSlot ( thePlayer, 0 )
    toggleControl ( thePlayer, "aim_weapon", false )
    toggleControl ( thePlayer, "vehicle_fire", false )
    toggleControl ( thePlayer, "vehicle_secondary_fire", false )
  else
    outputChatBox("exit your not allowed here xd leave madafaker",root,255,0,0)
  end
end
addEventHandler ( "onColShapeHit", greenzone, greenzoneEnter )
 
function greenzoneExit ( thePlayer, matchingDimension )
  if getElementType( thePlayer ) ~= "player" then return end
  outputChatBox ( "* You Left The VIP Vehicle recover Area", thePlayer, 0, 255, 0 )
  toggleControl ( thePlayer, "fire", true )
  toggleControl ( thePlayer, "next_weapon", true )
  toggleControl ( thePlayer, "previous_weapon", true )
  toggleControl ( thePlayer, "aim_weapon", true )
  toggleControl ( thePlayer, "vehicle_fire", true )
  toggleControl ( thePlayer, "vehicle_secondary_fire", true )
end
 
addEventHandler ( "onColShapeLeave", greenzone, greenzoneExit )

Just as a tip: Try to keep your code clean and intented. Makes it much more readable and easier to spot errors like <eof>

Share this post


Link to post
3 hours ago, Sorata_Kanda said:

x, y, size = -2095.97632, -280.48669, 120
local greenzone = createColRectangle ( -2095.97632, -280.48669,85, 200)
local greenzonemaparea = createRadarArea (-2095.97632, -280.48669,85, 200, 255,215,0, 120)
 
function greenzoneEnter ( thePlayer, matchingDimension )
  if getElementType( thePlayer ) ~= "player" then return end
  if (isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Owner"))) then
    outputChatBox ( "* You Entered The VIP Vehicle recover Area", thePlayer, 0, 255, 0 )
    toggleControl ( thePlayer, "fire", false )
    toggleControl ( thePlayer, "next_weapon", true )
    toggleControl ( thePlayer, "previous_weapon", true )
    setPedWeaponSlot ( thePlayer, 0 )
    toggleControl ( thePlayer, "aim_weapon", false )
    toggleControl ( thePlayer, "vehicle_fire", false )
    toggleControl ( thePlayer, "vehicle_secondary_fire", false )
  else
    outputChatBox("exit your not allowed here xd leave madafaker",root,255,0,0)
  end
end
addEventHandler ( "onColShapeHit", greenzone, greenzoneEnter )
 
function greenzoneExit ( thePlayer, matchingDimension )
  if getElementType( thePlayer ) ~= "player" then return end
  outputChatBox ( "* You Left The VIP Vehicle recover Area", thePlayer, 0, 255, 0 )
  toggleControl ( thePlayer, "fire", true )
  toggleControl ( thePlayer, "next_weapon", true )
  toggleControl ( thePlayer, "previous_weapon", true )
  toggleControl ( thePlayer, "aim_weapon", true )
  toggleControl ( thePlayer, "vehicle_fire", true )
  toggleControl ( thePlayer, "vehicle_secondary_fire", true )
end
 
addEventHandler ( "onColShapeLeave", greenzone, greenzoneExit )

Just as a tip: Try to keep your code clean and intented. Makes it much more readable and easier to spot errors like <eof>

Sorry I was on phone

Share this post


Link to post

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.