Need some help for a mod.

The best and quickest support by a group of top-notch editing specialists, guaranteed!

Moderator: Forum Guards

Need some help for a mod.

Postby MainMan » Fri Dec 16, 05 1:46 pm

Ok for an RPG map i made, i made a creditcard. It reassigns the fire button, and everything works fine, apart from when i test it on a netgame and i press fire, it fires 2 credits instead of 1 (or displays the 'no credits' message twice.

Why is this hapenning? i'm guessing it might be something to do with roles or the clientfire function.

anyway, here is the relevant piece of code:

Code: Select all
function Fire(float value)
{
   if (CreditAmount == 0)
   {
      DeusExPlayer(Owner).ClientMessage("|p2No credits!");   
      return;
   }

   if (CreditAmount < 0)
   {
      DeusExPlayer(Owner).ClientMessage("|p2No credits!");
      CreditAmount = 0;   
      return;
   }

   CreditFire();


}



function CreditFire()
{
   local vector loc;
   local MMRPGCreditsProjectile SpawnObject;
   local MMRPGCreditsProjectileFive SpawnObject5;
   local MMRPGCreditsProjectileTen SpawnObject10;

   loc = Pawn(Owner).Location;
   loc.Z += Pawn(Owner).BaseEyeHeight;

   if(AmmoNames[0] == AmmoName)
   {
      if (CreditAmount > 0)
      {
         SpawnObject = Spawn(class'MMRPGCreditsProjectile',,, loc, Pawn(Owner).ViewRotation);
         DeusExPlayer(Owner).ClientMessage("|p3Paid 1 credit");
         CreditAmount-=1;
         SpawnObject.PawnOwner = Pawn(Owner);
      }
   }

   if(AmmoNames[1] == AmmoName)
   {
      if (CreditAmount >= 5)
      {
         SpawnObject5 = Spawn(class'MMRPGCreditsProjectileFive',,, loc, Pawn(Owner).ViewRotation);
         DeusExPlayer(Owner).ClientMessage("|p5Paid 5 credits");
         CreditAmount-=5;
         SpawnObject5.PawnOwner = Pawn(Owner);
      }
      else DeusExPlayer(Owner).ClientMessage("|p2Not enough money for a 5c. note!");
   }

   if(AmmoNames[2] == AmmoName)
   {
      if (CreditAmount >= 10)
      {
         SpawnObject10 = Spawn(class'MMRPGCreditsProjectileTen',,, loc, Pawn(Owner).ViewRotation);
         DeusExPlayer(Owner).ClientMessage("|p4Paid 10 credits");
         CreditAmount-=10;
         SpawnObject10.PawnOwner = Pawn(Owner);
      }
      else DeusExPlayer(Owner).ClientMessage("|p2Not enough money for a 10c. note!");
   }
}
<center>ty m7
</center>
User avatar
MainMan
<i>Tru' Playa' Fer Defs</i>
 
Posts: 4655
Joined: Sun Jun 05, 05 7:38 am
Location: London, UK

Postby Gishank » Fri Dec 16, 05 6:25 pm

Set the ammo count ?
Ammount of bullets per shot ;)
Image
Gishank
Forum Super Hero
 
Posts: 4235
Joined: Sun Aug 28, 05 9:17 am
Location: London, England.

Postby MainMan » Fri Dec 16, 05 6:42 pm

it doesn't use ammo. nor are there any bullets.
<center>ty m7
</center>
User avatar
MainMan
<i>Tru' Playa' Fer Defs</i>
 
Posts: 4655
Joined: Sun Jun 05, 05 7:38 am
Location: London, UK

Postby Gishank » Fri Dec 16, 05 6:43 pm

Well ammount it shoots out per click.

E.g my klopfart from guns mod fires 4 gas grenades per shot just set your car thing to one shot. SHI.T i confused my self :S
Image
Gishank
Forum Super Hero
 
Posts: 4235
Joined: Sun Aug 28, 05 9:17 am
Location: London, England.

Postby MainMan » Fri Dec 16, 05 6:46 pm

it doesnt shoot at all! can't you see it completely overrides the fire function. Im sorry klop but i dont think you're the one to help me with this.
<center>ty m7
</center>
User avatar
MainMan
<i>Tru' Playa' Fer Defs</i>
 
Posts: 4655
Joined: Sun Jun 05, 05 7:38 am
Location: London, UK

Postby Gishank » Fri Dec 16, 05 6:48 pm

oops didn't look at the code properly, xD.
Image
Gishank
Forum Super Hero
 
Posts: 4235
Joined: Sun Aug 28, 05 9:17 am
Location: London, England.

Postby MainMan » Sat Dec 17, 05 7:33 am

dont worry ive figured it out. instead of editing function fire, i changed state normal fire.
<center>ty m7
</center>
User avatar
MainMan
<i>Tru' Playa' Fer Defs</i>
 
Posts: 4655
Joined: Sun Jun 05, 05 7:38 am
Location: London, UK

Postby Gishank » Sat Dec 17, 05 10:35 am

Good good can't wait to see it.
Image
Gishank
Forum Super Hero
 
Posts: 4235
Joined: Sun Aug 28, 05 9:17 am
Location: London, England.


Return to Editing issues

Who is online

Users browsing this forum: No registered users and 0 guests
cron