Jump to content

Otra duda


Arsilex

Recommended Posts

Por que me da error esto

-- /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 ( getElementData( recipent, "PMOFF.on") == true ) then 
                            pm( thePlayer, player, message ) 
                        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 
        end 
        cancelEvent( ) 
    end 
) 
  
function showTextDisplay2(playerSource) 
    if hasObjectPermissionTo( playerSource, "command.kick", false ) or hasObjectPermissionTo( playerSource, "command.deletecar", false ) then 
        setElementData(playerSource, "PMOFF.on", true) 
        outputChatBox( "Quitaste el PM", playerSource, 0, 255, 255 ) 
    else 
        outputChatBox( "No eres administrador", playerSource, 0, 255, 255 ) 
    end 
end 
addCommandHandler( "quitarpm", showTextDisplay2 ) 
  
function showTextDisplay(playerSource) 
    if hasObjectPermissionTo( playerSource, "command.kick", false ) or hasObjectPermissionTo( playerSource, "command.deletecar", false ) then 
        setElementData(playerSource, "PMOFF.on", false) 
        outputChatBox( "Activaste el PM", playerSource, 0, 255, 255 ) 
    else 
        outputChatBox( "No eres administrador", playerSource, 0, 255, 255 ) 
    end 
end 
addCommandHandler( "activarpm", showTextDisplay ) 

me sale este error :S

scaled.php?server=269&filename=sinttulogqg.png&res=landing

Link to comment
-- /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 ( getElementData( player, "PMOFF.on") == true ) then 
                            pm( thePlayer, player, message ) 
                        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 
        end 
        cancelEvent( ) 
    end 
) 
  
function showTextDisplay2(playerSource) 
    if hasObjectPermissionTo( playerSource, "command.kick", false ) or hasObjectPermissionTo( playerSource, "command.deletecar", false ) then 
        setElementData(playerSource, "PMOFF.on", true) 
        outputChatBox( "Quitaste el PM", playerSource, 0, 255, 255 ) 
    else 
        outputChatBox( "No eres administrador", playerSource, 0, 255, 255 ) 
    end 
end 
addCommandHandler( "quitarpm", showTextDisplay2 ) 
  
function showTextDisplay(playerSource) 
    if hasObjectPermissionTo( playerSource, "command.kick", false ) or hasObjectPermissionTo( playerSource, "command.deletecar", false ) then 
        setElementData(playerSource, "PMOFF.on", false) 
        outputChatBox( "Activaste el PM", playerSource, 0, 255, 255 ) 
    else 
        outputChatBox( "No eres administrador", playerSource, 0, 255, 255 ) 
    end 
end 
addCommandHandler( "activarpm", showTextDisplay ) 

Link to comment
  • Recently Browsing   0 members

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