Jump to content

How to run with weapons


UnKnownGuy

Recommended Posts

Posted

Wrong section next time post your question here, anyways you can run with weapons by changing your walking style to sneak.

Example:

-- use /sneak to chnage your walking style
function changeWalkStyle(player)
	setPedWalkingStyle(player,69)
end
addCommandHandler("sneak",changeWalkStyle)

 

  • Like 1
Posted
Just now, Walid said:

Wrong section next time post your question here, anyways you can run with weapons by changing your walking style to sneak.

Example:


-- use /sneak to chnage your walking style
function changeWalkStyle(player)
	setPedWalkingStyle(player,69)
end
addCommandHandler("sneak",changeWalkStyle)

 

I typed /sneak in Console and nothing happens

What I do now?

Posted (edited)
Just now, Walid said:

just copy and past my code server side then press T /sneak that's all.

I did that and nothing

Please I didn't understand 

I copied that:

  1. -- use /sneak to chnage your walking style
  2. function changeWalkStyle(player)
  3. setPedWalkingStyle(player,69)
  4. end
  5. addCommandHandler("sneak",changeWalkStyle)
  6.  

Then I typed in "T" chat /sneak and nothing happened 

Edited by UnKnownGuy
Posted
4 minutes ago, UnKnownGuy said:

I wanna run with M4/AK47 and I can't run with them

I'm pretty sure you don't undrestand how to use it , np try this code client side > restart your resource > switch to M4 > then run.

addEventHandler("onClientPlayerWeaponSwitch", localPlayer, 
    function (prevSlot, newSlot) 
        if (newSlot == 5 and getPedWeapon(localPlayer, 5) == 31) then 
            setPedWalkingStyle(localPlayer, 69) 
        else 
            setPedWalkingStyle(localPlayer, 0) 
        end 
    end 
) 

 

Posted
Just now, Walid said:

I'm pretty sure you don't undrestand how to use it , np try this code client side > restart your resource > switch to M4 > then run.


addEventHandler("onClientPlayerWeaponSwitch", localPlayer, 
    function (prevSlot, newSlot) 
        if (newSlot == 5 and getPedWeapon(localPlayer, 5) == 31) then 
            setPedWalkingStyle(localPlayer, 69) 
        else 
            setPedWalkingStyle(localPlayer, 0) 
        end 
    end 
) 

 

Copy this and past it in Console??

Posted
Just now, UnKnownGuy said:

Copy this and past it in Console??

:eek: Copy and past it client side in your resource then use /restart <resourcename>

Posted

Wrong section. What do you have in meta.xml? 

<script src="file.lua" type="server"/>

or

<script src="file.lua" type="client"/> -- This is client-side

?

If file.lua have in meta "client" then paste your code and use /restart <resource>

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...