Raised This Month: $51 Target: $400
 12% 

Escape game mode ideas


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
melaf
Senior Member
Join Date: Aug 2011
Old 11-12-2011 , 08:20   Escape game mode ideas
Reply With Quote #1

Good afternoon, author of the excellent plugin.
I have a small suggestion to improve this mod.
Offered in the next patch to implement two functions.
Your mod is perfect for maps zm .. But not for ze ..

1. I suggest adding a mod two settings is that a (Cvar's) setting victory zombie, ie right now is established so that at the end of time win people, it is convenient to map zm, but the maps ze must defeat zombies, as the cards on the passage. And people need to go and not to hide until the end of time.

2. Also add (Cvar's) option to the zombies are able to regenerate after the death of the other zombies, but not to spawn. When the map is very big, awkward to revive spawn, and run over the entire map. If zombies were killed, he was born in another zombie and the game becomes more interesting.

I think adding such a function, your mod will be even more interesting

Last edited by rhelgeby; 11-14-2011 at 02:46. Reason: Improved thread title so it's easier to find.
melaf is offline
TheRunningMan
Member
Join Date: Aug 2011
Location: Russia
Old 11-12-2011 , 08:38   Re: improvement mode
Reply With Quote #2

I agree, very necessary for maps ZE_ the function
TheRunningMan is offline
rhelgeby
Veteran Member
Join Date: Oct 2008
Location: 0x4E6F72776179
Old 11-14-2011 , 00:49   Re: improvement mode
Reply With Quote #3

If I understand you correctly, you want people to actually cross the finish line (and stay there) in escape map to win, instead of just avoiding being infected? It's an interesting idea.

This is theoretically possible, but it requires some work by the server admin to configure this. Initially, a plugin can't detect where the finish line in a map is. However, if the map has a named trigger volume (brush entity), a plugin can search for this trigger and hook its events, so that it knows which players that are inside it (and when they enter/leave).

If such triggers doesn't exist, they can be made by the server admin to define the safe zone in the escape map. This is the tricky part, because defining such volumes if far from user friendly and require some understanding of 3D-volumes. It's both possible to define fake and real triggers. The existing volumetric features in ZR use fake triggers.

An optimal solution would actually be to design a "standard" for escape map elements, such as the finish line. This standard would simply just be predefined names for trigger volumes in the map that ZR would find and use.

I'm not sure if I understand your second request. Do you want players to respawn where they died (teleported back)? This could work, but there are some risks. We don't know if the place they died is safe to go back to. This is possibly something that could be solved with this escape map "standard" idea, where there are one or more zones in the map that ZR could safely teleport players to.
__________________
Richard Helgeby

Zombie:Reloaded | PawnUnit | Object Library
(Please don't send private messages for support, they will be ignored. Use the forum.)

Last edited by rhelgeby; 11-14-2011 at 00:53.
rhelgeby is offline
Send a message via MSN to rhelgeby
nikooo777
AlliedModders Donor
Join Date: Apr 2010
Location: Lugano, Switzerland
Old 11-14-2011 , 18:08   Re: Escape game mode ideas
Reply With Quote #4

i think he means:

1: when time is over, winners are zombies, not humans
2: when you die you respawn beind another zombie and not at spawn because it's boring to walk again through the whole map
__________________
nikooo777 is offline
melaf
Senior Member
Join Date: Aug 2011
Old 11-14-2011 , 23:47   Re: Escape game mode ideas
Reply With Quote #5

Quote:
Originally Posted by nikooo777 View Post
i think he means:

1: when time is over, winners are zombies, not humans
2: when you die you respawn beind another zombie and not at spawn because it's boring to walk again through the whole map
yes
this is what I meant
melaf is offline
InstantDeath
Senior Member
Join Date: Mar 2007
Old 11-18-2011 , 18:14   Re: improvement mode
Reply With Quote #6

Quote:
Originally Posted by rhelgeby View Post
If I understand you correctly, you want people to actually cross the finish line (and stay there) in escape map to win, instead of just avoiding being infected? It's an interesting idea.

This is theoretically possible, but it requires some work by the server admin to configure this. Initially, a plugin can't detect where the finish line in a map is. However, if the map has a named trigger volume (brush entity), a plugin can search for this trigger and hook its events, so that it knows which players that are inside it (and when they enter/leave).

If such triggers doesn't exist, they can be made by the server admin to define the safe zone in the escape map. This is the tricky part, because defining such volumes if far from user friendly and require some understanding of 3D-volumes. It's both possible to define fake and real triggers. The existing volumetric features in ZR use fake triggers.

An optimal solution would actually be to design a "standard" for escape map elements, such as the finish line. This standard would simply just be predefined names for trigger volumes in the map that ZR would find and use.

I'm not sure if I understand your second request. Do you want players to respawn where they died (teleported back)? This could work, but there are some risks. We don't know if the place they died is safe to go back to. This is possibly something that could be solved with this escape map "standard" idea, where there are one or more zones in the map that ZR could safely teleport players to.

1. The ZE escape option is very simple possibility. Create a console command flagged as a cheat that once executed simply ends the round with the human's victory. Then have the mapper create a trigger_once and have it execute a console command with that command.

2. The respawn option has already been made. I made a plugin that(although a little buggy) will set it so that unless you kill the zombie with a headshot, the zombie will respawn where he died.

This plugin(below) also features a few other things, also are a little buggy. Note: It says in the author's notes that I removed headshot only mode... all I did was merely comment out the parts for that feature.

Code:
#include <sourcemod>
#include <cstrike>
#include <sdktools>

#pragma semicolon 1

#define MAXPLAYERS 64
#define PLUGIN_VERSION "0.6"
#define TEAM_T	2
#define TEAM_CT 3

/*
* Author Notes:
* 1. Terrorist respawn
	check death of teammate
	if respawns are left,
	start timer, 5 second respawn
	

2. create array for players and ammount of respawns left.

3. if death != headshot, respawn player, zombify them and teleport them to previous position.
* 
* 
* version .14 :
* * removed headshot only mode.
* 
*/

//new Handle:cvarrespawncount = INVALID_HANDLE;
//new Handle:cvarrespawntime = INVALID_HANDLE;
//new Handle:cvarheadshots = INVALID_HANDLE;
new RespawnCount[MAXPLAYERS+1];
//new Float:ZombieDeathLoc[MAXPLAYERS+1][3];
//new bool:Zombiehashead[MAXPLAYERS+1];
//new bool:ZombieDied[MAXPLAYERS+1];
new PlayerWeapon[MAXPLAYERS+1][2][3];
new bool:latespawn, bool: PlayerisSwapping[MAXPLAYERS+1];


public Plugin:myinfo = 
{
	name = "Zombiemod Addon",
	author = "InstantDeath",
	description = "Adds many features",
	version = PLUGIN_VERSION,
	url = "http://www.xpgaming.net"
}

public OnPluginStart()
{
	CreateConVar("sm_zombiemodaddons_version", PLUGIN_VERSION, "Zombiemod Addons version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);

	//cvarheadshots = CreateConVar("sm_zombie_headshotsonly", "1", "If set to 1, the zombie will only lose a life by headshot.");
	RegConsoleCmd("swap_primary", Command_SwapPrimary);
	
	//HookEvent("player_death", Event_PlayerDeath);
	//HookEvent("player_spawn", Event_PlayerSpawn);
	//HookEvent("round_end", RoundEndEvent);
	//HookEvent("player_death", BeforePlayerDeath, EventHookMode_Pre);
	//HookEvent("round_freeze_end",RoundFreezeEndEvent);
	//HookEvent("player_team", OnPlayerChangeTeam);
	//HookEvent("player_spawn", OnPlayerSpawn);
		
}

public Action:OnPlayerSpawn(Handle:event,const String:name[],bool:dontBroadcast)
{
	new client = GetClientOfUserId(GetEventInt(event,"userid")); // Get clients index
	new ClientTeam = GetClientTeam(client);
	
	if(ClientTeam == TEAM_CT)
	{
		new weaponid = GetPlayerWeaponSlot(client, 1);
		SetEntityRenderFx(client, RENDERFX_FADE_FAST);
		if(weaponid != -1)
			SetEntityRenderFx(weaponid, RENDERFX_FADE_FAST);
		SetEntProp(client, Prop_Data, "m_takedamage", 0, 1);
		
		CreateTimer(5.1,EndSpawnProtect, client,TIMER_FLAG_NO_MAPCHANGE);
	}
}
public Action:EndSpawnProtect(Handle:timer, any:index)
{
	new weaponid = GetPlayerWeaponSlot(index, 1);
	SetEntityRenderFx(index, RENDERFX_NONE);
	if(weaponid != -1)
		SetEntityRenderFx(weaponid, RENDERFX_NONE);
	SetEntProp(index, Prop_Data, "m_takedamage", 2, 1);
	return Plugin_Stop;
}

public Action:RoundFreezeEndEvent(Handle:event,const String:name[],bool:dontBroadcast)
{
	latespawn = false;
	CreateTimer(30.0,PlayerLateSpawn,TIMER_FLAG_NO_MAPCHANGE);
}

public OnClientPutInServer(client)
{
	if(client != 0 && latespawn)
	{
		RespawnCount[client] = 2;
	}
	else if(client != 0 && !latespawn)
	{
		RespawnCount[client] = 0;
	}
	
	for(new a = 0; a <= 3; a++)
	{
		PlayerWeapon[client][0][a] = -1;
		PlayerWeapon[client][1][a] = -1;
	}
}

public Action:PlayerLateSpawn(Handle:timer)
{
	latespawn = true;
	return Plugin_Stop;
}

public Action:RespawnClient(Handle:timer, any:index)
{
	new userid = GetClientUserId(index);
	new teamindex = GetClientTeam(index);
	if(teamindex == TEAM_T)
	{
		CS_RespawnPlayer(index);
		ServerCommand("zombie_player #%d", userid);
	}
	else
		CS_RespawnPlayer(index);
	return Plugin_Handled;
}

public Action:ZombieRespawnClient(Handle:timer, any:index)
{
	new userid = GetClientUserId(index);
	CS_RespawnPlayer(index);
	ServerCommand("zombie_player #%d", userid);
	
	return Plugin_Handled;
}

public Action:Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
	new client = GetClientOfUserId(GetEventInt(event, "userid"));
	new teamindex = GetClientTeam(client);
	new String: Weapon[32];
	new attacker = GetEventInt(event, "attacker");
	GetEventString(event, "weapon", Weapon, sizeof(Weapon));

	/* zombie_claws_of_death
	if(teamindex == TEAM_T)
	{
		if(GetEventInt(event, "attacker") == 0)
			return Plugin_Continue;
		//ZombieDied[client] = true;
			
		if(ZombieRespawnCount[client] > 0 && !roundend)
		{
			
			//Zombiehashead[client] = false;
			ZombieRespawnCount[client] = ZombieRespawnCount[client] - 1;
			CreateTimer(respawntime,ZombieRespawn, client,TIMER_FLAG_NO_MAPCHANGE);
			
		}
	}*/
	
	if(StrEqual(Weapon, "zombie_claws_of_death", true) || attacker == 0 || attacker == client)
		return Plugin_Continue;
	
	// check teams
	new TeamTcount = GetTeamClientCount(TEAM_T), TeamCTcount = GetTeamClientCount(TEAM_CT);
	
	if(TeamTcount > TeamCTcount)
	{
		if(teamindex == TEAM_T)
		{
			CS_SwitchTeam(client, TEAM_CT);
			CreateTimer(3.0,RespawnClient, client,TIMER_FLAG_NO_MAPCHANGE);
		}
		else
			CreateTimer(3.0,RespawnClient, client,TIMER_FLAG_NO_MAPCHANGE);
	}
	else if(TeamTcount < TeamCTcount)
	{
		if(teamindex == TEAM_CT)
		{
			CS_SwitchTeam(client, TEAM_T);
			CreateTimer(3.0,RespawnClient, client,TIMER_FLAG_NO_MAPCHANGE);
		}
		else
			CreateTimer(3.0,RespawnClient, client,TIMER_FLAG_NO_MAPCHANGE);
	}
	else
		CreateTimer(3.0,RespawnClient, client,TIMER_FLAG_NO_MAPCHANGE);
	
	return Plugin_Continue;
}

public Action:BeforePlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
	// get players entity ids
	new victim = GetClientOfUserId(GetEventInt(event, "userid"));
	new String:weaponname[32];
	
	if(IsClientInGame(victim))
	{
		if(PlayerWeapon[victim][0][0] != -1)
		{
			GetWeaponByID(PlayerWeapon[victim][0][0], weaponname, sizeof(weaponname));
			GivePlayerItem(victim, weaponname);
			PlayerWeapon[victim][0][0] = -1;
			PlayerWeapon[victim][0][1] = -1;
			PlayerWeapon[victim][0][2] = -1;
			
			//PrintToConsole(client, "Weapon: %s", weaponname);
		}
		if(PlayerWeapon[victim][1][0] != -1)
		{
			GetWeaponByID(PlayerWeapon[victim][1][0], weaponname, sizeof(weaponname));
			GivePlayerItem(victim, weaponname);
			
			PlayerWeapon[victim][1][0] = -1;
			PlayerWeapon[victim][1][1] = -1;
			PlayerWeapon[victim][1][2] = -1;
		}
		PlayerisSwapping[victim] = false;
	}
	return Plugin_Continue;
}

public Action:OnPlayerChangeTeam(Handle:event,const String:name[],bool:dontBroadcast)
{
	new userid = GetEventInt(event,"userid");
	new client = GetClientOfUserId(userid); // Get clients index
	new team = GetEventInt(event, "team");
	if(IsClientInGame(client))
	{
		if(!IsPlayerAlive(client) && team > 1)
		{
			if(RespawnCount[client] > 0)
			{
				CreateTimer(1.0,ZombieRespawnClient, client,TIMER_FLAG_NO_MAPCHANGE);
				RespawnCount[client]--;
			}
		}
	}
	return Plugin_Continue;
}
//transfers weapon to and from backpack

public Action:TimedWeaponSwap(Handle: timer, any:client)
{

	new String:weaponname[32];
	new weaponid;
	//PrintToConsole(client, "[SM] Ran TimedWeaponSwap");
	weaponid = GetPlayerWeaponSlot(client, 0);
	if(PlayerWeapon[client][0][0] != -1)
	{
		//PrintToConsole(client, "[SM] backpack is not empty");
		GetWeaponByID(PlayerWeapon[client][0][0], weaponname, sizeof(weaponname));
		GivePlayerItem(client, weaponname);
		//PrintToConsole(client, "Weapon: %s", weaponname);
		weaponid = GetPlayerWeaponSlot(client, 0);
		SetPrimaryAmmo(client, weaponid, PlayerWeapon[client][0][1]);
		GetEdictClassname(weaponid, weaponname, sizeof(weaponname));
		SetWeaponAmmo(client, GetWeaponAmmoOffset(weaponname), PlayerWeapon[client][0][2]);
		
		PlayerWeapon[client][0][0] = PlayerWeapon[client][1][0];
		PlayerWeapon[client][0][1] = PlayerWeapon[client][1][1];
		PlayerWeapon[client][0][2] = PlayerWeapon[client][1][2];
		PlayerWeapon[client][1][0] = -1;
		PlayerWeapon[client][1][1] = -1;
		PlayerWeapon[client][1][2] = -1;
		
		PlayerisSwapping[client] = false;
	}
	else if(PlayerWeapon[client][0][0] == -1)
	{
		if(PlayerWeapon[client][1][0] != -1)
		{
			PlayerWeapon[client][0][0] = PlayerWeapon[client][1][0];
			PlayerWeapon[client][0][1] = PlayerWeapon[client][1][1];
			PlayerWeapon[client][0][2] = PlayerWeapon[client][1][2];
			PlayerWeapon[client][1][0] = -1;
			PlayerWeapon[client][1][1] = -1;
			PlayerWeapon[client][1][2] = -1;
			//PrintToConsole(client, "[SM] backpack is not empty");
			GetWeaponByID(PlayerWeapon[client][0][0], weaponname, sizeof(weaponname));
			GivePlayerItem(client, weaponname);
			//PrintToConsole(client, "Weapon: %s", weaponname);
			weaponid = GetPlayerWeaponSlot(client, 0);
			SetPrimaryAmmo(client, weaponid, PlayerWeapon[client][0][1]);
			GetEdictClassname(weaponid, weaponname, sizeof(weaponname));
			SetWeaponAmmo(client, GetWeaponAmmoOffset(weaponname), PlayerWeapon[client][0][2]);
			PlayerWeapon[client][0][0] = -1;
			PlayerWeapon[client][0][1] = -1;
			PlayerWeapon[client][0][2] = -1;
		}
	}
			
	return Plugin_Stop;
}


public Action:Command_SwapPrimary(client, args)
{
	new weaponid, clip1, clip2;
	new String: weaponname[32];
	new colors[3];
	if(PlayerisSwapping[client])
		return Plugin_Handled;
	
	weaponid = GetPlayerWeaponSlot(client, 0);
	if(weaponid != -1)
	{
		colors[0] = 225;
		colors[1] = 10;
		colors[2] = 0;
		
		if(PlayerWeapon[client][0][0] != -1)
		{
			clip1 = GetPrimaryAmmo(client, weaponid);
			GetEdictClassname(weaponid, weaponname, sizeof(weaponname));
			clip2 = GetWeaponAmmo(client, GetWeaponAmmoOffset(weaponname));
			//PrintToConsole(client, "Got Primary Ammo: %d", clip1);
			//PrintToConsole(client, "Got Secondary Ammo: %d", clip2);
			
			
			//PrintToConsole(client, "Weapon: %s", weaponname);
			RemovePlayerItem(client, weaponid);
			weaponid = GetWeaponidByName(weaponname);
			PlayerWeapon[client][1][0] = weaponid;
			PlayerWeapon[client][1][1] = clip1;
			PlayerWeapon[client][1][2] = clip2;
			SendDialogToOne(client, colors, "Swapping primary weapons, please wait.");
			PlayerisSwapping[client] = true;
			CreateTimer(1.1,TimedWeaponSwap, client,TIMER_FLAG_NO_MAPCHANGE);
			weaponid = GetPlayerWeaponSlot(client, 1);
			if(weaponid != -1)
			{
				ClientCommand(client, "slot2");
			}
			else 
			{
				ClientCommand(client, "slot3");
			}
		}
		//PrintToConsole(client, "weapon Entity index: %d", weaponid);
		if(PlayerWeapon[client][0][0] == -1)
		{	
			if(PlayerWeapon[client][1][0] == -1)
			{
				clip1 = GetPrimaryAmmo(client, weaponid);
				GetEdictClassname(weaponid, weaponname, sizeof(weaponname));
				clip2 = GetWeaponAmmo(client, GetWeaponAmmoOffset(weaponname));
				//PrintToConsole(client, "Got Primary Ammo: %d", clip1);
				//PrintToConsole(client, "Got Secondary Ammo: %d", clip2);
				
				
				//PrintToConsole(client, "Weapon: %s", weaponname);
				RemovePlayerItem(client, weaponid);
				weaponid = GetWeaponidByName(weaponname);
				PlayerWeapon[client][0][0] = weaponid;
				PlayerWeapon[client][0][1] = clip1;
				PlayerWeapon[client][0][2] = clip2;
				SendDialogToOne(client, colors, "Your primary weapon was placed in your backpack.");
				PlayerisSwapping[client] = false;
				
				weaponid = GetPlayerWeaponSlot(client, 1);
				if(weaponid != -1)
				{
					ClientCommand(client, "slot2");
				}
				else
				{
					ClientCommand(client, "slot3");
				}
			}	
		}
	}
	else if(PlayerWeapon[client][0][0] != -1)
	{
		PlayerisSwapping[client] = false;
		GetWeaponByID(PlayerWeapon[client][0][0], weaponname, sizeof(weaponname));
		GivePlayerItem(client, weaponname);
		//PrintToConsole(client, "Weapon: %s", weaponname);
		weaponid = GetPlayerWeaponSlot(client, 0);
		SetPrimaryAmmo(client, weaponid, PlayerWeapon[client][0][1]);
		GetEdictClassname(weaponid, weaponname, sizeof(weaponname));
		SetWeaponAmmo(client, GetWeaponAmmoOffset(weaponname), PlayerWeapon[client][0][2]);
		PlayerWeapon[client][0][0] = -1;
		PlayerWeapon[client][0][1] = -1;
		PlayerWeapon[client][0][2] = -1;
	}
	
	return Plugin_Handled;
}

public GetWeaponidByName(String:Weapon[])
{
	if(StrEqual(Weapon, "weapon_ak47", false))
	{
		return 0;
	}
	else if(StrEqual(Weapon, "weapon_aug", false))
	{
		return 1;
	}
	else if(StrEqual(Weapon, "weapon_awp", false))
	{
		return 2;
	}
	else if(StrEqual(Weapon, "weapon_deagle", false))
	{	
		return 3;
	}
	else if(StrEqual(Weapon, "weapon_elite", false))
	{
		return 4;
	}
	else if(StrEqual(Weapon, "weapon_famas", false))
	{
		return 5;
	}
	else if(StrEqual(Weapon, "weapon_fiveseven", false))
	{
		return 6;
	}
	else if(StrEqual(Weapon, "weapon_flashbang", false))
	{
		return 7;
	}
	else if(StrEqual(Weapon, "weapon_g3sg1", false))
	{
		return 8;
	}
	else if(StrEqual(Weapon, "weapon_galil", false))
	{
		return 9;
	}
	else if(StrEqual(Weapon, "weapon_glock", false))
	{
		return 10;
	}
	else if(StrEqual(Weapon, "weapon_hegrenade", false))
	{
		return 11;
	}
	else if(StrEqual(Weapon, "weapon_knife", false))
	{
		return 12;
	}
	else if(StrEqual(Weapon, "weapon_m249", false))
	{
		return 13;
	}
	else if(StrEqual(Weapon, "weapon_m3", false))
	{
		return 14;
	}
	else if(StrEqual(Weapon, "weapon_m4a1", false))
	{
		return 15;
	}
	else if(StrEqual(Weapon, "weapon_mac10", false))
	{
		return 16;
	}
	else if(StrEqual(Weapon, "weapon_mp5navy", false))
	{
		return 17;
	}
	else if(StrEqual(Weapon, "weapon_p228", false))
	{
		return 18;
	}
	else if(StrEqual(Weapon, "weapon_p90", false))
	{
		return 19;
	}
	else if(StrEqual(Weapon, "weapon_scout", false))
	{
		return 20;
	}
	else if(StrEqual(Weapon, "weapon_sg550", false))
	{
		return 21;
	}
	else if(StrEqual(Weapon, "weapon_sg552", false))
	{
		return 22;
	}
	else if(StrEqual(Weapon, "weapon_smokegrenade_projectile", false))
	{
		return 23;
	}
	else if(StrEqual(Weapon, "weapon_tmp", false))
	{
		return 24;
	}
	else if(StrEqual(Weapon, "weapon_ump45", false))
	{
		return 25;
	}
	else if(StrEqual(Weapon, "weapon_usp", false))
	{
		return 26;
	}
	else if(StrEqual(Weapon, "weapon_xm1014", false))
	{
		return 27;
	}
	else if(StrEqual(Weapon, "weapon_c4", false))
	{
		return 28;
	}
	else
		return -1;
}

public GetWeaponByID(weaponid, String:WeaponName[], maxlen)
{
	if(weaponid == 0)
	{
		strcopy(WeaponName, maxlen, "weapon_ak47");
	}
	else if(weaponid == 1)
	{
		strcopy(WeaponName, maxlen, "weapon_aug");
	}
	else if(weaponid == 2)
	{
		strcopy(WeaponName, maxlen, "weapon_awp");
	}
	else if(weaponid == 3)
	{
		strcopy(WeaponName, maxlen, "weapon_deagle");
	}
	else if(weaponid == 4)
	{
		strcopy(WeaponName, maxlen, "weapon_elite");
	}
	else if(weaponid == 5)
	{
		strcopy(WeaponName, maxlen, "weapon_famas");
	}
	else if(weaponid == 6)
	{
		strcopy(WeaponName, maxlen, "weapon_fiveseven");
	}
	
	else if(weaponid == 7)
	{
		strcopy(WeaponName, maxlen, "weapon_flashbang");
	}
	else if(weaponid == 8)
	{
		strcopy(WeaponName, maxlen, "weapon_g3sg1");
	}
	else if(weaponid == 9)
	{
		strcopy(WeaponName, maxlen, "weapon_galil");
	}
	else if(weaponid == 10)
	{
		strcopy(WeaponName, maxlen, "weapon_glock");
	}
	else if(weaponid == 11)
	{
		strcopy(WeaponName, maxlen, "weapon_hegrenade");
	}
	else if(weaponid == 12)
	{
		strcopy(WeaponName, maxlen, "weapon_knife");
	}
	else if(weaponid == 13)
	{
		strcopy(WeaponName, maxlen, "weapon_m249");
	}
	else if(weaponid == 14)
	{
		strcopy(WeaponName, maxlen, "weapon_m3");
	}
	else if(weaponid == 15)
	{
		strcopy(WeaponName, maxlen, "weapon_m4a1");
	}
	else if(weaponid == 16)
	{
		strcopy(WeaponName, maxlen, "weapon_mac10");
	}
	else if(weaponid == 17)
	{
		strcopy(WeaponName, maxlen, "weapon_mp5navy");
	}
	else if(weaponid == 18)
	{
		strcopy(WeaponName, maxlen, "weapon_p228");
	}
	else if(weaponid == 19)
	{
		strcopy(WeaponName, maxlen, "weapon_p90");
	}
	else if(weaponid == 20)
	{
		strcopy(WeaponName, maxlen, "weapon_scout");
	}
	else if(weaponid == 21)
	{
		strcopy(WeaponName, maxlen, "weapon_sg550");
	}
	else if(weaponid == 22)
	{
		strcopy(WeaponName, maxlen, "weapon_sg552");
	}
	else if(weaponid == 23)
	{
		strcopy(WeaponName, maxlen, "weapon_smokegrenade");
	}
	else if(weaponid == 24)
	{
		strcopy(WeaponName, maxlen, "weapon_tmp");
	}
	else if(weaponid == 25)
	{
		strcopy(WeaponName, maxlen, "weapon_ump45");
	}
	else if(weaponid == 26)
	{
		strcopy(WeaponName, maxlen, "weapon_usp");
	}
	else if(weaponid == 27)
	{
		strcopy(WeaponName, maxlen, "weapon_xm1014");
	}
	else if(weaponid == 28)
	{
		strcopy(WeaponName, maxlen, "weapon_c4");
	}
}

public GetWeaponAmmoOffset(String:Weapon[])
{
	if(StrEqual(Weapon, "weapon_deagle", false))
	{
		return 1;
	}
	else if(StrEqual(Weapon, "weapon_ak47", false) || StrEqual(Weapon, "weapon_aug", false) || StrEqual(Weapon, "weapon_g3sg1", false) || StrEqual(Weapon, "weapon_scout", false))
	{
		return 2;
	}
	else if(StrEqual(Weapon, "weapon_famas", false) || StrEqual(Weapon, "weapon_galil", false) || StrEqual(Weapon, "weapon_m4a1", false) || StrEqual(Weapon, "weapon_sg550", false) || StrEqual(Weapon, "weapon_sg552", false))
	{
		return 3;
	}
	else if(StrEqual(Weapon, "weapon_m249", false))
	{
		return 4;
	}
	else if(StrEqual(Weapon, "weapon_awp", false))
	{
		return 5;
	}
	else if(StrEqual(Weapon, "weapon_elite", false) || StrEqual(Weapon, "weapon_glock", false) || StrEqual(Weapon, "weapon_mp5navy", false) || StrEqual(Weapon, "weapon_tmp", false))
	{
		return 6;
	}
	else if(StrEqual(Weapon, "weapon_xm1014", false) || StrEqual(Weapon, "weapon_m3", false))
	{
		return 7;
	}
	else if(StrEqual(Weapon, "weapon_mac10", false) || StrEqual(Weapon, "weapon_ump45", false) || StrEqual(Weapon, "weapon_usp", false))
	{
		return 8;
	}
	else if(StrEqual(Weapon, "weapon_p228", false))
	{
		return 9;
	}
	else if(StrEqual(Weapon, "weapon_fiveseven", false) || StrEqual(Weapon, "weapon_p90", false))
	{
		return 10;
	}
	else if(StrEqual(Weapon, "weapon_hegrenade", false))
	{
		return 11;
	}
	else if(StrEqual(Weapon, "weapon_flashbang", false))
	{
		return 12;
	}
	else if(StrEqual(Weapon, "weapon_smokegrenade", false))
	{
		return 13;
	}
	return -1;
}

SendDialogToOne(client, color[3], String:text[], any:...)
{
	new String:message[100];
	VFormat(message, sizeof(message), text, 4);	
	
	new Handle:kv = CreateKeyValues("Stuff", "title", message);
	KvSetColor(kv, "color", color[0], color[1], color[2], 255);
	KvSetNum(kv, "level", 2);
	KvSetNum(kv, "time", 2);
	
	CreateDialog(client, kv, DialogType_Msg);
	
	CloseHandle(kv);	
}

stock GetWeaponAmmo(client, slot)
{
	new ammoOffset = FindSendPropInfo("CCSPlayer", "m_iAmmo");
	return GetEntData(client, ammoOffset+(slot*4));
}  

stock SetWeaponAmmo(client, slot, ammo)
{
	new ammoOffset = FindSendPropInfo("CCSPlayer", "m_iAmmo");
	return SetEntData(client, ammoOffset+(slot*4), ammo);
}

stock GetPrimaryAmmo(client, weap) 
{   
	//new myweapons = FindSendPropInfo("CCSPlayer", "m_hMyWeapons");  
	//new weap = GetEntDataEnt2(client, myweapons+ (slot*4));
	if(IsValidEntity(weap))
		return GetEntData(weap, FindSendPropInfo("CBaseCombatWeapon", "m_iClip1")); 
	return 0;
}

stock SetPrimaryAmmo(client, weap, ammo) 
{     
	//new myweapons = FindSendPropInfo("CCSPlayer", "m_hMyWeapons");  
	//new weap = GetEntDataEnt2(client, myweapons+ (slot*4)); 
	if(IsValidEntity(weap))
		return SetEntData(weap, FindSendPropInfo("CBaseCombatWeapon", "m_iClip1"), ammo);
	return 0;
}

/*

public RoundEndEvent(Handle:event,const String:name[],bool:dontBroadcast)
{
	//round has started
	roundend = true;
	
	new maxclients = GetMaxClients();
	for (new i = 1; i < maxclients; i++)
	{
		ZombieDied[i] = false;
	}
	
}

public Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
	new client = GetClientOfUserId(GetEventInt(event, "userid"));
	new teamindex = GetClientTeam(client);
	
	if(teamindex == TEAM_T)
	{
		if(ZombieDied[client])
		{
			if(Zombiehashead[client])
			{
				TeleportEntity(client, ZombieDeathLoc[client], NULL_VECTOR, NULL_VECTOR);
			}
		}
	}
	
	if(teamindex == TEAM_CT)
	{
		roundend = false;
	}
}

public Action:ZombieRespawn(Handle:timer, any:index)
{
	if(roundend)
		return Plugin_Handled;
	new userid = GetClientUserId(index);
	ServerCommand("sm_respawn #%d", userid);
	ServerCommand("zombie_player #%d", userid);
	PrintToChat(index, "[SM] You have %d lives left.", ZombieRespawnCount[index]);
	return Plugin_Handled;
}


SetClientDeaths(client, deaths)
{
	SetEntProp(client, Prop_Data, "m_iDeaths", deaths);
}
*/

This plugin actually contains the backpack script that I separated and put into a separate plugin(which is very ideal for Zombiemod i might add).
__________________

Last edited by InstantDeath; 11-18-2011 at 18:21.
InstantDeath is offline
rhelgeby
Veteran Member
Join Date: Oct 2008
Location: 0x4E6F72776179
Old 11-19-2011 , 01:53   Re: Escape game mode ideas
Reply With Quote #7

Whether we let a trigger_once execute a command in ZR or let ZR find a certain trigger volume doesn't really matter. But it's possible to do more if ZR can decide when to do certain stuff. Instead of just receiving a command saying it should end the round, it can also act on players entering and leaving the safe zone in escape maps. Actually - it could work with both a command and a named trigger volume.

As for the plugin you posted, I recommend that you make use of the ZR API.

Instead of checking whether they are CT or T, use ZR_IsClientZombie and ZR_IsClientHuman.

Also, using CS_SwitchTeam might confuse ZR. Use ZR_InfectClient or ZR_HumanClient instead, and those will both switch team and update their appropriate class settings for you.

I don't know which bugs you have in your plugin, but they might be related to that ZR was confused when you directly switched teams and such.
__________________
Richard Helgeby

Zombie:Reloaded | PawnUnit | Object Library
(Please don't send private messages for support, they will be ignored. Use the forum.)
rhelgeby is offline
Send a message via MSN to rhelgeby
InstantDeath
Senior Member
Join Date: Mar 2007
Old 11-19-2011 , 03:42   Re: Escape game mode ideas
Reply With Quote #8

Quote:
Originally Posted by rhelgeby View Post
Whether we let a trigger_once execute a command in ZR or let ZR find a certain trigger volume doesn't really matter. But it's possible to do more if ZR can decide when to do certain stuff. Instead of just receiving a command saying it should end the round, it can also act on players entering and leaving the safe zone in escape maps. Actually - it could work with both a command and a named trigger volume.

As for the plugin you posted, I recommend that you make use of the ZR API.

Instead of checking whether they are CT or T, use ZR_IsClientZombie and ZR_IsClientHuman.

Also, using CS_SwitchTeam might confuse ZR. Use ZR_InfectClient or ZR_HumanClient instead, and those will both switch team and update their appropriate class settings for you.

I don't know which bugs you have in your plugin, but they might be related to that ZR was confused when you directly switched teams and such.
Oh yes, I guess I forgot to mention that. This plugin was originally made for the original zombiemod by coldfyr. meaning I would have to convert it and as you say, use the zombie reloaded api. So, this plugin would not currently work with ZR. The only reason I posted it is because I was hoping that someone would code the option into ZR itself. Though I guess I could convert it myself if there was enough demand for it.

As for the bugs, All I would need to figure out is to have it save the last position before the player died, because sometimes the player will respawn into a wall because after entering spectate, it seems to still be saving the player's position. Also, they can respawn inside of a prop if the prop was shot into the place they were last standing which can really piss the player off.


So, if there is demand for it, I will convert it. If not, please use it as a reference for future plugins.
__________________
InstantDeath is offline
Reply



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 01:53.


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