· Guests Online: 3
· Members Online: 0
· Total Members: 1,134
· Newest Member: Brody
·
hackepter01:03:34
·
GONZO17:58:05
·
Intruder18:24:48
·
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 29-12-2011 12:56
Offline
Member
Posts: 197
Joined: 26.04.11
Location: Northern NSW
Gender: male
Age: 49
Warnings:
This is my part of coding
SC_MP_SRV_SetClassLimit(18,0);
SC_MP_SRV_SetClassLimit(19,0);
SC_MP_SRV_SetClassLimit(39,0);
SC_MP_GetSRVsettings(&SRVset);
for (i=0;i<6;i++){
SC_MP_SRV_SetClassLimit(i+1,SRVset.atg_class_limit[i]);
SC_MP_SRV_SetClassLimit(i+21,SRVset.atg_class_limit[i]);
}// for (i)
do I change it to
SC_MP_SRV_SetClassLimit();
SC_MP_SRV_SetClassLimit();
SC_MP_SRV_SetClassLimit();
SC_MP_GetSRVsettings(&SRVset);
for (i=0;i<6;i++){
SC_MP_SRV_SetClassLimit(i+1,SRVset.atg_class_limit[i]);
SC_MP_SRV_SetClassLimit(i+21,SRVset.atg_class_limit[i]);
}// for (i)
Signature Don't spend your time lookin' around for something you want that can't be found
KostiCZ
Posted on 29-12-2011 18:13
Offline
Moderator
Posts: 1091
Joined: 15.03.11
Gender: male
Age: 48
Warnings:
Lol, try it, but it will not work :-)
SetClassLimit need 2 parameters, first is number of class (19 is US DM class, 39 is VC DM class), second number is allowed number of players, so you can put 64 there. Also you need to disable all other classes (set 0 players for these classes)
Signature ________________________________________________
2LT William Theolinus "KostiCZ" Boner Jr.
LRRP Squad Baker, Delta Team
techno
Posted on 29-12-2011 19:38
Offline
Member
Posts: 197
Joined: 26.04.11
Location: Northern NSW
Gender: male
Age: 49
Warnings:
KostiCZ wrote:
Lol, try it, but it will not work :-)
SetClassLimit need 2 parameters, first is number of class (19 is US DM class, 39 is VC DM class), second number is allowed number of players, so you can put 64 there. Also you need to disable all other classes (set 0 players for these classes)
Thankyou
Where do I find the settings to disable the other classes.
for example
1 - US soldier,
3 - US sniper,
21 - VC soldier... etc.
I added the code you posted and it works but as you already know I now have DM and all other classes.
this is my code
SC_MP_SRV_SetClassLimit(18,0);
SC_MP_SRV_SetClassLimit(19, 64); // US DM
SC_MP_SRV_SetClassLimit(39, 64); // VC DM
Signature Don't spend your time lookin' around for something you want that can't be found
Ando
Posted on 29-12-2011 20:18
Offline
Moderator
Posts: 294
Joined: 17.03.11
Gender: male
Warnings:
Just add limit for every class you need.
Example:
SC_MP_SRV_SetClassLimit(1,0);//1 - Soldier - US
SC_MP_SRV_SetClassLimit(2,0);//2 - gunner - US
SC_MP_SRV_SetClassLimit(3,0);//3 - Sniper - US
SC_MP_SRV_SetClassLimit(4,0);//4 - Medic - US
SC_MP_SRV_SetClassLimit(5,0);//5 - Engineer - US
SC_MP_SRV_SetClassLimit(6,0);//6 - Radioman - US
SC_MP_SRV_SetClassLimit(21,0);//21 - Soldier - VC
SC_MP_SRV_SetClassLimit(22,0);//22 - gunner - VC
SC_MP_SRV_SetClassLimit(23,0);//23 - Sniper - VC
SC_MP_SRV_SetClassLimit(24,0);//24 - Medic - VC
SC_MP_SRV_SetClassLimit(25,0);//25 - Engineer - VC
SC_MP_SRV_SetClassLimit(26,0);//26 - Radioman - VC
x 1
KostiCZ
Posted on 29-12-2011 21:24
Offline
Moderator
Posts: 1091
Joined: 15.03.11
Gender: male
Age: 48
Warnings:
Yep, don't forget to disable US pilot - number 18
Signature ________________________________________________
2LT William Theolinus "KostiCZ" Boner Jr.
LRRP Squad Baker, Delta Team
x 1
techno
Posted on 30-12-2011 04:41
Offline
Member
Posts: 197
Joined: 26.04.11
Location: Northern NSW
Gender: male
Age: 49
Warnings:
SC_MP_SRV_SetClassLimit(1,0); //1 - Soldier - US
SC_MP_SRV_SetClassLimit(2,0); //2 - gunner - US
SC_MP_SRV_SetClassLimit(3,0); //3 - Sniper - US
SC_MP_SRV_SetClassLimit(4,0); //4 - Medic - US
SC_MP_SRV_SetClassLimit(5,0); //5 - Engineer - US
SC_MP_SRV_SetClassLimit(6,0); //6 - Radioman - US
SC_MP_SRV_SetClassLimit(21,0); //21 - Soldier - VC
SC_MP_SRV_SetClassLimit(22,0); //22 - gunner - VC
SC_MP_SRV_SetClassLimit(23,0); //23 - Sniper - VC
SC_MP_SRV_SetClassLimit(24,0); //24 - Medic - VC
SC_MP_SRV_SetClassLimit(25,0); //25 - Engineer - VC
SC_MP_SRV_SetClassLimit(26,0); //26 - Radioman - VC
SC_MP_SRV_SetClassLimit(18,0); //18 -
SC_MP_SRV_SetClassLimit(19, 20); // US DM
SC_MP_SRV_SetClassLimit(39, 20); // VC DM
Thanks Ando for that. makes sense now to do it as you posted here.
but I still get all the other classes.
I am using the script you posted here http://www.vietcong.info/portal/forum/viewthread.php?thread_id=325&pid=4006#post_4006
instead of my old one so that it includes the flashlight.
What else needs changing or removing?
Signature Don't spend your time lookin' around for something you want that can't be found
Ando
Posted on 30-12-2011 09:04
Offline
Moderator
Posts: 294
Joined: 17.03.11
Gender: male
Warnings:
Yes, there next few lines was enabling all classes again from ATG server settings.
I just disabled that part and it should work now.
Spoiler: [Show Hide ]
Code /*
Eric multiplayer script - CTF
*/
// added option to use flash light
// removed main classes and enabled only DM classes
#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 Flash_off = TRUE;
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,1 + 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:
//enable flash light for PC
if (Flash_off){
if (SC_P_IsReady(SC_PC_Get())){
SC_PC_EnableFlashLight(TRUE);
Flash_off = FALSE;
}
}else{
if (!SC_PC_Get()){
Flash_off = TRUE;
}
}
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_SetClassLimit(1,0); //1 - Soldier - US
SC_MP_SRV_SetClassLimit(2,0); //2 - gunner - US
SC_MP_SRV_SetClassLimit(3,0); //3 - Sniper - US
SC_MP_SRV_SetClassLimit(4,0); //4 - Medic - US
SC_MP_SRV_SetClassLimit(5,0); //5 - Engineer - US
SC_MP_SRV_SetClassLimit(6,0); //6 - Radioman - US
SC_MP_SRV_SetClassLimit(21,0); //21 - Soldier - VC
SC_MP_SRV_SetClassLimit(22,0); //22 - gunner - VC
SC_MP_SRV_SetClassLimit(23,0); //23 - Sniper - VC
SC_MP_SRV_SetClassLimit(24,0); //24 - Medic - VC
SC_MP_SRV_SetClassLimit(25,0); //25 - Engineer - VC
SC_MP_SRV_SetClassLimit(26,0); //26 - Radioman - VC
SC_MP_SRV_SetClassLimit(18,0); //18 -
SC_MP_SRV_SetClassLimit(19, 20); // US DM
SC_MP_SRV_SetClassLimit(39, 20); // VC DM
SC_MP_GetSRVsettings(&SRVset);
// for (i=0;i<6;i++){
// SC_MP_SRV_SetClassLimit(i+1,SRVset.atg_class_limit[i]);
// SC_MP_SRV_SetClassLimit(i+21,SRVset.atg_class_limit[i]);
// }// for (i)
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_CLASS | 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_GetSRVsettings(&SRVset);
SC_MP_SRV_InitWeaponsRecovery((float)SRVset.dm_weap_resp_time);
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)
EDIT: added two comment lines to top of script ( changes what is made compared with original)
Edited by Ando on 30-12-2011 09:12
x 1
techno
Posted on 30-12-2011 09:21
Offline
Member
Posts: 197
Joined: 26.04.11
Location: Northern NSW
Gender: male
Age: 49
Warnings:
Sweet, that's works perfectly. Thankyou so much
Signature Don't spend your time lookin' around for something you want that can't be found
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 .