Re: SA-MP Gamemodes with PHP -
erorcun - 12.05.2014
Quote:
Originally Posted by Kikito
Had you built the latest SAMPGDK release?
Updated the plugin source code for the new API and stuff?
If you just edited the functions, and added the new ones in the PHP side, it ain't going to do nothing.
I haven't updated this plugin yet because I don't have almost time for myself, and it's quite a large amount of work.
So in my free time, instead being developing stuff, i prefer to spend time with my family.
About the "amx/amx.h"
that's related to the plugin development sdk.
|
Yeah I built/installed sampgdk.
Updating plugin for 0.3z (both php framework and plugin) only costed 2 hours to me. =D Plugin's structure is easy, it doesn't take too much time.
And yeah problem is related with sdk, and most probably with this commit:
https://github.com/Zeex/sampgdk/comm...2fcafb834a106a
Zeex removed sdk from gdk's itself and currently we're pointing sdk directory with CMAKE_SDK flag, this helps on building GDK but doesn't help on building SAMPHP :/
This commit was made 2 months ago(relatively new) and no one suffer from this problem in net, so probably problem is in this commit.
Re: SA-MP Gamemodes with PHP -
CoaPsyFactor - 12.05.2014
Why didn't you post any download link ?
Re: SA-MP Gamemodes with PHP -
erorcun - 13.05.2014
Because I was still working on it.
I will release it tomorrow. Stay tuned everybody =D
Re: SA-MP Gamemodes with PHP -
therainycat - 13.05.2014
Quote:
Originally Posted by erorcun
Because I was still working on it.
I will release it tomorrow. Stay tuned everybody =D
|
Staying =)
And could you provide sources for 0.3z version? I tried to update this plugin too, but had problems with amx.h
Re: SA-MP Gamemodes with PHP -
CoaPsyFactor - 13.05.2014
nice
Re: SA-MP Gamemodes with PHP -
erorcun - 13.05.2014
Callbacks works but natives don't, PHP gives "Undefined function" for them - only the ones which isn't in GDK works(AMXNativeExists etc.) so problem could be in GDK, current files on repo is in beta stage, last release was 4 months ago.
Is anyone have idea?
Re: SA-MP Gamemodes with PHP -
GWMPT - 13.05.2014
Quote:
Originally Posted by erorcun
Callbacks works but natives don't, PHP gives "Undefined function" for them - only the ones which isn't in GDK works(AMXNativeExists etc.) so problem could be in GDK, current files on repo is in beta stage, last release was 4 months ago.
Is anyone have idea?
|
Like I said, you need to build the source code of GDK [from github] and use it.
The binary packages to download are outdated.
I've attached to this post the "compiled" SAMPGDK package for windows.
However, it isn't the most recent[built for 0.3z].
Re: SA-MP Gamemodes with PHP -
erorcun - 13.05.2014
Quote:
Originally Posted by Kikito
Like I said, you need to build the source code of GDK [from github] and use it.
The binary packages to download are outdated.
|
....
I said "I built/installed it" in previous page so I compiled last build. I made changes on it ever.
Re: SA-MP Gamemodes with PHP -
GWMPT - 13.05.2014
Quote:
Originally Posted by erorcun
....
I said "I built/installed it" in previous page so I compiled last build. I made changes on it ever.
|
Sorry, I just misunderstood.[shit happens]
Anyways, some functions in the newest sampgdk have been removed.
You need to do a work around.
Re: SA-MP Gamemodes with PHP -
erorcun - 14.05.2014
I need help from experienced C++ coders.
Problem is I can't add function to PHP with the same name of any GDK function. I.e. I added PHP_FUNCTION(abcd) and tried it in-game, and it worked, but the same content with PHP_FUNCTION(SetGameModeText) doesn't work. So GDK functions creating problem while importing them with exact names to PHP.
Is anyone know something about that?
Re: SA-MP Gamemodes with PHP -
erorcun - 15.05.2014
Ok, I finished just now and everything works perfect. I will release soon. All problems' source was GDK, it's buggy.
Also thanks to Kikito. (and Zeex for not answering my PM)
Re: SA-MP Gamemodes with PHP -
Nazaret - 15.05.2014
Quote:
Originally Posted by erorcun
Ok, I finished just now and everything works perfect. I will release soon. All problems' source was GDK, it's buggy.
Also thanks to Kikito. (and Zeex for not answering my PM)
|
It's very cool, I'm in great anticipation for how revisions Linux and Windows, THANK YOU!
SAMPHP Released -
erorcun - 15.05.2014
Okay, here it is fixed GDK and SAMPHP.
This zip contains:
1- SAMPGDK's fixed include folder (you must download source and use this include folder for compiling) and .so file for
Linux.
2- SAMPHP sources, server files and again .so files only for
Linux.
Could be great if someone compile it for Windows.
Also I've fixed little object/playerobject handling problem in framework.
Instructions still same, you must install libphp5.
Also CreateExplosionForPlayer has forgotten in GDK, so I left it commented in framework files =D
Enjoy!
Re: SAMPHP Released -
therainycat - 15.05.2014
Quote:
Originally Posted by erorcun
Okay, here it is fixed GDK and SAMPHP.
This zip contains:
1- SAMPGDK's fixed include folder (you must download source and use this include folder for compiling) and .so file for Linux.
2- SAMPHP sources, server files and again .so files only for Linux.
Could be great if someone compile it for Windows.
Also I've fixed little object/playerobject handling problem in framework.
Instructions still same, you must install libphp5.
Also CreateExplosionForPlayer has forgotten in GDK, so I left it commented in framework files =D
Enjoy!
|
Great work!
I'll try to compile this for Windows, and if success, I'll tell you.
Re: SA-MP Gamemodes with PHP -
therainycat - 15.05.2014
So, I tried.
But have problem - when compile, VC++ "Cannot open include file: 'sampgdk/a_samp-decl.h'"
I read, that cmake would help with that, but I didn't work with cmake (and have no idea, what "a_samp-decl.h" should contain).
Can someone help?
Re: SA-MP Gamemodes with PHP -
erorcun - 15.05.2014
cmake generates that files automaticly. just do what gdk's readme says.
Re: SA-MP Gamemodes with PHP -
crs0r - 16.05.2014
I am also trying to work with this nice plugin because of the nice overview and that my php skills are much higher than pawno. It is very easy and nice to do with but I still have problems with some functions like the timer. Here is an example:
PHP код:
Event::on('PlayerEnterVehicle', function($player, $vehicle){
if($vehicle->getModel($player) == '462'){
$player->sendClientMessage(COLOR_GREY, "[Info] You can rent this scooter for $50. Type: /rent");
Timer::create(function() {
$player->freeze($player);
}, 1000, false);
}
});
I get this error:
Quote:
Fatal error: Call to a member function freeze() on a non-object
|
Without the timer-function I will get freezed directly. I tried already everything but without success. I hope someone can help me with this.
Thank you, best regards from germany.
//EDIT: Has already anyone included the mysql extension? My tries failed hard... Thanks.
//EDIT2: Hmm, so much problems..
I tried to move an object:
PHP код:
Event::on('GameModeInit', function() {
$lspdgate = Object::create(986, 1326.7, -1331.7, 14.36, 0, 0, 270);
});
CommandText::register('/open', function($player, $object){
$object->move(0, 0, 10, 1.00); // Where to add the object-id variable $lspdgate?
$player->sendClientMessage(COLOR_GREY, "[Info] The gate opens...");
});
But where I can define the object-id in the move function? I already checked the object.php file:
PHP код:
public function move($x, $y, $z, $speed, $rotX = -1000.0, $rotY = -1000.0, $rotZ = -1000.0) // Here isnt an variable for the object-id... ?!
{
return MoveObject($this->id, $x, $y, $z, $speed, $rotX, $rotY, $rotZ);
}
The same problems I have with pickups. There isnt an variable for the defined pickup. Thank you for your help!
Re: SA-MP Gamemodes with PHP -
CoaPsyFactor - 22.05.2014
nice, thanks for update
EDIT:
I've started writing new framework for SAMP PHP, it can be forked
HERE.
Point is to create easier way to update and get data about certain thing (e.g player, object, vehicle).
As I started developing today, there is just coverage for some of player function (name, position, rotation, ammo etc...)
Re: SA-MP Gamemodes with PHP -
erorcun - 15.06.2014
Quote:
Originally Posted by ProSpeed
|
I wasn't aware of this even. Thanks =)
Re: SA-MP Gamemodes with PHP -
CoaPsyFactor - 16.06.2014
Код:
I'm not sure, but I think this is new PHP 5.6 feature.
But still, it is very useful :)
My bad, it looks like its available in php 5.4