Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
      4. Frontier Pursuits
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. DLC
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
      7. The Diamond Casino Heist
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA IV Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA SA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA VC Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA III Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. News

    2. Forum Support

    3. Site Suggestions

Amey.Banaye

How to animate a ped in c# ?

Recommended Posts

Amey.Banaye

How can i make player do a certain set of animation after a key press or an event ?

 

Code example wll be helpful :)

Share this post


Link to post
Share on other sites
qwerasdzxc

How can i make player do a certain set of animation after a key press or an event ?

 

Code example wll be helpful :)

        if (e.KeyCode == Keys.O) //random key         {            Ped playerPed = Game.Player.Character;            GTA.Native.Function.Call(GTA.Native.Hash.TASK_START_SCENARIO_IN_PLACE, playerPed, "CODE_HUMAN_POLICE_INVESTIGATE", 1, true);        }

Hope this is what you need! :)

 

P.S. Here's the list for some of the animations that someone posted here on GTA:F

 

 

List:

Standing

WORLD_HUMAN_AA_COFFEE

WORLD_HUMAN_AA_SMOKE

WORLD_HUMAN_BINOCULARS

WORLD_HUMAN_BUM_FREEWAY

WORLD_HUMAN_BUM_SLUMPED

WORLD_HUMAN_BUM_STANDING

WORLD_HUMAN_BUM_WASH

WORLD_HUMAN_CAR_PARK_ATTENDANT

WORLD_HUMAN_CHEERING

WORLD_HUMAN_CLIPBOARD

WORLD_HUMAN_CONST_DRILL

WORLD_HUMAN_COP_IDLES

WORLD_HUMAN_DRINKING

WORLD_HUMAN_DRUG_DEALER

WORLD_HUMAN_DRUG_DEALER_HARD

WORLD_HUMAN_MOBILE_FILM_SHOCKING

WORLD_HUMAN_GARDENER_LEAF_BLOWER

WORLD_HUMAN_GARDENER_PLANT

WORLD_HUMAN_GOLF_PLAYER

WORLD_HUMAN_GUARD_PATROL

WORLD_HUMAN_GUARD_STAND

WORLD_HUMAN_GUARD_STAND_ARMY

WORLD_HUMAN_HAMMERING

WORLD_HUMAN_HANG_OUT_STREET

WORLD_HUMAN_HIKER_STANDING

WORLD_HUMAN_HUMAN_STATUE

WORLD_HUMAN_JANITOR

WORLD_HUMAN_JOG_STANDING

WORLD_HUMAN_LEANING

WORLD_HUMAN_MAID_CLEAN

WORLD_HUMAN_MUSCLE_FLEX

WORLD_HUMAN_MUSCLE_FREE_WEIGHTS

WORLD_HUMAN_MUSICIAN

WORLD_HUMAN_PAPARAZZI

WORLD_HUMAN_PARTYING

WORLD_HUMAN_PICNIC

WORLD_HUMAN_PROSTITUTE_HIGH_CLASS

WORLD_HUMAN_PROSTITUTE_LOW_CLASS

WORLD_HUMAN_PUSH_UPS

WORLD_HUMAN_SEAT_LEDGE

WORLD_HUMAN_SEAT_LEDGE_EATING

WORLD_HUMAN_SEAT_STEPS

WORLD_HUMAN_SEAT_WALL

WORLD_HUMAN_SEAT_WALL_EATING

WORLD_HUMAN_SEAT_WALL_TABLET

WORLD_HUMAN_SECURITY_SHINE_TORCH

WORLD_HUMAN_SIT_UPS

WORLD_HUMAN_SMOKING

WORLD_HUMAN_SMOKING_POT

WORLD_HUMAN_STAND_FIRE

WORLD_HUMAN_STAND_FISHING

WORLD_HUMAN_STAND_IMPATIENT

WORLD_HUMAN_STAND_IMPATIENT_UPRIGHT

WORLD_HUMAN_STAND_MOBILE

WORLD_HUMAN_STAND_MOBILE_UPRIGHT

WORLD_HUMAN_STRIP_WATCH_STAND

