Quote:
Originally Posted by NoCheatImPGM
You should read the whole post... It's not my code.
|
It works great
I have edited this code :
Code:
if (packetSubHeader.StartsWith("CFG"))
{
if (this.Ship.CanUseConfig == false)
{
ChangeCFG(packetParser.getUInt());
}
else
{
this.Send("0|A|STM|config_change_failed_time");
}
}
Code:
public async void ChangeCFG(uint cfg)
{
try
{
this.Ship.CanUseConfig = true;
if (cfg == 1)
{
this.Send("0|S|CFG|1");
this.Ship.config = 1;
this.Ship.shield2 = this.Ship.shield;
this.Ship.damage2 = this.Ship.damage;
this.Ship.shield = this.Ship.shield1;
this.Ship.damage = this.Ship.damage1;
this.Ship.maxShield = this.Ship.maxShield1;
//this.Ship.speed = this.Ship.speed1;
this.Send("0|A|SHD|" + this.Ship.shield + "|" + this.Ship.maxShield);
//this.Send("0|A|v|" + this.Ship.speed);
}
else if (cfg == 2)
{
this.Send("0|S|CFG|2");
this.Ship.config = 2;
this.Ship.shield1 = this.Ship.shield;
this.Ship.shield = this.Ship.shield2;
this.Ship.damage = this.Ship.damage2;
this.Ship.maxShield = this.Ship.maxShield2;
//this.Ship.speed = this.Ship.speed2;
this.Send("0|A|SHD|" + this.Ship.shield + "|" + this.Ship.maxShield);
//this.Send("0|A|v|" + this.Ship.speed);
}
await Task.Delay(5000);
this.Ship.CanUseConfig = false;
}
catch
{ }
}
There is only one problem
My damage is not updated.. (config1)
What do I need to update the damage?