Skip to content

Use this as an example of the implementation of PHP SDK on a MTA server.

License

Notifications You must be signed in to change notification settings

javierportillo/mta-php-sdk-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mta-php-sdk-example

This is an example of a system that you can use to get your head around connecting your resources in MTA to a remote (or local) Web server running PHP using the PHP SDK.

There are basically two ways of dealing with data flow in this system, one where you start from your PHP file and ask data to the MTA server. And the other where you start from your Lua file on a resource and then get data processed in PHP.

This can be very useful for things like showing a scoreboard on your website or sharing accounts between your game server and a forum, so your players only need to make one account. The possibilities are endless!

There are a couple of things that you need to make sure you have set up -unless you don't want your system to work- before you start coding.

  • Your MTA server is running. :)
  • You have a Web server set up with PHP and running.
  • You have downloaded the PHP SDK and followed the instalation instructions on the wiki (deleted line 80).
  • Every exported function in your Lua files must have the http="true" atribute.
  • Your resource has admin rights.
  • You have an account with admin rights on the server (you can create a new account just for this system).

Alright, I hope I didn't forget something, cause I did forgot some of those while doing this and that was a lot of fun hours figuring that out!

Note: I named this resouce as 'phpsdk' on my local server, if you see that name, just replace it with the name of your resource.

About

Use this as an example of the implementation of PHP SDK on a MTA server.

Resources

License

Stars

Watchers

Forks

Packages

No packages published