Post: [Codes]Use Functions People...
06-14-2010, 12:41 AM #1
(adsbygoogle = window.adsbygoogle || []).push({}); I posted this a while back when i made it which was actually the day i learned campaign modding. Since the topic is dead and i now have rfom. I decided to open this topic with a few functions and ask that you post your own unique functions here.

NOTE : These WILL Work with Campaign and Multiplayer.

Here is the Original Post. I realize the save didn't work, but the individual functions can be used separately to produce the same effect.
Originally posted by AnubisX View Post
Today was the first day modding COD4 for the PS3 ever came in mind. So i did research here and made this save the best i could.

Here is my 1st mod for PS3's COD4.

GRAD0_CM
    set gpad_buttonsConfig "DFect"


GRAD0_SP
    set sv_lastSaveGame "savegame.svg"
set cg_subtitles "1"
set takeCoverWarnings "1"
set cheat_points "0"
set cheat_items_set1 "33554433"
set cheat_items_set2 "0"
set mis_01 "20"
set mis_difficulty "422222222222222222220000000000000000000000000 0000 0"

set fastnoclip "noclip ; toggle g_speed 5.0 1.0"
set slowmode "toggle timescale 0.5 1.0 ; toggle r_fullbright 1 0"

set gm "vstr gm1"
set gm1 "vstr gm1a ; set gm vstr gm2"
set gm1a "say ^1 GodMode On ; godmode ; give defaultweapon_mp"
set gm2 "vstr gm2a ; set gm vstr gm1"
set gm2a "say ^1 GodMode Off ; godmode ; take defaultweapon_mp"

set xray "vstr xray1"
set xray1 "vstr xray1a ; set xray vstr xray2"
set xray1a "say ^1 Xray On ; set r_znear 50"
set xray2 "vstr xray2a ; set xray vstr xray3"
set xray2a "say ^1 Xray Max ; set r_znear 400"
set xray3 "vstr xray3a ; set xray vstr xray1"
set xray3a "say ^1 Xray Off ; set r_znear 1"

set jumpmode "vstr jumpmode1"
set jumpmode1 "vstr jumpmode1a ; set jumpmode vstr jumpmode2"
set jumpmode1a "say ^1 Jumpmode On ; set jump_height 250"
set jumpmode2 "vstr jumpmode2a ; set jumpmode vstr jumpmode3"
set jumpmode2a "say ^1 Jumpmode Max ; set jump_height 500"
set jumpmode3 "vstr jumpmode3a ; set jumpmode vstr jumpmode1"
set jumpmode3a "say ^1 Jumpmode Off ; set jump_height 39"

set runmode "vstr runmode1"
set runmode1 "vstr runmode1a ; set runmode vstr runmode2"
set runmode1a "say ^1 Runmode On ; player_sprintSpeedScale 3.0"
set runmode2 "vstr runmode2a ; set runmode vstr runmode3"
set runmode2a "say ^1 Runmode Max ; player_sprintSpeedScale 5.0"
set runmode3 "vstr runmode3a ; set runmode vstr runmode1"
set runmode3a "say ^1 Runmode Off ; player_sprintSpeedScale 1.5"

set firemode "vstr firemode1"
set firemode1 "vstr firemode1a; set firemode vstr firemode2"
set firemode1a "say ^1 Semi-Automatic ; bind BUTTON_RSHLDR vstr firemode2a"
set firemode1b "say ^1 Burst Fire ; bind BUTTON_RSHLDR vstr firemode2b"
set firemode1c "say ^1 Default ; bind BUTTON_RSHLDR +attack;-attack"
set firemode2 "vstr firemode1b; set firemode vstr firemode3"
set firemode2a "+attack; -attack"
set firemode2b "+attack; wait 5; -attack; wait 5; +attack; wait 5; -attack; wait 5; +attack; wait 5; -attack; wait 5"
set firemode3 "vstr firemode1c; set firemode vstr firemode1"

set UP1 "vstr firemode"
set LFT1 "vstr jumpmode"
set RGHT1 "vstr runmode"
set DWN1 "vstr xray"
set UP2 "vstr fastnoclip"
set LFT2 "toggle cg_fov 130 65"
set RGHT2 "vstr gm"
set DWN2 "vstr slowmode"

