SA-MP Forums Archive
[Question] Running a PHP Script with SAMP. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [Question] Running a PHP Script with SAMP. (/showthread.php?tid=365400)



[Question] Running a PHP Script with SAMP. - tony_fitto - 02.08.2012

Hey guys,

I just wonder if it's possible to run a PHP script with SAMP, for example a Donator site script. If I like press the button to buy an Infernus, is it possible to send a PHP code so the PHP code spawns the Infernus in game while the player presses on that button?.

-Regards
Tony


Re: [Question] Running a PHP Script with SAMP. - BlackBank - 02.08.2012

Do you mean the button on the site or in-game?


Re: [Question] Running a PHP Script with SAMP. - A7X_CEEJAY - 02.08.2012

Yes, it would be possible, you would however need to know PHP and MYSQL.

As you're only inserting a MYSQL Line into the DB as you would in the server - The only thing you'd have to do is make sure
A) The user is logged out
B) The user logs in AFTER they buy it.

Should work fine


Re: [Question] Running a PHP Script with SAMP. - Viiih - 02.08.2012

You just need to do the PHP place the value on the database and then, use the database value ingame with pawn functions.


Re: [Question] Running a PHP Script with SAMP. - linuxthefish - 02.08.2012

Use the exec plugin, and execute your script from command line PHP.


Re: [Question] Running a PHP Script with SAMP. - Vince - 02.08.2012

Sockets plugin is also an option. Open a listening socket in your sa-mp server and write to that with PHP. It's doable for I have done something like that before.


Re: [Question] Running a PHP Script with SAMP. - tony_fitto - 03.08.2012

Thanks guys, I think I got all information I needed. Since I'm allready using MySQL and like have 4 month experience I think I will make it work. Thanks Alot once agen!