Arsilex Posted September 1, 2012 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
Castillo Posted September 2, 2012 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 ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Arsilex Posted September 2, 2012 Author Posted September 2, 2012 me podrías decir cual es mi error para saber para la próxima y gracias por la ayuda
Castillo Posted September 2, 2012 Posted September 2, 2012 En esta linea: if ( getElementData( player, "PMOFF.on") == true ) then Vos habias puesto "recipient" en lugar de "player". San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Castillo Posted September 2, 2012 Posted September 2, 2012 De nada. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Recommended Posts