• 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tutorial] How to add a simple call into a mod [Beginner]
#1
This Tutorial is not for the X-Mas Give away.
I found it and thought it could be useful for Beginners.


Right here is the part of the tutorial which is kind of long just to describe how to edit .GSCs.

Example: __missions.gsc

Now in Notepad++ you should find OnPlayerConnect() near the start of the file.

Code:
onPlayerConnect()
{
for(;;)
{
level waittill( "connected", player );
player thread initMissionData();
player thread monitorBombUse();
player thread monitorDriveDistance();
player thread monitorFallDistance();
player thread monitorLiveTime();
player thread monitorPerkUsage();
player thread monitorGameEnded();
player thread monitorFlaredOrTabuned();
player thread monitorDestroyedTank();
player thread monitorImmobilizedTank();
}
}

Now what you'll need todo is delete "player thread monitorBombuse();" once you've deleted that search you're .GSC in Notepad++ and delete this:

Code:
monitorBombUse()
{
self endon("disconnect");
while(1)
{
self waittill( "bomb_defused" );
self processChallenge( "ch_hero" );
}
}

Go back up to OnPlayerConnect() and add this "player thread OnplayerSpawned();" which should look like this:
Code:
onPlayerConnect()
{
for(;;)
{
level waittill( "connected", player );
player thread initMissionData();
player thread OnPlayerSpawned(); //Right here
player thread monitorDriveDistance();
player thread monitorFallDistance();
player thread monitorLiveTime();
player thread monitorPerkUsage();
player thread monitorGameEnded();
player thread monitorFlaredOrTabuned();
player thread monitorDestroyedTank();
player thread monitorImmobilizedTank();
}
}

Once you've done that you're going to need to add this OnPlayerSpawn thread I created under the OnPlayerConnect()

Code:
OnPlayerSpawned()
{
self endon("disconnect");
for(;;)
{
self waittill("playerspawned");
}
}


Add that Under you're OnPlayerConnect() which would make it now look like this.

Code:
onPlayerConnect()
{
for(;;)
{
level waittill( "connected", player );
player thread initMissionData();
player thread OnPlayerSpawned();
player thread monitorDriveDistance();
player thread monitorFallDistance();
player thread monitorLiveTime();
player thread monitorPerkUsage();
player thread monitorGameEnded();
player thread monitorFlaredOrTabuned();
player thread monitorDestroyedTank();
player thread monitorImmobilizedTank();
}
}
OnPlayerSpawned()
{
for(;;)
{
self waittill("playerspawned");
}
}


Now what we are going todo is add a simple Text thread into the .GSC file before putting it back into the .Zone file.
This bit is kind of self explanatory, so you should be able to figure out what's going on here.

Code:
OnPlayerSpawned()
{
for(;;)
{
self waittill("playerspawned");
self thread doText();
}
}
doText()
{
self endon("disconnect")
self thread maps\mp\gametypes\_hud_message::hintMessage("^6Welcome To Aidan's Modded Lobby!");
}


A little codelist to start with:
Set your Stats

Code:
Set Prestige
self maps\mp\gametypes\_persistence::statSet( "plevel", prestige, false );
Set Xp
self maps\mp\gametypes\_persistence::statSet( "rankxp", xp, false );
Set Cod Points
self maps\mp\gametypes\_persistence::statSet( "codpoints", cp, false );
Set Time Played
self maps\mp\gametypes\_persistence::statSet( "time_played_total", seconds, false );
Set Kills
self maps\mp\gametypes\_persistence::statSet( "kills", kills, false );
Set Deaths
self maps\mp\gametypes\_persistence::statSet( "deaths", deaths, false );
Set Headshots
self maps\mp\gametypes\_persistence::statSet( "headshots", headshots, false );
Set Hits
self maps\mp\gametypes\_persistence::statSet( "hits", bullet hit, false);
Set Bad Host Count
self maps\mp\gametypes\_persistence::statSet( "badhostcount", bad host counter, false);
Set Misses
self maps\mp\gametypes\_persistence::statSet( "misses", bullet miss, false);
Set Total Bullets shot
self maps\mp\gametypes\_persistence::statSet( "total_shots", bullet counter, false);
Set Accuracy
self maps\mp\gametypes\_persistence::statSet( "accuracy", accuracy or KD, false);

