Use donate plugin for payments to players

UASECO is a fork of the XAseco2/1.03 controller for Trackmania and has been overhauled to support the Modescript Gamemodes of Trackmania².

Moderators: undef.de, NADEO

Post Reply
thepadawan
Posts: 2
Joined: 06 Jun 2020, 18:33

Use donate plugin for payments to players

Post by thepadawan »

Hi,

I'm trying to write a small lottery plugin that pays a random amount of planets to a random player at the end of each map (very similar to lottery plugins for older ASECO's).

For the payment I want to use the plugin.donate.php, which should be able to make a payment from the server to a player (according to the description). But my attempt crashed UASECO (unfortunately I don't get any error messages).

I'm adding the dependence in the constructor: $this->addDependence('PluginDonate', Dependence::REQUIRED, '1.0.0', null);
And I'm trying to use the plugin like this: $aseco->plugins['PluginDonate']->admin_payment($aseco, $aseco->server->login, $targetLogin, $amountPlanets);

($targetLogin = login of the player who won the lottery)

I'm still new to PHP and I couldn't find any help on how to use the donate plugin to make a payment from the server. Thank you in advance.

Cheers,
Padawan
User avatar
undef.de
Posts: 2095
Joined: 06 Apr 2011, 21:57
Location: Germany, North Sea Coast
Contact:

Re: Use donate plugin for payments to players

Post by undef.de »

You should use the pay method instead of the DonatePlugin: https://www.uaseco.org/dedicated-server/methods.php#Pay

Code: Select all

$billid = $aseco->client->query('Pay', 100, $login, $label);
Developer of UASECO, a controller with support of the Modescript Gamemodes for TM².
Visit the official website for more: UASECO.org


Developer of various plugins for XAseco/XAseco2 and MPAseco, visit my lab: www.undef.name

You like what I do? Then award a ManiaStar.
thepadawan
Posts: 2
Joined: 06 Jun 2020, 18:33

Re: Use donate plugin for payments to players

Post by thepadawan »

Thank you. That does the job! :)

I'm not sure if you confused the arguments. At least I used it like this:

Code: Select all

$billid = $aseco->client->query('Pay', $login, 100, $label);
User avatar
w1lla
Posts: 2396
Joined: 15 Jun 2010, 11:09
Location: Netherlands
Contact:

Re: Use donate plugin for payments to players

Post by w1lla »

thepadawan wrote: 30 Jun 2020, 17:46 Thank you. That does the job! :)

I'm not sure if you confused the arguments. At least I used it like this:

Code: Select all

$billid = $aseco->client->query('Pay', $login, 100, $label);
That is the correct one.
TM² Info
SM Info
QM Info

OS: Windows 10 x64 Professional
MB: MSI 970A-G46
Processor: AMD FX-6300 3500 mHz
RAM Memory: 16 GB DDR3
Video: SAPPHIRE DUAL-X R9 280X 3GB GDDR5
KB: Logitech G510s
Mouse: Logitech G300s
Mode Creation
ManiaScript Docs
Post Reply

Return to “UASECO”

Who is online

Users browsing this forum: No registered users and 1 guest