Jump to content

staff


joedajoester

Recommended Posts

Posted

Why do these scripts only work for admins, i need it to be staff only please.

function getPlayerFromPartOfName(playerPart) 
  local pl = getPlayerFromName(playerPart) 
  if isElement(pl) then 
    return pl 
  else 
    for i,v in ipairs (getElementsByType ("player")) do 
      if (string.find(getPlayerName(v),playerPart)) then 
        return v 
      end 
    end 
  end 
end 
  
function Jail (player, command, name) 
    if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(player)), aclGetGroup (  
Admin" ) ) then 
    local thePlayer = getPlayerFromPartOfName(name) 
    if not thePlayer then return end 
    if getElementData( thePlayer, "isJailed") then outputChatBox("This player is already in jail.",player,255,0,0) return end 
    setElementData(thePlayer, "jailSkin", getElementModel ( thePlayer )) 
    setElementModel ( thePlayer, 22 ) 
    setElementPosition ( thePlayer, 52, 2483, 21 ) 
    takeAllWeapons ( getRootElement() ) 
    setElementData ( thePlayer, "isJailed", true ) 
    outputChatBox (getPlayerName(thePlayer).." has been jailed", getRootElement(), 255, 0, 0, true ) 
    else 
    outputChatBox ("You cannot use this command!", player, 255, 0, 0, true ) 
    end 
end 
addCommandHandler("jail",Jail) 
  
function Unjail (player, command, name) 
    if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(player)), aclGetGroup ( "Admin" ) ) then 
    local thePlayer = getPlayerFromPartOfName(name) 
    if not thePlayer then return end 
    if not getElementData( thePlayer, "isJailed") then outputChatBox("This player is not in jail.",player,255,0,0) return end 
    setElementPosition ( thePlayer, 72, 2484, 16.3 ) 
    setElementModel ( thePlayer, tonumber(getElementData(thePlayer,"jailSkin"))) 
    setElementData ( thePlayer, "isJailed", false ) 
    outputChatBox (getPlayerName(thePlayer).." has been unjailed. Be good now, "..getPlayerName(thePlayer), getRootElement(), 0, 255, 0, true ) 
    else 
    outputChatBox ("You cannot unjail yourself!", player, 255, 0, 0, true ) 
    end 
 end 
addCommandHandler("unjail",Unjail) 
  
ped1inside = createPed ( 71, 69, 2503, 17) 
setPedRotation (ped1inside, 180) 
  
function respawn() 
    local x,y,z = getElementPosition(source) 
    local rx,ry,rz = getElementRotation(source) 
    setTimer(createPed, 60000, 1, 71, x,y,z,rz) 
    if isElement(ped1inside) then destroyElement(ped1inside) end 
end 
addEventHandler("onPedWasted",ped1inside,respawn) 
  
function visit (player) 
 setElementPosition (player, 71, 2499, 17 ) 
end 
addCommandHandler("visitjail", visit) 
  
 

What do i have to replace if is inadmingroup with? ill do it myself, becasue i have many scripts that need to be changed

Posted

I understand by "Staff" you mean a ACL group called "Staff".

function getPlayerFromPartOfName(playerPart) 
  local pl = getPlayerFromName(playerPart) 
  if isElement(pl) then 
    return pl 
  else 
    for i,v in ipairs (getElementsByType ("player")) do 
      if (string.find(getPlayerName(v),playerPart)) then 
        return v 
      end 
    end 
  end 
end 
  
function Jail (player, command, name) 
    if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(player)), aclGetGroup ("Staff" ) ) then 
    local thePlayer = getPlayerFromPartOfName(name) 
    if not thePlayer then return end 
    if getElementData( thePlayer, "isJailed") then outputChatBox("This player is already in jail.",player,255,0,0) return end 
    setElementData(thePlayer, "jailSkin", getElementModel ( thePlayer )) 
    setElementModel ( thePlayer, 22 ) 
    setElementPosition ( thePlayer, 52, 2483, 21 ) 
    takeAllWeapons ( getRootElement() ) 
    setElementData ( thePlayer, "isJailed", true ) 
    outputChatBox (getPlayerName(thePlayer).." has been jailed", getRootElement(), 255, 0, 0, true ) 
    else 
    outputChatBox ("You cannot use this command!", player, 255, 0, 0, true ) 
    end 
end 
addCommandHandler("jail",Jail) 
  
