salh Posted May 24, 2019 Share Posted May 24, 2019 (edited) السلام عليكم شباب انا حاولت اسوي عدد الاعبين يجي في صفحة php بس ما ضبط معي محالوتي <?php require( "mta_sdk.php" ); $mtaServer = new mta("192.168.8.105:22003", 22003 , "***" , "***"); $resource = $mtaServer->getResource ( "getPlayers" ); $retn = $resource->call ( "getPlayerCount" ); echo $input[0]; ?> Lua function getPlayerCount ( ) outputChatBox ( "There are now " .. getPlayerCount() .. " players on this server!" ) end addEventHandler ( "onPlayerJoin", getRootElement(), getPlayerCount ) addEventHandler ( "onPlayerQuit", getRootElement(), getPlayerCount ) Edited May 24, 2019 by salh Link to comment
Simple. Posted May 24, 2019 Share Posted May 24, 2019 10 hours ago, salh said: السلام عليكم شباب انا حاولت اسوي عدد الاعبين يجي في صفحة php بس ما ضبط معي محالوتي <?php require( "mta_sdk.php" ); $mtaServer = new mta("192.168.8.105:22003", 22003 , "***" , "***"); $resource = $mtaServer->getResource ( "getPlayers" ); $retn = $resource->call ( "getPlayerCount" ); echo $input[0]; ?> Lua function getPlayerCount ( ) outputChatBox ( "There are now " .. getPlayerCount() .. " players on this server!" ) end addEventHandler ( "onPlayerJoin", getRootElement(), getPlayerCount ) addEventHandler ( "onPlayerQuit", getRootElement(), getPlayerCount ) PHP <?php require( "mta_sdk.php" ); $mtaServer = new mta("192.168.8.105:22003", 22003 , "***" , "***"); $resource = $mtaServer->getResource ( "getPlayers" ); $retn = $resource->call ( "countServerPlayers" ); echo $retn[0]; ?> Server function countServerPlayers ( ) return getPlayerCount() end لاتنسى تسوي اكسبورت للفنكشن countServerPlayers Link to comment
salh Posted May 25, 2019 Author Share Posted May 25, 2019 (edited) 4 hours ago, Simple. said: PHP <?php require( "mta_sdk.php" ); $mtaServer = new mta("192.168.8.105:22003", 22003 , "***" , "***"); $resource = $mtaServer->getResource ( "getPlayers" ); $retn = $resource->call ( "countServerPlayers" ); echo $retn[0]; ?> Server function countServerPlayers ( ) return getPlayerCount() end لاتنسى تسوي اكسبورت للفنكشن countServerPlayers الحين اذا سيرفري محلي وش اكتب في مكان الايبي؟ -- sever function countServerPlayers ( ) return getPlayerCount() end -- meta <meta> <script src="Client.lua" type="client"/> <script src="Server.lua" type="server"/> <export function="countServerPlayers" http="true" /> </meta> -- php <html> <head> <title></title> <link rel="stylesheet" a href="index.css"> </head> <body> <?php echo ""; require( "mta_sdk.php" ); $mtaServer = new mta("localhost", 22003 , "account" , "pass"); $resource = $mtaServer->getResource ( "log" ); $retn = $resource->call ( "countServerPlayers" ); echo $retn[0]; ?> </body> </html> Edited May 25, 2019 by salh Link to comment
Simple. Posted May 25, 2019 Share Posted May 25, 2019 لازم تفتح بورت وتجيب اي بي اتصالك او اذا ال php على برنامج في جهازك اكتب localhost بس 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