+ Reply to Thread
Results 1 to 10 of 10

Thread: LScript:FireWhileSprinting and Climbing

  1. #1
    Gave Up Long Ago Angel of Darkness
    Join Date
    26th Apr 2006
    Posts
    250

    LScript:FireWhileSprinting and Climbing

    Hello....
    This will allow your gun to always stay up no matter what and you can fire while sprinting and on ladders.

    if PC.Pawn and PC.Pawn.Weapon then
    if PC.Pawn.Weapon.IsInState(Engine.FNames['Idle']) == false then
    if PC.Pawn.Weapon.IsInState(Engine.FNames['BusyFiring']) == false then
    if PC.Pawn.Weapon.IsInState(Engine.FNames['BusyZooming']) == false then

    PC.Pawn.Weapon.GotoState(Engine.FNames['Idle'])
    PC.Pawn.bLimitRotation = false
    PC.Pawn.bLockMovement = false
    end

    end
    end
    if PC.Pawn.bIsSprinting == true then
    PC.Pawn.bIsSprinting = false
    end

    end
    end
    end

    Not too good ...maybe someone can help to finish or fix this it seems to work but I beleive it could be better


    credits
    temp2 for 2.7 lua and for gun always up from uscript(i just added FNames BusyZooming false so to be able to zoom the gun
    SmokeZ for Zbot witch again I used as a base
    Santana for his Native Always Fire Snippet witch is where I got this
    Last edited by alien56; 18th November 2006 at 07:42.

  2. #2
    ₪₪ oldschool-leeb ₪₪ Bronze Hero SmokeZ's Avatar
    Join Date
    20th Jan 2004
    Posts
    1,390
    Code:
    WeaponStates = {}
    index = 0
    
    WeaponStates[0] = PC.Pawn.Weapon.IsInState(Engine.FNames['DownWeapon'])
    WeaponStates[1] = PC.Pawn.Weapon.IsInState(Engine.FNames['Reloading'])
    WeaponStates[2] = PC.Pawn.Weapon.IsInState(Engine.FNames['BusyFixingJam'])
    WeaponStates[3] = PC.Pawn.Weapon.IsInState(Engine.FNames['BusyReloading'])
    WeaponStates[4] = PC.Pawn.Weapon.IsInState(Engine.FNames['BusyTempLowering'])
    WeaponStates[5] = PC.Pawn.Weapon.IsInState(Engine.FNames['BusyChangingFireMode'])
    WeaponStates[6] = PC.Pawn.Weapon.IsInState(Engine.FNames['BusyRaisingWeapon'])
    WeaponStates[7] = PC.Pawn.Weapon.IsInState(Engine.FNames['BusySupporting'])
    WeaponStates[8] = PC.Pawn.Weapon.IsInState(Engine.FNames['BusyLoweringWeapon'])
    WeaponStates[9] = PC.Pawn.Weapon.IsInState(Engine.FNames['InCrawling'])
    WeaponStates[10] = PC.Pawn.Weapon.IsInState(Engine.FNames['Crawling'])
    WeaponStates[11] = PC.Pawn.Weapon.IsInState(Engine.FNames['BusySuppressor'])
    WeaponStates[12] = PC.Pawn.Weapon.IsInState(Engine.FNames['DownWeapon'])
    WeaponStates[13] = PC.Pawn.Weapon.IsInState(Engine.FNames['BusyZooming'])
    WeaponStates[14] = PC.Pawn.Weapon.IsInState(Engine.FNames['BusyTempDown'])
    WeaponStates[15] = PC.Pawn.Weapon.IsInState(Engine.FNames['BusyProning'])
    
    
    for index = 0, 15 do
    
    	if WeaponStates[index] then //doublecheck (!=NULL) (==true)
    	
    		PC.Pawn.Weapon.GotoState('Idle');
    	end
    end
    if you need some more states just add them ;o
    Latest AA Project (ZBot LUA):
    [0] [1] [2] [3] [4] [5] [6] [7] [8] [9]

  3. #3
    C++ <3 Angel of Darkness
    Join Date
    8th Oct 2005
    Posts
    260
    yeah.. watch is there smoke, your mixin uscript and lua..

    this:

    Code:
    PC.Pawn.Weapon.GoToState('Idle');
    would actually be..

    Code:
    PC.Pawn.Weapon.GoToState(Engine.FNames['Idle'])

  4. #4
    Gave Up Long Ago Angel of Darkness
    Join Date
    26th Apr 2006
    Posts
    250
    Hey,
    does anyone know how to make it so the gun will not fire when throwing a nade...when using this script every time you pull the pin on the grenade you unload a clip....ive tried every playerstate i could find and tried a few If statements to make it stop doing this but was unsuccessfull

  5. #5
    Banned Silent Killer Killa's Avatar
    Join Date
    6th Jan 2004
    Posts
    400
    Maybe you could use "not Weapon.IsA("ThrowWeapon")"?

  6. #6
    ₪₪ oldschool-leeb ₪₪ Bronze Hero SmokeZ's Avatar
    Join Date
    20th Jan 2004
    Posts
    1,390
    Code:
    	CThrowWeapon	= Engine.UObjects['Class AGP.ThrowWeapon']
    
    	if (not Engine.IsA(PC.Pawn.Weapon, CThrowWeapon)) 
    	and (PC.Pawn.Weapon.eROF ~= 4) then
    Latest AA Project (ZBot LUA):
    [0] [1] [2] [3] [4] [5] [6] [7] [8] [9]

  7. #7
    Gave Up Long Ago Angel of Darkness
    Join Date
    26th Apr 2006
    Posts
    250
    Isnt working ...still unloads a clip everytime

  8. #8
    ₪₪ oldschool-leeb ₪₪ Bronze Hero SmokeZ's Avatar
    Join Date
    20th Jan 2004
    Posts
    1,390
    Quote Originally Posted by alien56 View Post
    Isnt working ...still unloads a clip everytime
    aha? and where did you put it ? ;p
    you need to check that before every state-change
    if you dont change the state it cant shot.. or you use serverfire on the mousebutton?
    Latest AA Project (ZBot LUA):
    [0] [1] [2] [3] [4] [5] [6] [7] [8] [9]

  9. #9
    Gave Up Long Ago Angel of Darkness
    Join Date
    26th Apr 2006
    Posts
    250
    Alright ...thnx guys ...its working great now. As long as I turn off always autofire mode its fine.

  10. #10
    ok so i put this up at the top for global

    Code:
    CThrowWeapon	= Engine.UObjects['Class AGP.ThrowWeapon']
    and then this in postrender;
    Code:
    WeaponStates = {}
    index = 0
    
    WeaponStates[0] = PC.Pawn.Weapon.IsInState(Engine.FNames['DownWeapon'])
    WeaponStates[1] = PC.Pawn.Weapon.IsInState(Engine.FNames['Reloading'])
    WeaponStates[2] = PC.Pawn.Weapon.IsInState(Engine.FNames['BusyFixingJam'])
    WeaponStates[3] = PC.Pawn.Weapon.IsInState(Engine.FNames['BusyReloading'])
    WeaponStates[4] = PC.Pawn.Weapon.IsInState(Engine.FNames['BusyTempLowering'])
    WeaponStates[5] = PC.Pawn.Weapon.IsInState(Engine.FNames['BusyChangingFireMode'])
    WeaponStates[6] = PC.Pawn.Weapon.IsInState(Engine.FNames['BusyRaisingWeapon'])
    WeaponStates[7] = PC.Pawn.Weapon.IsInState(Engine.FNames['BusySupporting'])
    WeaponStates[8] = PC.Pawn.Weapon.IsInState(Engine.FNames['BusyLoweringWeapon'])
    WeaponStates[9] = PC.Pawn.Weapon.IsInState(Engine.FNames['InCrawling'])
    WeaponStates[10] = PC.Pawn.Weapon.IsInState(Engine.FNames['Crawling'])
    WeaponStates[11] = PC.Pawn.Weapon.IsInState(Engine.FNames['BusySuppressor'])
    WeaponStates[12] = PC.Pawn.Weapon.IsInState(Engine.FNames['DownWeapon'])
    WeaponStates[13] = PC.Pawn.Weapon.IsInState(Engine.FNames['BusyZooming'])
    WeaponStates[14] = PC.Pawn.Weapon.IsInState(Engine.FNames['BusyTempDown'])
    WeaponStates[15] = PC.Pawn.Weapon.IsInState(Engine.FNames['BusyProning'])
    
    if (not Engine.IsA(PC.Pawn.Weapon, CThrowWeapon))
    	and (PC.Pawn.Weapon.eROF ~= 4) then
    
    		for index = 0, 15 do
    
    			if WeaponStates[index] then //doublecheck (!=NULL) (==true)
    				PC.Pawn.Weapon.GoToState(Engine.FNames['Idle'])
    			end
    		end
    end
    Doesn't work and makes game 5 fps when gun is up. How did you get it working? The //doublecheck isn't compiling either, so i'm not sure if that was old script or what. Thanks.

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts