CabConModding
Facebook
Twitter
youtube
Discord
Contact us
RSS
Menu
CabConModding
Home
New
Top
Premium
Rules
FAQ - Frequently Asked Questions
Games
Fornite
Call of Duty: Black Ops 3
Clash of Clans
Grand Theft Auto 5
Apex Legends
Assassin’s Creed Origins
Forums
Premium
Latest posts
What's new
Latest posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Log in
Register
What's new
Premium
Latest posts
Menu
Log in
Register
Navigation
Install the app
Install
More options
Dark Theme
Contact us
Close Menu
Forums
Gaming
Grand Theft Auto 5
Grand Theft Auto 5 PS3
Grand Theft Auto 5 PS3 C++ Code Thread
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Venox" data-source="post: 5895" data-attributes="member: 15"><p>The purpose of this thread is sharing functions.</p><p>I hope you can learn from it .</p><p>most of it is done by me.</p><p></p><p></p><p></p><p>Kick All Players From your Lobby</p><p>[spoiler]</p><p>[code]</p><p>for (int i = 0; i < 16; i++)</p><p> {</p><p> int id = PLAYER::GET_PLAYER_PED(i);</p><p> if (id > 0 && id != PLAYER::PLAYER_PED_ID())</p><p> {</p><p> NETWORK_REQUEST_CONTROL_OF_ENTITY(GET_PLAYER_PED(i)); </p><p> NETWORK_SESSION_KICK_PLAYER(GET_PLAYER_PED(i));</p><p> }</p><p>requestLobbyKick = false; </p><p>}</p><p></p><p>[/code]</p><p>[/spoiler]</p><p></p><p>Clone Lobby </p><p>[spoiler]</p><p>[code]</p><p> void CloneLobby()</p><p> {</p><p> for(int i = 0; i < PlayerCount(); i++)</p><p> {</p><p> if (i >= 0 && i != PlayerSelf())</p><p> {</p><p> Ped lclone_ = CLONE_PED(GET_PLAYER_PED(i), GET_ENTITY_HEADING(GET_PLAYER_PED(i)), 1, 1);</p><p> Ped* lclone = &lclone_;</p><p> SET_ENTITY_AS_NO_LONGER_NEEDED(lclone);</p><p> }</p><p> }</p><p> }</p><p></p><p>[/code]</p><p>[/spoiler]</p><p></p><p>SuperRun (Button Bind)</p><p>[spoiler]</p><p>[code]</p><p> </p><p>void super_run() </p><p>{</p><p> if (CONTROLS::IS_CONTROL_JUST_PRESSED(0, Button_X)) </p><p> {</p><p> ENTITY::APPLY_FORCE_TO_ENTITY(PLAYER::PLAYER_PED_ID(), true, 0, 60, 0, 0, 0, 0, true, true, true, true, false, true);</p><p> }</p><p>}</p><p></p><p>[/code]</p><p>[/spoiler]</p><p></p><p>Spawn WheelChair</p><p>[spoiler]</p><p>[code]</p><p> bool doWheelchair = false;</p><p> bool spawnWheelchair()</p><p> {</p><p> uint Handle = PLAYER::PLAYER_PED_ID();</p><p> Vector3 MyCoords = ENTITY::GET_ENTITY_COORDS(PLAYER::PLAYER_PED_ID(), 1);</p><p> Vector3 null; null.x = 0, null.y = 0; null.z = 0;</p><p> Vector3 a; a.x = -0.27, a.y = -0.24, a.z = 0.13f; </p><p> Vector3 b; b.x = 0, b.y = 0, b.z = 180;</p><p> int hash = GAMEPLAY::GET_HASH_KEY("bati");</p><p> int hash2 = GAMEPLAY::GET_HASH_KEY("prop_wheelchair_01");</p><p> STREAMING::REQUEST_MODEL(hash);</p><p> STREAMING::REQUEST_MODEL(hash2);</p><p> if (STREAMING::HAS_MODEL_LOADED(hash) && STREAMING::HAS_MODEL_LOADED(hash2))</p><p> {</p><p> int Object = OBJECT::CREATE_OBJECT(hash2, null.x, null.y, null.z, 1, 0, 1);</p><p> if (ENTITY::DOES_ENTITY_EXIST(Object))</p><p> {</p><p> int Vehicle = VEHICLE::CREATE_VEHICLE(hash, MyCoords.x, MyCoords.y, MyCoords.z, ENTITY::GET_ENTITY_HEADING(Handle), 1, 0);</p><p> if (ENTITY::DOES_ENTITY_EXIST(Vehicle))</p><p> {</p><p> PED::SET_PED_INTO_VEHICLE(PLAYER::PLAYER_PED_ID(), Vehicle, -1);</p><p> STREAMING::SET_MODEL_AS_NO_LONGER_NEEDED(hash);</p><p> ENTITY::SET_ENTITY_VISIBLE(Vehicle, false);</p><p> 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);</p><p> ENTITY::SET_ENTITY_VISIBLE(Handle, true); </p><p> return true;</p><p> }</p><p> return false;</p><p> } </p><p> return false; </p><p> }</p><p> return false;</p><p> }</p><p>[/code]</p><p>[/spoiler]</p><p></p><p>Give other player 3Stars</p><p>[spoiler]</p><p>[code]</p><p>void vOnline3Stars(Entity eEntity)</p><p>{</p><p> if (ENTITY::DOES_ENTITY_EXIST(eEntity))</p><p> {</p><p> const int iPeds = 40;</p><p> Ped pPed[iPeds];</p><p> Vector3 Coordinates = ENTITY::GET_ENTITY_COORDS(eEntity, 0);</p><p></p><p> for (int i = 0; i < iPeds; i++)</p><p> {</p><p> pPed[i] = PED::CLONE_PED(eEntity, ENTITY::GET_ENTITY_HEADING(PLAYER::PLAYER_PED_ID()), 1, 1);</p><p> ENTITY::SET_ENTITY_COORDS(pPed[i], Coordinates.x, Coordinates.y, Coordinates.z + 25, 0, 0, 0, 1);</p><p> PED::SET_PED_AS_COP(pPed[i], true);</p><p> Wait(20);</p><p> Vector3 pPedCoordinates = ENTITY::GET_ENTITY_COORDS(pPed[i], 0);</p><p> FIRE::ADD_OWNED_EXPLOSION(eEntity, pPedCoordinates.x, pPedCoordinates.y, pPedCoordinates.z, 9, 5.0f, 0, 1, 0.0f);</p><p> PED::DELETE_PED(&pPed[i]);</p><p> }</p><p> }</p><p>}</p><p>[/code]</p><p>[/spoiler]</p></blockquote><p></p>
[QUOTE="Venox, post: 5895, member: 15"] 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 [spoiler] [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; } [/code] [/spoiler] Clone Lobby [spoiler] [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); } } } [/code] [/spoiler] SuperRun (Button Bind) [spoiler] [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); } } [/code] [/spoiler] Spawn WheelChair [spoiler] [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; } [/code] [/spoiler] Give other player 3Stars [spoiler] [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]); } } } [/code] [/spoiler] [/QUOTE]
Verification
Post reply
Forums
Gaming
Grand Theft Auto 5
Grand Theft Auto 5 PS3
Grand Theft Auto 5 PS3 C++ Code Thread
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top