function Unjail (player, command, name) 
    if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(player)), aclGetGroup ( "Staff" ) ) then 
    local thePlayer = getPlayerFromPartOfName(name) 
    if not thePlayer then return end 
    if not getElementData( thePlayer, "isJailed") then outputChatBox("This player is not in jail.",player,255,0,0) return end 
    setElementPosition ( thePlayer, 72, 2484, 16.3 ) 
    setElementModel ( thePlayer, tonumber(getElementData(thePlayer,"jailSkin"))) 
    setElementData ( thePlayer, "isJailed", false ) 
    outputChatBox (getPlayerName(thePlayer).." has been unjailed. Be good now, "..getPlayerName(thePlayer), getRootElement(), 0, 255, 0, true ) 
    else 
    outputChatBox ("You cannot unjail yourself!", player, 255, 0, 0, true ) 
    end 
end 
addCommandHandler("unjail",Unjail) 
  
ped1inside = createPed ( 71, 69, 2503, 17) 
setPedRotation (ped1inside, 180) 
  
function respawn() 
   local x,y,z = getElementPosition(source) 
   local rx,ry,rz = getElementRotation(source) 
   setTimer(createPed, 60000, 1, 71, x,y,z,rz) 
   if isElement(ped1inside) then destroyElement(ped1inside) end 
end 
addEventHandler("onPedWasted",ped1inside,respawn) 
  
function visit (player) 
setElementPosition (player, 71, 2499, 17 ) 
end 
addCommandHandler("visitjail", visit) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Oh, now I get it, use this:

function getPlayerFromPartOfName(playerPart) 
  local pl = getPlayerFromName(playerPart) 
  if isElement(pl) then 
    return pl 
  else 
    for i,v in ipairs (getElementsByType ("player")) do 
      if (string.find(getPlayerName(v),playerPart)) then 
        return v 
      end 
    end 
  end 
end 
  
function Jail (player, command, name) 
    if isStaff(player) then 
    local thePlayer = getPlayerFromPartOfName(name) 
    if not thePlayer then return end 
    if getElementData( thePlayer, "isJailed") then outputChatBox("This player is already in jail.",player,255,0,0) return end 
    setElementData(thePlayer, "jailSkin", getElementModel ( thePlayer )) 
    setElementModel ( thePlayer, 22 ) 
    setElementPosition ( thePlayer, 52, 2483, 21 ) 
    takeAllWeapons ( getRootElement() ) 
    setElementData ( thePlayer, "isJailed", true ) 
    outputChatBox (getPlayerName(thePlayer).." has been jailed", getRootElement(), 255, 0, 0, true ) 
    else 
    outputChatBox ("You cannot use this command!", player, 255, 0, 0, true ) 
    end 
end 
addCommandHandler("jail",Jail) 
  
function Unjail (player, command, name) 
    if isStaff(player) then 
    local thePlayer = getPlayerFromPartOfName(name) 
    if not thePlayer then return end 
    if not getElementData( thePlayer, "isJailed") then outputChatBox("This player is not in jail.",player,255,0,0) return end 
    setElementPosition ( thePlayer, 72, 2484, 16.3 ) 
    setElementModel ( thePlayer, tonumber(getElementData(thePlayer,"jailSkin"))) 
    setElementData ( thePlayer, "isJailed", false ) 
    outputChatBox (getPlayerName(thePlayer).." has been unjailed. Be good now, "..getPlayerName(thePlayer), getRootElement(), 0, 255, 0, true ) 
    else 
    outputChatBox ("You cannot unjail yourself!", player, 255, 0, 0, true ) 
    end 
end 
addCommandHandler("unjail",Unjail) 
  
ped1inside = createPed ( 71, 69, 2503, 17) 
setPedRotation (ped1inside, 180) 
  
function respawn() 
   local x,y,z = getElementPosition(source) 
   local rx,ry,rz = getElementRotation(source) 
   setTimer(createPed, 60000, 1, 71, x,y,z,rz) 
   if isElement(ped1inside) then destroyElement(ped1inside) end 
end 
addEventHandler("onPedWasted",ped1inside,respawn) 
  
function visit (player) 
setElementPosition (player, 71, 2499, 17 ) 
end 
addCommandHandler("visitjail", visit) 
  
function isStaff(player) 
    for index, group in ipairs({"Admin", "SuperModerator", "Moderator"}) do 
        if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(player)), aclGetGroup ( group ) ) then 
            return true 
        end 
        break 
    end 
    return false 
