November 26 2024 11:34:52
Navigation
· Home
· Articles
· Downloads
· FAQ
· Discussion Forum
· Web Links
· News Categories
· Contact Me
· Photo Gallery
· Search
· Gameservers
Languages
Users Online
· Guests Online: 9

· Members Online: 0

· Total Members: 1,134
· Newest Member: Brody
Teamspeak 3
Last Seen Users
· hackepter02:16:59
· GONZO19:11:30
· Intruder19:38:13
· Sully 1 day
· desintegrator 2 days
· WEZ 3 days
· Homi 3 days
· The ACE 4 days
· xhc 1 week
· dRgiGGLeZ 1 week
· El Dookie 1 week
· Melber 2 weeks
· SGT PEPPER 2 weeks
· martyr 2 weeks
· Terminator 2 weeks

View Thread: DM.c Change Gun
Vietcong.Info » Vietcong General Discussion » Vietcong Tech Talk
Who is here? 1 Guest
Current Rating: (Total: 1 rating)  
 Print Thread
DM.c Change Gun
techno
Hello

I want to have a DM were everyone will respawn with a rifle and not a hand gun
US = M16 / VC = AK47
what do I need to add or edit in this script to make that happen...

Download source  Code

/*
   Eric multiplayer script - DM
*/

#include <inc\sc_global.h>
#include <inc\sc_def.h>


#define RECOVER_TIME   5.0f      // time to recover player after killed
#define NORECOV_TIME   3.0f      // disable time of recoverplace after recovering someone there

#define REC_WPNAME      "DM%d"
#define REC_MAX         64


dword gRecs = 0;
s_SC_MP_Recover gRec[REC_MAX];
float gRecTimer[REC_MAX];


dword gEndRule;
dword gEndValue;
float gTime;

dword gPlayersConnected = 0;

BOOL SRV_CheckEndRule(float time){
   int frags;

   switch(gEndRule){
      case SC_MP_ENDRULE_TIME:

         if (gPlayersConnected>0) gTime += time;
         SC_MP_EndRule_SetTimeLeft(gTime,gPlayersConnected>0);

         if (gTime>gEndValue){
            SC_MP_LoadNextMap();
            return TRUE;
         }

         break;

      case SC_MP_ENDRULE_FRAGS:

         if (SC_MP_GetMaxFragsPl(&frags)){

            if (frags>=gEndValue){
               SC_MP_LoadNextMap();
               return TRUE;
            }
         }

         break;

      default:
         SC_message("EndRule unsopported: %d",gEndRule);
         break;

   }// switch(gEndRule)

   return FALSE;

}// void SRV_CheckEndRule(float time)


