[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


Messages In This Thread
C-SMF 1.1 - Connect from Simple Machines Forums to SA-MP! - by Carlton - 05.07.2010, 15:50
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by sampfun - 05.07.2010, 16:21
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by -Sneaky- - 05.07.2010, 16:21
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by Typhome - 05.07.2010, 16:27
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by Calgon - 05.07.2010, 16:27
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by Carlton - 05.07.2010, 16:28
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by ziomal432 - 05.07.2010, 16:49
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by Carlton - 05.07.2010, 16:52
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by L4ky - 05.07.2010, 17:06
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by Carlton - 05.07.2010, 20:13
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by shady91 - 06.07.2010, 01:18
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by iZN - 06.07.2010, 05:47
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by [03]Garsino - 06.07.2010, 10:28
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by Jay_ - 06.07.2010, 12:57
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by Calgon - 06.07.2010, 14:01
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by Carlton - 06.07.2010, 15:37
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by Burridge - 06.07.2010, 22:52
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by TheKingOfSamp - 06.07.2010, 22:54
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by BloodyEric - 07.07.2010, 08:43
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by Calgon - 07.07.2010, 10:41
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by Simon - 07.07.2010, 11:56
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by KnooL - 07.07.2010, 12:16
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by Carlton - 07.07.2010, 12:39
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by Carlton - 07.07.2010, 13:16
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by Carlton - 07.07.2010, 23:43
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by Carlton - 08.07.2010, 00:03
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by wr4h4ck - 08.07.2010, 17:00
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by Carlton - 08.07.2010, 23:18
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by Carlton - 13.07.2010, 18:23
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by Scones - 15.07.2010, 16:27
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by Jay_ - 07.08.2010, 12:08
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by Jay_ - 07.08.2010, 14:08
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by Carlton - 07.08.2010, 17:19
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by Jay_ - 07.08.2010, 17:37
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by Jay_ - 08.08.2010, 13:50
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by armyoftwo - 10.08.2010, 16:29
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by rbN. - 27.11.2010, 14:44
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by gtg2808 - 22.12.2010, 16:24
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by iTorran - 01.01.2011, 13:41
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by Luis- - 02.10.2011, 13:30
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by Edvin - 02.10.2011, 17:55
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by Kazuo - 03.10.2011, 07:11
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by Dripac - 03.10.2011, 07:12
Re : C-SMF - Connect from Simple Machines Forums to SA-MP! - by Varkoll_ - 03.10.2011, 18:05
Re : C-SMF - Connect from Simple Machines Forums to SA-MP! - by TheBest6 - 03.10.2011, 18:15
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by TheLazySloth - 03.10.2011, 18:27
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by LZLo - 03.10.2011, 18:37
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by Luis- - 03.10.2011, 21:24
Re : C-SMF - Connect from Simple Machines Forums to SA-MP! - by deliocomrp - 08.10.2011, 19:51
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by GangsTa_ - 08.10.2011, 20:58
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by Ronaldo_raul™ - 20.12.2011, 19:34
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by Astralis - 20.12.2011, 19:40
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by AndreT - 20.12.2011, 19:47
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by Raku - 08.03.2012, 01:12
Re: C-SMF - Connect from Simple Machines Forums to SA-MP! - by Britas - 17.03.2012, 15:07

Forum Jump:


Users browsing this thread: 1 Guest(s)