Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
Updated the PHP framework, to be compatible with the newest changes on
the PLUGIN code.
Commands can now be registered with the class CMD or class
Command(alias)
  • Loading branch information
Carlos Rodrigues committed Nov 11, 2014
1 parent de4a9ff commit f1a615c
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 8 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
Changelog
=========
2014/11/11:
- Removed AMXNativeExists, RegisterAMXNative and CallAMXNative temporarly.
- Updated the PLUGIN to support SAMPGDK 4.(samp 0.3z r4)
- Updated the visual studio project files for visual studio 2013.
- Now, it's possible to register commands with the CMD class or Command class(alias).

2013/06/12:
- added AMXNativeExists, RegisterAMXNative and CallAMXNative (examples: http://forum.sa-mp.com/showpost.php?p=2565856&postcount=69)

Expand Down
1 change: 0 additions & 1 deletion server-folder/php/core/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

set_include_path(get_include_path() . PATH_SEPARATOR . PHP_DIR . PATH_SEPARATOR . CORE_DIR);

require_once 'helpers.php';
require_once 'callbacks.php';
require_once 'modelevent.php';
require_once 'namedinstance.php';
Expand Down
16 changes: 12 additions & 4 deletions server-folder/php/core/callbacks.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,8 @@ function OnRconLoginAttempt($ip, $playerid, $success)
return Event::fireDefault("RconLoginAttempt", true, $ip, Player::find($playerid, true), $success);
}

function OnUnoccupiedVehicleUpdate($vehicleid, $playerid, $passengerSeat)
{
return Event::fireDefault("UnoccupiedVehicleUpdate", true, Vehicle::find($vehicleid), Player::find($playerid, true), $passengerSeat);
function OnUnoccupiedVehicleUpdate($vehicleid, $playerid, $passenger_seat, $newx, $newy, $newz, $velx, $vely, $velz) {
return Event::fireDefault("OnUnoccupiedVehicleUpdate", Vehicle::find($vehicleid), Player::find($playerid, true), $passenger_seat, $newx, $newy, $newz, $velx, $vely, $velz);
}

function OnVehicleDamageStatusUpdate($vehicleid, $playerid)
Expand Down Expand Up @@ -257,4 +256,13 @@ function OnVehicleStreamIn($vehicleid, $forplayerid)
function OnVehicleStreamOut($vehicleid, $forplayerid)
{
return Event::fireDefault("VehicleStreamOut", true, Vehicle::find($vehicleid), Player::find($forplayerid, true));
}
}

function OnIncomingConnection($playerid, $ipaddress, $port)
{
return Event::fireDefault("IncomingConnection", true, Player::find($playerid, true), $ipaddress, $port);
}

function OnTrailerUpdate($playerid, $vehicleid) {
return Event::fireDefault("TrailerUpdate", true, Player::find($playerid, true), Vehicle::find($vehicleid));
}
5 changes: 4 additions & 1 deletion server-folder/php/core/callbacks.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,7 @@ OnVehiclePaintjob
OnVehicleRespray
OnVehicleSpawn
OnVehicleStreamIn
OnVehicleStreamOut
OnVehicleStreamOut
OnIncomingConnection
OnTrailerUpdate
OnUnoccupiedVehicleUpdate
6 changes: 4 additions & 2 deletions server-folder/php/core/commandtext.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

class CommandText
class CMD
{
protected static $commands;

Expand Down Expand Up @@ -29,4 +29,6 @@ public static function handleCommand($player, $commandStr)
}
}

Event::on('PlayerCommandText', array('CommandText', 'handleCommand'));
class_alias('CMD', 'Command');

Event::on('PlayerCommandText', array('CMD', 'handleCommand'));
8 changes: 8 additions & 0 deletions server-folder/php/core/server.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,12 @@ public static function gameTextForPlayer($player, $message, $time, $style)
{
return GameTextForPlayer($player->id, $message, $time, $style);
}

public static function blockIpAddress($ipaddress, $timems) {
return BlockIpAddress($ipaddress, $timems);
}

public static function unBlockIpAddress($ipaddress) {
return UnBlockIpAddress($ipaddress);
}
}

0 comments on commit f1a615c

Please sign in to comment.