int ScriptMain(s_SC_NET_info *info){
   char txt[32];
   dword i;
   s_SC_MP_Recover *precov;
   s_SC_MP_hud hudinfo;
   s_SC_MP_EnumPlayers enum_pl[64];
   s_SC_MP_SRV_settings SRVset;

   switch(info->message){
      
      case SC_NET_MES_SERVER_TICK:         

         gPlayersConnected = 64;
         SC_MP_EnumPlayers(enum_pl,&gPlayersConnected,SC_MP_ENUMPLAYER_SIDE_ALL);         

         if (SRV_CheckEndRule(info->elapsed_time)) break;

         for (i=0;i<gRecs;i++)
            gRecTimer[i] -= info->elapsed_time;


         break;

      case SC_NET_MES_CLIENT_TICK:

         break;// SC_NET_MES_CLIENT_TICK

      case SC_NET_MES_LEVELPREINIT:
         SC_sgi(GVAR_MP_MISSIONTYPE,GVAR_MP_MISSIONTYPE_DM);

         gEndRule = info->param1;
         gEndValue = info->param2;
         gTime = 0.0f;

         SC_MP_EnableBotsFromScene(FALSE);

         break;// SC_NET_MES_LEVELPREINIT

      case SC_NET_MES_LEVELINIT:


         SC_MP_SRV_SetForceSide(0xffffffff);
         SC_MP_SetChooseValidSides(3);

         
         SC_HUD_DisableRadar(TRUE);         

         SC_MP_SRV_SetClassLimitsForDM();         

         CLEAR(hudinfo);
         hudinfo.title = 1050;
         

         hudinfo.sort_by[0] = SC_HUD_MP_SORTBY_FRAGS;         
         hudinfo.sort_by[1] = SC_HUD_MP_SORTBY_KILLS;
         hudinfo.sort_by[2] = SC_HUD_MP_SORTBY_DEATHS | SC_HUD_MP_SORT_DOWNUP;
         hudinfo.sort_by[3] = SC_HUD_MP_SORTBY_PINGS | SC_HUD_MP_SORT_DOWNUP;

         hudinfo.pl_mask = SC_HUD_MP_PL_MASK_FRAGS | SC_HUD_MP_PL_MASK_KILLS | SC_HUD_MP_PL_MASK_DEATHS;
         hudinfo.use_sides = 0;

         SC_MP_HUD_SetTabInfo(&hudinfo);

         SC_MP_AllowStPwD(FALSE);
         SC_MP_AllowFriendlyFireOFF(FALSE);

         SC_MP_SetItemsNoDisappear(TRUE);

         if (info->param2){

            if (info->param1){
               // it's server                     

               SC_MP_GetSRVsettings(&SRVset);
               SC_MP_SRV_InitWeaponsRecovery((float)SRVset.dm_weap_resp_time);

               gRecs = 0;

               for (i=0;i<REC_MAX;i++){      
                  sprintf(txt,REC_WPNAME,i);         
                  if (SC_NET_FillRecover(&gRec[gRecs],txt)) gRecs++;
               }               

#if _GE_VERSION_ >= 133

               i = REC_MAX - gRecs;
               SC_MP_GetRecovers(SC_MP_RESPAWN_DM,&gRec[gRecs],&i);
               gRecs += i;
#endif

               SC_Log(3,"DM respawns: %d",gRecs);

               if (gRecs==0) SC_message("no recover place defined!");

               CLEAR(gRecTimer);

            }// if (info->param1)

         }//if (info->param2)


         break;// SC_NET_MES_LEVELINIT


      case SC_NET_MES_RENDERHUD:

         break;

      case SC_NET_MES_SERVER_RECOVER_TIME:

         if (info->param2){
               info->fval1 = 0.1f;
         }
         else{
            // killed
            info->fval1 = RECOVER_TIME;
         }

         break;

      case SC_NET_MES_SERVER_RECOVER_PLACE:
         
         precov = (s_SC_MP_Recover*)info->param2;

         i = SC_MP_SRV_GetBestDMrecov(gRec,gRecs,gRecTimer,NORECOV_TIME);
         
         gRecTimer[i] = NORECOV_TIME;
         *precov = gRec[i];
                  
         break;



      case SC_NET_MES_RESTARTMAP:

         gTime = 0;

         SC_MP_SRV_ClearPlsStats();

         SC_MP_SRV_InitGameAfterInactive();
         SC_MP_RecoverAllNoAiPlayers();         

         break;// SC_NET_MES_RESTARTMAP

      case SC_NET_MES_RULESCHANGED:         
         gEndRule = info->param1;
         gEndValue = info->param2;
         gTime = 0.0f;
         break;
                  

   }// switch(info->message)
   

   return 1;

}// int ScriptMain(void)




SignatureDon't spend your time lookin' around for something you want that can't be found
 
KostiCZ
The best way is to edit soldier class definition in some .dat file (ascii file), but i don't remember the exact name, i'm not at my PC. Second way is to change it in client part after player joined game or respawned.

But: when you change .DAT file, you will need to pack it manualy with map by total commander.
Signature________________________________________________

2LT William Theolinus "KostiCZ" Boner Jr.
LRRP Squad Baker, Delta Team
cache.www.gametracker.com/player/KostiCZ/63.143.47.189:2302/b_560x95.png
 
Teamrespawn.cz
techno
Couldn't find any dat files with gun settings. I opened the map.dat file and there was 3 dats files in the dev folder but as far as i could see it only had info about dds files.
SignatureDon't spend your time lookin' around for something you want that can't be found
 
KostiCZ
Try to search .\vietcong\ini\dat\C6DE0CD84BBA3C74.DAT file, there is definition of classes, find DM - US class and add one line to this definition - "`mp_class_w 3 1" for US side and M16. Similar for VC side.
Signature________________________________________________

2LT William Theolinus "KostiCZ" Boner Jr.
LRRP Squad Baker, Delta Team
cache.www.gametracker.com/player/KostiCZ/63.143.47.189:2302/b_560x95.png
 
Teamrespawn.cz
techno
Found that file and made the changes as follows

Download source  Code

// multiplayer definitions


// `mp_class [class_id] [name_text_id] [info_text_id] [hot_key] [hot_scan]
// `mp_class_w [slot_nr] [weap_type]
// `mp_class_ini [ force inifile ]
// `mp_class_eqpname [folder name ]



// Soldier - US
`mp_class 1 1100 1101 1 2
`mp_class_w 1 29
`mp_class_w 2 7
`mp_class_w 3 1
`mp_class_w 3 19
`mp_class_w 3 21
`mp_class_w 3 25
`mp_class_w 3 11
`mp_class_w 3 24
`mp_class_w 3 32
`mp_class_w 5 59
`mp_class_w 10 58
`mp_class_eqpname soldier



// Machiner gunner - US
`mp_class 2 1102 1103 2 3
`mp_class_w 1 29
`mp_class_w 2 7
`mp_class_w 3 17
`mp_class_w 10 58
`mp_class_eqpname machineguner



// Sniper - US
`mp_class 3 1104 1105 3 4
`mp_class_w 1 33
`mp_class_w 2 22
`mp_class_w 3 4
`mp_class_w 3 31
`mp_class_w 3 12
`mp_class_w 10 58
`mp_class_eqpname sniper



// Medic - US
`mp_class 4 1106 1107 4 5
`mp_class_w 1 29
`mp_class_w 2 10
`mp_class_w 3 21
`mp_class_w 3 25
`mp_class_w 3 24
`mp_class_w 3 32
`mp_class_w 4 62
`mp_class_w 5 59
`mp_class_w 10 58
`mp_class_eqpname medic



