Author Topic: RequestFunds ^yes Help.  (Read 1153 times)

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.
Code: [Select]
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...
Code: [Select]
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
Code: [Select]
registerOutputEvent("GameConnection", "requestFunds", "string 80 200\tint 1 9999", 0);
« Last Edit: January 02, 2010, 05:51:48 PM by Bloxxed »

Bump, really need help, please help ASAP.

You spelled player wrong on line 2

You spelled player wrong on line 2

Changed, doesn't do anything.


Why you have %this when you need to put %client cause %this isn't declared as anything.

Why you have %this when you need to put %client cause %this isn't declared as anything.

Theres no %this in here, and sorry for like a 2 day bump.

Edit:Just noticed it, will post back if works.
« Last Edit: January 04, 2010, 03:28:07 PM by Bloxxed »

Theres no %this in here, and sorry for like a 2 day bump.
if(isObject(%this.player)

3rd line down.

Yeah, thanks guys, really helped, especially Pah, Thanks, don't post in this topic anymoar.

This is a known glich in Ibans CityRPG v2
I shall post a fix in a min.

This is a known glich in Ibans CityRPG v2
I shall post a fix in a min.

What the hell, you bumped a 1 month old topic and I've already solved the problem, have shame on you.
« Last Edit: February 21, 2010, 02:59:26 PM by Bloxxed »