Search the Community

Showing results for tags 'php'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


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

Found 10 results

  1. New with Linux

    howdy.i just hosted my server "RP" and i dont know why i cant connect with Mysql.i tired to put 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
  2. Obtener cierto valor

    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.
  3. PHP SDK

    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?

    <?php require "mta_sdk.php"; $mtaServer = new mta( '', 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.." ("")",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.
  5. php 'crypt' function in lua

    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?
  6. MTA website template with server info

    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
  7. بسم الله الرحمن الرحيم سلام عليكم ورحمة الله وبركاتة انا سويت دورة عن كيف تسوي موقع دردشة .. وممكن يفيد بعضكم وسلام خير الختام
  8. 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?
  9. TAG System with WEB integration

    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 ?
  10. Export score on php website with SDK

    Hello everyone this is my first post please take it easy on me. here goes nothing. I followed xxmadexx's tutorial 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" => "", #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?