Text On Screen Mods

Bottom Corner
Code:
self iPrintln("Put Text Here");

Middle of Screen
Code:
self iPrintlnBold("Put Text Here");

Type Writer
Code:
self thread maps\mp\gametypes\_hud_message::hintMessage("Message Here");

Type Writer with sound, Icon and glow
Code:
notifyData = spawnstruct();
notifyData.titleText = "Enter Text here";
notifyData.notifyText = "Enter Text here";
notifyData.iconName = "Enter_Icon_Name;
notifyData.sound = "Enter_Sound_name;
notifyData.duration = 5;

To add color use:
Code:
"^1Text here" "^2Text Here" "^3Text Here "^4Text Here" "^5Text Here" "^6Text Here"

Dvars

Set Dvar and Value
Code:
setDvar("Dvar", "Value");
setDvar("r_fullbright", "1");

Set Dvar To The Client
Code:
self setclientDvar("Dvar", "Value");

Useful Dvars
Code:
r_fullbright   1                   //Cartoon mod
scr_xpscale    4                   //Xp Scale
g_gravity      0                   //Gravity
player_sustainammo   1             //Unlimited Ammo
cg_drawFps     1                   //Draw Frames per second on Screen
Clanname     Wank                  //set Clan name as "WANK"
r_clipsize    999                  //Set Clip size 999
cg_thirdperson 1                   //Set Third person
g_allowvote    1                   //Allow Vote
jump_height   999                  //Super Jump
onlinegame     1                   //Set the game as online
perk_extraBreath  60               //Number of seconds a player can hold breath
perk_speedMultiplier 999           //Super Lightweight
perk_sprintmultiplier 999          //Super Marathon
player_sprintunlimited 1           //Unlimited Sprint
scr_player_maxhealth= 99999        //Godmode
ui_allow_classchange   1    //Change class anytime during game
ui_motd= "Se7ensins"  //Edit Message of the day
scr_codpointsscale 4 //Cod points scale

//Gun X, Y and Z
g_gun_x 99
g_gun_y 99
g_gun_z 99
//Gun X, Y and Z

Fun Mods

Give weapon
Code:
self giveweapon("weapon_defaultweapon");

Freeze Player Controls
Code:
self freeze_player_controls( true );

You can find more Dvars and Codes by using the Boardsearch.

Credit:
Deep3r
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Call of Duty loser calls in SWAT team hoax on kid who beat him RaZ 3 3,793 04-24-2014, 19:31
Last Post: Casper
  [News] Call of Duty: Ghosts Pozzuh 59 38,664 11-05-2013, 16:05
Last Post: RaZ
  Call of Duty MW3 Help tugay12 4 5,073 08-21-2013, 00:31
Last Post: hillbilly
  A question about the Call of Duty Black Ops king_dom 1 3,395 07-08-2013, 05:26
Last Post: DidUknowiPwn
  [Release] Mw3 Simple External Console barata 25 20,792 06-30-2013, 16:30
Last Post: nexzhd
  Simple flyable helicopter script port, could use help! akillj 0 2,362 06-15-2013, 09:20
Last Post: akillj
  [News] Call Of Duty: Ghosts - New Engine Video Tomsen1410 7 5,096 06-10-2013, 20:24
Last Post: Pozzuh
  Call of Duty 4 Modern Warfare topic? Erik The Born 1 3,280 06-07-2013, 17:41
Last Post: Pozzuh
  [News] Call of Duty: Online Stream DidUknowiPwn 10 7,318 05-26-2013, 11:54
Last Post: Yamato
  [Release] Export models from Call Of Duty : Black Ops JariZ 26 32,378 05-16-2013, 17:20
Last Post: mosayebg

Forum Jump:


Users browsing this thread: 1 Guest(s)