initial commit of zombie hunting zones
This commit is contained in:
@@ -550,7 +550,7 @@ public void CreateZonePoints(float point[8][3])
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
public Action DrawZone(int client, float array[8][3], int beamsprite, int halosprite, color[4], float life)
|
||||
public Action DrawZone(int client, float array[8][3], int beamsprite, int halosprite, int color[4], float life)
|
||||
{
|
||||
//shavit
|
||||
static int pairs[][] =
|
||||
@@ -635,7 +635,7 @@ public int Keychecker()
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// Purpose: Writing to File
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
public void writetofile(float[3] startpos, float[3] endpos, char[] zones, int client, int state)
|
||||
public void writetofile(float startpos[3], float endpos[3], char[] zones, int client, int state)
|
||||
{
|
||||
char l_cEntryCount[MAXZONES];
|
||||
char l_cTransfer[MAXZONES];
|
||||
@@ -924,7 +924,7 @@ public void CreateZones(float f_min[3], float f_max[3], char[] sZoneName, int zo
|
||||
* 1 - only a player can trigger this by touch, makes it so a NPC cannot fire a trigger_multiple
|
||||
* 2 - Won't fire unless triggering ent's view angles are within 45 degrees of trigger's angles (in addition to any other conditions), so if you want the player to only be able to fire the entity at a 90 degree angle you would do ",angles,0 90 0," into your spawnstring.
|
||||
* 4 - Won't fire unless player is in it and pressing use button (in addition to any other conditions), you must make a bounding box,(max\mins) for this to work.
|
||||
* 8 - Won't fire unless player/NPC is in it and pressing fire button, you must make a bounding box,(max\mins) for this to work.
|
||||
* 8 - Wont fire unless player/NPC is in it and pressing fire button, you must make a bounding box,(max\mins) for this to work.
|
||||
* 16 - only non-player NPCs can trigger this by touch
|
||||
* 128 - Start off, has to be activated by a target_activate to be touchable/usable
|
||||
* 256 - multiple players can trigger the entity at the same time
|
||||
@@ -980,7 +980,7 @@ public void CreateZones(float f_min[3], float f_max[3], char[] sZoneName, int zo
|
||||
public void OnStartTouch(int entindex, int other)
|
||||
{
|
||||
char l_cZoneName[MAXZONES];
|
||||
if (IsValidClient(other) && IsPlayerAlive(other))
|
||||
if (IsValidClient1(other) && IsPlayerAlive(other))
|
||||
{
|
||||
GetEntPropString(entindex, Prop_Data, "m_iName", l_cZoneName, sizeof(l_cZoneName));
|
||||
//forward
|
||||
@@ -996,7 +996,7 @@ public void OnStartTouch(int entindex, int other)
|
||||
public void OnEndTouch(int entindex, int other)
|
||||
{
|
||||
char l_cZoneName[MAXZONES];
|
||||
if (IsValidClient(other) && IsPlayerAlive(other))
|
||||
if (IsValidClient1(other) && IsPlayerAlive(other))
|
||||
{
|
||||
GetEntPropString(entindex, Prop_Data, "m_iName", l_cZoneName, sizeof(l_cZoneName));
|
||||
//forward
|
||||
@@ -1015,6 +1015,13 @@ stock int IsValidClient(int client, bool nobots = true)
|
||||
return false;
|
||||
return IsClientInGame(client);
|
||||
}
|
||||
|
||||
stock int IsValidClient1(int client, bool nobots = true)
|
||||
{
|
||||
if (client <= 0 || client > MaxClients || !IsClientConnected(client))
|
||||
return false;
|
||||
return IsClientInGame(client);
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
@@ -1049,4 +1056,4 @@ stock void ReplaceStrings(char[] str, char[] strReplace)
|
||||
ReplaceString(l_cstrFix, sizeof(l_cstrFix), strReplace, "");
|
||||
TrimString(l_cstrFix);
|
||||
Format(str, sizeof(l_cstrFix), l_cstrFix);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user