Jump to content

Una ayudita porfis


Arsilex

Recommended Posts

Posted
-- /pm to message other players 
local function pm( player, target, message ) 
    outputChatBox( "PM a [" .. exports.players:getID( target ) .. "] " .. getPlayerName( target ) .. ": " .. message, player, 255, 255, 0 ) 
    outputChatBox( "PM de [" .. exports.players:getID( player ) .. "] " .. getPlayerName( player ) .. ": " .. message, target, 255, 255, 0 ) 
end 
  
addCommandHandler( "pm", 
    function( thePlayer, commandName, otherPlayer, ... ) 
        if exports.players:isLoggedIn( thePlayer ) then 
            if otherPlayer and ( ... ) then 
                local message = table.concat( { ... }, " " ) 
                local player, name = exports.players:getFromName( thePlayer, otherPlayer ) 
                if player then 
                    if ( hasObjectPermissionTo ( getThisResource (), "command.kick", true ) ) then 
                        pm( thePlayer, player, message ) 
                    else 
                        outputChatBox( "El jugador no es un administrador", thePlayer, 255, 255, 255 ) 
                    end 
                end 
            else 
                outputChatBox( "Syntax: /" .. commandName .. " [player] [ooc text]", thePlayer, 255, 255, 255 ) 
            end 
        end 
    end 
) 
  
addEventHandler( "onPlayerPrivateMessage", root, 
    function( message, recipent ) 
        if exports.players:isLoggedIn( thePlayer ) and exports.players:isLoggedIn( recipent ) then 
                pm( source, recipent, message ) 
        end 
        cancelEvent( ) 
    end 
) 

Intente poner que no se pueda enviar PM a un jugador que no es admin pero lo que pasa es que cuando lo ago el admin tampoco puedo como ago para que el admin pueda?

Posted

intenta esto

addCommandHandler( "pm", 
    function( thePlayer, commandName, otherPlayer, ... ) 
 local account = getPlayerAccount(thePlayer) 
        if exports.players:isLoggedIn( thePlayer ) then 
            if otherPlayer and ( ... ) then 
                local message = table.concat( { ... }, " " ) 
                local player, name = exports.players:getFromName( thePlayer, otherPlayer ) 
                if player then 
 if isObjectInACLGroup( 'user.'..getAccountName( account ), aclGetGroup( 'Admin' ) ) then 
                        pm( thePlayer, player, message ) 
                    else 
                        outputChatBox( "El jugador no es un administrador", thePlayer, 255, 255, 255 ) 
                    end 
                end 
            else 
                outputChatBox( "Syntax: /" .. commandName .. " [player] [ooc text]", thePlayer, 255, 255, 255 ) 
            end 
        end 
    end 
) 

Posted

nada esto lo unico que cambio es que ahora los Player no pueden enviar PM ni a admin ni a Player y los Admins si

Lo que yo quiero es que los player solo puedan a admin y admin a todos :S

Posted

aaaaaaaaah ahora entiendo.

addCommandHandler( "pm", 
    function( thePlayer, commandName, otherPlayer, ... ) 
 local account = getPlayerAccount(thePlayer) 
 local account2 = getPlayerAccount(otherPlayer) 
  
        if exports.players:isLoggedIn( thePlayer ) then 
            if otherPlayer and ( ... ) then 
                local message = table.concat( { ... }, " " ) 
                local player, name = exports.players:getFromName( thePlayer, otherPlayer ) 
                if player then 
 if isObjectInACLGroup( 'user.'..getAccountName( account ), aclGetGroup( 'Everyone' ) ) and   
 if isObjectInACLGroup( 'user.'..getAccountName( account2 ), aclGetGroup( 'Admin' ) ) or 
 if isObjectInACLGroup( 'user.'..getAccountName( account ), aclGetGroup( 'Admin' ) ) and   
 if isObjectInACLGroup( 'user.'..getAccountName( account2 ), aclGetGroup( 'Everyone' ) ) then 
                        pm( thePlayer, player, message ) 
                    else 
                        outputChatBox( "El jugador no es un administrador", thePlayer, 255, 255, 255 ) 
                    end 
                end 
end 
end 
end 
            else 
                outputChatBox( "Syntax: /" .. commandName .. " [player] [ooc text]", thePlayer, 255, 255, 255 ) 
            end 
        end 
    end 
) 

No estoy seguro. :S Dudo mucho, pero testealo

Posted
addCommandHandler( "pm", 
    function( thePlayer, commandName, otherPlayer, ... ) 
        if exports.players:isLoggedIn( thePlayer ) then 
            if otherPlayer and ( ... ) then 
                local message = table.concat( { ... }, " " ) 
                local player, name = exports.players:getFromName( thePlayer, otherPlayer ) 
                if player then 
                    if ( hasObjectPermissionTo ( getThisResource (), "command.kick", true ) ) then 
                     if ( hasObjectPermissionTo ( "user."..exports.players:getUserName( name ), "command.kick", true ) ) then 
                        pm( thePlayer, player, message ) 
                    elseif ( hasObjectPermissionTo ( "user."..exports.players:getUserName( player ), "command.kick", true ) ) then 
                        pm( thePlayer, player, message ) 
                      else 
                        outputChatBox( "El jugador no es un administrador", thePlayer, 255, 255, 255 ) 
                    end 
                end 
            else 
                outputChatBox( "Syntax: /" .. commandName .. " [player] [ooc text]", thePlayer, 255, 255, 255 ) 
            end 
        end 
    end 
end 
) 

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...