WORLD_HUMAN_STUPOR

WORLD_HUMAN_SUNBATHE

WORLD_HUMAN_SUNBATHE_BACK

WORLD_HUMAN_SUPERHERO

WORLD_HUMAN_SWIMMING

WORLD_HUMAN_TENNIS_PLAYER

WORLD_HUMAN_TOURIST_MAP

WORLD_HUMAN_TOURIST_MOBILE

WORLD_HUMAN_VEHICLE_MECHANIC

WORLD_HUMAN_WELDING

WORLD_HUMAN_WINDOW_SHOP_BROWSE

WORLD_HUMAN_YOGA

WORLD_BOAR_GRAZING

WORLD_CAT_SLEEPING_GROUND

WORLD_CAT_SLEEPING_LEDGE

WORLD_COW_GRAZING

WORLD_COYOTE_HOWL

WORLD_COYOTE_REST

WORLD_COYOTE_WANDER

WORLD_CHICKENHAWK_FEEDING

WORLD_CHICKENHAWK_STANDING

WORLD_CORMORANT_STANDING

WORLD_CROW_FEEDING

WORLD_CROW_STANDING

WORLD_DEER_GRAZING

WORLD_DOG_BARKING_ROTTWEILER

WORLD_DOG_BARKING_RETRIEVER

WORLD_DOG_BARKING_SHEPHERD

WORLD_DOG_SITTING_ROTTWEILER

WORLD_DOG_SITTING_RETRIEVER

WORLD_DOG_SITTING_SHEPHERD

WORLD_DOG_BARKING_SMALL

WORLD_DOG_SITTING_SMALL

WORLD_FISH_IDLE

WORLD_GULL_FEEDING

WORLD_GULL_STANDING

WORLD_HEN_PECKING

WORLD_HEN_STANDING

WORLD_MOUNTAIN_LION_REST

WORLD_MOUNTAIN_LION_WANDER

WORLD_PIG_GRAZING

WORLD_PIGEON_FEEDING

WORLD_PIGEON_STANDING

WORLD_RABBIT_EATING

WORLD_RATS_EATING

WORLD_SHARK_SWIM

PROP_BIRD_IN_TREE

PROP_BIRD_TELEGRAPH_POLE

PROP_HUMAN_ATM

PROP_HUMAN_BBQ

PROP_HUMAN_BUM_BIN

PROP_HUMAN_BUM_SHOPPING_CART

PROP_HUMAN_MUSCLE_CHIN_UPS

PROP_HUMAN_MUSCLE_CHIN_UPS_ARMY

PROP_HUMAN_MUSCLE_CHIN_UPS_PRISON

PROP_HUMAN_PARKING_METER

PROP_HUMAN_SEAT_ARMCHAIR

PROP_HUMAN_SEAT_BAR

PROP_HUMAN_SEAT_BENCH

PROP_HUMAN_SEAT_BENCH_DRINK

PROP_HUMAN_SEAT_BENCH_DRINK_BEER

PROP_HUMAN_SEAT_BENCH_FOOD

PROP_HUMAN_SEAT_BUS_STOP_WAIT

PROP_HUMAN_SEAT_CHAIR

PROP_HUMAN_SEAT_CHAIR_DRINK

PROP_HUMAN_SEAT_CHAIR_DRINK_BEER

PROP_HUMAN_SEAT_CHAIR_FOOD

PROP_HUMAN_SEAT_CHAIR_UPRIGHT

PROP_HUMAN_SEAT_CHAIR_MP_PLAYER

PROP_HUMAN_SEAT_COMPUTER

PROP_HUMAN_SEAT_DECKCHAIR

PROP_HUMAN_SEAT_DECKCHAIR_DRINK

PROP_HUMAN_SEAT_MUSCLE_BENCH_PRESS

PROP_HUMAN_SEAT_MUSCLE_BENCH_PRESS_PRISON

PROP_HUMAN_SEAT_SEWING

PROP_HUMAN_SEAT_STRIP_WATCH

PROP_HUMAN_SEAT_SUNLOUNGER

