News UnrealEd Files Mods FragBU Liandri Archives
BeyondUnreal Forums

Go Back   BeyondUnreal Forums > Unreal Development > Coding

Thread Tools Display Modes
Old 7th Mar 2004, 04:00 AM   #1
Registered User
damaestrio's Avatar
Join Date: Aug. 30th, 2001
Posts: 25
Duplicate Projectiles

I'm trying to write in a function to spawn a projectile in a weapon. I can't subclass from the original projectilefire, so I've written this code:

function SpawnProjectile(Vector Start, Rotator Dir)
  local UETFWeapon Fweapon;
  local Projectile p;


  if (Role < Role_Authority)
  if (Fweapon.BulletsInClip<=0){

  if (p==None){
     p = Spawn(ProjectileClass,,, Start, Dir);
However, this code creates 2 projectiles each time it's called instead of one.
I believe only one projectile is actually replicated-the other doesn't seem to do damage.

Any help with getting rid of the second projectile?


Last edited by Mychaeel; 7th Mar 2004 at 07:13 AM. Reason: [code] tags have [], not <>
damaestrio is offline   Reply With Quote
Old 7th Mar 2004, 12:13 PM   #2
International arms dealer
Mr_Evi1's Avatar
Join Date: Jan. 4th, 2003
Location: UK
Posts: 312
Fire modes are spawned on both client and server, thus your check for role will always be true. Check weapon.role instead.
Mr_Evi1 is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -5. The time now is 04:35 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2015, vBulletin Solutions, Inc.

Copyright ©1998 - 2015, BeyondUnreal
Privacy Policy | Terms of Use
Bandwidth provided by AtomicGamer