Wysłany: 2017-01-20, 12:23
=DC=
Wiek: 35 Na forum: 3944 dni Posty: 223
Nick w MP: =DC=
Piwa : 72
Witam pr?bowa?em zrobi? funkcj?, kt?ra wy?wietli mi pewne informacje z serwera na stronie, ale mta_sdk.php nie mo?e po??czy? mi si? z serwerem.
Port http otwarty, u?ytkownik kt?rego u?ywam do po??czenia ma wymagane prawa i pomimo tego nie ?miga.
B??d jaki mi wyrzuca:
Kod: 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
Po??czenie wygl?da tak:
Kod:
<?php
include( "mta_sdk.php" );
$mtaServer = new mta( "ip", 20145, "mta_php_sdk", "password" );
$resource = $mtaServer->getResource ( "php" );
$return = $resource->call ( "getPlayersOnline" );
?>
Wie kto? w czym le?y problem?
Dodam, ?e u?ywaj?c SDK w drug? stron? czyli przez callRemote z serwera MTA wszystko pi?knie ?miga.
Podpis
Witaj
[you]
, jeśli Ci pomogłem postaw mi lub Dzięki!
Wysłany: 2017-01-20, 13:42
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
=DC= , https://wiki.multitheftauto.com/wiki/Meta.xml
Kod: [<export /> This exports functions from this resource, so other resources can use them with call
function: The function name
type Whether function is exported server-side or client-side (valid values are: "client", "server" and "shared")
http: Can the function be called via HTTP (true/false)
Wysłany: 2017-01-20, 13:51
=DC=
Wiek: 35 Na forum: 3944 dni Posty: 223
Nick w MP: =DC=
Piwa : 72
luki123luki123 , oczywi?cie zapomnia?em o tym napisa? ale w mecie mam ustawione http na true
Kod: <export function="getPlayersOnline" type="server" http="true"/>
Jakie? inne pomys?y z tym jeszcze masz?
[ Dodano : 2017-01-20, 15:22 ]
Problemem jest chyba to, ?e hosting strony blokuje po??czenia. - Dam zna? jak sprawdz?.
Podpis
Witaj
[you]
, jeśli Ci pomogłem postaw mi lub Dzięki!
Tagi: mta :: php :: sdk :: nie :: łączy
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: