Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

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

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

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

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

    2. Support

    3. Suggestions

how to change gang weapons in SA


technomusicrocks
 Share

Recommended Posts

technomusicrocks

I am tired of the gang members you can recruit in san andreas having only pistols and sometimes tec9s, how do i modify it so i can give them stuff like flamthrowers, rocket launcehrs, ak-47s and shotguns?

Link to comment
Share on other sites

Use the opcode 0237 and follow this help.

 

0 = Ballas1 = Groove2 = Los Santos Vagos3 = San Fiero Rifa4 = Da Nang Boys5 = LV Mafia6 = Triads7 = Varrio Los Aztecas

 

Change the first parameter to choose the gang and others to change the weapons to the homies.

 

0237=4,set_gang %1d% weapons_pool_to %2d% %3d% %4d% 

 

Edited by Wesser

012          345
678   9A   BCD
EFG HIJK LMN
OPQR  STUV
WX    YZ

Link to comment
Share on other sites

technomusicrocks

which file do i modify, which folder is it in? and do i need any programs (aside from notepad) to help me with this?

Link to comment
Share on other sites

The file main.scm is located in data\script.

012          345
678   9A   BCD
EFG HIJK LMN
OPQR  STUV
WX    YZ

Link to comment
Share on other sites

Just to let you know: Changing SCM Code means you need to start a new game, so you would probably want to use CLEO or, which would be my fav' way to change the weapons: Hacking the Save-File:

As you can see here: here

I just made this out of an old tool I coded a few weeks ago: http://npshare.de/files/36/7581/gtasave.exe

 

 

Version             : 1.00 UnmodifiedLabel               : You've had your ChipsChecksum            : 19068956 [CORRECT]=========================================Times Wasted/Busted : 0Money               : $604048Gang Weapons:1: A:Pistol B:Micro Uzi (Mac 10) C:Unarmed2: A:Desert Eagle B:MP5 C:Knife3: A:Pistol B:Unarmed C:Unarmed4: A:Unarmed B:Unarmed C:Unarmed5: A:Pistol B:Micro Uzi (Mac 10) C:Unarmed6: A:Desert Eagle B:Unarmed C:Unarmed7: A:Pistol B:AK47 C:Unarmed8: A:Pistol B:Micro Uzi (Mac 10) C:Unarmed9: A:Unarmed B:Unarmed C:Unarmed10: A:Unarmed B:Unarmed C:Unarmed

 

Link to comment
Share on other sites

 

Just to let you know: Changing SCM Code means you need to start a new game,

 

Wow, i forgot about that part! Anyways, i, like technomusicrocks, would like to make a couple of modifications to the game. And, since i'm completely crap at doing anything with the SCM Code (never touched it), i'll be needing all the assistance i can get. In other words, the assistance so kindly provided by members like Wesser and WordsBG is about a mile over my head. blush.gif

 

Heres what i intend to change... somehow:

 

GSF:

>9mm

>Nightstick

>Shotgun?

 

Reason being, i've replaced their models with some i downloaded (which are police models)

 

Other changes i would like to make are:

 

Firefighters:

>Fire-extinguishers (not sure if this is possible. Would be nice though.)

 

SWAT

>SMG (instead of the micro SMG)

 

FBI

>9mm (instead of the SMG)

 

So, if somebody would be nice enough to educated me in the ways of SCM modding, it'd be much appreciated. smile.gif

 

EDIT: Figured the gang part out. Thanks Wesser!

Edited by computergeek
Link to comment
Share on other sites

  • 3 years later...

 

Use the opcode 0237 and follow this help.

 

0 = Ballas1 = Groove2 = Los Santos Vagos3 = San Fiero Rifa4 = Da Nang Boys5 = LV Mafia6 = Triads7 = Varrio Los Aztecas

 

Change the first parameter to choose the gang and others to change the weapons to the homies.

 

0237=4,set_gang %1d% weapons_pool_to %2d% %3d% %4d% 

 

what to do there in main.scm?

Edited by aleksa
Link to comment
Share on other sites

  • 6 years later...
StrangeStrike

I need help I saw these posts and I want to change my gang members weapons, cop weapons, swat weapons, FBI weapons...... But I can't do it because my main.scm file is full of symbols and can i change these symbols into characters

Link to comment
Share on other sites

The Savegame Editor linked below has a Gang Weapons tool that can adjust your weapons. It only works on gangs though, not police.

 