// Engineer - US
`mp_class 5 1108 1109 5 6
`mp_class_w 1 33
`mp_class_w 2 7
`mp_class_w 3 11
`mp_class_w 3 21
`mp_class_w 3 25
`mp_class_w 3 24
`mp_class_w 4 61
`mp_class_w 5 59
`mp_class_w 7 55
`mp_class_w 8 49 // claymore
`mp_class_w 9 52         
`mp_class_w 10 58
`mp_class_eqpname engineer


// Radioman - US
`mp_class 6 1110 1111 6 7
`mp_class_w 1 29
`mp_class_w 2 7
`mp_class_w 3 11
`mp_class_w 3 19
`mp_class_w 3 21
`mp_class_w 3 24
`mp_class_w 4 60
`mp_class_w 5 59
`mp_class_w 10 58
`mp_class_eqpname radioman


// Pilot - US
`mp_class 18 1120 1120 7 8
`mp_class_w 1 29
`mp_class_w 2 7
`mp_class_w 10 58
`mp_class_ini ini\players\net_pilot.ini
`mp_class_eqpname pilot

// DM - US
`mp_class 19 1112 1112 - 0
`mp_class_w 1 29
`mp_class_w 2 7
`mp_class_w 3 1
`mp_class_w 5 59
`mp_class_w 10 58





// Soldier - NVA
`mp_class 21 1150 1151 1 2
`mp_class_w 1 30
`mp_class_w 2 8
`mp_class_w 3 2
`mp_class_w 3 3
`mp_class_w 3 6
`mp_class_w 3 23
`mp_class_w 3 15
`mp_class_w 3 28
`mp_class_w 3 13
`mp_class_w 6 50
`mp_class_w 10 58
`mp_class_eqpname soldier


// Machiner gunner - NVA
`mp_class 22 1152 1153 2 3
`mp_class_w 1 30
`mp_class_w 2 9
`mp_class_w 3 18
`mp_class_w 3 5
`mp_class_w 10 58
`mp_class_eqpname machineguner


// Sniper - NVA
`mp_class 23 1154 1155 3 4
`mp_class_w 1 33
`mp_class_w 2 9
`mp_class_w 3 14
`mp_class_w 3 16
`mp_class_w 3 26
`mp_class_w 10 58
`mp_class_eqpname sniper


// Medic - NVA
`mp_class 24 1156 1157 4 5
`mp_class_w 1 30
`mp_class_w 2 10
`mp_class_w 3 23
`mp_class_w 3 15
`mp_class_w 3 13
`mp_class_w 3 3
`mp_class_w 4 62
`mp_class_w 6 50
`mp_class_w 10 58
`mp_class_eqpname medic


// Engineer - NVA
`mp_class 25 1158 1159 5 6
`mp_class_w 1 33
`mp_class_w 2 8
`mp_class_w 3 23
`mp_class_w 3 28
`mp_class_w 3 15
`mp_class_w 3 13
`mp_class_w 4 61
`mp_class_w 6 50
`mp_class_w 7 55
`mp_class_w 8 49
`mp_class_w 9 52
`mp_class_w 10 58
`mp_class_eqpname engineer


// Radioman - NVA
`mp_class 26 1160 1161 6 7
`mp_class_w 1 30
`mp_class_w 2 9
`mp_class_w 3 6
`mp_class_w 3 23
`mp_class_w 3 13
`mp_class_w 3 28
`mp_class_w 4 60
`mp_class_w 6 50
`mp_class_w 10 58
`mp_class_eqpname radioman


// DM - NVA
`mp_class 39 1113 1113 - 0
`mp_class_w 1 30
`mp_class_w 2 8
`mp_class_w 3 2
`mp_class_w 6 50
`mp_class_w 10 58


// end of file





Once re-packing my map with folder INI\dat\C6DE0CD84BBA3C74.DAT

DM was still the same, player only spawns with a gun
is there something else I need to change as well?
SignatureDon't spend your time lookin' around for something you want that can't be found
 
Jump to Forum:
Similar Threads
Thread Forum Replies Last Post
Change skin HELP Maps & Mapping 1 12-07-2015 00:29
Cant change Player name or clothing Vietcong Tech Talk 7 30-01-2014 18:43
Change sound in game Vietcong Tech Talk 3 03-06-2013 00:06
Change version. Vietcong Tech Talk 3 11-06-2011 17:07
Login
Username

Password



Not a member yet?
Click here to register.

Forgotten your password?
Request a new one here.
Render time: 0.25 seconds - 55 Queries 5,473,586 unique visits