SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 07/06/2013, 09:32 AM   #21
Hanger
Huge Clucker
 
Join Date: Apr 2012
Location: UK
Posts: 205
Reputation: 32
Default Re: SA-MP Gamemodes with PHP

Quote:
Originally Posted by Emmet_ View Post
The best part is that MySQL is integrated into PHP and we can use it in this plugin. Very nice job!
Thought about it straight away, eliminates the damn MySQL plugins which usually cause problems to launch a server.

Perfect work, could not wish for anything more, just improvements of this. However, I am a little concerned about performance in execution speed.
__________________
Hanger is offline   Reply With Quote
Old 07/06/2013, 01:00 PM   #22
lapayo
Little Clucker
 
Join Date: Jun 2013
Posts: 25
Reputation: 37
Default AW: SA-MP Gamemodes with PHP

Quote:
Originally Posted by Rsmiley View Post
It works now! After arguing with it a little, and I recommend putting the libphp5.so instructions in the first post. I was wondering why you were fresh installing php, until I re-read this post.
Great!
I added the binaries to the first post and how to install libphp5.so
Quote:
Originally Posted by Gamer_Z View Post
so, I expect this does allow dynamic mode changing without restart too?
Well, theoretically this would be possible. Do you think of changing a gamemode like it is done with "gamemodeexit" or of simply loading a new gamemode.php and ignoring the old script? Or simply modifing the gamemode while running?

Quote:
Originally Posted by Hanger View Post
Perfect work, could not wish for anything more, just improvements of this. However, I am a little concerned about performance in execution speed.
Development will go on
Regarding the performance: I dont have some comparisions between pawn and php yet.
But php is not slow. Of course not as fast as c. I normally use php for webdevelopment and get there it takes like 10ms to load the php scripts, initialize a framework, route a uri, connect to a database, retrive information and then render it as html. But in this case it only retrives some informations (Maybe not even from a database) and then calls some functions. Everything else falls away, so it shouldnt be slow.

I will look if I can abuse the NPCs somehow to generate some heavy usage later

Last edited by lapayo; 07/06/2013 at 01:31 PM.
lapayo is offline   Reply With Quote
Old 07/06/2013, 10:49 PM   #23
Memoryz
Gangsta
 
Join Date: Dec 2008
Posts: 749
Reputation: 26
Default Re: SA-MP Gamemodes with PHP

Are you planning on allowing filterscripts as well?
Memoryz is offline   Reply With Quote
Old 08/06/2013, 12:16 AM   #24
Rsmiley
Little Clucker
 
Join Date: Oct 2010
Posts: 15
Reputation: 2
Default Re: SA-MP Gamemodes with PHP

Quote:
Originally Posted by Memoryz View Post
Are you planning on allowing filterscripts as well?
I think we'll have to rewrite most filter scripts given the complete difference in scripting language.

It'd be nice if we could, but I doubt support will be there
__________________
Just beginning to work with PAWN
PHP/MySQL scripter. Do work for $
Rsmiley is offline   Reply With Quote
Old 08/06/2013, 12:49 AM   #25
Kalladel
Little Clucker
 
Join Date: May 2013
Posts: 15
Reputation: 0
Default Re: SA-MP Gamemodes with PHP

Awesome..
__________________
Rep+ if i helped you
Kalladel is offline   Reply With Quote
Old 08/06/2013, 01:27 AM   #26
lapayo
Little Clucker
 
Join Date: Jun 2013
Posts: 25
Reputation: 37
Default AW: SA-MP Gamemodes with PHP

Quote:
Originally Posted by Memoryz View Post
Are you planning on allowing filterscripts as well?
Well, not planned yet, but possible. But given the fact, that you can have unlimited events, you could simply create a new file and include this in the gamemode.php. (Do you want a shared or a isolated environment for the filterscripts?)