PROP_HUMAN_STAND_IMPATIENT

CODE_HUMAN_COWER

CODE_HUMAN_CROSS_ROAD_WAIT

CODE_HUMAN_PARK_CAR

PROP_HUMAN_MOVIE_BULB

PROP_HUMAN_MOVIE_STUDIO_LIGHT

CODE_HUMAN_MEDIC_KNEEL

CODE_HUMAN_MEDIC_TEND_TO_DEAD

CODE_HUMAN_MEDIC_TIME_OF_DEATH

CODE_HUMAN_POLICE_CROWD_CONTROL

CODE_HUMAN_POLICE_INVESTIGATE

CODE_HUMAN_STAND_COWER

EAR_TO_TEXT

EAR_TO_TEXT_FAT

 

 

Edited by qwerasdzxc

Share this post


Link to post
Share on other sites
thewhitehammer99

 

How can i make player do a certain set of animation after a key press or an event ?

 

Code example wll be helpful :)

        if (e.KeyCode == Keys.O) //random key         {            Ped playerPed = Game.Player.Character;            GTA.Native.Function.Call(GTA.Native.Hash.TASK_START_SCENARIO_IN_PLACE, playerPed, "CODE_HUMAN_POLICE_INVESTIGATE", 1, true);        }

Hope this is what you need! :)

 

im not really sure if the OP wants to make his own player animate or a spawned one :p

 

but if you want to make a spawned ped dance etc, its the exact same as the above code, but you need to request control of the ped, and while you have it, call that animation :p

 

 

 

 

also your gif in your sig is great ^ :p

Share this post


Link to post
Share on other sites
Amey.Banaye

Thank you Very Much :)

Share this post


Link to post
Share on other sites
Amey.Banaye

How do I stop the Animation

Share this post


Link to post
Share on other sites
qwerasdzxc

im not really sure if the OP wants to make his own player animate or a spawned one :p

 

but if you want to make a spawned ped dance etc, its the exact same as the above code, but you need to request control of the ped, and while you have it, call that animation :p

 

 

 

 

also your gif in your sig is great ^ :p

 

Well he has what he needs, he can modify it for the future use.

 

Thanks for the gif haha :D

 

How do I stop the Animation

Like this:

playerPed.Task.ClearAnimation("WORLD_HUMAN_CLIPBOARD", "WORLD_HUMAN_CLIPBOARD"); //where playerPed can be changed to whatever ped you're using

I'm not sure for the part inside of the brackets but I put it like that and it works fine..

Share this post


Link to post
Share on other sites
Prof_Farnsworth

Just to be clear what these two are talking about is a scenario, which is different from an animation.

 

Here is how I play animations in .net:

Function.Call(Hash.REQUEST_ANIM_DICT, "[email protected][email protected]@idle_a");                        while (!Function.Call<bool>(Hash.HAS_ANIM_DICT_LOADED, "[email protected][email protected]@idle_a")) Wait(10);                        targets[0].Task.PlayAnimation("[email protected][email protected]@idle_a", "idle_e", 1f, -1, true, 1f);

Share this post


Link to post
Share on other sites
bhavinbhai2707

okkk so does anyone know how to make a ped sit in nearby chair and make him act like he is working. . . suggest if u know ;)

Share this post


Link to post
Share on other sites
AHK1221

 

How can i make player do a certain set of animation after a key press or an event ?

 

Code example wll be helpful :)

        if (e.KeyCode == Keys.O) //random key         {            Ped playerPed = Game.Player.Character;            GTA.Native.Function.Call(GTA.Native.Hash.TASK_START_SCENARIO_IN_PLACE, playerPed, "CODE_HUMAN_POLICE_INVESTIGATE", 1, true);        }

Hope this is what you need! :)

 

P.S. Here's the list for some of the animations that someone posted here on GTA:F

 

 

List:

Standing

WORLD_HUMAN_AA_COFFEE

WORLD_HUMAN_AA_SMOKE

WORLD_HUMAN_BINOCULARS

WORLD_HUMAN_BUM_FREEWAY

