Jump to content

private message


Castillo

Recommended Posts

Posted

hey, i added a PM system into my player menu but the problem is that players can send empty messages so im trying to cancel that but dunno why dosnt works, here is my code.

addEvent ("sendMsg", true)
addEventHandler ("sendMsg", getRootElement(),
function(msg,client)
local givenplayer = getPlayerFromName ( client )	
if( givenplayer ) then
if msg == nil then
outputChatBox ( "* PM from " .. getPlayerName(source) .. ": " ..msg.. ".", givenplayer, 243, 151, 12 )
else
outputChatBox ("Error: You cant send empty messages.", source, 255, 0, 0, false)
end	
end
end)

Thanks in advance.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

post whole code maybe?

or try

if msg==nil or msg=='' or msg==false then

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

yea that worked, thanks.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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