MisterQuestions Posted July 23, 2014 Posted July 23, 2014 Hi, in this time i wanna ask how can i use a login panel, taking the accounts from my forum,players should be registered on forum, then will login on game.
Saml1er Posted July 23, 2014 Posted July 23, 2014 If you're using a free host then forget about it but if you've a forum then I can give you my script ( php script ) which I wrote. It works with SMF 2.0 forum and if you're using phpBB then still no problem, I can make it for you. ;P
MisterQuestions Posted July 23, 2014 Author Posted July 23, 2014 SMF ! I will thank you alot! please ^^ Else, is there anyway to do a mapuploader to user upload from web, then maps arrive to server?
12p Posted July 23, 2014 Posted July 23, 2014 (edited) is there anyway to do a mapuploader to user upload from web, then maps arrive to server? You could certainly add an e-mail account so people can send you their maps through there. Easy and free solution, and will take just a bit of time to check every map you want to have. Also, since there's the possibility of spamming your server with bad maps, and maybe even a DDoS attack through chains of tiny-sized resources, you gotta be careful. Edited July 23, 2014 by Guest
FuriouZ Posted July 23, 2014 Posted July 23, 2014 Here is something, you should check it out https://community.multitheftauto.com/index.php?p= ... ls&id=6436
MisterQuestions Posted July 24, 2014 Author Posted July 24, 2014 Mmmm, i still with the idea of map uploader, the server have Anti-DDoS So np
Saml1er Posted July 24, 2014 Posted July 24, 2014 First download: https://wiki.multitheftauto.com/wiki/PHP_SDK <-- Downlaod latest version and make sure you remove line 80 or simply make it a dead line so php doesn't read the code: //echo Extract files to a folder and rename it "mtaphpsdk_0.4" and upload it to your root folder of website. Now all you need to do is to make a new PHP script in your root folder of your website and lets name it "MTA_login.php". You should be under this directory now: "public_html/MTA_login.php". Open your php file and paste your code if you don't know php scripting then you can use the code I wrote for someone. <?php include ("mtaphpsdk_0.4/mta_sdk.php"); include("SSI.php"); $input = mta::getInput(); $username = $input[0]; $password = $input[1]; $result = $smcFunc['db_query']('', ' SELECT passwd FROM {db_prefix}members WHERE member_name = {string:member_na} LIMIT 1', array( 'member_na' => $username, ) ); if ($smcFunc['db_num_rows']($result) !== 0) { while ($row = $smcFunc['db_fetch_assoc']($result) ) { if(sha1(strtolower($username) . $password) == $row['passwd']) { mta::doReturn("true"); } else { mta::doReturn("false"); } } } ?> Now all you need to do is to use callRemote ( REMEMBER THIS IS NOT AN efficient method. It will be better if you use fetchRemote.) Here's an example of using callRemote: function result(val) local val2 = tostring(val) if val2 == "true" then -- Now login the player with MTA functions or whatever you want to use elseif val2 == "false" --- Password/Username is invalid end end local username = "Saml1er" local password = "123456" callRemote ( "http://www.example.com/MTA_login.php", result, username,password ) NOTE: Make sure you've given admin rights to your resource.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now