Quote:
Originally Posted by killer boss
i have paste this on emulator
PHP Code:
else if(packetHeader == "S|ROB") { if (this.Ship.HP == this.Ship.maxHP) { Send("0|A|RS|0"); Send("0|A|HPT|" + this.Ship.HP + "|" + this.Ship.maxHP); { if (this.Ship.HP < this.Ship.maxHP) Send("0|A|RS|1"); long hp = this.Ship.HP + 10000; Send("0|A|HPT|" + hp + "|" + this.Ship.maxHP);
if (this.Ship.HP >= this.Ship.maxHP) this.Ship.HP = this.Ship.maxHP; Send("0|A|RS|0"); } } }
and this d'ont work O_o ? where is my error pliz 
|
Your error is this " if (this.Ship.HP == this.Ship.maxHP)"
You told to your server to verify if the current ship hp = the current max hp
if both are equals them you desactivate the robot but if current hp is less or more than max hp, nothing is doing
i did it like this for my part
PHP Code:
else if (packetHeader.StartsWith("S"))
{
string packetSubHeader = packetParser.getString();
if (packetSubHeader.StartsWith("ROB"))
{
this.Ship.repair = true;
if (this.Ship.HP == this.Ship.maxHP)
{
this.Send("0|A|RS|0");
this.Send("0|A|HPT|" + this.Ship.HP + "|" + this.Ship.maxHP);
this.Ship.repair = false;
return;
}
else if (this.Ship.HP < this.Ship.maxHP)
{
this.Send("0|A|RS|1");
uint newhp = this.Ship.HP + 500;
this.Ship.HP += 500;
this.Send("0|A|HPT|" + newhp + "|" + this.Ship.maxHP);
}
else if (this.Ship.HP > this.Ship.maxHP)
{
this.Ship.HP = this.Ship.maxHP;
this.Send("0|A|HPT|" + this.Ship.HP + "|" + this.Ship.maxHP);
this.Send("0|A|RS|0");
this.Ship.repair = false;
}
this.Send("0|A|RS|0");
}
}