Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char EntityList[4][158] = { "Tradedoor1", "Tradedoor2", "Tradedoor3", "Tradedoor4" };
- public OnEntityCreated(entity, const char[] classname)
- {
- if (IsValidEntity(entity))
- {
- if ((StrContains(classname, "func_") != -1))
- {
- SDKHook(entity, SDKHook_Spawn, Spawn);
- }
- }
- }
- public Action Spawn(entity, classname)
- {
- if (IsValidEntity(entity))
- {
- char strName[50];
- GetEntPropString(entity, Prop_Data, "m_iName", strName, sizeof(strName));
- for (int i = 1; i < sizeof(EntityList); i++)
- {
- if (StrEqual(strName, EntityList[i]))
- {
- AcceptEntityInput(entity, "Close"); // Entity is the checked door< th
- PrintToServer("Name: %s", strName);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement