Hey people, I need some help, I've being editing Iban's City RPG, and I need help with this part of requestfunds, when ever it says like
"Service Want a gun? requests 150"
accept with ^yes or decline with ^no
When I say ^yes, it says "You have no active transfers that you can accept!"
Heres the Code.
function CrpCmdYes(%client)
{
if(isObject(%this.player) && isObject(%client.player.CityRP_lastProcessBrick))
{
if(VectorDist(%client.player.CityRP_lastProcessBrick.getPosition(), %client.player.getPosition()) < 16)
{
if(CityRPData.getData(%client.bl_id).valueMoney >= %client.player.serviceFee)
{
CityRPData.getData(%client.bl_id).valueMoney -= %client.player.serviceFee;
CityRPData.getData(%client.player.CityRP_lastProcessBrick.getGroup().bl_id).valueBank += %client.player.serviceFee;
messageClient(%client, '', "\c6You have accepted the service fee of \c3$" @ %client.player.serviceFee @ "\c6!");
%client.setInfo();
if(%client.player.CityRP_lastProcessBrick.getGroup().client)
{
messageClient(%client.player.CityRP_lastProcessBrick.getGroup().client, '', "\c3" @ %client.name @ "\c6 has wired you \c3$" @ %client.player.serviceFee @ "\c6 for a service.");
}
%client.player.CityRP_lastProcessBrick.onTransferSuccess(%client);
}
else
{
messageClient(%client, '', "\c6You cannot afford this service.");
}
%client.player.CityRP_lastProcessBrick = NULL;
%client.player.serviceFee = 0;
}
else
{
%client.player.CityRP_lastProcessBrick = NULL;
%client.player.serviceFee = 0;
messageClient(%client, '', "\c6You are too far away from the service to purchase it!");
}
}
else
{
messageClient(%client, '', "\c6You have no active tranfers that you may accept!");
}
return 1;
}
function CrpCmdNo(%client)
{
if(isObject(%client.player.CityRP_lastProcessBrick))
{
messageClient(%client, '', "\c6You have rejected the service fee!");
%client.player.CityRP_lastProcessBrick.onTransferDecline(%client);
%client.player.CityRP_lastProcessBrick = NULL;
%client.player.serviceFee = 0;
}
else
{
messageClient(%client, '', "\c6You have no active tranfers that you may decline!");
}
return 1;
}
Thanks if you can help.
And, if you can't say Anything helpful, don't say ANYTHING.
EDIT:Found something else that might be helpful...
function GameConnection::requestFunds(%client, %serviceName, %fund)
{
if(isObject(%client.player) && !%client.player.CityRP_lastProcessBrick && isObject($lastProcessedBrick_cityRP))
{
//You might want to check if they're already in an accept/decline thing, or the distance to $lastProcessedBrick_cityRP, etc.
%client.player.CityRP_lastProcessBrick = $lastProcessedBrick_cityRP;
%client.player.serviceFee = %fund;
messageClient(%client,'',"\c6Service \"\c3" @ %serviceName @ "\c6\" requests \c3$" @ %fund SPC "\c6.");
messageClient(%client,'',"\c6Accept with \c3^yes\c6, decline with \c3^no\c6.");
//other stuff
}
else if(%client.player.CityRP_lastProcessBrick)
{
if(%client.player.CityRP_lastProcessBrick != $lastProcessedBrick_cityRP)
{
messageClient(%client, '', "\c6You already have a charge request from another service! Type \c3^no to reject it.");
}
}
}
And this
registerOutputEvent("GameConnection", "requestFunds", "string 80 200\tint 1 9999", 0);