WORLD_HUMAN_BUM_SLUMPED

WORLD_HUMAN_BUM_STANDING

WORLD_HUMAN_BUM_WASH

WORLD_HUMAN_CAR_PARK_ATTENDANT

WORLD_HUMAN_CHEERING

WORLD_HUMAN_CLIPBOARD

WORLD_HUMAN_CONST_DRILL

WORLD_HUMAN_COP_IDLES

WORLD_HUMAN_DRINKING

WORLD_HUMAN_DRUG_DEALER

WORLD_HUMAN_DRUG_DEALER_HARD

WORLD_HUMAN_MOBILE_FILM_SHOCKING

WORLD_HUMAN_GARDENER_LEAF_BLOWER

WORLD_HUMAN_GARDENER_PLANT

WORLD_HUMAN_GOLF_PLAYER

WORLD_HUMAN_GUARD_PATROL

WORLD_HUMAN_GUARD_STAND

WORLD_HUMAN_GUARD_STAND_ARMY

WORLD_HUMAN_HAMMERING

WORLD_HUMAN_HANG_OUT_STREET

WORLD_HUMAN_HIKER_STANDING

WORLD_HUMAN_HUMAN_STATUE

WORLD_HUMAN_JANITOR

WORLD_HUMAN_JOG_STANDING

WORLD_HUMAN_LEANING

WORLD_HUMAN_MAID_CLEAN

WORLD_HUMAN_MUSCLE_FLEX

WORLD_HUMAN_MUSCLE_FREE_WEIGHTS

WORLD_HUMAN_MUSICIAN

WORLD_HUMAN_PAPARAZZI

WORLD_HUMAN_PARTYING

WORLD_HUMAN_PICNIC

WORLD_HUMAN_PROSTITUTE_HIGH_CLASS

WORLD_HUMAN_PROSTITUTE_LOW_CLASS

WORLD_HUMAN_PUSH_UPS

WORLD_HUMAN_SEAT_LEDGE

WORLD_HUMAN_SEAT_LEDGE_EATING

WORLD_HUMAN_SEAT_STEPS

WORLD_HUMAN_SEAT_WALL

WORLD_HUMAN_SEAT_WALL_EATING

WORLD_HUMAN_SEAT_WALL_TABLET

WORLD_HUMAN_SECURITY_SHINE_TORCH

WORLD_HUMAN_SIT_UPS

WORLD_HUMAN_SMOKING

WORLD_HUMAN_SMOKING_POT

WORLD_HUMAN_STAND_FIRE

WORLD_HUMAN_STAND_FISHING

WORLD_HUMAN_STAND_IMPATIENT

WORLD_HUMAN_STAND_IMPATIENT_UPRIGHT

WORLD_HUMAN_STAND_MOBILE

WORLD_HUMAN_STAND_MOBILE_UPRIGHT

WORLD_HUMAN_STRIP_WATCH_STAND

WORLD_HUMAN_STUPOR

WORLD_HUMAN_SUNBATHE

WORLD_HUMAN_SUNBATHE_BACK

WORLD_HUMAN_SUPERHERO

WORLD_HUMAN_SWIMMING

WORLD_HUMAN_TENNIS_PLAYER

WORLD_HUMAN_TOURIST_MAP

WORLD_HUMAN_TOURIST_MOBILE

WORLD_HUMAN_VEHICLE_MECHANIC

WORLD_HUMAN_WELDING

WORLD_HUMAN_WINDOW_SHOP_BROWSE

WORLD_HUMAN_YOGA

WORLD_BOAR_GRAZING

WORLD_CAT_SLEEPING_GROUND

WORLD_CAT_SLEEPING_LEDGE

WORLD_COW_GRAZING

WORLD_COYOTE_HOWL

WORLD_COYOTE_REST

WORLD_COYOTE_WANDER

WORLD_CHICKENHAWK_FEEDING

WORLD_CHICKENHAWK_STANDING

WORLD_CORMORANT_STANDING

WORLD_CROW_FEEDING

WORLD_CROW_STANDING

WORLD_DEER_GRAZING

