Guten Morgen,
wollte gerne mal wissen was "SMF" genau ist und was das bringt hier mal der Verlauf vom Englishen Forum.
ZitatAlles anzeigenInformation
<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 ""
Kapier das nicht so richtig