Jump to content

Webstats, where to start?


Recommended Posts

Hello, MTA.

I got little problems, I wanted to make webstats system (wanted levels) and so on, but I don't know even where to start :/ I'm not asking you to script a system or any scripts to me, but is there any tutorials/sites (wiki?) where I can find more information about sending data from server to html (php). I can script lua very well (scripted for a year). I started to learn php months ago. I'm just too newbie in sending datas from lua to php, so simply, I'm just looking for sites where I can learn to send datas and so on, so I can implement my websystem (I can maybe put it to community after done it). Anyway, any help would be great. Thanks. Regards, Taalasmaa.

Link to comment

Oh, I found this:

https://wiki.multitheftauto.com/wiki/PHP_SDK

Gonna try it, I'll ask if i have any questions :P

EDIT: can I call to php with callRemote, or can I just call to other servers with it?

EDIT2: of course i can ;) never mind.

function chatz ( message, type )
callRemote ( "http://www.gamenet.fi/stats.php", getResourceName(getThisResource()), "phpFunction", chatBoxFunction, getPlayerName(source), message, type, getServerPort() )
end
addEventHandler ( "onPlayerChat", getRootElement(), chatz )

How can I make function to PHP that takes this?

Link to comment

Yeah, thanks 50p.

<?php
include( "mta_sdk.php" );
$input = mta::getInput();
$input[0];
mta::doReturn($input[0]);
?>

This is my PHP file

function messages()
callRemote ( "http://**.***.***.**/stats.php", outputDebugString, "works" ) -- I hided my ip.
end 
addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),messages)

This is my lua file

it debugs this "works" to server debug. I just want to know how can I get this "works" to my sites too. In my sites (stats.php) it just shows as [null].

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...