Author Topic: Mining Script Help?  (Read 2353 times)

So, i'm working on an event where each click, the brick's gold gets decreased by 1 (starts at 5) and the player's gold gets increased by 1 (starts at 0). But the player's gold will just stay at 1 and the first click, the brick dissapears.

Code: [Select]
function fxDTSBrick::Gold(%this,%client)
{
if($Pref::Server::RPGMod::Enabled==1)
{
%client.goldAmount++;
%this.goldAmount-=1;
if(%client.goldAmount=1)
{
messageClient(%client,'',"\c6You now have \c21\c6 peice of gold. The block now has \c24\c6 peices of gold.");
%this.goldAmount=4;
}
if(%client.goldAmount>=2)
{
messageClient(%client,'',"\c6You now have \c2"@%client.goldAmount@"\c6 peices of gold. The block now has \c2"@%this.goldAmount@"\c6 peices of

gold.");
}
if(%this.goldAmount=4)
{
%this.delete();
}
}
}

Please help!
« Last Edit: April 02, 2009, 02:45:41 PM by Club559 »

Please help I really need to know

its ::onClientEnterGame for when they spawn, or ::authCheck for when they connect.

Remember to package your new method and call the parent too.

its ::onClientEnterGame for when they spawn, or ::authCheck for when they connect.

Remember to package your new method and call the parent too.

Thanks, Ephialtes. You are going to get credit for the release. NEW QUESTION BEING MADE...

EDIT: Wait, i'm not such a scripting pro... call my parent? Do you mean do...

Code: [Select]
%client.authCheck();
..?
« Last Edit: April 01, 2009, 11:03:30 PM by Club559 »


http://forum.blockland.us/index.php?topic=21811.0

I believe this pertains to the subject.

ERROR: function declaration failed: GameConnection::authCheck

My bad, I meant use ::autoAdminCheck instead.

My bad, I meant use ::autoAdminCheck instead.
I want it to be viewable for anyone, not just auto-admins...

EDIT: Oh, I see... you do autoAdminCheck... but you don't DEFINE the yes/no process...
« Last Edit: April 01, 2009, 11:35:19 PM by Club559 »

Ok, now, I need THIS question answered.

To do string comparisons you need to use $= and to do numeracy + bool (true/false) comparision you need to use  ==.
You're currently using = which doesn't work at all so you need to use $=. (Because you're comparing a string)

Nevermind, I got a new (working) code down.

Code: [Select]
$Pref::Server::RPGMod::Enabled=0;

function serverCmdStartRPG(%client)
{
if(%client.isSuperAdmin=1)
{
$Pref::Server::TooFarDistance="0";
$Pref::Server::RPGMod::Enabled=1;
messageAll("MsgItemPickup","\c6The RPG Mod is now \c2on\c6.");
}
}

function serverCmdEndRPG(%client)
{
if(%client.isSuperAdmin=1)
{
$Pref::Server::TooFarDistance="50";
$Pref::Server::RPGMod::Enabled=0;
messageAll("MsgItemPickup","\c6The RPG Mod is now \c0off\c6.");
}
}


Nevermind, I got a new (working) code down.

Code: [Select]
$Pref::Server::RPGMod::Enabled=0;

function serverCmdStartRPG(%client)
{
if(%client.isSuperAdmin=1)
{
$Pref::Server::TooFarDistance="0";
$Pref::Server::RPGMod::Enabled=1;
messageAll("MsgItemPickup","\c6The RPG Mod is now \c2on\c6.");
}
}

function serverCmdEndRPG(%client)
{
if(%client.isSuperAdmin=1)
{
$Pref::Server::TooFarDistance="50";
$Pref::Server::RPGMod::Enabled=0;
messageAll("MsgItemPickup","\c6The RPG Mod is now \c0off\c6.");
}
}

No, that's not a working code. You're setting the %client's isSuperAdmin variable to true, not checking it. Read what Destiny said and actually pay attention this time.

No, that's not a working code. You're setting the %client's isSuperAdmin variable to true, not checking it. Read what Destiny said and actually pay attention this time.

Can you get on topic to the current bug here?

Can you get on topic to the current bug here?

No, fix your code. Even the one in the first post doesn't work right.