Author Topic: Changing Crosshairs  (Read 3168 times)

I can't anything like 'Ammo.cs' or anything that shouts out "Here's what your looking for!"

Where's the ammo part of the Zombie mod?

This could make a useful add-on to change crosshairs in game.

Is there some thing like "$Player.iteminhand = Gun" that I could do to change crosshairs?

Also, for the Ammo, I'm thinking something like this (Be warned, I don't script):

Code: [Select]
function gunImage::onFire(%this,%obj,%slot)
{
   $Pref:Ammo:GunMax=56;
   $Pref:Ammo:GunClip=7;
   $Pref:Ammo:GunReload=240; //miliseconds

   if($Pref:Ammo:GunAmmo > 0)
   {
      $Pref:Ammo:GunAmmo = ($Pref:Ammo:GunAmmo - 1);
   }
   else if($Pref:Ammo:GunAmmoTotal > $Pref:Ammo:GunClip)
   {
      $Pref:Ammo:GunAmmoTotal = ($Pref:Ammo:GunAmmoTotal - $Pref:Ammo:GunClip);
      $Pref:Ammo:GunAmmo=7;
   }
   else
   {
      messageClient("","\c6 You need more ammo!);
   }
}

I can't anything like 'Ammo.cs' or anything that shouts out "Here's what your looking for!"

Where's the ammo part of the Zombie mod?
The piece where you can find the ammo stuff is in Zombie_Overwrite.cs
Code: [Select]
function WeaponImage::onFire(%this, %obj, %slot)
{
if(IsInMinigame(%obj) && %obj.client.minigame.EnableAmmoMod == 1)
{
if(%this.melee == 1){
parent::onFire(%this, %obj, %slot);
return ;
}
if(%obj.zombieammo[%this.projectile] == -1)
{
BottomPrint(%obj.client,"<just:center><color:FFFF00>Ammo <color:FFFFFF>: <just:left><color:FF0000> NONE",3);
//%obj.playthread(2,activate2);
return;

}
if(%obj.zombieammo[%this.projectile] >= 1)
{
%obj.zombieammo[%this.projectile]--;
bottomprintremainingammo(%obj,%this);
parent::onFire(%this, %obj, %slot);
if(%obj.zombieammo[%this.projectile] == 1 && %this.projectile $= "akimboGunProjectile")
{
%obj.zombieammo[%this.projectile]--;
bottomprintremainingammo(%obj,%this);
}
}
if(%obj.zombieammo[%this.projectile] <= 0)
{
%obj.zombieammo[%this.projectile] = -1;
if(isobject(%obj.getmountedimage(0).getname() @ "NoFire"))
{
%obj.mountimage(%obj.getmountedimage(0).getname() @ "NoFire",0);
}
BottomPrint(%obj.client,"<just:center><color:FFFF00>Ammo <color:FFFFFF>: <just:left><color:FF0000> NONE",3);
%obj.playaudio(1,ammocratesound);
%obj.playthread(2,activate2);
return;
}
}
else
{
parent::onFire(%this, %obj, %slot);
}
}