set switch "vstr switch1"
set switch1 "vstr switch1a ; set switch vstr switch2"
set switch1a "say ^1 Bind Set 1 ; bind DPAD_UP vstr UP1 ; bind DPAD_LEFT vstr LFT1 ; bind DPAD_RIGHT vstr RGHT1 ; bind DPAD_DOWN vstr DWN1"
set switch2 "vstr switch2a ; set switch vstr switch1"
set switch2a "say ^1 Bind Set 2 ; bind DPAD_UP vstr UP2 ; bind DPAD_LEFT vstr LFT2 ; bind DPAD_RIGHT vstr RGHT2 ; bind DPAD_DOWN vstr DWN2"

bind BUTTON_BACK "vstr switch ; give ammo"
bind DPAD_UP "vstr UP1"
bind DPAD_LEFT "vstr LFT1"
bind DPAD_RIGHT "vstr RGHT1"
bind DPAD_DOWN "vstr DWN1"

set jump_spreadAdd "0"
set bg_fallDamageMaxHeight "1000"
set bg_fallDamageMinHeight "1000"
set player_meleeHeight "1000"
set player_meleeRange "1000"
set player_meleeWidth "10"
set friendlyfire_dev_disabled 1


How to use:
Select - Switch (Toggle S1/S2)
[S1]Dpad Up - Toggle Firemode (Tonsillitis Burst/Single/Default shot)
[S1]Dpad Left - Toggle Jumpmode (3 levels of jumpheight)
[S1]Dpad Right - Toggle Runmode (3 levels of sprintspeed)
[S1]Dpad Down - Toggle Xray (3 levels of "Seeing through walls")

[S2]Dpad Up - Toggle FastNoClip (Speed incread + NoClip)
[S2]Dpad Left - Toggle FoV (Change Field of View)
[S2]Dpad Right - Toggle Godmode (Godmode + Default Weapon)
[S2]Dpad Down - Toggle Slowmode (SlowMo On/Off)


Tip: Press the Select Button to change Dpad Set.


Tons messed around with the code and made it small enough to go into one file. Here's that post...
Originally posted by Tons View Post
k, here's under 1kb, i tested it and it works.

However:

1. I took out toggle burst fire script, as it uses too much room for what it's worth.
2. I took out melee distance, as it was the most useless thing on there and i needed to knock off some bytes.

set sv_lastSaveGame "savegame.svg"
set cg_subtitles "1"
set takeCoverWarnings "1"
set cheat_points "0"
set cheat_items_set1 "33554433"
set cheat_items_set2 "0"
set mis_01 "20"
set mis_difficulty "422222222222222222220000000000000000000000000
0000 0"
set 3 "toggle jump_height 250 500 39"
set 4 "toggle player_sprintSpeedScale 1.5 3 5"
set 5 "toggle r_znear 50 400 4"
set 2 "vstr 21"
set 21 "vstr 21a; set 21 vstr 22"
set 21a "bind DPAD_UP bind DPAD_LEFT vstr 3; bind DPAD_RIGHT vstr 4; bind DPAD_DOWN vstr 5"
set 22 "vstr 22a; set 2 vstr 21"
set 22a "bind DPAD_UP vstr 6; bind DPAD_LEFT vstr 7; bind DPAD_RIGHT vstr 8;
bind DPAD_DOWN vstr 9"
set 6 "noclip; toggle g_speed 950 190"
set 7 "toggle cg_fov 80 65"
set 8 "vstr 81"
set 81 "vstr 81a; set 8 vstr 82"
set 81a "god; give defaultweapon_mp"
set 82 "vstr 82a; set 8 vstr 81"
set 82a "god; take defaultweapon_mp"
set 9 "toggle timescale 0.5 1.0"
set player_sustainammo "1"
set friendlyfire_dev_disabled "1"
bind BUTTON_BACK "vstr 2"
(adsbygoogle = window.adsbygoogle || []).push({});

The following user thanked Deffect for this useful post:

SavagedPixel

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo