Jump to content

Jail Help


Wei

Recommended Posts

addCommandHandler ( 'aj', 
    function ( sCommand, uTarget, nTime ) 
        if ( isStaff ( localPlayer ) ) then 
            nTime = nTime * 60 * 1000 
            local target = getPlayerFromName ( uTarget ); 
            setElementInterior ( target, 6 ); 
            setElementPosition ( target, 265.21185302734, 77.63591003418, 1001.0390625 ); 
            setTimer ( 
                function ( uTarget ) 
                    setElementPosition ( uTarget, 1546.20203, -1675.47412, 13.56186 ); 
                    setElementInterior ( uTarget, 0 ); 
                end, 
            nTime, 1, target ) 
            outputChatBox ( 'You have been jailed!', target, 255, 255, 0 ); 
            outputChatBox ( 'INFO: ' .. getPlayerName ( target ) .. ' has been jailed for 5 minutes by Admin.', root, 255, 255, 0 ); 
            outputDebugString ( getPlayerName ( target ) .. ' has been jailed!' ); 
        else 
            outputChatBox ( 'Acess denied to the command!', localPlayer, 255, 255, 0 ); 
        end 
    end 
) 
  
addCommandHandler ( 'auj', 
    function ( sCommand, uTarget ) 
        if ( isStaff ( localPlayer ) ) then 
            local target = getPlayerFromName ( uTarget ); 
            setElementInterior ( target, 0 ); 
            setElementPosition ( target, 1546.20203, -1675.47412, 13.56186 ); 
            outputChatBox ( 'You have been unjailed!', target, 255, 255, 0 ); 
        else 
            outputChatBox ( 'Acess denied to the command!', localPlayer, 255, 255, 0 ) 
        end 
    end 
) 
  
isStaff = function ( thePlayer ) 
team = getPlayerTeam(localPlayer) 
if team == getTeamFromName("Staff") then 
        return true; 
    else 
        return false; 
    end 
end 

Why doesn't work color for text ?

Link to comment

Ok, so what this

outputChatBox ( 'You have been jailed!', target, 255, 255, 0 ); 

??

blazy can you read all argument on wiki again?

isStaff = function ( uPlayer ) 
    local uTeam = getPlayerTeam( uPlayer ) 
    if not uTeam then 
        return false 
    end 
    if uTeam == getTeamFromName 'Staff' then 
        return true 
    end 
    return false 
end 
  
addCommandHandler ( 'aj', 
    function ( _, sTarget, sTime ) 
        if ( isStaff ( localPlayer ) ) then 
            local nTime = tonumber( sTime ) 
            nTime = nTime * 60 * 1000 
            local uTarget = getPlayerFromName ( sTarget ); 
            setElementInterior ( uTarget, 6 ); 
            setElementPosition ( uTarget, 265.21185302734, 77.63591003418, 1001.0390625 ); 
            setTimer ( 
                function ( uTarget ) 
                    setElementPosition ( uTarget, 1546.20203, -1675.47412, 13.56186 ); 
                    setElementInterior ( uTarget, 0 ); 
                end, 
            nTime, 1, uTarget ) 
            outputChatBox ( 'You have been jailed!', 255, 255, 0 ) 
            outputChatBox ( 'INFO: ' .. getPlayerName ( uTarget ) .. ' has been jailed for 5 minutes by Admin.', 255, 255, 0 ) 
            outputDebugString ( getPlayerName ( uTarget ) .. ' has been jailed!' ) 
        else 
            outputChatBox ( 'Acess denied to the command!', 255, 255, 0 ) 
        end 
    end 
) 
  
addCommandHandler ( 'auj', 
    function ( _, sTarget ) 
        if isStaff ( localPlayer ) then 
            local target = getPlayerFromName ( sTarget ) 
            setElementInterior ( target, 0 ) 
            setElementPosition ( target, 1546.20203, -1675.47412, 13.56186 ) 
            outputChatBox ( 'You have been unjailed!', 255, 255, 0 ) 
        else 
            outputChatBox ( 'Acess denied to the command!', 255, 255, 0 ) 
        end 
    end 
) 

Corrected code -_-

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