SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 05/07/2010, 03:50 PM   #1
Carlton
Gangsta
 
Carlton's Avatar
 
Join Date: Mar 2010
Posts: 687
Reputation: 0
Cool C-SMF 1.1 - Connect from Simple Machines Forums to SA-MP!

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.

Last edited by Carlton; 13/07/2010 at 06:24 PM.
Carlton is offline   Reply With Quote
Old 05/07/2010, 04:21 PM   #2
sampfun
Little Clucker
 
Join Date: May 2010
Posts: 41
Reputation: 0
Default Re: C-SMF - Connect from Simple Machines Forums to SA-MP!

this is nice!
sampfun is offline   Reply With Quote
Old 05/07/2010, 04:21 PM   #3
-Sneaky-
Gangsta
 
Join Date: Jul 2006
Posts: 595
Reputation: 24
Default Re: C-SMF - Connect from Simple Machines Forums to SA-MP!

Very nice idea!

2 suggestions:

Code:
CreateAccount(name[], password[]);
LoginAccount(name[], password[]);
-Sneaky- is offline   Reply With Quote
Old 05/07/2010, 04:27 PM   #4
Typhome
Gangsta
 
Typhome's Avatar
 
Join Date: Mar 2009
Location: Estonia
Posts: 951
Reputation: 10
Default Re: C-SMF - Connect from Simple Machines Forums to SA-MP!

Hmm, nice.
Typhome is offline   Reply With Quote
Old 05/07/2010, 04:27 PM   #5
Calgon
Banned
 
Join Date: Jan 2009
Posts: 6,144
Reputation: 1127
Default Re: C-SMF - Connect from Simple Machines Forums to SA-MP!

Nice, but useless. Create a vBulletin version, most SA-MP communities use vBulletin.
Calgon is offline   Reply With Quote
Old 05/07/2010, 04:28 PM   #6
Carlton
Gangsta
 
Carlton's Avatar
 
Join Date: Mar 2010
Posts: 687
Reputation: 0
Default Re: C-SMF - Connect from Simple Machines Forums to SA-MP!

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.

Last edited by Carlton; 05/07/2010 at 04:39 PM.
Carlton is offline   Reply With Quote
Old 05/07/2010, 04:49 PM   #7
ziomal432
Big Clucker
 
Join Date: Dec 2009
Posts: 121
Reputation: 0
Default Re: C-SMF - Connect from Simple Machines Forums to SA-MP!

Topic title should be
Quote:
C-SMF - Connect from SA-MP to Simple Machines Forums!
ziomal432 is offline   Reply With Quote
Old 05/07/2010, 04:52 PM   #8
Carlton
Gangsta
 
Carlton's Avatar
 
Join Date: Mar 2010
Posts: 687
Reputation: 0
Default Re: C-SMF - Connect from Simple Machines Forums to SA-MP!

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.
Carlton is offline   Reply With Quote
Old 05/07/2010, 05:06 PM   #9
L4ky
Little Clucker
 
Join Date: May 2008
Posts: 8
Reputation: 1
Default Re: C-SMF - Connect from Simple Machines Forums to SA-MP!

This is awesome! Very nice work!
L4ky is offline   Reply With Quote
Old 05/07/2010, 08:13 PM   #10
Carlton
Gangsta
 
Carlton's Avatar
 
Join Date: Mar 2010
Posts: 687
Reputation: 0
Default Re: C-SMF - Connect from Simple Machines Forums to SA-MP!

Quote:
Originally Posted by L4ky View Post
This is awesome! Very nice work!
Thank you.
Carlton is offline   Reply With Quote
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sprunk Machines Pre-Coded? sidhu123 Scripting Help 10 29/01/2012 07:50 AM
[FilterScript] [FS] Sprunkin || Vending Machines! Tr1viUm Filterscripts 20 28/12/2010 11:04 PM
Sprunk machines? Thrarod Help Archive 1 11/05/2010 04:14 PM
State machines Malice Help Archive 1 04/12/2009 11:13 AM
[help] soda machines ғαιιοцт Help Archive 6 23/02/2009 02:30 PM


All times are GMT. The time now is 10:57 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.