PHP Code:
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <morecolors>
new String:Map_Name[55];
public Plugin:myinfo = {
name = "tesla",
author = "Skuzy",
description = "",
url = ""
};
public OnPluginStart()
{
HookEvent("round_start", OnRoundStart_CB);
}
public OnMapStart()
{
GetCurrentMap(Map_Name, sizeof(Map_Name));
}
public Action:OnRoundStart_CB(Handle:event, const String:name[], bool:dontBroadcast)
{
if(StrEqual("surf_pyramidduel2",Map_Name,false))
{
DELETE();
HookEnt();
}
}
DELETE()
{
decl String:SortiePyra[64];
for(new i=GetMaxClients();i<=GetMaxEntities();i++)
{
if(IsValidEdict(i) && IsValidEntity(i))
{
GetEdictClassname(i, SortiePyra, sizeof(SortiePyra));
if(StrContains(SortiePyra,"trigger_teleport")!=-1 && Isinzone(i))
{
AcceptEntityInput(i,"kill");
CPrintToChatAll("{blue}l'accès à la zone de gravité a été bloqué !");
}
}
}
}
HookEnt()
{
new EntIndex = -1;
do{
HookSingleEntityOutput(EntIndex, "OnTouching", OnEntityOutPut, false);
HookSingleEntityOutput(EntIndex, "OnTouchedByEntity", OnEntityOutPut, false);
}
while((EntIndex = FindEntityByClassname(EntIndex , "func_rotating")) != -1 && Isinzone(EntIndex));
}
public OnEntityOutPut(const String:output[], caller, activator, Float:delay)
{
PrintToChat(activator,"Close!");
}
stock bool:Isinzone(i)
{
new Float:v[3];
GetEntPropVector(i, Prop_Send, "m_vecOrigin", v);
if (v[0] >= -12920.491211
&& v[0] <= -9156.031250
&& v[1] >= -769.758667
&& v[1] <= 1775.133057
&& v[2] >= 14405.568359
&& v[2] <= 15675.418945)return true;
else
return false;
}