Raised This Month: $276 Target: $400
 69% 

DOD Style Reinforcements


Post New Thread Reply   
 
Thread Tools Display Modes
Mr.Zinc
Member
Join Date: Mar 2006
Old 02-20-2008 , 11:41   Re: DOD Style Reinforcements
Reply With Quote #31

Problems.

Sometimes teams stop spawning on T (T wont spawn atm)

Set to 0 since I want everyone to spawn regardless of map.

No in built spawn protection and lack of money is an issue.

Seperate plugins made this useful.
Mr.Zinc is offline
Ark_Procession
Member
Join Date: Jun 2020
Location: Argentina
Old 08-26-2020 , 19:43   Re: DOD Style Reinforcements
Reply With Quote #32

I modified this plugin so you can choose team ct only/tt only/both instead of map prefix.

CVARS:

- sv_reinforcements 1/0 (enable/disable plugin)

- sv_reinforcementstime 0/9999 (0 instant reinforcements. also it's in seconds and 10 is Default)

(9999 more than that haven't tested but guess you won't need it)

- sv_reinforcementsboth 1/0 (1 default)
- sv_reinforcementsctonly 1/0 (enable/disable ct only (0 default)
- sv_reinforcementsttonly 1/0 (enable/disable tt only (0 default)

Deactivate the ones you don't use and activate the one you prefer, for eg:

If you want to have only tt reinforcements use:
sv_reinforcementsboth 0
sv_reinforcementsttonly 1

If you want to have only ct reinforcements use:
sv_reinforcementsboth 0
sv_reinforcementsttonly 0
sv_reinforcementsctonly 1


and don't forget to change map/ restart server.

Code:
/*
 _,.~^*^~.,_DOD Style Reinforcements_,.~^*^~.,_
 
 Credits to:
	Suicid3 - for the suggestions
 
 //- Cvars -
 sv_DSR			//Turns DSR on(1) and off(0)
 sv_DSRmode		//Scenario specific reinforcements(1) and all map reinforcements(0)
					//cs_ - only cts get reinforcements
					//de_ - both teams get reinforcements
					//as_ - only ts get reinforcements
					//other - both teams get reinforcements
 sv_DSRtime		//Time it takes to start to send reinforcements
 */

 #include <amxmodx>
 #include <cstrike>
 #include <fun>

 #define PLUGNAME		"DOD Style Reinforcements"
 #define AUTHOR			"Emp`"
 #define VERSION		"1.2"

 new bool:g_allowDSR[3] = false		//if a team can have reinforcements
 new bool:g_hasDead[3]				//if a team has someone dead on its team
 new DSRtime[3]						//countdown for the teams
 new SOrigin[33][3]					//moves you back to where you originally spawned

 new sv_reinforcements, sv_reinforcementstime, sv_reinforcementsboth,sv_reinforcementsctonly, sv_reinforcementsttonly

 public plugin_init()
 {

	register_plugin(PLUGNAME, VERSION, AUTHOR)

	sv_reinforcements = register_cvar("sv_reinforcements", "1")
	sv_reinforcementsboth = register_cvar("sv_reinforcementsboth", "1")
	sv_reinforcementstime = register_cvar("sv_reinforcementstime", "10")
	sv_reinforcementsctonly = register_cvar("sv_reinforcementsctonly", "0")
	sv_reinforcementsttonly = register_cvar("sv_reinforcementsttonly", "0")

	CheckMap()
	set_task(1.0, "dsr_loop", 0, "", 0, "b")
	set_msg_block(get_user_msgid("ClCorpse"), BLOCK_SET);
 }
 CheckMap()
 {
	new mapname[64]
	get_mapname(mapname,63)

	if(get_pcvar_num(sv_reinforcementsboth)==1)
	{
		g_allowDSR[1] = true
		g_allowDSR[2] = true
	}
	else if(get_pcvar_num(sv_reinforcementsctonly)==1)
	{
		g_allowDSR[1] = false
		g_allowDSR[2] = true
	}
         else if(get_pcvar_num(sv_reinforcementsttonly)==1)
	{
		g_allowDSR[1] = true
		g_allowDSR[2] = false
	}

 }
 CheckDead()
 {
	new players[32], pnum
	get_players(players, pnum, "b")

	new id, team

	for ( new i = 0; i < pnum; i++ )
	{
		id = players[i]
		team = get_user_team(id)

		if(0<team<3){
			if(!g_hasDead[team]){
				g_hasDead[team] = true
				DSRtime[team] = get_pcvar_num(sv_reinforcementstime) + 1
			}
		}
	}
 }
 public dsr_loop()
 {
	if ( get_pcvar_num(sv_reinforcements)<1) return
	
	for( new x = 1; x < 3; x++){
		CheckDead()

		if(g_hasDead[x] && g_allowDSR[x]){
			DSRtime[x] -= 1

			if(DSRtime[x]<0)
				DSRtime[x] = 0

			team_messages(x)
		}
		else DSRtime[x] = 0
	}
 }

 public team_messages(team)
 {
	new players[32], pnum
	if(team==1) get_players(players, pnum, "e", "TERRORIST")
	else get_players(players, pnum, "e", "CT")

	new id

	for ( new i = 0; i < pnum; i++ )
	{
		id = players[i]

		if(is_user_connected(id)){

			new message[128]

			if(DSRtime[team] == 0){

				format(message, 127, "Reinforcements have arrived")

				if(!is_user_alive(id))
					respawn(id)

				g_hasDead[team] = false
			}
			else
				format(message, 127, "Reinforcements will arrive in %d", DSRtime[team])

			set_hudmessage(0,255,0,-1.0,0.3,0,0.25,1.0,0.0,0.0,4)
			show_hudmessage(id, message)
		}
	}
 }
 
 public respawn(id)
 {
	if(is_user_alive(id) || !is_user_connected(id)) return

	new team = get_user_team(id)

	if(team==1 || team==2) {
		new parm[2]
		parm[0] = id
		parm[1] = 0
		set_task( 0.5, "actual_revive", 1, parm, 2)
		parm[1] = 1
		set_task( 1.0, "actual_revive", 1, parm, 2)
		set_task( 1.5, "weapons", id)
	}
 }
 public actual_revive(parm[])
 {
	new id = parm[0], a = parm[1]
	spawn(id)
	if(a==0)
		get_user_origin(id, SOrigin[id])
	else
		set_user_origin(id, SOrigin[id])
 }
 public weapons(id)
 {
	if(!is_user_connected(id) || !is_user_alive(id)) return

	new team = get_user_team(id), money = cs_get_user_money(id)

	give_item(id, "weapon_knife")

	if(team==2 && !user_has_weapon(id, CSW_USP )){
		cs_set_user_money(id, money + 500)
		engclient_cmd(id, "usp" )
		set_task(0.5, "CheckGun", id)
	}
	else if(team==1 && !user_has_weapon(id, CSW_GLOCK18 )){
		cs_set_user_money(id, money + 400)
		engclient_cmd(id, "glock18")
		set_task(0.5, "CheckGun", id)
	}
 }
 public CheckGun(id)
 {
	new team = get_user_team(id), money = cs_get_user_money(id)

	if(team==2){
		if(user_has_weapon(id, CSW_USP )){
			give_item(id,"ammo_45acp")
			give_item(id,"ammo_45acp")
		}
		else
			cs_set_user_money(id, money - 500)
	}
	else if(team==1){
		if(user_has_weapon(id, CSW_GLOCK18 )){
			give_item(id,"ammo_9mm")
			give_item(id,"ammo_9mm")
		}
		else
			cs_set_user_money(id, money - 400)
	}

 }
__________________
Feel free to ask for ENG to SPA Translations.

Last edited by Ark_Procession; 08-26-2020 at 19:43.
Ark_Procession is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:53.


Powered by vBulletin®
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Theme made by Freecode