Link to comment
Share on other sites

 

 

But I can't do it because my main.scm file is full of symbols and can i change these symbols into characters

 

Sounds like you're opening it with Notepad....

 

Download Sanny Builder and open your SCM with sanny builder.

Link to comment
Share on other sites

StrangeStrike

 

 

 

But I can't do it because my main.scm file is full of symbols and can i change these symbols into characters

 

Sounds like you're opening it with Notepad....

 

Download Sanny Builder and open your SCM with sanny builder.

 

Ok, but what do I type to find to change weapons for swat, fbi, army, gangs.

Link to comment
Share on other sites

The Savegame Editor linked below has a Gang Weapons tool that can adjust your weapons. It only works on gangs though, not police.

You can use this for gangs.

 

To change weapons for non-gang members you can use CLEO script that I wrote.

 

There were some problems with this script, but all is FIXED now.

It was same problem as here: http://gtaforums.com/topic/893365-sais-actor-in-group

 

Policemen may decide to not use weapon that you've assigned to them if you have only one star, but that's expected behaviour.

 

 

 

{$CLEO}0000:const    RADIUS = 10.0    AMMO = 60 //dummy valueendwhile true    wait 0    if 0256: player $PLAYER_CHAR defined    jf continue    04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0    if 0AE1: [email protected] = random_actor_near_point [email protected] [email protected] [email protected] in_radius RADIUS find_next 1 pass_deads 1    then        0665: get_actor [email protected] model_to [email protected]        //***********************************//        //** HERE YOU CONFIGURE THE SCRIPT **//        //***********************************//        //List of all allowed values for [email protected] can be found here:        //  https://gtagmodding.com/sanandreas/peds/        //List of all allowed values for [email protected] can be found in:        //  Sanny Builder help > SCM Documentation > GTA SA > Weapon numbers, "number" column        if [email protected] == #LAPD1        then            [email protected] = 30            jump @loopEnd        end        if [email protected] == #SFPD1        then                 [email protected] = 24            jump @loopEnd        end        if [email protected] == #LVPD1        then                                            [email protected] = 22            jump @loopEnd        end        if [email protected] == #CSHER        then                                                     [email protected] = 25            jump @loopEnd        end        if [email protected] == #LAPDM1        then                                                       [email protected] = 26            jump @loopEnd        end        if [email protected] == #SWAT        then                                                    [email protected] = 28            jump @loopEnd        end        if [email protected] == #DSHER        then            [email protected] = 37            jump @loopEnd        end        if [email protected] == #FBI        then            [email protected] = 38            jump @loopEnd        end        //******************************************//        //** YOU CAN ADD MORE CONFIGURATIONS HERE **//        //******************************************//        continue        :loopEnd        if 8491: not actor [email protected] has_weapon [email protected]        then            0781: get_weapon_with_ID [email protected] model_to [email protected]            repeat                wait 0                0247: load_model [email protected]            until 0248: model [email protected] available             01B2: give_actor [email protected] weapon [email protected] ammo AMMO             0249: release_model [email protected]        end        01B9: set_actor [email protected] armed_weapon_to [email protected]    endend    0A93: end_custom_thread

 

 

Edited by kosticn101
Link to comment
Share on other sites

Ok, I've updated the script but there are some issues. If you give a weapon to someone, he has unlimited ammo. It's probably happening because of the logic of my script. Does he have a weapon? No? Then give it to him.

I've put textbox inside the test if 8491: not actor ACTOR has_weapon WNUMBER and it's always showing up if I'm next to a cop, so looks like the test is always returning true and I'm constantly giving him a weapon. Anyone knows what's happening here?

 

Fixed.

Edited by kosticn101
Link to comment
Share on other sites

Ok, but what do I type to find to change weapons for swat, fbi, army, gangs.

 

 

