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;
}
|
__________________