View Single Post
KOkokosz
Junior Member
Join Date: Jul 2012
Old 07-15-2015 , 12:51   Re: [CS:S/CS:GO] Jailbreak Warden
Reply With Quote #182

Would you add acces to commands !open and !close when player becomes warden?

Here's some code with public acces:

Quote:
#include <sourcemod>
#include <sdktools>

#pragma semicolon 1

new iEnt;
new const String:EntityList[][] = { "func_door", "func_movinglinear" };

public OnPluginStart()
{
RegConsoleCmd("sm_open", OnOpenCommand);
RegConsoleCmd("sm_close", OnCloseCommand);
}

public Action:OnOpenCommand(client, args)
{
for(new i = 0; i < sizeof(EntityList); i++)
while((iEnt = FindEntityByClassname(iEnt, EntityList[i])) != -1)
AcceptEntityInput(iEnt, "Open");

return Plugin_Handled;
}

public Action:OnCloseCommand(client, args)
{
for(new i = 0; i < sizeof(EntityList); i++)
while((iEnt = FindEntityByClassname(iEnt, EntityList[i])) != -1)
AcceptEntityInput(iEnt, "Close");

return Plugin_Handled;
}
__________________

KOkokosz is offline