Arsilex Posted September 1, 2012 Share Posted September 1, 2012 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 Link to comment
Castillo Posted September 2, 2012 Share Posted September 2, 2012 -- /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
Arsilex Posted September 2, 2012 Author Share Posted September 2, 2012 me podrías decir cual es mi error para saber para la próxima y gracias por la ayuda Link to comment
Castillo Posted September 2, 2012 Share Posted September 2, 2012 En esta linea: if ( getElementData( player, "PMOFF.on") == true ) then Vos habias puesto "recipient" en lugar de "player". Link to comment
Recommended Posts