Raised This Month: $12 Target: $400
 3% 

Signal PM System - MySQL/SQLite based in-game Private Messaging


Post New Thread Reply   
 
Thread Tools Display Modes
Scone
Senior Member
Join Date: Apr 2010
Location: England
Old 04-12-2010 , 16:44   Re: Signal PM System - MySQL based in-game Private Messaging
Reply With Quote #11

Quote:
Originally Posted by BDeep View Post
Would it be possible to maybe notify people VIA email or something that they have a PM?
It is possible, but it'd be difficult to send e-mail from inside SourceMod (you'd need to install the Sockets extension, and the plugin would have to manually implement SMTP).

The easiest way is to do it outside the plugin, maybe in PHP. You could set up a daily Cron job to run the PHP script, and then inside you could get all the users with unread messages from the database (SELECT DISTINCT destId FROM signal WHERE unread = 1) and send e-mails to them.

So, I doubt this is something I'd be able to do in the plugin, but if you know how to code with MySQL it's not too hard to extend it
__________________
Scone is offline
Scone
Senior Member
Join Date: Apr 2010
Location: England
Old 04-12-2010 , 16:57   Re: Signal PM System - MySQL based in-game Private Messaging
Reply With Quote #12

If you add a table "signal_emails", the following (entirely untested) code could work:

PHP Code:
$db mysql_connect(...);

$q mysql_query("SELECT DISTINCT email FROM signal, signal_emails "
                 
"WHERE unread = 1 AND destId = signal_emails.steamId"$db);

$rows mysql_num_rows($q);

for(
$i 0$i $rows$i++) {
    
$res mysql_fetch_array($q);
    
mail($res[0], "Unread PM""You have one or more unread PMs in your inbox!");
}

mysql_close($db); 
__________________

Last edited by Scone; 04-14-2010 at 05:36. Reason: typo
Scone is offline
BDeep
Senior Member
Join Date: Jun 2009
Location: NH
Old 04-12-2010 , 18:16   Re: Signal PM System - MySQL based in-game Private Messaging
Reply With Quote #13

I will give it a try tomorrow and see what happens. I will post back with the results
__________________
BDeep is offline
Scone
Senior Member
Join Date: Apr 2010
Location: England
Old 04-13-2010 , 02:32   Re: Signal PM System - MySQL based in-game Private Messaging
Reply With Quote #14

Updated with version 1.1.1, due to a minor bugfix in the appearance of the inbox.
__________________
Scone is offline
Ph03n1X
Member
Join Date: Apr 2010
Location: Latvia, Riga
Old 04-13-2010 , 09:07   Re: Signal PM System - MySQL based in-game Private Messaging
Reply With Quote #15

Thanks, for nice plugin! There russian translations.

P.S. Can you change translation mechanism that using LANG_SERVER, to client specific lang?
Attached Files
File Type: txt signal.phrases.txt (10.9 KB, 154 views)
Ph03n1X is offline
Scone
Senior Member
Join Date: Apr 2010
Location: England
Old 04-13-2010 , 09:41   Re: Signal PM System - MySQL based in-game Private Messaging
Reply With Quote #16

That's excellent, thanks! I've updated the plugin to version 1.1.2:
- Each client now sees the interface in their own language
- Russian translations added
__________________
Scone is offline
Scone
Senior Member
Join Date: Apr 2010
Location: England
Old 04-16-2010 , 13:40   Re: Signal PM System - MySQL based in-game Private Messaging
Reply With Quote #17

Version 1.1.3 released:
- Added CVAR "signalpm_pollinterval"
- Minor bugfix relating to reconnect after DB failure
__________________
Scone is offline
noodleboy347
AlliedModders Donor
Join Date: Mar 2009
Old 04-16-2010 , 21:29   Re: Signal PM System - MySQL based in-game Private Messaging
Reply With Quote #18

This is awesome!
noodleboy347 is offline
Scone
Senior Member
Join Date: Apr 2010
Location: England
Old 04-17-2010 , 16:31   Re: Signal PM System - MySQL based in-game Private Messaging
Reply With Quote #19

Thanks

I'm still open to feature suggestions if anyone has any more.
__________________
Scone is offline
noodleboy347
AlliedModders Donor
Join Date: Mar 2009
Old 04-17-2010 , 17:45   Re: Signal PM System - MySQL based in-game Private Messaging
Reply With Quote #20

I have a request, since I use Simple Chat Colors and it doesn't let the admins use pmsend.

Maybe commands to use? /pmsend, /pm, etc. All of the chat triggers with parameters.
noodleboy347 is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:45.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode