· Guests Online: 64
· Members Online: 0
· Total Members: 1,134
· Newest Member: Brody
·
hackepter10:01:31
·
GONZO16:07:56
·
Intruder16:34:39
·
Sully 1 day
·
desintegrator 2 days
·
WEZ 2 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: Weapons changes
Who is here? 1 Guest
Current Rating: (Total: 0 ratings )
Weapons changes
H5N1 Bird Flu
Posted on 17-12-2011 00:28
Offline
Member
Posts: 79
Joined: 16.12.11
Location: Bratislava,SVK
Gender: male
Age: 44
Warnings:
Hi everybody,
I would like to know ,it is possible (by script) change weapons between US and VC team?
I mean add some weapons from VC to US and other way round.
THX for answer from anybody
KostiCZ
Posted on 17-12-2011 00:33
Offline
Moderator
Posts: 1091
Joined: 15.03.11
Gender: male
Age: 48
Warnings:
Yes, it is possible. But - why? Is there any reason why US should use AK47?
Signature ________________________________________________
2LT William Theolinus "KostiCZ" Boner Jr.
LRRP Squad Baker, Delta Team
H5N1 Bird Flu
Posted on 17-12-2011 01:31
Offline
Member
Posts: 79
Joined: 16.12.11
Location: Bratislava,SVK
Gender: male
Age: 44
Warnings:
Reason is simple I want to add more atractivity to server also survive could be a little bit harder than usually..in many cases u can identify your enemy by near sound of enemies weapon..with changes u have not be 100% sure that it is your enemy or team mate.
Other reason is that when teams are not even...many players have excuse that they wont swap cause Vc side haven´t M16 and so on.
It is possible to share this script ?
Im not script skiller so try to find other ways how to do that.
I tried to do this by apllying changed relevant DAT file (E96...) directly to the map CBF file. Cause this changed file needs to be on both sides (server and client). It works great ,but on others servres player will be identified as a cheater beacuse CBF file from map is loaded at the start of VC and this "weapon rules" isn´t valid only on this map.
Edited by H5N1 Bird Flu on 17-12-2011 11:22
KostiCZ
Posted on 17-12-2011 10:14
Offline
Moderator
Posts: 1091
Joined: 15.03.11
Gender: male
Age: 48
Warnings:
My answer is - possible by script is to change your weapon which you choosed by menu, but not to add another weapon to menu. So when you are VC soldier and choose AK, it can be changed to M16 when joined. But it is not good for ppl who like to play with AK. I don't think that M16 is so special weapon.
For COOP - AI identifies enemies by weapons shooting at them. So if VC AI will hear AK47 shooting around, he will not react unless they will see you. Yes, this is game bug, but we are not able to repair it now. So for coop it will ruin the game. It is possible only for CTF/ATG games.
Signature ________________________________________________
2LT William Theolinus "KostiCZ" Boner Jr.
LRRP Squad Baker, Delta Team
H5N1 Bird Flu
Posted on 17-12-2011 12:50
Offline
Member
Posts: 79
Joined: 16.12.11
Location: Bratislava,SVK
Gender: male
Age: 44
Warnings:
Yes of course I want this change for CTF mode. So u r telling me that possible is just swap weapons not add weapon by script ?
These pictures are from edited DAT file which was putted to map file.... also it is not possible to change invertory like on the picture 2 ? (with script)
H5N1 Bird Flu attached the following images:
[82.2 kB]
[26.44 kB]
Edited by H5N1 Bird Flu on 17-12-2011 12:54
Ando
Posted on 17-12-2011 13:41
Offline
Moderator
Posts: 294
Joined: 17.03.11
Gender: male
Warnings:
H5N1 Bird Flu wrote:
Yes of course I want this change for CTF mode. So u r telling me that possible is just swap weapons not add weapon by script ?
Not tested but should be possible to add extra weapon after player respawn.
Ando
Posted on 17-12-2011 14:30
Offline
Moderator
Posts: 294
Joined: 17.03.11
Gender: male
Warnings:
Give me your CTF script and tell what slot extra weapon should be and after 5 min it should be done.
But you must test it by yourself.
Ando
Posted on 17-12-2011 14:55
Offline
Moderator
Posts: 294
Joined: 17.03.11
Gender: male
Warnings:
LDC-78 wrote:
CTF script
OK , done, but still need slot id or keyboard number where that weapon should be( to avoid conflict with other, already used slots ).
Edited by Ando on 17-12-2011 14:57
Ando
Posted on 17-12-2011 15:17
Offline
Moderator
Posts: 294
Joined: 17.03.11
Gender: male
Warnings:
LDC-78 wrote:
1 - medkit
7 // 2 - medbag
3 - ammobag
4 - radio
5 - grenade
6 - map
7 - intel
8 - booby trap
9 - lightstick
10 - C4
11 - VC grenade
12 - claymore
Looks that those are item type id's and its not what I need.
I made some testes:
slot 0 ( keyboard 1) - knife
slot 1 ( keyboard 2) - pistol
slot 2 ( keyboard 3) - main weapon
slot 3 ( keyboard 4) - ammokit, medbag
slot 4 ( keyboard 5) - US grenade
slot 5 ( keyboard 6) - VC grenade
slot 6 ( keyboard 7) - lightstick
slot 7 ( keyboard 8) - medkit
slot 8 ( keyboard 9) - booby trap
So, slots 6 ( keyboard 7) looks most reasonable to use.
EDIT:improved list and conclusion.
Can you confirm it?
Edited by Ando on 17-12-2011 15:42
Ando
Posted on 17-12-2011 15:44
Offline
Moderator
Posts: 294
Joined: 17.03.11
Gender: male
Warnings:
CTF script with extra weapon
- for US AK47
- for VC M16
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];
// for extra weapon
BOOL dont_have_extra_w = TRUE;
#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:
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
// EXTRA weapon
if(SC_P_IsReady(SC_PC_Get())){
if(dont_have_extra_w){
SC_P_GetInfo(SC_PC_Get(), &plinfo);
if( plinfo.side == 0){//US
i=2; // for US side weapon id 2 (AK)
}else{// VC
i=1; // for VC side weapon id q (m16)
}
SC_P_ChangeWeapon(SC_PC_Get(), 6, i);
SC_P_AddAmmoNoGrenade(SC_PC_Get());
dont_have_extra_w = FALSE;
}
}else{
dont_have_extra_w =TRUE;
}
//end of EXTRA weapon
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(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)
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_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)
H5N1 Bird Flu
Posted on 17-12-2011 17:27
Offline
Member
Posts: 79
Joined: 16.12.11
Location: Bratislava,SVK
Gender: male
Age: 44
Warnings:
some compile error for me..doesn´t work...
line: 5
message: symbol `\n`expected after `#include` command.
OK thx... as I wrote Im not script skiller any fault and Im out
LDC-78 wrote:
yeah right, just delete those lines and you're welcome
/*
Eric multiplayer script - CTF
*/
..no change after deleted lines...same preprocessing error....now line 1
something wrong withmy editor..im not able compile any script... lol
Edited by H5N1 Bird Flu on 17-12-2011 17:51
Ando
Posted on 17-12-2011 17:49
Offline
Moderator
Posts: 294
Joined: 17.03.11
Gender: male
Warnings:
H5N1 Bird Flu wrote:
some compile error for me..doesn´t work...
line: 5
message: symbol `\n`expected after `#include` command.
You must have latest "sc_global.h" and "sc_def.h" files under your vietcong\dev\compiler\inc folder.
And you will find these on SDK what you can download here.
Edited by Ando on 17-12-2011 17:54
H5N1 Bird Flu
Posted on 17-12-2011 18:07
Offline
Member
Posts: 79
Joined: 16.12.11
Location: Bratislava,SVK
Gender: male
Age: 44
Warnings:
OK ..updated from SDK 0.96...but same result...preprocessing error line 1 ...
LDC-78 wrote:
ok try my script, if it's not working, you can use the compiled script (also inlcuded in ctf1.rar file)
OK..thx...worked ctf1.c ....no error through compiling...
Edited by H5N1 Bird Flu on 17-12-2011 18:24
H5N1 Bird Flu
Posted on 17-12-2011 18:48
Offline
Member
Posts: 79
Joined: 16.12.11
Location: Bratislava,SVK
Gender: male
Age: 44
Warnings:
OK..finally works great... ..THX for all replys...
At last so is not possible to add more weapons for each soldier class (choose as a primary weapon) just add extra weapon for all classes ? (see picture1 post #5)
Is possible add different extra weapon for diferent class soldier (other extra weapon for soldier than extra weapon for medic) ?
My idea was that etc. US and VC soldier will be able choose as primary weapon from (M16,AK47,PPS43,PPS41 and so on)..nade and map will be disabled for all...and all players will have medkit...and one diferent extra weapon for each class... (see picture 2 post #5)
Edited by H5N1 Bird Flu on 18-12-2011 20:26
hrco
Posted on 19-12-2011 00:18
Offline
Junior Member
Posts: 32
Joined: 19.03.11
Gender: male
Age: 27
Warnings:
easier thing...go back to 1.01...
I hate ppl that are using US weapons on VC and the other way around....
confuses me always with the sound...
Edited by hrco on 19-12-2011 00:19
x 1
H5N1 Bird Flu
Posted on 19-12-2011 15:38
Offline
Member
Posts: 79
Joined: 16.12.11
Location: Bratislava,SVK
Gender: male
Age: 44
Warnings:
hrco wrote:
easier thing...go back to 1.01...
I hate ppl that are using US weapons on VC and the other way around....
confuses me always with the sound...
lol...take it easy ..it´s just a game for fun not for to anger u
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 .