[Include] C-SMF - Connect from Simple Machines Forums to SA-MP!
#1

Information

<Removed for market linking>

What can this be used for?

Like I said above, to connect the Simple Machines forums to a SA-MP server and collect data from the forums and display them ingame or whatever you'd like to do with them.

Functions
No they're not really natives, just something I like to do when creating functions.
Code:
native OnCSMFInit();
native FormatRealName(bool:_RealName, _field[], _name[], _id);

native GetMemberNameByID(_id[], bool:_RealName);
native GetMemberIDByName(_name[], bool:_RealName);
native GetMemberUMessagesByID(_id, bool:_RealName);
native GetMemberUMessagesByName(_name[], bool:_RealName);
native GetMemberGroupByID(_id, bool:_RealName);
native GetMemberGroupByName(_name[], bool:_RealName);
native GetMemberPostsByID(_id, bool:_RealName);
native GetMemberPostsByName(_name[], bool:_RealName);
native GetMemberIPByName(_name[], bool:_RealName);
native GetMemberIPByID(_id, bool:_RealName);
native GetMemberIP2ByName(_name[], bool:_RealName);
native GetMemberIP2ByID(_id, bool:_RealName);
native CheckUserNameAndPassword(_name[], Password__[], bool:_RealName);

native GetForumNews();
native GetForumSMTP_Username();
native GetForumSMTP_Port();
native GetCategoryNameByID(_id);
native GetBoardNameByID(_id);
native GetBoardIDByName(_name[]);
native GetBoardCategoryByID(_id);
native GetBoardCategoryByName(_name[]);
The bool:_RealName function is for name reasons on the forum, if you didn't notice you can change your display name on this forum and on any other SMF forum. If RealName is true, then it will use the real name of the account, and not the display name!

Thanks for the suggestion on creating a account, here's the function below, insert this into CSMF

Quote:
Originally Posted by Carlton
View Post
pawn Code:
stock CreateAccount(_name[], Password__[], Email[]) {
     new hash[60], formated[128];
     strmid(hash, Password__, 0, strlen(Password__), sizeof hash);
     strins(hash, _name, 0, sizeof hash);
     for(new s; s < strlen(hash); s++) hash[s] = tolower(hash[s]);
     format(formated, 128, "INSERT INTO %s (realName, passwd, emailAddress, memberName) VALUES('%s', sha1('%s'), '%s', '%s')",  MEMBERTABLE, _name,hash, Email, _name);
     mysql_query(formated, -1, -1, SMFConnection);
}
That was tested, it works perfectly, i'm able to login and do what I wan't do. Enjoy.

PS: Insert this into the CSMF, it will bring no errors that way.
Installation

On top of your script.
Code:
#include <CSMF>
In OnGameModeInit() or OnFilterScriptInit()
Code:
OnCSMFInit();
In CSMF.inc, configuration.

Code:
#define SMF_HOST "localhost"
#define SMF_DB "smf"
#define SMF_USER "root"
#define SMF_PASSWORD ""
Download

http://solidfiles.com/d/af33/download

Credits
I - Creating the functions.
Seif - Helping with some problems.
Reply
#2

this is nice!
Reply
#3

Very nice idea!

2 suggestions:

Code:
CreateAccount(name[], password[]);
LoginAccount(name[], password[]);
Reply
#4

Hmm, nice.
Reply
#5

Nice, but useless. Create a vBulletin version, most SA-MP communities use vBulletin.
Reply
#6

Quote:
Originally Posted by Calgon
View Post
Nice, but useless. Create a vBulletin version, most SA-MP communities use vBulletin.
Soon. I was going to make a PHPBB one first or whatever it's called, but i can move vBulletin ahead.

Edit:

Quote:
Originally Posted by -Sneaky-
View Post
Very nice idea!

2 suggestions:

Code:
CreateAccount(name[], password[]);
LoginAccount(name[], password[]);
LoginAccount is pretty much the same as CheckUserNameAndPassword. It returns 0 if the username and password are incorrect, otherwise it returns 1, if you wanted to make sure a player logged in, feel free to set a variable once CheckUserNameAndPassword returns 1.
Reply
#7

Topic title should be
Quote:

C-SMF - Connect from SA-MP to Simple Machines Forums!

Reply
#8

Quote:
Originally Posted by ziomal432
View Post
Topic title should be
Would it matter? You're connecting to Simple Machines from SA:MP and from SA:MP to Simple Machines.
Reply
#9

This is awesome! Very nice work!
Reply
#10

Quote:
Originally Posted by L4ky
View Post
This is awesome! Very nice work!
Thank you.
Reply
#11

Nice idea, never seen something like this before, good work
Reply
#12

Oh my god!!
Never saw anything like this, awesome work!
Reply
#13

Nice work, you should make a PHPBB version too (I know you said this earlier in this topic :P).
My co-owner / website manager couldn't bother to change to SMF D:
Reply
#14

Ignore those incapable of understanding the differences between SMF and vBulletin. Obviously since a recent forum has changed to vBulletin a lot of people seem to get the immediate impression that it's better.

Very, very useful! Definitely going to use this! Well done!
Reply
#15

Quote:
Originally Posted by Jay_
Посмотреть сообщение
Ignore those incapable of understanding the differences between SMF and vBulletin. Obviously since a recent forum has changed to vBulletin a lot of people seem to get the immediate impression that it's better.

Very, very useful! Definitely going to use this! Well done!
It is, in my opinion, and many other communities use vBulletin, not just SMF.
Reply
#16

I don't have a vBulletin license :>
Reply
#17

Wow! Nice, I may utilize this in my code.
Reply
#18

Great Job thank you!!
Reply
#19

This is absolutly awesome!

But especially German SA:MP Communities use Woltlab Burning Board, if you could add it in a future release many more people would use it, SMF is rather unknown here.
Reply
#20

Quote:
Originally Posted by ded
Посмотреть сообщение
Wrong. Most SA:MP Communities use PHPBB or MyBB (For it's obvious vBulletin-alike appearance.)


OT:

This is amazing, I personally use MyBB nowadays, however I used SMF in the past and have a lot of experience with it. So, this is real nice to see. So, this include makes it possible for you to log a player in (In-Game) with his/her forum account? Or am I just too high?
A large majority of SA-MP communities use vBulletin then, not most, but a large majority of the larger servers do. It's the small clans that use SMF, from what I've seen.
Reply


Forum Jump:


Users browsing this thread: 9 Guest(s)