end 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Thsis a differenct script. eof expected near end. Do you want me to post all the scripts that need t o be changed? Or can you tell me what to change??

col  = createColTube (-1683.0999755859, -2881.1000976563, 50.400001525879, 10, 3) -- enter your cooderates here for your colshape please note 10 and 3 is to do with the size of the shape. 
root = getRootElement () 
  
cone1 = createObject ( 1237, -1679.099609375, -2884.099609375, 51.099998474121, 0, 0, 311.99523925781) -- enter the ID of the object followed by the coordinates 
cone2 = createObject ( 1237, -1681.5, -2881.7998046875, 51.099998474121, 0, 0, 311.99523925781) 
cone3 = createObject ( 1237, -1684.19921875, -2879.3994140625, 51.099998474121, 0, 0, 311.99523925781) 
cone4 = createObject ( 1237, -1686.7998046875, -2877, 51.099998474121, 0, 0, 311.99523925781)   
gate1 = createObject ( 980, -1683, -2881.19921875, 54, 0, 0, 317.99926757813)                                           -- note the rotx y and z may not be required so you just remove these. x y and z is where you would put your cordinates. 
  
  
function Open ( pla ) 
    if getElementType ( pla ) == "player" then 
        if isStaff(player) then 
            moveObject (cone1, 300, -1679.0999755859, -2884.1000976563, 50) 
            moveObject (cone2, 300, -1681.5, -2881.8000488281, 50) 
            moveObject (cone3, 300, -1684.1999511719, -2879.3999023438, 50) 
            moveObject (cone4, 300, -1686.8000488281, -2877, 50) 
            moveObject (gate1, 2500, -1674.4000244141, -2888.8999023438, 54)    -- here is where you enter the coordinatess of the new location of the object, 2200 = the speed of the movent. 
        end 
    end 
end   
addEventHandler ( "onColShapeHit", col, Open) 
  
function Close ( pla ) 
    if getElementType ( pla ) == "player" then 
        if isStaff(player) then 
            moveObject (cone1, 300, -1679.099609375, -2884.099609375, 51.099998474121) 
            moveObject (cone2, 300, -1681.5, -2881.7998046875, 51.099998474121) 
            moveObject (cone3, 300, -1684.19921875, -2879.3994140625, 51.099998474121) 
            moveObject (cone4, 300, -1686.7998046875, -2877, 51.099998474121) 
            moveObject (gate1, 2500, -1683, -2881.19921875, 54) -- here is where you copy the coordinates of the orginal location of the object, 2951 = the timer of movent. 
        end 
    end 
end 
addEventHandler ( "onColShapeLeave", col, Close ) 
  
function isStaff(pla) 
    for index, group in ipairs({"Admin", "SuperModerator", "Moderator"}) do 
        if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(player)), aclGetGroup ( group ) ) then 
            return true 
        end 
        break 
    end 
    return false 
end 

Posted

You changed the player argument at "isStaff" with "pla", replace it again with "player".

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Post what did you do, maybe you didn't get me right.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
col  = createColTube (-1683.0999755859, -2881.1000976563, 50.400001525879, 10, 3) -- enter your cooderates here for your colshape please note 10 and 3 is to do with the size of the shape. 
root = getRootElement () 
  
cone1 = createObject ( 1237, -1679.099609375, -2884.099609375, 51.099998474121, 0, 0, 311.99523925781) -- enter the ID of the object followed by the coordinates 
cone2 = createObject ( 1237, -1681.5, -2881.7998046875, 51.099998474121, 0, 0, 311.99523925781) 
cone3 = createObject ( 1237, -1684.19921875, -2879.3994140625, 51.099998474121, 0, 0, 311.99523925781) 
cone4 = createObject ( 1237, -1686.7998046875, -2877, 51.099998474121, 0, 0, 311.99523925781)   
gate1 = createObject ( 980, -1683, -2881.19921875, 54, 0, 0, 317.99926757813)                                           -- note the rotx y and z may not be required so you just remove these. x y and z is where you would put your cordinates. 
  
  
function Open ( pla ) 
    if getElementType ( pla ) == "player" then 
        if isStaff(pla) then 
            moveObject (cone1, 300, -1679.0999755859, -2884.1000976563, 50) 
            moveObject (cone2, 300, -1681.5, -2881.8000488281, 50) 
            moveObject (cone3, 300, -1684.1999511719, -2879.3999023438, 50) 
            moveObject (cone4, 300, -1686.8000488281, -2877, 50) 
            moveObject (gate1, 2500, -1674.4000244141, -2888.8999023438, 54)    -- here is where you enter the coordinatess of the new location of the object, 2200 = the speed of the movent. 
        end 
    end 
