Jump to content

Help me turn this into reality


Recommended Posts

Cedric574

This is a csa file for a skateboard it uses vehicle id 509 skate22.ifp and it replaces gun_cane.dff like the pc mod i just want to convert it but doesent work. Can you guys compile it or change whats wrong?

 

 

{$CLEO .csa}

WHILE TRUE
    WAIT 0

    // Check if player is holding Sprint (ID 16)
    IF 00E1: key_pressed 0 16
    THEN
        WAIT 500  // Wait to confirm player is holding the Sprint button

        IF 00E1: key_pressed 0 16  // Check if still holding after 500ms
        THEN
            // Load Skate22 animations
            04ED: load_animation "SKATE22"

            // Load Gun_Cane model for skateboard
            Model.Load(#GUN_CANE)
            WHILE NOT Model.Available(#GUN_CANE)
                WAIT 0
            ENDWHILE

            // Get player position
            04C4: store_coords_to 9@ 10@ 11@ from_actor $PLAYER_ACTOR with_offset 0.0 1.0 0.0

            // Spawn Bike (Vehicle ID 509) as skateboard
            0@ = Car.Create(509, 9@, 10@, 11@)
            0338: set_car 0@ visibility 0  // Hide Bike model

            // Attach Gun_Cane model to Bike
            1@ = Object.Create(#GUN_CANE, 9@, 10@, 11@)
            0681: attach_object 1@ to_car 0@ with_offset 0.0 0.0 -0.45 rotation 0.0 0.0 0.0

            // Put player on Bike
            036A: put_actor $PLAYER_ACTOR in_car 0@

            // Equip Gun_Cane weapon
            Actor.GiveWeaponAndAmmo($PLAYER_ACTOR, #GUN_CANE, 1)
            01B9: set_actor $PLAYER_ACTOR armed_weapon_to #GUN_CANE

            // Start skating animation
            0605: actor $PLAYER_ACTOR perform_animation "SKATEROLLER" IFP "SKATE22" framedelta 4.0 loop 1 lockX 1 lockY 1 lockF 1 time -1
        ENDIF
    ENDIF

    // Check if player presses Enter/Exit button (ID 5) to stop skating
    IF 00E1: key_pressed 0 5
    THEN
        // Remove skateboard vehicle & object
        Car.Destroy(0@)
        Object.Destroy(1@)

        // Stop animation
        0605: actor $PLAYER_ACTOR perform_animation "JUMP_LAND" IFP "PED" framedelta 4.0 loop 0 lockX 1 lockY 1 lockF 0 time -1
    ENDIF

ENDWHILE

Link to comment
https://gtaforums.com/topic/1000846-help-me-turn-this-into-reality/
Share on other sites

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
  • 0 User Currently Viewing
    0 members, 0 Anonymous, 0 Guests

×
×
  • Create New...

Important Information

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