· Guests Online: 22
· Members Online: 0
· Total Members: 1,134
· Newest Member: Brody
·
hackepter01:07:44
·
GONZO18:02:15
·
Intruder18:28:58
·
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
·
CrNcK 3 weeks
·
Brody 4 weeks
·
DALmata 5 weeks
·
Jardacz 5 weeks
·
Silent Bob 7 weeks
·
Virus 8 weeks
·
SodoMyzer 9 weeks
·
Lerner 9 weeks
·
areen10 weeks
·
gus11 weeks
·
Doc11 weeks
·
middle4413 weeks
·
KiSha14 weeks
·
buzZzer14 weeks
·
Croocker15 weeks
View Thread: CTF Scripting with DM gun respawn
Current Rating: (Total: 1 rating )
CTF Scripting with DM gun respawn
techno
Posted on 13-05-2011 19:24
Offline
Member
Posts: 197
Joined: 26.04.11
Location: Northern NSW
Gender: male
Age: 49
Warnings:
Maybe someone might be able to help me out with something I have been working on for some time and note sure
where to add this line. Plus I need a CTF.c Script that works. all the ones I have error when finalizing.
SC_MP_SRV_InitweaponsRecovery(50);
I am making or should I say trying to make a custom ctf with guns that respawn like DM but don't know much about scripting; just a very little.
I have done this with COOP and works as it should.
following this small movie step by step, I get the guns in the game but once used they don't respawn because I dont have a custom CTF script.
cheers
http://www.youtub...XvbAFXLxlI
Edited by Silent Bob on 13-05-2011 19:53
Signature Don't spend your time lookin' around for something you want that can't be found
Silent Bob
Posted on 13-05-2011 20:15
Offline
Admin
Posts: 931
Joined: 07.03.11
Location: Austria
Gender: male
Age: 48
Warnings:
Here you go:
Silent Bob attached the following file:
gamemodes.rar [55.67 kB, 540 Downloads]
KostiCZ
Posted on 13-05-2011 20:53
Offline
Moderator
Posts: 1091
Joined: 15.03.11
Gender: male
Age: 48
Warnings:
init weapons recovery command place in gamescript (ctf.c) in section ...
Code
case SC_NET_MES_LEVELINIT:
...
...
...
if (info->param2){
if (info->param1){
// it's server
SC_MP_GetSRVsettings(&SRVset);
SC_MP_SRV_InitWeaponsRecovery((float)SRVset.dm_weap_resp_time);
Signature ________________________________________________
2LT William Theolinus "KostiCZ" Boner Jr.
LRRP Squad Baker, Delta Team
techno
Posted on 13-05-2011 21:07
Offline
Member
Posts: 197
Joined: 26.04.11
Location: Northern NSW
Gender: male
Age: 49
Warnings:
This is awesome, ask the right ppl, use the right tools and things happen.
what I have tried to do my self for so long is done by asking the right ppl.
add this file to your list CTFDM is what i called it.
just tested it and works perfect
follow the steps of the movie i posted
open the file mplevel.inc found in \Vietcong1.6\dev\compiler\inc
change
case GVAR_MP_MISSIONTYPE_CTF:
hide_CTF_flags = FALSE;
break;
to this
case GVAR_MP_MISSIONTYPE_CTF:
hide_CTF_flags = FALSE;
hide_weapons = FALSE;
break;
use this script and your done
now CTF with DM Re-spawning guns
Now I would like someone who knows more then I do that if I have done something wrong to let me know
as I don't want others doing the same thing then something goes wrong and getting upset with me...
thankyou all so very much for your support
Also Silent Bob that ctf.c script worked perfect
techno attached the following file:
ctfdm.zip [5.68 kB, 540 Downloads]
Edited by techno on 13-05-2011 21:10
Signature Don't spend your time lookin' around for something you want that can't be found
Silent Bob
Posted on 13-05-2011 21:10
Offline
Admin
Posts: 931
Joined: 07.03.11
Location: Austria
Gender: male
Age: 48
Warnings:
Youre welcome!
Feel free to mess around with VC...be creative
Edited by Silent Bob on 13-05-2011 21:10
techno
Posted on 14-05-2011 06:28
Offline
Member
Posts: 197
Joined: 26.04.11
Location: Northern NSW
Gender: male
Age: 49
Warnings:
Could I ask ever so kindly if someone can point me at the file that tells
what number belongs to which gun.
Example
#1 is M16
#2 is AKA47
I have spent the last 2 hours duplicating Maps trying to get the numbers for all the guns
as I don't like to ask for help all the time, But there must be an better way then the way I am doing it.
Cheers
Edited by techno on 14-05-2011 06:29
Signature Don't spend your time lookin' around for something you want that can't be found
KostiCZ
Posted on 14-05-2011 08:38
Offline
Moderator
Posts: 1091
Joined: 15.03.11
Gender: male
Age: 48
Warnings:
From SDK:
Code
VIETCONG(items.txt)
1 – M16 assault rifle
2 – AK47 assault rifle
4 – M1 garand sniper rifle
6 – PPS-41 submachinegun
7 – Colt M1911 pistol
8 – Tokarev pistol
9 – Makarov pistol
10 – Revolver .38
11 – Remmington shotgun
12 – Winchester sniper rifle
14 – SVD Dragunov sniper rifle
15 – SKS Simonov rifle
17 – M60 machinegun
18 – Degtarjev machinegun
19 – USM3 submachinegun
20 – M2C50 – heavy machine gun, used for mounted weapons on the chopper
21 – Thompson submachinegun
22 – S&W silenced pistol
23 – PPS-43 submachinegun
25 – M1 carabine
26 – Mosin Nagant rifle
27 – M79 grenade launcher
28 – double barelled shotgun
29 – US knife
30 – VC knife
50 – VC grenade
51 – Lightstick
52 – Booby trap
55 – C4 explosive
58 – FPV map
59 – US grenade
60 – Radio
61 – Ammobag
62 – medibag
63 – medikit
140 – mini radio
53,54,64-138 are intel items
Fist Alpha(items2.txt)
3 – Scorpion smg
5 – DP2 machinegun
13 – Tokarev SVT rifle
16 – Tokarev SVT sniper rifle
24 – M14 rifle
31 – M14 sniper rifle
32 – Sten SMG
33 - Machete
34 – BESA/ZB37 hmg for mounted weapon
49 – Claymore mine
Stage weapons and items
Stage items is stuff placed in the level, either by designer, spawned by script or when the item fell (is thrown out) out of the player. These items are defined in the items.txt and items2.txt, for definition see here.
VIETCONG (items.txt)
1 – M16 assault rifle
2 – AK47 assault rifle
4 – M1 garand sniper rifle
6 – PPS-41 submachinegun
7 – Colt M1911 pistol
8 – Tokarev pistol
9 – Makarov pistol
10 – Revolver .38
11 – Remmington shotgun
12 – Winchester sniper rifle
14 – SVD Dragunov sniper rifle
15 – SKS Simonov rifle
17 – M60 machinegun
18 – Degtarjev machinegun
19 – USM3 submachinegun
21 – Thompson submachinegun
22 – S&W silenced pistol
23 – PPS-43 submachinegun
25 – M1 carabine
26 – Mosin Nagant rifle
27 – M79 grenade launcher
28 – double barelled shotgun
50 – VC grenade
55 – C4 explosive
59 – US grenade
60 – Radio
62 – medibag
63 – medikit
Ammo:
71 – M16 assault rifle
72 – AK47 assault rifle
74 – M1 garand sniper rifle
76 – PPS-41 submachinegun
77 – Colt M1911 pistol
78 – Tokarev pistol
79 – Makarov pistol
80 – Revolver .38
81 – Remmington shotgun
82 – Winchester sniper rifle
84 – SVD Dragunov sniper rifle
85 – SKS Simonov rifle
87 – M60 machinegun
88 – Degtarjev machinegun
89 – USM3 submachinegun
91 – Thompson submachinegun
92 – S&W silenced pistol
93 – PPS-43 submachinegun
95 – M1 carabine
96 – Mosin Nagant rifle
97 – M79 grenade launcher
98 – double barelled shotgun
128 – VC grenade
129 – US grenade
Specials:
136 – unlimited smoke grenade with particle 184
140 – red flare
141 – bag
142 – lightstick
143 – booby trap
144 – C4
145 – US flag
146 – VC flag
147 – smoke grenade
148 – shot from m79
149 – white flare
150-229 are intel items
FIST ALPHA (item2.txt)
3 – Scorpion smg
5 – DP2 machinegun
13 – Tokarev SVT rifle
16 – Tokarev SVT sniper rifle
24 – M14 rifle
31 – M14 sniper rifle
32 – Sten SMG
33 - bandage
AMMO:
41 – Scorpion smg
42 – DP2 machinegun
43 – Tokarev SVT rifle
44 – Tokarev SVT sniper rifle
45 – M14 rifle
46 – M14 sniper rifle
47 – Sten SMG
Specials:
137 – unlimited smoke grenade
138 – claymore switch
139 - claymore
Signature ________________________________________________
2LT William Theolinus "KostiCZ" Boner Jr.
LRRP Squad Baker, Delta Team
techno
Posted on 14-05-2011 09:03
Offline
Member
Posts: 197
Joined: 26.04.11
Location: Northern NSW
Gender: male
Age: 49
Warnings:
perfect, Thanks heaps
Signature Don't spend your time lookin' around for something you want that can't be found
techno
Posted on 12-06-2011 23:14
Offline
Member
Posts: 197
Joined: 26.04.11
Location: Northern NSW
Gender: male
Age: 49
Warnings:
Would anyone have a good coop.c script with no respawn time.
I tried the script from slowbobs post in this topic and downloaded a heap from the downloads but all of them have errors for me except using a coop.scr from storm by renaming it to coop.c setup my coop then rename it back to coop.scr and my map works with coop no errors.
So if someone has a good coop script with no errors and any extra files along with it. and the respawn time from coop removed or tell me how to edit the script. that would be great.
cheers
KostiCZ
Posted on 12-06-2011 23:37
Offline
Moderator
Posts: 1091
Joined: 15.03.11
Gender: male
Age: 48
Warnings:
Post here your script and tell me WHAT EXACTLY you want. Respawn time of weapons or of players? I dont have script you want... i make scripts for all maps extra, so i have NOT any universal coop script :-(
Signature ________________________________________________
2LT William Theolinus "KostiCZ" Boner Jr.
LRRP Squad Baker, Delta Team
Ando
Posted on 13-06-2011 00:44
Offline
Moderator
Posts: 294
Joined: 17.03.11
Gender: male
Warnings:
techno wrote:
I tried the script from slowbobs post in this topic and downloaded a heap from the downloads but all of them have errors for me except using a coop.scr
cheers
I think these errors are caused by something else. Maybe you are using old header files example.
What error text it show?
techno
Posted on 13-06-2011 05:30
Offline
Member
Posts: 197
Joined: 26.04.11
Location: Northern NSW
Gender: male
Age: 49
Warnings:
Hi
yeah I thought maybe not the script, that's why I asked for extra files along with script
so I can over come 2 problems at one time.
All different kinds off errors depends on what script I am using.
most are \dev\compiler\inc\Maxovo\!max_support.h or !max_multiplayer.h or LIBRARY line 18 or something like that
other scripts don't error on finalizing but game crashes on start with coop.
only if I use a .src coop file for my coop is when the game works with no errors or crashes.
I know it's more than likely something in my .h files is where I have the problem but removing the files
doesn't fix the problem, just the editor message missing file bla bla bla.
so if anyone got a good \dev\compiler folder thay can zip and send my way
I think would fix my problem.
cheers
Signature Don't spend your time lookin' around for something you want that can't be found
Ando
Posted on 13-06-2011 09:13
Offline
Moderator
Posts: 294
Joined: 17.03.11
Gender: male
Warnings:
You are using VC2 scripts, there is header files on "\Maxovo\" folder, but not in vc1.
You can search scripts example from Vietcong-coop.net page.
Edited by Ando on 13-06-2011 10:36
KostiCZ
Posted on 13-06-2011 10:24
Offline
Moderator
Posts: 1091
Joined: 15.03.11
Gender: male
Age: 48
Warnings:
If game crashed, you can find some additional info in pt_excp.txt in your vietcong folder.
As Ando wrote you are using VC2 scripts, ofcourse in VC1 are missing necessary libraries and script cannot be compiled without it.
Signature ________________________________________________
2LT William Theolinus "KostiCZ" Boner Jr.
LRRP Squad Baker, Delta Team
techno
Posted on 13-06-2011 15:40
Offline
Member
Posts: 197
Joined: 26.04.11
Location: Northern NSW
Gender: male
Age: 49
Warnings:
I don't use or play VC2 but I do have it installed on my computer.
I am a 1.6 player and map editor only. If I do have vc2 scripts and using them!! I don't know...
what files are in my DEV folder are what I have downloaded given to me or if the editor said it
was missing a file I would search my computer find the file and put it where it needs to be.
if in doing that I have put vc2 scripts in my dev folder/folders then I need to correct this.
I don't really want to have to reinstall my game as to reinstall the dev editor
but it looks like if thats what I have to do to correct this then so be it...
would be so much faster and simpler if I just had the correct files zipped
so I can download them.
cheers
Signature Don't spend your time lookin' around for something you want that can't be found
techno
Posted on 13-06-2011 17:42
Offline
Member
Posts: 197
Joined: 26.04.11
Location: Northern NSW
Gender: male
Age: 49
Warnings:
I have re-installed my game and editor, will let you know if still having problems when i test it again. at the moment having another problem with 3dmax
Signature Don't spend your time lookin' around for something you want that can't be found
KostiCZ
Posted on 13-06-2011 19:21
Offline
Moderator
Posts: 1091
Joined: 15.03.11
Gender: male
Age: 48
Warnings:
techno wrote:
I have re-installed my game and editor, will let you know if still having problems when i test it again. at the moment having another problem with 3dmax
I just returned from fhopping and now preparing dinner. I have problem also - not parking place near house.
techno, don't post here everything you are doing, just result. I always see here is a new post, click here and ... nothing useful.
Less can be more sometimes.
Signature ________________________________________________
2LT William Theolinus "KostiCZ" Boner Jr.
LRRP Squad Baker, Delta Team
techno
Posted on 27-12-2011 15:11
Offline
Member
Posts: 197
Joined: 26.04.11
Location: Northern NSW
Gender: male
Age: 49
Warnings:
New topic Along the same lines as this topic, thought is would be better to post it here.
I have already made maps with what I call CTFDM but I was asked by my members
if I could make a map with DMCTF meaning you spawn like DM and have to find a rifle but the game is CTF.
How would I edit my script from CTFDM to spawn with no rifle?
Silent Bob
Posted on 27-12-2011 15:37
Offline
Admin
Posts: 931
Joined: 07.03.11
Location: Austria
Gender: male
Age: 48
Warnings:
Kermit created a mode called ctfrevolver...that could be usefull for you!
Spoiler: [Show Hide ]
Code
/*
Eric multiplayer script - CTF
*/
#include <inc\sc_global.h>
#include <inc\sc_def.h>
#define NORECOV_TIME 3.0f // disable time of recoverplace after recovering someone there
#define ONGROUND_MAXTIME 30.0f
#define REC_WPNAME_US "USSpawn%d"
#define REC_WPNAME_VC "VCSpawn%d"
#define REC_MAX 64
#define GVAR_SIDE0POINTS 500
#define GVAR_SIDE1POINTS 501
#define GVAR_FLAGSTATUS 510
#define GVAR_ONPLAYER 512
#define GVAR_INFO 514
#define GVAR_GAMERUNS 516
#define GVAR_SCOREPL 517
#define GVAR_LAST 519
#define FLAG_PH_INBASE 0
#define FLAG_PH_ONPLAYER 1
#define FLAG_PH_ONGROUND 2
#define PRELOADBES_FLAG_US 1
#define PRELOADBES_FLAG_VC 2
#define INFO_FL_STOLEN 1
#define INFO_FL_DROPPED 2
#define INFO_FL_RETURNED 3
#define INFO_SCORE 4
BOOL gMission_started = FALSE;
float gMission_afterstart_time = 0.0f;
float gMission_starting_timer = 0.0f;
dword gRecs[2] = {0,0};
s_SC_MP_Recover gRec[2][REC_MAX];
float gRecTimer[2][REC_MAX];
float gNextRecover = 0.0f;
int gSidePoints[2] = {0,0};
int gCLN_SidePoints[2];
float gCLN_HelpInfo_timer = 0.0f;
ushort gCLN_HelpInfo[256];
dword gEndRule;
dword gEndValue;
float gTime;
dword abl_lists = 0;
dword abl_list[64];
#if _GE_VERSION_ >= 138
dword g_FPV_UsFlag = 0;
dword g_FPV_VcFlag = 0;
#endif
BOOL SRV_CheckEndRule(float time){
switch(gEndRule){
case SC_MP_ENDRULE_TIME:
if (gMission_started) gTime += time;
SC_MP_EndRule_SetTimeLeft(gTime,gMission_started);
if (gTime>gEndValue){
SC_MP_LoadNextMap();
return TRUE;
}
break;
case SC_MP_ENDRULE_POINTS:
if ((gSidePoints[0]>=gEndValue)||(gSidePoints[1]>=gEndValue)){
SC_MP_LoadNextMap();
return TRUE;
}
break;
default:
SC_message("EndRule unsopported: %d",gEndRule);
break;
}// switch(gEndRule)
return FALSE;
}// void SRV_CheckEndRule(float time)
float GetRecovTime(void){
float val;
s_SC_MP_SRV_AtgSettings set;
SC_MP_SRV_GetAtgSettings(&set);
if (set.ctf_respawntime>1.0f){
return set.ctf_respawntime;
}
val = SC_ggf(400);
if (val==0) val = 30;
return val;
}
float GetRecovLimitTime(void){
float val;
s_SC_MP_SRV_AtgSettings set;
SC_MP_SRV_GetAtgSettings(&set);
if (set.ctf_respawntime>1.0f){
return set.ctf_respawntime / 4.0f;
}
val = SC_ggf(401);
if (val==0){
val = GetRecovTime()/4.0f;
}
return val;
}
void UpdateSidePoints(void){
SC_sgi(GVAR_SIDE0POINTS,gSidePoints[0]);
SC_sgi(GVAR_SIDE1POINTS,gSidePoints[1]);
}// void UpdateSidePoints(void)
void *gFlagNod[2];
c_Vector3 gOrigFlagPos[2];
dword gFlagPhase[2] = {FLAG_PH_INBASE,FLAG_PH_INBASE}; // FLAG_PH_
dword gFlagOnPlayer_handle[2] = {0,0}; // handle of player
dword gInfo[2] = {0,0}; // INFO_xxxxx
dword gOnGroundNetID[2] = {0,0};
float gOnGroundTimer[2] = {0,0};
dword gInfoLastScorePlayer[2] = {0,0};
dword gSend_InfoLastScorePlayer[2] = {0,0};
dword gSend_FlagPhase[2];
dword gSend_FlagOnPlayer[2];
dword gSend_Info[2];
dword gCLN_FlagPhase[2];
dword gCLN_FlagOnPlayer[2];
dword gCLN_Info[2];
dword gCLN_eqp_pl_handle[2] = {0,0};
float gCLN_MyFlagTimer = 0.0f;
char *gEQP_name[2] = {
{"G\\WEAPONS\\Vvh_flag\\eqp\\Vvh_flag_US_3pv.eqp"},
{"G\\WEAPONS\\Vvh_flag\\eqp\\Vvh_flag_VC_3pv.eqp"}
};
void SRV_ChechSendStatus(void){
dword i;
for (i=0;i<2;i++){
if (gFlagPhase[i]!=gSend_FlagPhase[i]){
gSend_FlagPhase[i] = gFlagPhase[i];
SC_sgi(GVAR_FLAGSTATUS+i,gSend_FlagPhase[i]);
}
if (gSend_FlagOnPlayer[i]!=gFlagOnPlayer_handle[i]){
gSend_FlagOnPlayer[i] = gFlagOnPlayer_handle[i];
SC_sgi(GVAR_ONPLAYER+i,gFlagOnPlayer_handle[i]);
}
if (gInfoLastScorePlayer[i]!=gSend_InfoLastScorePlayer[i]){
gSend_InfoLastScorePlayer[i] = gInfoLastScorePlayer[i];
SC_sgi(GVAR_SCOREPL+i,gSend_InfoLastScorePlayer[i]);
}
if (gSend_Info[i]!=gInfo[i]){
gSend_Info[i] = gInfo[i];
SC_sgi(GVAR_INFO+i,gSend_Info[i]);
}// if (gInfo[i]!=gSend_Info[i])
}// for (i)
}// void SRV_ChechSendStatus(void)
void CLN_SetOnPlayerEqp(dword side, dword onplayer){
dword handle,plid,pc;
s_SC_P_getinfo pl_info;
handle = SC_MP_GetHandleofPl(onplayer);
if (handle!=gCLN_eqp_pl_handle[side]){
// need change
if (gCLN_eqp_pl_handle[side]){
plid = SC_MP_GetPlofHandle(gCLN_eqp_pl_handle[side]);
if (plid) SC_P_UnLink3pvEqp(plid,0);
}
gCLN_eqp_pl_handle[side] = handle;
if (handle){
SC_P_Link3pvEqp(onplayer,0,PRELOADBES_FLAG_US+side,gEQP_name[side]);
}
pc = SC_PC_Get();
if (pc){
SC_P_GetInfo(pc,&pl_info);
if (pl_info.side!=side){
//SC_MP_HUD_SelectPl(onplayer,0x40888888);
if (onplayer){
gCLN_HelpInfo_timer = 5.0f;
swprintf(gCLN_HelpInfo,SC_Wtxt(1130),SC_P_GetName(onplayer));
}
}
}
//else
// SC_MP_HUD_SelectPl(0,0);
}//if (handle!=gCLN_eqp_pl_handle[side])
}// void CLN_SetOnPlayerEqp(dword side, dword onplayer)
void ResetMission(void){
dword i;
for (i=0;i<2;i++){
switch(gFlagPhase[i]){
case FLAG_PH_INBASE:
break;
case FLAG_PH_ONGROUND:
gInfo[i] = INFO_FL_RETURNED;
gFlagPhase[i] = FLAG_PH_INBASE;
SC_SRV_Item_Release(gOnGroundNetID[i]);
gOnGroundNetID[i] = 0;
break;
case FLAG_PH_ONPLAYER:
gFlagOnPlayer_handle[i] = 0;
gFlagPhase[i] = FLAG_PH_INBASE;
gInfo[i] = INFO_FL_RETURNED;
break;
}// switch(gFlagPhase[i])
}// for (i)
}// void ResetMission(void)
void Check_ABL(dword pl_handle){
int val;
dword to_change;
s_SC_P_getinfo info;
if (!SC_MP_SRV_GetAutoTeamBalance()) return;
val = SC_MP_SRV_GetTeamsNrDifference(TRUE);
if ((val<3)&&(val>-3)) return; // no big difference
SC_P_GetInfo(pl_handle,&info);
if ((info.side==0)&&(val>0)) to_change = 1;
else
if ((info.side==1)&&(val<0)) to_change = 0;
else
return;
SC_MP_SRV_P_SetSideClass(pl_handle,to_change,4 + 20*to_change);
if (abl_lists<64){
abl_list[abl_lists] = pl_handle;
abl_lists++;
}
}// void Check_ABL(dword pl_handle)
int ScriptMain(s_SC_NET_info *info){
char txt[128],*itxt;
ushort wtxt[128],wtxt2[64],*witxt;
dword i,j,pl_id,pl_val;
s_SC_MP_Recover *precov;
s_SC_MP_hud hudinfo;
s_SC_P_getinfo plinfo;
void *nod;
c_Vector3 vec,vec2;
BOOL valid,inbase;
float pl_dist;
s_SC_HUD_MP_icon icon[2];
s_SC_MP_EnumPlayers enum_pl[64];
BOOL side[2];
s_SC_MP_SRV_settings SRVset;
float val,valy;
#if _GE_VERSION_ >= 138
s_SC_FpvMapSign fpv_list[2];
#endif
switch(info->message){
case SC_NET_MES_SERVER_TICK:
if (SRV_CheckEndRule(info->elapsed_time)) break;
side[0] = side[1] = FALSE;
j = 64;
if (SC_MP_EnumPlayers(enum_pl,&j,SC_MP_ENUMPLAYER_SIDE_ALL)){
if ((j==0)&&((gSidePoints[0]+gSidePoints[1])!=0)){
gSidePoints[0] = 0;
gSidePoints[1] = 0;
UpdateSidePoints();
}// if ((side[0]+side[1])==0)
for (i=0;i<j;i++)
if (enum_pl[i].status!=SC_MP_P_STATUS_NOTINGAME){
if (enum_pl[i].side<2) side[enum_pl[i].side] = TRUE;
}// if (enum_pl[i].status==SC_MP_P_STATUS_INGAME)
gMission_starting_timer -= info->elapsed_time;
if ((side[0])&&(side[1])){
SC_MP_SetInstantRecovery(FALSE);
if (!gMission_started){
gMission_started = TRUE;
gMission_afterstart_time = 0.0f;
SC_sgi(GVAR_GAMERUNS,gMission_started);
ResetMission();
SC_MP_SRV_InitGameAfterInactive();
SC_MP_RecoverAllNoAiPlayers();
gMission_starting_timer = 8.0f;
}
}// if ((side[0])&&(side[1]))
else{
if (gMission_starting_timer<=0.0f){
SC_MP_SetInstantRecovery(TRUE);
if (gMission_started){
gMission_started = FALSE;
gMission_afterstart_time = 0.0f;
SC_sgi(GVAR_GAMERUNS,gMission_started);
ResetMission();
}
}
}// else if ((side[0])&&(side[1]))
}// if (SC_MP_EnumPlayers(enum_pl,&j,SC_MP_ENUMPLAYER_SIDE_ALL))
for (j=0;j<2;j++)
for (i=0;i<gRecs[j];i++)
gRecTimer[j][i] -= info->elapsed_time;
gNextRecover -= info->elapsed_time;
if (gNextRecover<0.0f) gNextRecover = GetRecovTime();
if (gMission_started){
for (i=0;i<2;i++){
valid = FALSE;
switch(gFlagPhase[i]){
case FLAG_PH_INBASE:
in_base:
vec = gOrigFlagPos[i];
valid = TRUE;
break;
case FLAG_PH_ONGROUND:
if (SC_Item_GetPos(gOnGroundNetID[i],&vec)) valid = TRUE;
else gOnGroundTimer[i] = 0.0f;
gOnGroundTimer[i] -= info->elapsed_time;
if (gOnGroundTimer[i]<0.0f){
gInfo[i] = INFO_FL_RETURNED;
gFlagPhase[i] = FLAG_PH_INBASE;
SC_SRV_Item_Release(gOnGroundNetID[i]);
gOnGroundNetID[i] = 0;
valid = FALSE;
}// if (gOnGroundTimer[i]<0.0f)
break;
case FLAG_PH_ONPLAYER:
pl_id = SC_MP_GetPlofHandle(gFlagOnPlayer_handle[i]);
if (!pl_id){
gFlagOnPlayer_handle[i] = 0;
gFlagPhase[i] = FLAG_PH_INBASE;
goto in_base;
}// if (!pl_id)
SC_P_GetInfo(pl_id,&plinfo);
if (plinfo.side==i){
gFlagOnPlayer_handle[i] = 0;
gFlagPhase[i] = FLAG_PH_INBASE;
goto in_base;
}
SC_P_GetPos(pl_id,&vec);
if (gFlagPhase[1-i]==FLAG_PH_INBASE){
vec2 = gOrigFlagPos[1-i];
if (SC_IsNear3D(&vec,&vec2,1.5f)){
SC_P_MP_AddPoints(pl_id,1);
gSidePoints[1-i]++;
UpdateSidePoints();
gInfo[i] = INFO_SCORE;
gInfoLastScorePlayer[i] = gFlagOnPlayer_handle[i];
gFlagPhase[i] = FLAG_PH_INBASE;
gFlagOnPlayer_handle[i] = 0;
}
}// if (gFlagPhase[1-i]==FLAG_PH_INBASE)
break;
}// switch(gFlagPhase[i])
gMission_afterstart_time += info->elapsed_time;
if ((gMission_afterstart_time>5.0f)&&(valid)){
j = SC_GetNearestPlayer(&vec,&pl_dist);
if ((j)&&(pl_dist<1.5f)){
SC_P_GetInfo(j,&plinfo);
switch(gFlagPhase[i]){
case FLAG_PH_INBASE:
if (plinfo.side!=i){
gInfo[i] = INFO_FL_STOLEN;
gFlagPhase[i] = FLAG_PH_ONPLAYER;
gFlagOnPlayer_handle[i] = SC_MP_GetHandleofPl(j);
}
break;
case FLAG_PH_ONGROUND:
if (plinfo.side!=i){
gInfo[i] = INFO_FL_STOLEN;
gFlagPhase[i] = FLAG_PH_ONPLAYER;
gFlagOnPlayer_handle[i] = SC_MP_GetHandleofPl(j);
}
else{
gInfo[i] = INFO_FL_RETURNED;
gFlagPhase[i] = FLAG_PH_INBASE;
}
SC_SRV_Item_Release(gOnGroundNetID[i]);
gOnGroundNetID[i] = 0;
break;
}// switch(gFlagPhase[i])
}// if ((j)&&(pl_dist<1.0f))
}// if (valid)
}// for (i) - for both flags
}// if (gMission_started)
SRV_ChechSendStatus();
break;
case SC_NET_MES_CLIENT_TICK:
if (SC_P_IsReady(SC_PC_Get())){
switch(SC_P_GetCurWeap(SC_PC_Get()))
{
case 0: //niks??
case 29: //knife
case 30: //vc knife
case 10: //revolver
case 12: //winchester
case 26: //mosin
case 58: //map
break;
default:
SC_P_ChangeWeapon(SC_PC_Get(),1,10);
SC_P_SetSelWeapon(SC_PC_Get(),1);
//SC_P_ChangeWeapon(SC_PC_Get(),0,0);
//SC_P_ChangeWeapon(SC_PC_Get(),2,0);
//SC_P_ChangeWeapon(SC_PC_Get(),3,0);
SC_P_ChangeWeapon(SC_PC_Get(),4,0);
SC_P_ChangeWeapon(SC_PC_Get(),5,0);
//SC_P_ChangeWeapon(SC_PC_Get(),6,0);
//SC_P_ChangeWeapon(SC_PC_Get(),7,0);
//SC_P_ChangeWeapon(SC_PC_Get(),8,0);
break;
}
}
if (gCLN_HelpInfo_timer>0.0f){
gCLN_HelpInfo_timer -= info->elapsed_time;
}
pl_id = SC_PC_Get();
for (i=0;i<2;i++){
gCLN_SidePoints[i] = SC_ggi(GVAR_SIDE0POINTS+i);
SC_MP_SetSideStats(i,0,gCLN_SidePoints[i]);
gCLN_FlagPhase[i] = SC_ggi(GVAR_FLAGSTATUS+i);
gCLN_FlagOnPlayer[i] = SC_MP_GetPlofHandle(SC_ggi(GVAR_ONPLAYER+i));
j = SC_ggi(GVAR_INFO+i);
if (j!=gCLN_Info[i]){
gCLN_Info[i] = j;
switch(j){
case INFO_FL_STOLEN:
swprintf(wtxt,SC_AnsiToUni("%s %s",wtxt2),SC_Wtxt(1010+i),SC_Wtxt(1067));
// play sound
if (gCLN_FlagOnPlayer[i]==SC_PC_Get()){
SC_SND_PlaySound2D(10424);
}
else{
SC_SND_PlaySound2D(10425);
}
break;
case INFO_FL_DROPPED:swprintf(wtxt,SC_AnsiToUni("%s %s",wtxt2),SC_Wtxt(1010+i),SC_Wtxt(1068));break;
case INFO_FL_RETURNED:swprintf(wtxt,SC_AnsiToUni("%s %s",wtxt2),SC_Wtxt(1010+i),SC_Wtxt(1069));break;
case INFO_SCORE:
// improve message, add player name
pl_val = SC_ggi(GVAR_SCOREPL+i);
pl_val = SC_MP_GetPlofHandle(pl_val);
if (pl_val)
swprintf(wtxt,SC_AnsiToUni("%s (%S) %s",wtxt2),SC_Wtxt(1011-i),SC_P_GetName(pl_val),SC_Wtxt(1070));
else
swprintf(wtxt,SC_AnsiToUni("%s %s",wtxt2),SC_Wtxt(1011-i),SC_Wtxt(1070));
// play sound
SC_SND_PlaySound2D(11116+i);
break;
}// switch(j)
SC_GameInfoW(wtxt);
}// if (j!=gCLNd_Info[i])
if ((pl_id)&&(gCLN_FlagOnPlayer[i]==pl_id)){
gCLN_MyFlagTimer += info->elapsed_time;
while (gCLN_MyFlagTimer > 1.0f) gCLN_MyFlagTimer -= 1.0f;
if (gCLN_MyFlagTimer>0.5f) icon[i].color = (dword)(511.0f * (gCLN_MyFlagTimer-0.5f));
else icon[i].color = (dword)(511.0f * (0.5f-gCLN_MyFlagTimer));
icon[i].color <<= 24;
icon[i].color += 0x00ffffff;
}
else
icon[i].color = 0xffffffff;
icon[i].type = SC_HUD_MP_ICON_TYPE_NUMBER;
icon[i].icon_id = 3*i;
icon[i].value = gCLN_SidePoints[i];
j = 0;
switch(gCLN_FlagPhase[i]){
case FLAG_PH_INBASE:
inbase = TRUE;
break;
case FLAG_PH_ONPLAYER:
icon[i].icon_id+=1;
inbase = FALSE;
j = gCLN_FlagOnPlayer[i];
break;
case FLAG_PH_ONGROUND:
icon[i].icon_id+=2;
inbase = FALSE;
break;
}// switch(gCLN_FlagPhase[i])
CLN_SetOnPlayerEqp(i,j);
SC_DUMMY_Set_DoNotRenHier2(gFlagNod[i],!inbase);
}// for (i)
SC_MP_SetIconHUD(icon,2);
#if _GE_VERSION_ >= 138
fpv_list[0].color = 0xffffffff;
fpv_list[0].scale = 1.0f;
fpv_list[0].id = g_FPV_UsFlag;
fpv_list[0].pos = gOrigFlagPos[0];
fpv_list[1].color = 0xffffffff;
fpv_list[1].scale = 1.0f;
fpv_list[1].id = g_FPV_VcFlag;
fpv_list[1].pos = gOrigFlagPos[1];
SC_MP_FpvMapSign_Set(2,fpv_list);
#endif
break;// SC_NET_MES_CLIENT_TICK
case SC_NET_MES_LEVELPREINIT:
SC_sgi(GVAR_MP_MISSIONTYPE,GVAR_MP_MISSIONTYPE_CTF);
gEndRule = info->param1;
gEndValue = info->param2;
gTime = 0.0f;
SC_MP_EnableBotsFromScene(FALSE);
break;// SC_NET_MES_LEVELPREINIT
case SC_NET_MES_LEVELINIT:
#if _GE_VERSION_ >= 138
g_FPV_UsFlag = SC_MP_FpvMapSign_Load("g\\weapons\\Vvh_map\\icons\\MPIC_USflag.BES");
g_FPV_VcFlag = SC_MP_FpvMapSign_Load("g\\weapons\\Vvh_map\\icons\\MPIC_VCflag.BES");
#endif
SC_MP_SRV_SetForceSide(0xffffffff);
SC_MP_SetChooseValidSides(3);
SC_MP_SRV_SetClassLimitsForDM();
/*
SC_MP_SRV_SetClassLimit(18,0);
SC_MP_SRV_SetClassLimit(19,0);
SC_MP_SRV_SetClassLimit(39,0);
//soldier
SC_MP_SRV_SetClassLimit(1,0);
SC_MP_SRV_SetClassLimit(21,0);
//machinegunner
SC_MP_SRV_SetClassLimit(2,0);
SC_MP_SRV_SetClassLimit(22,0);
//sniper
SC_MP_SRV_SetClassLimit(3,0);
SC_MP_SRV_SetClassLimit(23,0);
//medic
SC_MP_SRV_SetClassLimit(4,0xffffffff);
SC_MP_SRV_SetClassLimit(24,0xffffffff);
//engineer
SC_MP_SRV_SetClassLimit(5,0);
SC_MP_SRV_SetClassLimit(25,0);
//radio
SC_MP_SRV_SetClassLimit(6,0);
SC_MP_SRV_SetClassLimit(26,0);
*/
CLEAR(hudinfo);
hudinfo.title = 1071;
hudinfo.sort_by[0] = SC_HUD_MP_SORTBY_POINTS;
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_POINTS | SC_HUD_MP_PL_MASK_KILLS | SC_HUD_MP_PL_MASK_DEATHS;
hudinfo.use_sides = TRUE;
hudinfo.side_name[0] = 1010;
hudinfo.side_color[0] = 0x440000ff;
hudinfo.side_name[1] = 1011;
hudinfo.side_color[1] = 0x44ff0000;
hudinfo.side_mask = SC_HUD_MP_SIDE_MASK_POINTS;
SC_MP_HUD_SetTabInfo(&hudinfo);
SC_MP_AllowStPwD(TRUE);
SC_MP_AllowFriendlyFireOFF(TRUE);
SC_MP_SetItemsNoDisappear(FALSE);
gMission_started = FALSE;
if (info->param2){
// preload flag items
SC_Item_Preload(145);
SC_Item_Preload(146);
// preload flag eqp items
SC_PreloadBES(PRELOADBES_FLAG_US,"G\\WEAPONS\\Vvh_flag\\Vvh_flag_US_3pv.BES");
SC_PreloadBES(PRELOADBES_FLAG_VC,"G\\WEAPONS\\Vvh_flag\\Vvh_flag_VC_3pv.BES");
nod = SC_NOD_Get(NULL,"flag_us");
if (!nod) SC_message("US flag not found 01");
gFlagNod[0] = SC_NOD_Get(nod,"Vlajka US");
if (!gFlagNod[0]) SC_message("VC flag not found 01");
SC_NOD_GetWorldPos(nod,&gOrigFlagPos[0]);
nod = SC_NOD_Get(NULL,"flag_vc");
if (!nod) SC_message("VC flag not found 01");
gFlagNod[1] = SC_NOD_Get(nod,"Vlajka VC");
if (!gFlagNod[1]) SC_message("VC flag not found 02");
SC_NOD_GetWorldPos(nod,&gOrigFlagPos[1]);
if (info->param1){
// it's server
SC_MP_Gvar_SetSynchro(GVAR_SIDE0POINTS);
SC_MP_Gvar_SetSynchro(GVAR_SIDE1POINTS);
UpdateSidePoints();
SC_MP_Gvar_SetSynchro(GVAR_GAMERUNS);
SC_sgi(GVAR_GAMERUNS,0);
for (i=0;i<2;i++){
SC_MP_Gvar_SetSynchro(GVAR_FLAGSTATUS+i);
SC_sgi(GVAR_FLAGSTATUS+i,FLAG_PH_INBASE);
SC_MP_Gvar_SetSynchro(GVAR_ONPLAYER+i);
SC_sgi(GVAR_ONPLAYER+i,0);
SC_MP_Gvar_SetSynchro(GVAR_INFO+i);
SC_sgi(GVAR_ONPLAYER+i,0);
SC_MP_Gvar_SetSynchro(GVAR_SCOREPL+i);
SC_sgi(GVAR_SCOREPL+i,0);
}
CLEAR(gRecs);
for (i=0;i<REC_MAX;i++){
sprintf(txt,REC_WPNAME_US,i);
if (SC_NET_FillRecover(&gRec[0][gRecs[0]],txt)) gRecs[0]++;
}
#if _GE_VERSION_ >= 133
i = REC_MAX - gRecs[0];
SC_MP_GetRecovers(SC_MP_RESPAWN_CTF_US,&gRec[0][gRecs[0]],&i);
gRecs[0] += i;
#endif
SC_Log(3,"CTF respawns us: %d",gRecs[0]);
if (gRecs[0]==0) SC_message("no US recover place defined!");
for (i=0;i<REC_MAX;i++){
sprintf(txt,REC_WPNAME_VC,i);
if (SC_NET_FillRecover(&gRec[1][gRecs[1]],txt)) gRecs[1]++;
}
#if _GE_VERSION_ >= 133
i = REC_MAX - gRecs[1];
SC_MP_GetRecovers(SC_MP_RESPAWN_CTF_VC,&gRec[1][gRecs[1]],&i);
gRecs[1] += i;
#endif
SC_Log(3,"CTF respawns vc: %d",gRecs[1]);
if (gRecs[1]==0) SC_message("no VC recover place defined!");
CLEAR(gRecTimer);
}// if (info->param1)
}//if (info->param2)
break;// SC_NET_MES_LEVELINIT
case SC_NET_MES_RENDERHUD:
witxt = NULL;
if (SC_ggi(GVAR_GAMERUNS)){
if (gCLN_HelpInfo_timer>0.0f){
witxt = gCLN_HelpInfo;
}
}
else{
witxt = SC_Wtxt(101);
}
if (witxt){
SC_GetScreenRes(&val,&valy);
val -= SC_Fnt_GetWidthW(witxt,1);
valy = 15;
SC_Fnt_WriteW(val * 0.5f,valy,witxt,1,0xffffffff);
}//if (i)
break;
case SC_NET_MES_SERVER_RECOVER_TIME:
if (info->param2){
info->fval1 = 0.1f;
}
else{
// killed
if (gMission_started){
for (i=0;i<abl_lists;i++)
if (info->param1==abl_list[i]){
abl_lists--;
abl_list[i] = abl_list[abl_lists];
break;
}
if (i<abl_lists){
info->fval1 = 0.1f;
}
else{
if (gNextRecover>GetRecovLimitTime()) info->fval1 = gNextRecover;
else info->fval1 = gNextRecover + GetRecovTime();
}
}
else info->fval1 = 3.0f;
}
break;
case SC_NET_MES_SERVER_RECOVER_PLACE:
precov = (s_SC_MP_Recover*)info->param2;
i = SC_MP_SRV_GetBestDMrecov(gRec[info->param1],gRecs[info->param1],gRecTimer[info->param1],NORECOV_TIME);
gRecTimer[info->param1][i] = NORECOV_TIME;
*precov = gRec[info->param1][i];
break;
case SC_NET_MES_SERVER_KILL:
for (i=0;i<2;i++){
pl_id = SC_MP_GetPlofHandle(gFlagOnPlayer_handle[i]);
if (info->param1==pl_id){
// killed player with flag
gInfo[i] = INFO_FL_DROPPED;
SC_P_GetPos(pl_id,&vec);
vec.z += 0.6f;
gOnGroundNetID[i] = SC_Item_Create(145+i,&vec);
gOnGroundTimer[i] = ONGROUND_MAXTIME;
gFlagPhase[i] = FLAG_PH_ONGROUND;
gFlagOnPlayer_handle[i] = 0;
}// if (info->param1==pl_id)
}// for (i)
Check_ABL(info->param1);
break;// SC_NET_MES_SERVER_KILL
case SC_NET_MES_RESTARTMAP:
CLEAR(gSidePoints);
UpdateSidePoints();
gMission_afterstart_time = 0.0f;
gMission_starting_timer = 0.0f;
gTime = 0;
SC_MP_SetInstantRecovery(TRUE);
if (gMission_started){
gMission_started = FALSE;
SC_sgi(GVAR_GAMERUNS,gMission_started);
}
SC_MP_SRV_ClearPlsStats();
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)
This part of the script is the important one:
Spoiler: [Show Hide ]
Code
case SC_NET_MES_CLIENT_TICK:
if (SC_P_IsReady(SC_PC_Get())){
switch(SC_P_GetCurWeap(SC_PC_Get()))
{
case 0: //niks??
case 29: //knife
case 30: //vc knife
case 10: //revolver
case 12: //winchester
case 26: //mosin
case 58: //map
break;
default:
SC_P_ChangeWeapon(SC_PC_Get(),1,10);
SC_P_SetSelWeapon(SC_PC_Get(),1);
//SC_P_ChangeWeapon(SC_PC_Get(),0,0);
//SC_P_ChangeWeapon(SC_PC_Get(),2,0);
//SC_P_ChangeWeapon(SC_PC_Get(),3,0);
SC_P_ChangeWeapon(SC_PC_Get(),4,0);
SC_P_ChangeWeapon(SC_PC_Get(),5,0);
//SC_P_ChangeWeapon(SC_PC_Get(),6,0);
//SC_P_ChangeWeapon(SC_PC_Get(),7,0);
//SC_P_ChangeWeapon(SC_PC_Get(),8,0);
break;
}
KostiCZ
Posted on 27-12-2011 16:23
Offline
Moderator
Posts: 1091
Joined: 15.03.11
Gender: male
Age: 48
Warnings:
techno wrote:
New topic Along the same lines as this topic, thought is would be better to post it here.
I have already made maps with what I call CTFDM but I was asked by my members
if I could make a map with DMCTF meaning you spawn like DM and have to find a rifle but the game is CTF.
How would I edit my script from CTFDM to spawn with no rifle?
Disable all classes except DM class. Check SDK for:
SC_MP_SRV_SetClassLimitsForDM();
SC_MP_SRV_SetClassLimit(...);
for example
SC_MP_SRV_SetClassLimit(19, 64); // US DM
SC_MP_SRV_SetClassLimit(39, 64); // VC DM
will set 64 players limit for DM class (player with pistol and nades only). But you need to disable all another classes.. for example 1 - US soldier, 3 - US sniper, 21 - VC soldier... etc.
Edited by KostiCZ on 27-12-2011 16:24
Signature ________________________________________________
2LT William Theolinus "KostiCZ" Boner Jr.
LRRP Squad Baker, Delta Team
x 1
Jump to Forum:
Vietcong @ESL
Vietcong Tech Talk
Maps & Mapping
General Discussion
Vietcong 2 Tech Talk
General Discussion
Maps & Mapping
Allgemeines Diskussionsforum
Vietcong 2 Allgemeines Diskussionsforum
Not a member yet?
Click here to register.
Forgotten your password?
Request a new one
here .