Skip to content

Commit

Permalink
Added noblock zones
Browse files Browse the repository at this point in the history
  • Loading branch information
Franc1sco committed Dec 20, 2015
1 parent f5de948 commit 3e22930
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
Binary file added DevZones_NoBlock/devzones_noblock.smx
Binary file not shown.
67 changes: 67 additions & 0 deletions DevZones_NoBlock/devzones_noblock.sp
@@ -0,0 +1,67 @@
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <devzones>
#include <sdkhooks>

// configuration
#define ZONE_PREFIX "noblock"
//End

new bool:noblock[MAXPLAYERS+1] = false;

public Plugin:myinfo =
{
name = "SM DEV Zones - NoBlock",
author = "Franc1sco franug",
description = "",
version = "1.1",
url = "http://www.cola-team.es"
};

public OnPluginStart()
{
HookEvent("player_spawn", EventPlayerSpawn);
}

public EventPlayerSpawn(Handle:event,const String:name[],bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
noblock[client] = false;
}

public Zone_OnClientEntry(client, String:zone[])
{
if(StrContains(zone, ZONE_PREFIX, false) == 0)
{
noblock[client] = true;
}
}

public Zone_OnClientLeave(client, String:zone[])
{
if(StrContains(zone, ZONE_PREFIX, false) == 0)
{
noblock[client] = false;
}
}

public OnClientPutInServer(client)
{
SDKHook(client, SDKHook_ShouldCollide, ShouldCollide);
}


public bool:ShouldCollide(entity, collisiongroup, contentsmask, bool:result)
{
if (contentsmask == 33636363)
{
if(noblock[entity])
{
result = false;
return false;
}
}

return true;
}

0 comments on commit 3e22930

Please sign in to comment.