'LinKin Posted April 8, 2014 Share Posted April 8, 2014 Hello, Have you seen some signatures that displays the player's stats? I've always wondered, how do they do that? Now I really want to learn how to make one. Do you know the steps? Thanks. Link to comment
monumento Posted April 8, 2014 Share Posted April 8, 2014 I totally know those steps. It's not hard as it looks. AFAIK you cant do this on sqlite. 1. You need to have mysql. 2. You need to make a background for your stats image, 3. You need to make a php script looking like it: <? $mysqlUsername=""; /MySQL Username. $mysqlPassword=""; // MySQL Pass. $mysqlDatabase=""; // mysql db. $mysqlHost=""; // Your mysql host, it's usually LOCALHOST or ip specified by your hosting company mysql_connect($mysqlHost,$mysqlUsername,$mysqlPassword); //We are trying to conect to mysql database @mysql_select_db($mysqlDatabase) or die( "MYSQL ERROR (CANT SELECT DATABASE)"); if ($_GET['accountname']) { $account = $_GET['accountname']) $account = stripslashes($account ); $account = mysql_real_escape_string($account); $dothejob="SELECT * FROM users WHERE account='$player_name'"; //searching for playah $what=mysql_query($dothejob); $i=mysql_num_rows($what); if ($i == 1) { $money = mysql_result($result,0,"CASH"); // getting 'cash' data from mysql to a variable } else echo('WRONG ACCOUNT NAME.'); // HERE YOU NEED TO HAVE SOME FUN WITH IMAGES, SORRY, I DONT LIKE THIS. GOOGLE FOR IT mysql_close(); } ?> 4. Save it as for example sig.php 5. Now youadress/sig.php?accountname=YOUR_ACCOUNT_NAME for test you can also do not image but just echo $money; Link to comment
Saml1er Posted April 8, 2014 Share Posted April 8, 2014 Check out this: http://blog.doh.ms/2008/02/12/adding-te ... -with-php/ Its really helpful. It won't even take you 5 mins you make it if you know php basics. I'm not an expert tho but I know some basics like we use $ before variables ( can be underscores as well but not numbers ) and we use brackets for every if statement and ";" symbol after every function. Well you see you can use MysQL to save data from MTA and you can access the same data from your website and voila you can render the text using real time. I want to help you with this but like I said I'm not an expert so I'll need to make a lot of tests for that and since I don't have time for that but anyway Good Luck. Link to comment
monumento Posted April 8, 2014 Share Posted April 8, 2014 Check out this: http://blog.doh.ms/2008/02/12/adding-te ... -with-php/Its really helpful. It won't even take you 5 mins you make it if you know php basics. I'm not an expert tho but I know some basics like we use $ before variables ( can be underscores as well but not numbers ) and we use brackets for every if statement and ";" symbol after every function. Well you see you can use MysQL to save data from MTA and you can access the same data from your website and voila you can render the text using real time. I want to help you with this but like I said I'm not an expert so I'll need to make a lot of tests for that and since I don't have time for that but anyway Good Luck. That blog article is awesome. I'm using the module, not the function in PHP but it's really enough to make a good dynamic signature/statistic page! And i think you can access SQLite by PDO if you have it on same dedi as your server! Link to comment
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