And some news
I finally managed to create a version for windows. You can download the binaries from the first topic
(Compiling instructions will follow later, it was very complicated )

I also created new releases for centos and debian/ubuntu, using the new code
I hope the new code is as stable as the old one

I also added a feature, that you can start a gamemode using the server.cfg.
Simply add "samphpmode grandlarc" and it will automatically load grandlarc/gamemode.php.
If there is no gamemode set it will load gamemode.php as before.

Finally I also added an empty gamemode to the binary release. (thx Rsmiley )


Maybe someone wants to help testing the windows version.
lapayo is offline   Reply With Quote
Old 08/06/2013, 02:37 AM   #27
CoaPsyFactor
Gangsta
 
Join Date: Jul 2010
Location: Belgrade, Serbia
Posts: 867
Reputation: 47
Default Re: SA-MP Gamemodes with PHP

Call me crazy, but how could this work?

PHP Code:
public function playAudioStream($url$x 0.0$y 0.0$z 0.0$distance 50.0$usePos false)
{
     return 
PlayAudioStreamForPlayer($this->id$x$y$z$distance$usePos);

What I mean is that there is no variable $url given to PlayAudioStreamForPlayer, how does it know what to stream xD
__________________
Quote:
Originally Posted by ThaiLuan View Post
Code:
C:\Users\Administrator\Downloads\Viet-RP\gamemodes\3mien.pwn(112016) : fatal error 101: cannot write to file: "disk full"

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Help me! How to fix error
CoaPsyFactor is offline   Reply With Quote
Old 08/06/2013, 10:51 AM   #28
lapayo
Little Clucker
 
Join Date: Jun 2013
Posts: 25
Reputation: 37
Default Re: SA-MP Gamemodes with PHP

You are right, I missed the $url parameter
Will fix it with the next release
lapayo is offline   Reply With Quote
Old 08/06/2013, 12:43 PM   #29
Whiteagle
Big Clucker
 
Join Date: Mar 2008
Posts: 73
Reputation: 2
Default Re: SA-MP Gamemodes with PHP

Man, you work fast!

Thanks for the Windows Release Testing it out.


Do you even have a "Buy Me a Beer" button of some sort somewhere?
Because I would.

Thanks

Last edited by Whiteagle; 08/06/2013 at 02:30 PM.
Whiteagle is offline   Reply With Quote
Old 08/06/2013, 12:55 PM   #30
steki.
High-roller
 
steki.'s Avatar
 
Join Date: Nov 2010
Location: São Paulo, Brasil
Posts: 2,584
Reputation: 315
Default Re: AW: SA-MP Gamemodes with PHP

Quote:
Originally Posted by lapayo View Post
Well, not planned yet, but possible. But given the fact, that you can have unlimited events, you could simply create a new file and include this in the gamemode.php. (Do you want a shared or a isolated environment for the filterscripts?)

And some news
I finally managed to create a version for windows. You can download the binaries from the first topic
(Compiling instructions will follow later, it was very complicated )

I also created new releases for centos and debian/ubuntu, using the new code
I hope the new code is as stable as the old one

I also added a feature, that you can start a gamemode using the server.cfg.
Simply add "samphpmode grandlarc" and it will automatically load grandlarc/gamemode.php.
If there is no gamemode set it will load gamemode.php as before.

Finally I also added an empty gamemode to the binary release. (thx Rsmiley )


Maybe someone wants to help testing the windows version.
I love you.
But I'm kinda afraid about the performance and the overhead this piece of work would cause.
Can a SA-MP gamemode and a PHP gamemode run together?
__________________
Rio
steki. is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Gamemodes for 0.3d ? Mr.Fames Scripting Help 16 08/12/2011 09:54 PM
beg for gamemodes gf sql vagosz Help Archive 3 29/12/2009 10:28 AM
I want a new gamemodes crime Help Archive 10 13/08/2009 10:49 PM


All times are GMT. The time now is 06:54 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.