WORLD_DOG_BARKING_ROTTWEILER

WORLD_DOG_BARKING_RETRIEVER

WORLD_DOG_BARKING_SHEPHERD

WORLD_DOG_SITTING_ROTTWEILER

WORLD_DOG_SITTING_RETRIEVER

WORLD_DOG_SITTING_SHEPHERD

WORLD_DOG_BARKING_SMALL

WORLD_DOG_SITTING_SMALL

WORLD_FISH_IDLE

WORLD_GULL_FEEDING

WORLD_GULL_STANDING

WORLD_HEN_PECKING

WORLD_HEN_STANDING

WORLD_MOUNTAIN_LION_REST

WORLD_MOUNTAIN_LION_WANDER

WORLD_PIG_GRAZING

WORLD_PIGEON_FEEDING

WORLD_PIGEON_STANDING

WORLD_RABBIT_EATING

WORLD_RATS_EATING

WORLD_SHARK_SWIM

PROP_BIRD_IN_TREE

PROP_BIRD_TELEGRAPH_POLE

PROP_HUMAN_ATM

PROP_HUMAN_BBQ

PROP_HUMAN_BUM_BIN

PROP_HUMAN_BUM_SHOPPING_CART

PROP_HUMAN_MUSCLE_CHIN_UPS

PROP_HUMAN_MUSCLE_CHIN_UPS_ARMY

PROP_HUMAN_MUSCLE_CHIN_UPS_PRISON

PROP_HUMAN_PARKING_METER

PROP_HUMAN_SEAT_ARMCHAIR

PROP_HUMAN_SEAT_BAR

PROP_HUMAN_SEAT_BENCH

PROP_HUMAN_SEAT_BENCH_DRINK

PROP_HUMAN_SEAT_BENCH_DRINK_BEER

PROP_HUMAN_SEAT_BENCH_FOOD

PROP_HUMAN_SEAT_BUS_STOP_WAIT

PROP_HUMAN_SEAT_CHAIR

PROP_HUMAN_SEAT_CHAIR_DRINK

PROP_HUMAN_SEAT_CHAIR_DRINK_BEER

PROP_HUMAN_SEAT_CHAIR_FOOD

PROP_HUMAN_SEAT_CHAIR_UPRIGHT

PROP_HUMAN_SEAT_CHAIR_MP_PLAYER

PROP_HUMAN_SEAT_COMPUTER

PROP_HUMAN_SEAT_DECKCHAIR

PROP_HUMAN_SEAT_DECKCHAIR_DRINK

PROP_HUMAN_SEAT_MUSCLE_BENCH_PRESS

PROP_HUMAN_SEAT_MUSCLE_BENCH_PRESS_PRISON

PROP_HUMAN_SEAT_SEWING

PROP_HUMAN_SEAT_STRIP_WATCH

PROP_HUMAN_SEAT_SUNLOUNGER

PROP_HUMAN_STAND_IMPATIENT

CODE_HUMAN_COWER

CODE_HUMAN_CROSS_ROAD_WAIT

CODE_HUMAN_PARK_CAR

PROP_HUMAN_MOVIE_BULB

PROP_HUMAN_MOVIE_STUDIO_LIGHT

CODE_HUMAN_MEDIC_KNEEL

CODE_HUMAN_MEDIC_TEND_TO_DEAD

CODE_HUMAN_MEDIC_TIME_OF_DEATH

CODE_HUMAN_POLICE_CROWD_CONTROL

CODE_HUMAN_POLICE_INVESTIGATE

CODE_HUMAN_STAND_COWER

EAR_TO_TEXT

EAR_TO_TEXT_FAT

 

 

 

Those arent animations, they are scenarios.... two different things.

Share this post


Link to post
Share on other sites
NOTHING2

I want to make NPC (not player ped) doing animation...what should i do 

I can control Player animation...but when i try with other Peds i failed

companion.Task.PlayAnimation("pickup_object", "pickup_low", 8f, -1, false, 0f);    

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • 2 Users Currently Viewing
    0 members, 0 Anonymous, 2 Guests

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.