Jump to content

Forum Accounts on mta


Recommended Posts

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

Link to comment
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 by Guest
Link to comment

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.

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...