end   
addEventHandler ( "onColShapeHit", col, Open) 
  
function Close ( pla ) 
    if getElementType ( player ) == "player" then 
        if isStaff(player) then 
            moveObject (cone1, 300, -1679.099609375, -2884.099609375, 51.099998474121) 
            moveObject (cone2, 300, -1681.5, -2881.7998046875, 51.099998474121) 
            moveObject (cone3, 300, -1684.19921875, -2879.3994140625, 51.099998474121) 
            moveObject (cone4, 300, -1686.7998046875, -2877, 51.099998474121) 
            moveObject (gate1, 2500, -1683, -2881.19921875, 54) -- here is where you copy the coordinates of the orginal location of the object, 2951 = the timer of movent. 
        end 
    end 
end 
addEventHandler ( "onColShapeLeave", col, Close ) 
  
function isStaff(pla) 
    for index, group in ipairs({"Admin", "SuperModerator", "Moderator"}) do 
        if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(player)), aclGetGroup ( group ) ) then 
            return true 
        end 
        break 
    end 
    return false 
end 

Posted

As I supposed, you didn't get me, or you didn't read careful.

col  = createColTube (-1683.0999755859, -2881.1000976563, 50.400001525879, 10, 3) -- enter your cooderates here for your colshape please note 10 and 3 is to do with the size of the shape. 
root = getRootElement () 
  
cone1 = createObject ( 1237, -1679.099609375, -2884.099609375, 51.099998474121, 0, 0, 311.99523925781) -- enter the ID of the object followed by the coordinates 
cone2 = createObject ( 1237, -1681.5, -2881.7998046875, 51.099998474121, 0, 0, 311.99523925781) 
cone3 = createObject ( 1237, -1684.19921875, -2879.3994140625, 51.099998474121, 0, 0, 311.99523925781) 
cone4 = createObject ( 1237, -1686.7998046875, -2877, 51.099998474121, 0, 0, 311.99523925781)   
gate1 = createObject ( 980, -1683, -2881.19921875, 54, 0, 0, 317.99926757813)                                           -- note the rotx y and z may not be required so you just remove these. x y and z is where you would put your cordinates. 
  
  
function Open ( pla ) 
    if getElementType ( pla ) == "player" then 
        if isStaff(pla) then 
            moveObject (cone1, 300, -1679.0999755859, -2884.1000976563, 50) 
            moveObject (cone2, 300, -1681.5, -2881.8000488281, 50) 
            moveObject (cone3, 300, -1684.1999511719, -2879.3999023438, 50) 
            moveObject (cone4, 300, -1686.8000488281, -2877, 50) 
            moveObject (gate1, 2500, -1674.4000244141, -2888.8999023438, 54)    -- here is where you enter the coordinatess of the new location of the object, 2200 = the speed of the movent. 
        end 
    end 
end   
addEventHandler ( "onColShapeHit", col, Open) 
  
function Close ( pla ) 
    if getElementType ( pla ) == "player" then 
        if isStaff(pla) then 
            moveObject (cone1, 300, -1679.099609375, -2884.099609375, 51.099998474121) 
            moveObject (cone2, 300, -1681.5, -2881.7998046875, 51.099998474121) 
            moveObject (cone3, 300, -1684.19921875, -2879.3994140625, 51.099998474121) 
            moveObject (cone4, 300, -1686.7998046875, -2877, 51.099998474121) 
            moveObject (gate1, 2500, -1683, -2881.19921875, 54) -- here is where you copy the coordinates of the orginal location of the object, 2951 = the timer of movent. 
        end 
    end 
end 
addEventHandler ( "onColShapeLeave", col, Close ) 
  
function isStaff(player) -- I meant here to replace "pla" with "player". 
    for index, group in ipairs({"Admin", "SuperModerator", "Moderator"}) do 
        if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(player)), aclGetGroup ( group ) ) then 
            return true 
        end 
        break 
    end 
    return false 
end 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Will this work??

if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(player)), aclGetGroup (moderator" ) ) then

if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(player)), aclGetGroup (supermoderator" ) ) then

if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(player)), aclGetGroup (Admin" ) ) then

Posted

That's not from this script, I tested and no errors.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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