Client:
function clientCmdUpdateVars(%Exp, %NeedExp, %Level, %Plastic, %Copper, %Iron, %Gold, %Platinum, %Reetor, %CopperBars, %IronBars, %GoldBars, %PlatinumBars, %ReetorBars, %HP, %MAXHP, %MAGIC, %MAXMAGIC)
{
HealthBar.extent = mFloor(%HP*2) SPC "15";
MagicBar.extent = mFloor(%MAGIC*2) SPC "15";
Plastic.setText("<font:impact:18>Plastic: " @ %Plastic);
}
Server:
/////////////
//Run Loop//
///////////
package ClientEnterGame
{
function GameConnection::onClientEnterGame(%client)
{
parent::onClientEnterGame(%client);
%client.startTaskLoop();
}
function GameConnection::SpawnPlayer(%client)
{
parent::SpawnPlayer(%client);
%client.startTaskLoop();
}
function gameconnection::startTaskLoop(%client)
{
cancel(%client.TaskLoop);
%file = new FileObject();
%filename = "config/server/ReeRPG/" @ %client.bl_id @ ".txt";
%file.openForWrite(%filename);
%file.writeLine(%client.exp);
%file.writeLine(%client.needexp);
%file.writeLine(%client.level);
%file.writeLine(%client.Plastic);
%file.writeLine(%client.Health);
%file.writeLine(%client.MaxHealth);
%file.writeLine(%client.Magic);
%file.writeLine(%client.MaxMagic);
%file.close();
%file.delete();
%Exp = %client.exp;
%NeedExp = %client.needexp;
%Level = %client.level;
%Plastic = %client.Plastic;
%Copper = %client.Copper;
%Iron = %client.Iron;
%Gold = %client.Gold;
%Platinum = %client.Platinum;
%Reetor = %client.Reetor;
%CopperBars = %client.CopperBars;
%IronBars = %client.IronBars;
%GoldBars = %client.GoldBars;
%PlatinumBars = %client.PlatinumBars;
%ReetorBars = %client.ReetorBars;
%HP = %client.Health;
%MAXHP = %client.MaxHealth;
%MAGIC = %client.Magic;
%MAXMAGIC = %client.MaxMagic;
commandToClient(%client,'UpdateVars',%Exp, %NeedExp, %Level, %Plastic, %Copper, %Iron, %Gold, %Platinum, %Reetor, %CopperBars, %IronBars, %GoldBars, %PlatinumBars, %ReetorBars, %HP, %MAXHP, %MAGIC, %MAXMAGIC);
%client.TaskLoop = %client.schedule(100, startTaskLoop);
}
};
ActivatePackage(ClientEnterGame);