RSSy MYGO.pl Opublikowano Sierpień 26, 2020 o 06:03 RSSy Udostępnij Opublikowano Sierpień 26, 2020 o 06:03 Description Provides only 1 forward for collision control The plugin was tested on a clean server and I didn't find any errors This plugin is only supported for Windows This is a test version and may be removed in the future PHP Code: forward Action OnPassServerEntityFilter (int ent1, int ent2, bool &result); Example Spoiler Code: /* The survivor will pass through the infected if the survivor was caught by smoker */ #pragma semicolon 1 #pragma newdecls required #include <sourcemod> #include <sdktools> forward Action OnPassServerEntityFilter (int ent1, int ent2, bool &result); bool g_bAllow [MAXPLAYERS + 1]; public void OnPluginStart() { HookEvent("tongue_grab", tongue); HookEvent("tongue_release", tongue); } public void tongue (Event event, const char[] name, bool dontbroadcast) { g_bAllow[GetClientOfUserId(event.GetInt("victim"))] = (strcmp(name, "tongue_grab") == 0); } public Action OnPassServerEntityFilter (int ent1, int ent2, bool &result ) { if (ent2 > 0 && ent2 <= MaxClients && GetClientTeam(ent2) == 2 && IsInfected(ent1)) { result = !g_bAllow[ent2]; return Plugin_Changed; } return Plugin_Continue; } bool IsInfected(int entity) { char szName[36]; GetEntityClassname(entity, szName, sizeof szName); return strcmp(szName, "infected") == 0; } Attached Files Get Plugin or Get Source (l4d2_collision_hook.sp - 7.8 KB) l4d2_collision.txt (315 Bytes) Wyświetl pełny artykuł Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
Rekomendowane odpowiedzi