PHP scripting support for SAMP
#1

So yeah.. as title says.. you can make your own gamemodes in PHP

I was thinking that maybe someone here might want this so i posted it.

The build may have some bugs as it is untested.

Currently supported functions are the ones from:
a_samp.inc (0.3e)
a_players.inc (0.3e)
a_vehicles.inc (0.3e)
a_objects.inc (0.3e)

- MySQL is enabled in PHP. You can use these functions http://www.php.net/manual/en/ref.mysql.php
- Added $_SAMP superglobal variable. An example is that you can store the players info in $_SAMP['players'][].. and you don't need to declare it as global in each function or callback that you want to use.


So how does it work?
* This is basically a plugin (plugins\phsamp.dll) that uses php (php5ts.dll) and its extension (php_plugin.dll) to call functions from samp.
* The archive contains a folder "_phps" and the main script that gets executed when you start the server is "nxmain.php"
* Logs are saved in "_phps/php_errors.log" but you can change that in php.ini
* When creating gamemodes you do not need to restart the server or reload the filterscript. You can just type "/rr" and the php will be reloaded (_phps/nxmain.php). Look into the filterscript source for more details.

Download for PHSAMP

Download for PHSAMP source

Notice that this is the first thing that i ever done in c++, so please excuse me for my bad c++ code
Reply


Messages In This Thread
PHP scripting support for SAMP - by rfksna - 03.07.2012, 13:38
Re: PHP scripting support for SAMP - by Niko_boy - 03.07.2012, 14:20
Re: PHP scripting support for SAMP - by rfksna - 03.07.2012, 14:21
Re: PHP scripting support for SAMP - by Roperr - 03.07.2012, 15:12
Respuesta: Re: PHP scripting support for SAMP - by [DOG]irinel1996 - 03.07.2012, 15:43
Re: PHP scripting support for SAMP - by rfksna - 03.07.2012, 15:45
Re: PHP scripting support for SAMP - by next-studio|TheKiller - 03.07.2012, 16:17
Re: PHP scripting support for SAMP - by next-studio|TheKiller - 05.07.2012, 18:19
Re: PHP scripting support for SAMP - by CoaPsyFactor - 06.07.2012, 05:31
Re: PHP scripting support for SAMP - by rfksna - 08.07.2012, 22:19
Re: PHP scripting support for SAMP - by Rg-Gaming.Info - 08.07.2012, 22:26
Re: PHP scripting support for SAMP - by rfksna - 08.07.2012, 22:33
Re: PHP scripting support for SAMP - by next-studio|TheKiller - 08.07.2012, 22:50
Re: PHP scripting support for SAMP - by rfksna - 08.07.2012, 22:54
Re : PHP scripting support for SAMP - by Eony - 13.08.2012, 09:03
Re: PHP scripting support for SAMP - by wups - 13.08.2012, 16:16
Re : Re: PHP scripting support for SAMP - by scott1 - 13.08.2012, 17:37
Re : Re: PHP scripting support for SAMP - by Eony - 14.08.2012, 15:12
Re: PHP scripting support for SAMP - by Steven82 - 14.08.2012, 15:16
Re : Re: PHP scripting support for SAMP - by Eony - 14.08.2012, 15:58
Re : PHP scripting support for SAMP - by scott1 - 14.08.2012, 18:19
Re: Re : PHP scripting support for SAMP - by wups - 16.08.2012, 14:31
AW: PHP scripting support for SAMP - by d34d - 20.08.2012, 08:46
Re: PHP scripting support for SAMP - by Jovazxc - 07.05.2013, 23:53

Forum Jump:


Users browsing this thread: 4 Guest(s)