; enum eWeaponTypeWEAPON_UNARMED      = 0WEAPON_BRASSKNUCKLE  = 1WEAPON_GOLFCLUB  = 2WEAPON_NIGHTSTICK  = 3WEAPON_KNIFE     = 4WEAPON_BASEBALLBAT  = 5WEAPON_SHOVEL    = 6WEAPON_POOLCUE   = 7WEAPON_KATANA    = 8WEAPON_CHAINSAW  = 9WEAPON_DILDO1    = 10WEAPON_DILDO2    = 11WEAPON_VIBE1     = 12WEAPON_VIBE2     = 13WEAPON_FLOWERS   = 14WEAPON_CANE      = 15WEAPON_GRENADE   = 16WEAPON_TEARGAS   = 17WEAPON_MOLOTOV   = 18WEAPON_ROCKET    = 19WEAPON_ROCKET_HS  = 20WEAPON_FREEFALL_BOMB  = 21WEAPON_PISTOL    = 22WEAPON_PISTOL_SILENCED  = 23WEAPON_DESERT_EAGLE  = 24WEAPON_SHOTGUN   = 25WEAPON_SAWNOFF   = 26WEAPON_SPAS12    = 27WEAPON_MICRO_UZI  = 28WEAPON_MP5       = 29WEAPON_AK47      = 30WEAPON_M4        = 31WEAPON_TEC9      = 32WEAPON_COUNTRYRIFLE  = 33WEAPON_SNIPERRIFLE  = 34WEAPON_RLAUNCHER  = 35WEAPON_RLAUNCHER_HS  = 36WEAPON_FTHROWER  = 37WEAPON_MINIGUN   = 38WEAPON_SATCHEL_CHARGE  = 39WEAPON_DETONATOR  = 40WEAPON_SPRAYCAN  = 41WEAPON_EXTINGUISHER  = 42WEAPON_CAMERA    = 43WEAPON_NIGHTVISION  = 44WEAPON_INFRARED  = 45WEAPON_PARACHUTE  = 46WEAPON_UNUSED    = 47WEAPON_ARMOUR    = 48WEAPON_FLARE     = 49

 

 

 

Wanted Level Editor can do it (not for the gangs though).

 

EDIT:

 

 

I've put textbox inside the test if 8491: not actor ACTOR has_weapon WNUMBER and it's always showing up if I'm next to a cop, so looks like the test is always returning true and I'm constantly giving him a weapon. Anyone knows what's happening here?

 

You shoud put this:

 

01B9: set_actor ACTOR armed_weapon_to WNUMBER

under the conditional check.

Edited by Jack
  • Like 2
Link to comment
Share on other sites

put a marker above actor to see what happens

 

 

 

{$CLEO .cs}:RandomPed_ModelIDthread 'PEDMODL'while truewait 0    if        0256:   player $PLAYER_CHAR defined     then        if            044B:   actor $PLAYER_ACTOR on_foot        then                04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 2.0 0.0            if                0AE1:   [email protected] = random_actor_near_point [email protected] [email protected] [email protected] in_radius 8.0 find_next 0 pass_deads 1 // CLEO 4 opcode            then                if                    8118:   not actor [email protected] dead                 then                        0187: [email protected] = create_marker_above_actor [email protected]                    0665: get_actor [email protected] model_to [email protected]                    if or                        [email protected] == 280                        [email protected] == 281                        [email protected] == 282                        [email protected] == 283                        [email protected] == 284                        [email protected] == 285                        [email protected] == 286                    then                        00BA: show_text_styled GXT 'fem_ok' time 1000 style 4                    end                                        wait 1000                    0164: disable_marker [email protected]                    01C2: remove_references_to_actor [email protected] // Like turning an actor into a random pedestrian                end            end        end    endend

 

Link to comment
Share on other sites

  • 3 months later...
solidwatersnake

 

The Savegame Editor linked below has a Gang Weapons tool that can adjust your weapons. It only works on gangs though, not police.

You can use this for gangs.

 

To change weapons for non-gang members you can use CLEO script that I wrote.

 

There were some problems with this script, but all is FIXED now.

It was same problem as here: http://gtaforums.com/topic/893365-sais-actor-in-group

 

Policemen may decide to not use weapon that you've assigned to them if you have only one star, but that's expected behaviour.

 

 

 

