Jump to content

Search the Community

Showing results for tags 'php'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Member Title


Gang


Location


Occupation


Interests

Found 19 results

  1. Hello, I have a problem with php sdk for MTA with my web page when it is hosted. When i test the php sdk and the script that i made in mi localhost with XAMPP this works fine, but when i upload the page to my host this doesn't work. I want to ask if anyone knows about a permissions or something like that that i need to be aware when working with PHP SDK and hosting, because the server and page are hosted. The error i get in the page is: Connection refused.
  2. I'm working on this project since last day. I'm waiting your comments.
  3. Hello, community! I searched on the forums how to get server information using PHP, but I get the error "Data is invalid" using following code: <?php class CSocketMTA { function CSocketMTA( $IP, $PORT = 22003 ) { if ( $socket = fsockopen( "udp://$IP", $PORT + 123, $errno, $errstr ) ) { stream_set_timeout( $socket, 1, 0 ); fwrite( $socket, "s" ); $data = fread( $socket, 16384 ); fclose( $socket ); if ( substr( $data, 0, 4 ) == "EYE1" ) { $data = substr( $data, 4 ); for ( $i = 0; $data != ""; $i++ ) { if ( substr( $data, 0, 2 ) == chr( 1 ) . "?" ) $data = substr( $data, 2 ); $l = ord( substr( $data, 0, 1 ) ); $buffer[ $i ] = substr( $data, 1, $l - 1 ); $data = substr( $data, $l ); } $this->gameshort = $buffer[ 0 ]; $this->port = $buffer[ 1 ]; $this->name = $buffer[ 2 ]; $this->rules[ 'game' ] = $buffer[ 3 ]; $this->map = $buffer[ 4 ]; $this->rules[ 'version' ] = $buffer[ 5 ]; $this->public = $buffer[ 6 ] != "0"; $this->players = $buffer[ 7 ]; $this->maxplayers = $buffer[ 8 ]; $j = 0; for ( $i = 11; $i < sizeof( $buffer ) - 2; $i += 5 ) { $this->player[ $j ]->name = $buffer[ $i ]; $this->player[ $j ]->score = $buffer[ $i + 3 ]; $this->player[ $j ]->time = 0; $j++; } } else echo "Data is invalid\n"; } else echo "Can not open socket $IP:$PORT - $errstr\n"; } }; ?> I want get the information from any MTA:SA server. Help me, please! Thanks.
  4. Привет всем! Помогите, пожалуйста! Вопрос к тем, кто разбирается в PHP. Собственно вопрос в следующем: На сайте luac.multitheftauto.com в разделе API имеется руководство по обфускации Lua скриптов через сам Lua скрипт: local FROM="example.Lua" local TO="compiled.Lua" fetchRemote( "https://luac.multitheftauto.com/?compile=1&debug=0&obfuscate=3", function(data) fileSave(TO,data) end, fileLoad(FROM), true ) Предположим, на моём сайте лежит скрипт: $file_name = "my_script.Lua"; Как можно "скомпилировать" данный скрипт на PHP? Возможно, что через curl, но как его использовать в PHP я не знаю. Прошу помощи! Спасибо.
  5. Hello everyone! Can you help me, please? Question to those who understand PHP. Actually the question is as follows: On the site luac.multitheftauto.com in the API section there is a guide to compile Lua scripts by the Lua script itself: local FROM= "example.Lua" local TO= "compiled.Lua" fetchRemote("https://luac.multitheftauto.com/?compile=1&debug=0&obfuscate=3", function(data) fileSave(TO, date) end, fileLoad(FROM), true) Suppose there is a script on my website: $file_name = "my_script.Lua"; How can I compile this script in PHP? Maybe it is possible by using curl, but how to use it in PHP I don't know. Please help! Thanks.
  6. Creación de PCU/UCP Los mismos se realizan a medida con o sin foro, generalmente los UCP se utilizan para los RolePlay dado que los conectamos a la base de datos del mismo haciendolos interactivos, convirtiendolos en UCP, pero también se pueden crear para RPG y demás modos de servidores. Todo en PHP y JavaScript. Demostración gratuita y vista del código por Teamviewer. Presupuesto sin cargo ningúno. Diseño original y responsive. Con o sin foro (estamos creando un foro propio desde 0, también se puede conectar a un SMF, MyBB, etc). Paneles administrativos para lideres de facciones para gestionar las mismas y también "curriculm" (para RP). Paneles administrativos para Staff con funciones por rango tanto para UCP como para el foro o ambos incluidos. PRECIOS ACCESIBLES Y RAZONABLES, NO DUDE EN CONSULTAR Algunas Capturas al azar de algunos sitios construidos: PRECIOS ACCESIBLES Y RAZONABLES, NO DUDE EN CONSULTAR
  7. السلام عليكم ورحمة الله وبركاتة كيف الحال ان شاء الله بخير اليوم انا بدي منكو بعض الافكار : اول فكرة ايش احط نوع المتغير الخاص بموضوع كامل text يعني انا بسوي موقع الان لما الناس تنشر توبك اخلي نوع التوبك ذا في قاعدة البيانات ولا في افضل الامر الأخر : الان انا بدي الناس تقدر تحط لايك الان الايك ويظهر عند الموضوع عدد الايكات زبط معي كل شي بس ضل قصة هي ابي يظهر مين الي حطو لايكات كيف اربطهم بالقاعدة الخاصة بالبيانات عقل يقول اسوي جدول للايكات لوحده واربطه مع الجدول التوبك وش قلتو ابي اشوف اذا في طرق افضل
  8. Hey! Would someone tell me how to do getPlayerPing for the php sdk library? I only managed to make a list of players on the server function listPlayer( ) local players = {} for k, player in ipairs( getElementsByType ("player") ) do local player = getPlayerName( player ) table.insert( players, player ) end return players end
  9. Thanks مشكورين صراحة وانا اسف على الرد المتاخر لظرف ما بس ممكن تشوفولي طلبي الثاني ------------ لما الشخص يدوس زر التسجيل ويرسل البيانات ينتقل للصفحة الرئيسية بس لما يتحقق الموقع من بيناتاته الشخصية <form action = 'Successful.php' method = 'POST' > ----------- ولكم مني خاص احترامي
  10. howdy.i just hosted my server "RP" and i dont know why i cant connect with Mysql.i tired to put Mysql.so and lib in Modules but it didnt work on windows works. If u dont know how to help me i can give my PHP because anything i have there ist special
  11. Buenas, tengo un pequeño inconveniente. Terminé de armar un login y necesito que este esté vinculado con el foro de mi servidor, necesito obtener datos del foro como por ejemplo ciertas estadísticas de los miembros del foro. No conozco mucho el lenguaje de programación php y quisiera saber que debería usar para obtener ciertos valores del foro a través de una consulta GET. Uso IPS de la comunidad. Por ejemplo, cómo puedo obtener o qué debo usar para recibir en mi servidor únicamente el nombre de la cuenta del miembro? Había hecho algo de esto: <?php $communityUrl = 'urlCode'; $apiKey = 'apikey'; $curl = curl_init( $communityUrl . 'api/'.'?/core/members/1' ); curl_setopt_array( $curl, array( CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_HTTPAUTH => CURLAUTH_BASIC, CURLOPT_USERPWD => "{$apiKey}:" ) ); $response = curl_exec( $curl ); echo $response; Con esto logré que me devuelva todos los datos de cierto miembro especificando la ID del usuario, pero quiero que me devuelva sólo cierto como por ejemplo el nombre. ¿Cómo puedo extraer sólo ese dato?. Gracias.
  12. بسم الله الرحمن الرحيم سلام عليكم ورحمة الله وبركاتة انا سويت دورة عن كيف تسوي موقع دردشة .. وممكن يفيد بعضكم وسلام خير الختام
  13. Hello guys. I'm trying to use the PHP SDK from MTA: SA on my site but I can not. What I want to do is get the basic information from a server as a number of players online, whether it is password protected, or no password, whether online or offline. I just can not find any documentation to help me. Can someone help me?
  14. Swagy

    [HELP] PHP SDK

    <?php require "mta_sdk.php"; $mtaServer = new mta( '137.74.164.56', 22006); $resource = $mtaServer->getResource ( 'UDCupdates', $mtaServer ); $returns[] = $resource->call('addUpdate', $_POST['name'], $_POST['dev']); ?> ok I use this in the PHP file, don't mind the HTML file since it works fine, now I'll show you my MTA script local sql = executeSQLQuery function createTables () sql("CREATE TABLE IF NOT EXISTS updates (update TEXT, developer TEXT, date TIMESTAMP DEFAULT CURRENT_TIMESTAMP)") end addEventHandler("onClientGUIClick", root, createTables) function addUpdate (text, dev) if (text) then if (dev) then sql("INSERT INTO updates (update, developer) VALUES (?,?)", text, dev) outputChatBox("[Updates] "..text.." ("..dev..")",root,255,130,4) return true else return false end else return false end end resource is started and export is added, but the problem is call function in PHP, help please.
  15. Is it possible to make crypt function from php in lua? I connected IPS 4 by php script using PHP SDK but on Linux it returns array not JSON (so weird, returns JSON on Windows and array on Linux). It makes few casualities in my script so i decided to ask here. Is it possible to make php crypt function in MTA?
  16. Hello everyone! I want to present my little development - website template for servers, with information about your server online, embed statistic, and other Useful information. Based on PHP, bootstrap html/css framework, and seegaming servers API. Global update v1.1:- Now using API via JSON- New design- Easy to configure- Supporting API reviews- Support white, dark and blue themes- Parsing favicon, backgrounds, icons (if used default settings)- You can enable/disable players history graph / reviews page- Fast connect from browser to your server Demo page: Link Download: Link
  17. Hi, today i was trying to do function which displays players who are online on my website using php_sdk and i have problem with connection to server. HTTP port is opened, user who i'm using to connect has admin rights and it's not working. mta_sdk version 0.4 - downloaded from wiki mta this is php file on my website: <?php include( "mta_sdk.php" ); $mtaServer = new mta( "ip", 20145, "mta_php_sdk", "password" ); $resource = $mtaServer->getResource ( "php" ); $returns[] = $resource->call ( "getPlayersOnline" ); ?> And the error: Fatal error: Uncaught exception 'Exception' with message 'Could not connect to ip:20145' in /home/users/XXX/public_html/YYY/mta_php_sdk/mta_sdk.php:146 Stack trace: #0 /home/users/XXX/public_html/YYY/mta_php_sdk/mta_sdk.php(79): mta->do_post_request('ip', 20145, '/php/call...', '') #1 /home/users/XXX/public_html/YYY/mta_php_sdk/mta_sdk.php(257): mta->callFunction('php', 'getPlayersOnlin...', Array) #2 /home/users/XXX/public_html/YYY/mta_php_sdk/mta.php(38): Resource->call('getPlayersOnlin...') #3 {main} thrown in /home/users/XXX/public_html/YYY/mta_php_sdk/mta_sdk.php on line 146 If i visit in my browser ip:20145/php/call/getPlayersOnline everything is working correctly. How can i fix it?
  18. Hi, i`m developing a TAG system with web integration and i need a little help. Have some function in MTA where i can load all mods inside a folder without specifying all names inside mtaserver.conf ?
  19. Hello everyone this is my first post please take it easy on me. here goes nothing. I followed xxmadexx's tutorial https://forum.multitheftauto.com/topic/74834-introduction-to-the-php-sdk/ It works and my site show the users. but I was wondering how do I go about exporting more information such as score and other information stored on the server. This is my server.lua file function getAllPlayersForWebsite ( ) local players = {} for k, player in ipairs( getElementsByType ("player") ) do local name = getPlayerName( player ) table.insert( players, name ) end return players end my meta xml <meta> <info author="xXMADEXx" type="script" version="1.0" name="MTA PHP" /> <!-- Include our awesome script --> <script src="server.lua" /> <!-- Export our function -- Make sure to allow HTTP to access it --> <export function="doPrint" type="server" http="true" /> <export function="getAllPlayersForWebsite" type="server" http="true" /> </meta> and the php file <?php include "sdk/mta_sdk.php"; # Include the MTA PHP SDK - Give us the classes and methods that we'll need $MY_SERVER = [ "host" => "54.153.65.51", #The host/IP of your MTA server "http_port" => 22005, #The HTTP port for your MTA server (Default 22005) "http_user" => "user", #The username that we created in the previous step "http_pass" => "password" #The password for the username that we created ]; #Create a new mta object $SERVER = new mta ( $MY_SERVER['host'], $MY_SERVER['http_port'], $MY_SERVER['http_user'], $MY_SERVER['http_pass'] ); try { $RESOURCE = $SERVER->getResource ( "mta_php" ); # We need to get our resource Object $RESULT[] = $RESOURCE->call ( "getAllPlayersForWebsite" ); foreach ( $RESULT [ 0 ] [ 0 ] as $index=>$playerName ) { print_r ( $playerName ); echo "<br /><br />"; } #Catch any errors that occurred } catch ( Exception $e ){ #Output error message echo "<strong>Oops, Something went wrong!</strong><br />Error: {$e->getMessage()}<br /><br />e printout:<br />"; #Print the error table print_r ( $e ); } ?> Where should I start?
×
×
  • Create New...