Skip to content
This repository was archived by the owner on Oct 30, 2019. It is now read-only.

Commit ab797f0

Browse files
CleversonCleverson
authored andcommitted
Updated teammate money displayer
Updated teammate money displayer and winner team parameters
1 parent 62421ab commit ab797f0

File tree

1 file changed

+35
-32
lines changed

1 file changed

+35
-32
lines changed

addons/amxmodx/scripting/PugCS.sma

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ new g_pPlayersMin;
2323
new g_pPlayersMax;
2424
new g_pAllowSpec;
2525
new g_pSvRestart;
26-
new g_pMpStartMoney;
26+
new g_pStartMoney;
2727

2828
new g_iEventReturn;
2929
new g_iEventJoinedTeam;
@@ -70,7 +70,7 @@ public plugin_init()
7070
g_pPlayersMax = get_cvar_pointer("pug_players_max");
7171
g_pAllowSpec = get_cvar_pointer("pug_allow_spectators");
7272
g_pSvRestart = get_cvar_pointer("sv_restart");
73-
g_pMpStartMoney = get_cvar_pointer("mp_startmoney");
73+
g_pStartMoney = get_cvar_pointer("mp_startmoney");
7474

7575
g_iEventJoinedTeam = CreateMultiForward("PugPlayerJoined",ET_IGNORE,FP_CELL,FP_CELL);
7676
g_iEventSpawn = CreateMultiForward("PugPlayerSpawned",ET_IGNORE,FP_CELL);
@@ -336,12 +336,12 @@ public fnRoundEnd()
336336

337337
public fnWonTR()
338338
{
339-
PugRoundWinner(_:CS_TEAM_T);
339+
PugRoundWinner(1);
340340
}
341341

342342
public fnWonCT()
343343
{
344-
PugRoundWinner(_:CS_TEAM_CT);
344+
PugRoundWinner(2);
345345
}
346346

347347
public fnRoundDraw()
@@ -552,24 +552,46 @@ public fnSpawnPost(id)
552552
ExecuteForward(g_iEventSpawn,g_iEventReturn,id);
553553
}
554554

555+
public fnKilledPost(id)
556+
{
557+
ExecuteForward(g_iEventKilled,g_iEventReturn,id);
558+
}
559+
560+
public CS_OnBuy(id,iWeapon)
561+
{
562+
if(iWeapon == CSI_SHIELD)
563+
{
564+
return get_pcvar_num(g_pBlockShield) ? PLUGIN_HANDLED : PLUGIN_CONTINUE;
565+
}
566+
else if((iWeapon == CSI_FLASHBANG) || (iWeapon == CSI_HEGRENADE) || (iWeapon == CSI_SMOKEGRENADE))
567+
{
568+
new iStage = GET_PUG_STAGE();
569+
570+
if((iStage == STAGE_WARMUP) || (iStage == STAGE_HALFTIME))
571+
{
572+
return get_pcvar_num(g_pBlockGrenades) ? PLUGIN_HANDLED : PLUGIN_CONTINUE;
573+
}
574+
}
575+
576+
return PLUGIN_CONTINUE;
577+
}
578+
555579
public PugPlayerSpawned(id)
556580
{
557581
new iStage = GET_PUG_STAGE();
558582

559583
if((iStage == STAGE_FIRSTHALF) || (iStage == STAGE_SECONDHALF) || (iStage == STAGE_OVERTIME))
560584
{
561-
if(is_user_alive(id) && isTeam(id) && get_pcvar_num(g_pTeamMoney) && (cs_get_user_money(id) != get_pcvar_num(g_pMpStartMoney)))
585+
if(get_pcvar_num(g_pTeamMoney) && is_user_connected(id))
562586
{
563-
set_task(0.1,"fnMoneyTeam",id);
587+
if(get_pcvar_num(g_pStartMoney) != cs_get_user_money(id))
588+
{
589+
set_task(0.1,"fnMoneyTeam",id);
590+
}
564591
}
565592
}
566593
}
567594

568-
public fnKilledPost(id)
569-
{
570-
ExecuteForward(g_iEventKilled,g_iEventReturn,id);
571-
}
572-
573595
public fnMoneyTeam(id)
574596
{
575597
new sTeam[13];
@@ -597,32 +619,13 @@ public fnMoneyTeam(id)
597619
);
598620
}
599621

600-
set_hudmessage(0,255,0,0.58,0.02,0,0.0,10.0,0.0,0.0,1);
622+
set_hudmessage(0,255,0,0.58,0.02,0,0.0,10.0,0.0,0.0,3);
601623
show_hudmessage(id,(sTeam[0] == 'T') ? "Terrorists" : "Counter-Terrorists");
602624

603-
set_hudmessage(255,255,225,0.58,0.05,0,0.0,10.0,0.0,0.0,2);
625+
set_hudmessage(255,255,225,0.58,0.05,0,0.0,10.0,0.0,0.0,4);
604626
show_hudmessage(id,sList);
605627
}
606628

607-
public CS_OnBuy(id,iWeapon)
608-
{
609-
if(iWeapon == CSI_SHIELD)
610-
{
611-
return get_pcvar_num(g_pBlockShield) ? PLUGIN_HANDLED : PLUGIN_CONTINUE;
612-
}
613-
else if((iWeapon == CSI_FLASHBANG) || (iWeapon == CSI_HEGRENADE) || (iWeapon == CSI_SMOKEGRENADE))
614-
{
615-
new iStage = GET_PUG_STAGE();
616-
617-
if((iStage == STAGE_WARMUP) || (iStage == STAGE_HALFTIME))
618-
{
619-
return get_pcvar_num(g_pBlockGrenades) ? PLUGIN_HANDLED : PLUGIN_CONTINUE;
620-
}
621-
}
622-
623-
return PLUGIN_CONTINUE;
624-
}
625-
626629
public fnJoinedClass(id)
627630
{
628631
if(get_ent_data(id,"CBasePlayer","m_iMenu") == CS_Menu_ChooseAppearance)

0 commit comments

Comments
 (0)