{$CLEO}0000:const    RADIUS = 10.0    AMMO = 60 //dummy valueendwhile true    wait 0    if 0256: player $PLAYER_CHAR defined    jf continue    04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0    if 0AE1: [email protected] = random_actor_near_point [email protected] [email protected] [email protected] in_radius RADIUS find_next 1 pass_deads 1    then        0665: get_actor [email protected] model_to [email protected]        //***********************************//        //** HERE YOU CONFIGURE THE SCRIPT **//        //***********************************//        //List of all allowed values for [email protected] can be found here:        //  https://gtagmodding.com/sanandreas/peds/        //List of all allowed values for [email protected] can be found in:        //  Sanny Builder help > SCM Documentation > GTA SA > Weapon numbers, "number" column        if [email protected] == #LAPD1        then            [email protected] = 30            jump @loopEnd        end        if [email protected] == #SFPD1        then                 [email protected] = 24            jump @loopEnd        end        if [email protected] == #LVPD1        then                                            [email protected] = 22            jump @loopEnd        end        if [email protected] == #CSHER        then                                                     [email protected] = 25            jump @loopEnd        end        if [email protected] == #LAPDM1        then                                                       [email protected] = 26            jump @loopEnd        end        if [email protected] == #SWAT        then                                                    [email protected] = 28            jump @loopEnd        end        if [email protected] == #DSHER        then            [email protected] = 37            jump @loopEnd        end        if [email protected] == #FBI        then            [email protected] = 38            jump @loopEnd        end        //******************************************//        //** YOU CAN ADD MORE CONFIGURATIONS HERE **//        //******************************************//        continue        :loopEnd        if 8491: not actor [email protected] has_weapon [email protected]        then            0781: get_weapon_with_ID [email protected] model_to [email protected]            repeat                wait 0                0247: load_model [email protected]            until 0248: model [email protected] available             01B2: give_actor [email protected] weapon [email protected] ammo AMMO             0249: release_model [email protected]        end        01B9: set_actor [email protected] armed_weapon_to [email protected]    endend    0A93: end_custom_thread

 

 

 

 

<script src="/cdn-cgi/scripts/78d64697/cloudflare-static/email-decode.min.js"></script>

 

Hello,

 

I tried your cleo script. It really worked! However, how can I assign different weapons on passengers? Example: SWAT1 will have MP5, SWAT2 will have Combat Shotgun, SWAT3 will have M4. I tried to blend your code to police weapons change cleos through minor coding there but it messes up my game and sometimes it doesn't appear through the game.

Link to comment
Share on other sites

<script src="/cdn-cgi/scripts/78d64697/cloudflare-static/email-decode.min.js"></script>

 

Hello,

 

I tried your cleo script. It really worked! However, how can I assign different weapons on passengers? Example: SWAT1 will have MP5, SWAT2 will have Combat Shotgun, SWAT3 will have M4. I tried to blend your code to police weapons change cleos through minor coding there but it messes up my game and sometimes it doesn't appear through the game.

 

Police Weapons

 

And how does it look as sdk plugin script:

 

 

#include "plugin.h"#include <game_sa\common.h>#include <game_sa\CPools.h>#include <game_sa\CVehicle.h>#include <game_sa\CPed.h>#include <game_sa\CCopPed.h>#include <game_sa\CStreaming.h>#include <game_sa\CEntity.h>#include <game_sa\CWanted.h>using namespace plugin;class PoliceWeapons {public:    PoliceWeapons() {        Events::gameProcessEvent += [] {            CPed *ped = FindPlayerPed();            CPed *playa = FindPlayerPed();            CVehicle *veh = FindPlayerVehicle(-1, true);            CWanted *Wanted = playa->m_pPlayerData->m_pWanted;            if (ped) {                for (int i = 0; i < CPools::ms_pPedPool->m_nSize; i++) {                    if (!CPools::ms_pPedPool->IsFreeSlotAtIndex(i)) {                        ped = &CPools::ms_pPedPool->m_pObjects[i];                        if (ped != FindPlayerPed(0)) {                            if (ped->m_nPedType == PED_TYPE_COP) {                                if (ped && ped->m_pVehicle) {                                    if (Wanted->m_nWantedLevel == 4 && ped->m_wModelIndex == MODEL_SWAT) {                                        if (ped == ped->m_pVehicle->m_apPassengers[0] && ped->m_pVehicle->m_apPassengers[0] != 0) {                                            if (ped->m_dwWeaponModelId != MODEL_MP5LNG) {                                                if (CStreaming::ms_aInfoForModel[MODEL_MP5LNG].m_loadState == LOADSTATE_LOADED) {                                                    ped->ClearWeapons();                                                    ped->GiveWeapon(WEAPON_MP5, 9999, true);                                                    ped->SetCurrentWeapon(WEAPON_MP5);                                                    CStreaming::SetModelIsDeletable(MODEL_MP5LNG);                                                }                                                else {                                                    CStreaming::RequestModel(MODEL_MP5LNG, true);                                                    CStreaming::LoadRequestedModels();                                                }                                            }                                        }                                        if (ped == ped->m_pVehicle->m_apPassengers[1] && ped->m_pVehicle->m_apPassengers[1] != 0) {                                            if (ped->m_dwWeaponModelId != MODEL_SHOTGSPA) {                                                if (CStreaming::ms_aInfoForModel[MODEL_SHOTGSPA].m_loadState == LOADSTATE_LOADED) {                                                    ped->ClearWeapons();                                                    ped->GiveWeapon(WEAPON_SPAS12, 9999, true);                                                    ped->SetCurrentWeapon(WEAPON_SPAS12);                                                    CStreaming::SetModelIsDeletable(MODEL_SHOTGSPA);                                                }                                                else {                                                    CStreaming::RequestModel(MODEL_SHOTGSPA, true);                                                    CStreaming::LoadRequestedModels();                                                }                                            }                                        }                                        if (ped == ped->m_pVehicle->m_apPassengers[2] && ped->m_pVehicle->m_apPassengers[2] != 0) {                                            if (ped->m_dwWeaponModelId != MODEL_M4) {                                                if (CStreaming::ms_aInfoForModel[MODEL_M4].m_loadState == LOADSTATE_LOADED) {                                                    ped->ClearWeapons();                                                    ped->GiveWeapon(WEAPON_M4, 9999, true);                                                    ped->SetCurrentWeapon(WEAPON_M4);                                                    CStreaming::SetModelIsDeletable(WEAPON_MP5);                                                }                                                else {                                                    CStreaming::RequestModel(MODEL_M4, true);                                                    CStreaming::LoadRequestedModels();                                                }                                            }                                        }                                    }                                }                            }                        }                    }                }            }        };    }} PoliceWeapons;

 

