1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Release Grand Theft Auto 5 PS3 C++ Code Thread

Discussion in 'Grand Theft Auto 5 PS3' started by Venox, May 23, 2016.

  1. Venox

    Venox Moderator Staff Member

    95
    104
    133
    Credits:
    770
    The purpose of this thread is sharing functions.
    I hope you can learn from it .
    most of it is done by me.



    Kick All Players From your Lobby
    Code:
    for (int i = 0; i < 16; i++)
            {
                int id = PLAYER::GET_PLAYER_PED(i);
                if (id > 0 && id != PLAYER::PLAYER_PED_ID())
                {
                            NETWORK_REQUEST_CONTROL_OF_ENTITY(GET_PLAYER_PED(i));                   
                            NETWORK_SESSION_KICK_PLAYER(GET_PLAYER_PED(i));
                        }
    requestLobbyKick = false;    
    }
    
    

    Clone Lobby
    Code:
        void CloneLobby()
        {
            for(int i = 0; i < PlayerCount(); i++)
            {
                if (i >= 0 && i != PlayerSelf())
                {
                    Ped lclone_ = CLONE_PED(GET_PLAYER_PED(i),                        GET_ENTITY_HEADING(GET_PLAYER_PED(i)), 1, 1);
                    Ped* lclone = &lclone_;
                    SET_ENTITY_AS_NO_LONGER_NEEDED(lclone);
                }
            }
        }
    
    

    SuperRun (Button Bind)
    Code:
     
    void super_run() 
    {
           if (CONTROLS::IS_CONTROL_JUST_PRESSED(0, Button_X)) 
          {
                    ENTITY::APPLY_FORCE_TO_ENTITY(PLAYER::PLAYER_PED_ID(), true, 0, 60, 0, 0, 0, 0, true, true, true, true, false, true);
            }
    }
    
    

    Spawn WheelChair
    Code:
        bool doWheelchair = false;
        bool spawnWheelchair()
        {
            uint Handle = PLAYER::PLAYER_PED_ID();
            Vector3 MyCoords = ENTITY::GET_ENTITY_COORDS(PLAYER::PLAYER_PED_ID(), 1);
            Vector3 null; null.x = 0, null.y = 0; null.z = 0;
            Vector3 a; a.x = -0.27, a.y = -0.24, a.z = 0.13f;  
            Vector3 b; b.x = 0, b.y = 0, b.z = 180;
            int hash = GAMEPLAY::GET_HASH_KEY("bati");
            int hash2 = GAMEPLAY::GET_HASH_KEY("prop_wheelchair_01");
            STREAMING::REQUEST_MODEL(hash);
            STREAMING::REQUEST_MODEL(hash2);
            if (STREAMING::HAS_MODEL_LOADED(hash) && STREAMING::HAS_MODEL_LOADED(hash2))
            {
                int Object = OBJECT::CREATE_OBJECT(hash2, null.x, null.y, null.z, 1, 0, 1);
                if (ENTITY::DOES_ENTITY_EXIST(Object))
                {
                    int Vehicle = VEHICLE::CREATE_VEHICLE(hash, MyCoords.x, MyCoords.y, MyCoords.z, ENTITY::GET_ENTITY_HEADING(Handle), 1, 0);
                    if (ENTITY::DOES_ENTITY_EXIST(Vehicle))
                    {
                        PED::SET_PED_INTO_VEHICLE(PLAYER::PLAYER_PED_ID(), Vehicle, -1);
                        STREAMING::SET_MODEL_AS_NO_LONGER_NEEDED(hash);
                        ENTITY::SET_ENTITY_VISIBLE(Vehicle, false);
                        UNK::ATTACH_ENTITY_TO_ENTITY(Object, Vehicle, 0, a.x, a.y, a.z, b.x, b.y, b.z, 0, 1, 0, 0, 2, 1);
                        ENTITY::SET_ENTITY_VISIBLE(Handle, true);  
                        return true;
                    }
                    return false;
                }      
                return false;                                                      
            }
            return false;
        }
    

    Give other player 3Stars
    Code:
    void vOnline3Stars(Entity eEntity)
    {
        if (ENTITY::DOES_ENTITY_EXIST(eEntity))
        {
            const int iPeds = 40;
            Ped pPed[iPeds];
            Vector3 Coordinates = ENTITY::GET_ENTITY_COORDS(eEntity, 0);
    
            for (int i = 0; i < iPeds; i++)
            {
                pPed[i] = PED::CLONE_PED(eEntity, ENTITY::GET_ENTITY_HEADING(PLAYER::PLAYER_PED_ID()), 1, 1);
                ENTITY::SET_ENTITY_COORDS(pPed[i], Coordinates.x, Coordinates.y, Coordinates.z + 25, 0, 0, 0, 1);
                PED::SET_PED_AS_COP(pPed[i], true);
                Wait(20);
                Vector3 pPedCoordinates = ENTITY::GET_ENTITY_COORDS(pPed[i], 0);
                FIRE::ADD_OWNED_EXPLOSION(eEntity, pPedCoordinates.x, pPedCoordinates.y, pPedCoordinates.z, 9, 5.0f, 0, 1, 0.0f);
                PED::DELETE_PED(&pPed[i]);
            }
        }
    }
    
     
    iRnZ likes this.
  2. iRnZ

    iRnZ Active Member

    32
    18
    193
    Credits:
    16
    how to use Spawn WheelChair on menu for spawn cars names
    and did u know how to put label bool on menu ? and thanks
     
  3. Venox

    Venox Moderator Staff Member

    95
    104
    133
    Credits:
    770
    1.put my Wheelchair code in you Func.H
    2.Go to prx.h ( i think you use 2much base)
    3.AddOption("Wheelchair");
    case 1:
    spawnWheelchair();doWheelchair = true;break;

    4.if this method not work try
    case 1:
    doWheelchair = true;break;
     
    iRnZ likes this.
  4. VerTical

    VerTical Head Member Donator

    1,010
    1,227
    273
    Credits:
    2,894
    nice :b
     
  5. banzai

    banzai New Member

    2
    0
    101
    Credits:
    41
    Vertical-_-MoDz, you conding too ??
     
  6. Gentle

    Gentle Guest

    Credits:
    0
    yas who doesn't cond?
     
  7. banzai

    banzai New Member

    2
    0
    101
    Credits:
    41
    L33T Scrub you coding on SPRX ??
     
  8. Gentle

    Gentle Guest

    Credits:
    0
    Yeh.
     
  9. Gentle

    Gentle Guest

    Credits:
    0
    not GTA doe
     
  10. VerTical

    VerTical Head Member Donator

    1,010
    1,227
    273
    Credits:
    2,894
    Yea im Coder :smile:
     
  11. chadbell

    chadbell Active Member

    40
    12
    18
    Credits:
    186
    Hi bud 2much base has no func.h so how would your code go in thank bud
     
  12. chadbell

    chadbell Active Member

    40
    12
    18
    Credits:
    186
    Any one help at all to my above post Thanks to any one with 5 min to reply
     
  13. ruben92

    ruben92 Member

    8
    0
    1
    Credits:
    56
    Help to give rp please?
     
  14. ruben92

    ruben92 Member

    8
    0
    1
    Credits:
    56
    help to add give rp please?
     
  15. FaZeModz

    FaZeModz Member

    6
    3
    3
    Credits:
    181
    Using 2Much4u base?
     
  16. FaZeModz

    FaZeModz Member

    6
    3
    3
    Credits:
    181
    Nice but use a bool for Super Run... Here is the code
     

    Attached Files:

  17. ruben92

    ruben92 Member

    8
    0
    1
    Credits:
    56
    yes using 2much4u base, lack to put protection rp and give rp
     
  18. ruben92

    ruben92 Member

    8
    0
    1
    Credits:
    56
    How to add give rp y protection rp using 2muc4u sprx source
     
  19. Nerf_Herder

    Nerf_Herder Member

    7
    1
    3
    Credits:
    51
    you can find it pretty easily if you look around the web. But you'll need to know how to implement it. You probably wont be able to just c/p it without any modifying. But once you see how it works you should be able to get it to work with your base without too much trouble. It's been public for awhile.
     
    Last edited: Nov 14, 2017
  20. Nerf_Herder

    Nerf_Herder Member

    7
    1
    3
    Credits:
    51
    so make a func.h header for all of your functions.(or separate them i.e. self.h, players.h, peds.h, teleport.h, etc) If you don't know how this is done, You need to learn more about c++ and Visual Studio
     

Share This Page