Jump to content

[HELP] script


Machine

Recommended Posts

this dont work! :cry:

  
aRadarArea = createRadarArea ( 1024, 1024, 30, 140, 255, 255, 0, 85 ) -- create the radar area 
flag = setRadarAreaSize ( aRadarArea, 50, 90 ) 
if ( flag ) then 
local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then --check if hes admin 
setElementPosition ( source, x, y, z ) -- that he stay where he is and dont teleport 
if not then setElementPosition ( source, 1549.88953, -1685, 13 )-- if hes not admin then teleprot him to other postion 
    end 
end 
  
  

Link to comment
this dont work! :cry:
  
aRadarArea = createRadarArea ( 1024, 1024, 30, 140, 255, 255, 0, 85 ) -- create the radar area 
flag = setRadarAreaSize ( aRadarArea, 50, 90 ) 
if ( flag ) then 
local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then --check if hes admin 
setElementPosition ( source, x, y, z ) -- that he stay where he is and dont teleport 
if not then setElementPosition ( source, 1549.88953, -1685, 13 )-- if hes not admin then teleprot him to other postion 
    end 
end 
  
  

see what are u writing.

u forgot the if

"if isObjectInAclGroup"

not "isObjectInAclGroup"

u forgot :

local aRadarArea = createRadarArea 
  
local flag = setRadarAreaSize 

Link to comment

tried didnt work :(

local aRadarArea = createRadarArea ( 1024, 1024, 30, 140, 255, 255, 0, 85 ) -- create the radar area 
local flag = setRadarAreaSize ( aRadarArea, 50, 90 ) 
if ( flag ) then 
local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then --check if hes admin 
setElementPosition ( source, x, y, z ) -- that he stay where he is and dont teleport 
if not then setElementPosition ( source, 1549.88953, -1685, 13 )-- if hes not admin then teleprot him to other postion 
    end 
end if 
  
  
  

Link to comment

Machine, what u want to do in this code?

If u want warp admin to base, then u should set any event...

For example:

1) Create Col shape. http://wiki.multitheftauto.com/wiki/CreateColCuboid

Then u should addEvent for this colshape...

2) Add Event OnColshapeHit (http://wiki.multitheftauto.com/wiki/OnColShapeHit)

Example:

local Colshape = createColCuboid ( 1024, 1024, 0, 500, 500, 500 ) --Create colshape 
  
  
function OnHit ( hitElement, matchingDimension ) 
    if ( source == Colshape ) then --If Source is our colshape then 
        if ( matchingDimension and getElementType ( hitElement ) == "player" ) then -- chech if hit element is player  
            if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(hitElement)), aclGetGroup ( "Admin" ) ) then --If player is admin 
                setElementPosition ( hitElement, 1549.88953, -1685, 13 ) --Warp to admin's position 
            else 
                setElementPosition ( hitElement, 0, 0, 0 ) --Warp to not admin's position 
            end 
        end 
    end 
end 
addEventHandler ( "onColShapeLeave", root, OnHit) 

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