Link to comment
Share on other sites

 

That's nice!

Some corrections to your 'script'.

 

 

 

 

#include "plugin.h"#include "common.h"#include "CVehicle.h"#include "CCopPed.h"#include "CStreaming.h"class PoliceWeapons {public:    PoliceWeapons() {        static std::pair<int, eWeaponType> weaps[] = {{ MODEL_MP5LNG, WEAPON_MP5 },{ MODEL_SHOTGSPA, WEAPON_SPAS12 },{ MODEL_M4, WEAPON_M4 }};        static auto GiveWeaponToPed = [](CPed *ped, int weapModelId, eWeaponType weaponType) { // create a helper function            if (ped->m_dwWeaponModelId != weapModelId) {                CStreaming::RequestModel(weapModelId, true);                CStreaming::LoadRequestedModels();                if (CStreaming::ms_aInfoForModel[weapModelId].m_loadState == LOADSTATE_LOADED) {                    ped->ClearWeapons();                    ped->GiveWeapon(weaponType, 9999, true);                    ped->SetCurrentWeapon(weaponType);                    CStreaming::SetModelIsDeletable(weapModelId);                }            }        };        plugin::Events::gameProcessEvent += [] {            CPed *playa = FindPlayerPed();            if (playa) {                for (int i = 0; i < CPools::ms_pPedPool->m_nSize; i++) {                    CPed *ped = CPools::ms_pPedPool->GetAt(i); // get ped at pool index                    if (ped && ped != playa && ped->m_nPedType == PED_TYPE_COP && ped->m_pVehicle && ped == ped->m_pVehicle->m_pDriver) {                        if (playa->m_pPlayerData->m_pWanted->m_nWantedLevel == 4 && ped->m_wModelIndex == MODEL_SWAT) {                            for (int p = 0; p < 3; p++) {                                if (ped->m_pVehicle->m_apPassengers[p])                                    GiveWeaponToPed(ped->m_pVehicle->m_apPassengers[p], weaps[p].first, weaps[p].second);                            }                        }                    }                }            }        };    }} policeWeapons;

 

 

Note1: Use latest sdk version to be able to include files without "game_sa" prefix (useful if you targetting multiple games).

Note2: Naming class and class instance with same name is not really a good idea. Please use Project Wizard to create plugins, so you'll get all these names automatically.

Edited by DK22Pac
Link to comment
Share on other sites

That's nice!

Some corrections to your 'script'.

Note1: Use latest sdk version to be able to include files without "game_sa" prefix (useful if you targetting multiple games).

Note2: Naming class and class instance with same name is not really a good idea. Please use Project Wizard to create plugins, so you'll get all these names automatically.

 

 

Thanks. And your sdk plugin is beyond incredible!

Link to comment
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
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

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