PHP Code:
//#CLIENTSIDE
function onCreated()
{
this.overheat_max = 100;
this.overheat = 0;
}
function onWeaponFired()
{
this.active = !this.active;
if (this.active)
{
setTimer( 1 );
}
if (!this.active)
{
onCreated()
}
}
function onKeyPressed( code, key, ind)
{
if (temp.key == "s")
{
if (this.active)
{
if (this.overheat != 100)
{
this.angle = getangle( vecx( player.dir), vecy( player.dir));
shoot( this.x, this.y, this.z, this.angle, 0, 0, "arrow", NULL);
this.overheat +=1;
sleep( 0.1);
}
}
}
}
function onTimeOut()
{
if (this.overheat >= this.overheat_max)
{
this.active = 2;
sleep( 5);
this.active = 1;
}
setTimer( 0.05);
}