C-SMF 1.1 - Connect from Simple Machines Forums to SA-MP! -
Carlton - 05.07.2010
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
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.
In OnGameModeInit() or OnFilterScriptInit()
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.
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! -
sampfun - 05.07.2010
this is nice!
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! -
-Sneaky- - 05.07.2010
Very nice idea!
2 suggestions:
Code:
CreateAccount(name[], password[]);
LoginAccount(name[], password[]);
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! -
Typhome - 05.07.2010
Hmm, nice.
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! -
Calgon - 05.07.2010
Nice, but useless. Create a vBulletin version, most SA-MP communities use vBulletin.
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! -
Carlton - 05.07.2010
Quote:
Originally Posted by Calgon
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-
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.
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! -
ziomal432 - 05.07.2010
Topic title should be
Quote:
C-SMF - Connect from SA-MP to Simple Machines Forums!
|
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! -
Carlton - 05.07.2010
Quote:
Originally Posted by ziomal432
Topic title should be
|
Would it matter? You're connecting to Simple Machines from SA:MP and from SA:MP to Simple Machines.
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! -
L4ky - 05.07.2010
This is awesome! Very nice work!
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! -
Carlton - 05.07.2010
Quote:
Originally Posted by L4ky
This is awesome! Very nice work!
|
Thank you.
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! -
shady91 - 06.07.2010
Nice idea, never seen something like this before, good work
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! -
iZN - 06.07.2010
Oh my god!!
Never saw anything like this, awesome work!
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - [03]Garsino - 06.07.2010
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:
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! -
Jay_ - 06.07.2010
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!
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! -
Calgon - 06.07.2010
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.
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! -
Carlton - 06.07.2010
I don't have a vBulletin license :>
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! -
Burridge - 06.07.2010
Wow! Nice, I may utilize this in my code.
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! -
TheKingOfSamp - 06.07.2010
Great Job thank you!!
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! -
BloodyEric - 07.07.2010
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.
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! -
Calgon - 07.07.2010
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.