Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sourcemod>
- #include <sdktools>
- #include <sdkhooks>
- public Plugin:myinfo =
- {
- name = "spinfix",
- author = "aMasheep",
- description = "Fixing all bugs where tanktrains spins when they hit a path_track. Will set the orientation type of both func_tanktrans and path_tracks to 0",
- version = "1.0",
- url = "www.hellfragger.no"
- }
- public OnPluginStart()
- {
- new ent = -1;
- while ((ent = FindEntityByClassname(ent, "func_tanktrain")) != -1)
- {
- new String:classname[32];
- GetEdictClassname(ent, classname, 32);
- DispatchKeyValueFloat(ent, "orientationtype", 0.0);
- }
- new entt = -1;
- while ((entt = FindEntityByClassname(entt, "func_tracktrain")) != -1)
- {
- new String:classname[32];
- GetEdictClassname(entt, classname, 32);
- DispatchKeyValueFloat(entt, "orientationtype", 0.0);
- }
- }
- public OnEntityCreated(entity, const String:classname[])
- {
- if (StrEqual(classname, "func_tanktrain"))
- {
- SDKHook(entity, SDKHook_SpawnPost, SpawnTrain);
- }
- if (StrEqual(classname, "func_tracktrain"))
- {
- SDKHook(entity, SDKHook_SpawnPost, SpawnTrainn);
- }
- }
- public SpawnTrain(entity)
- {
- DispatchKeyValueFloat(entity, "orientationtype", 0.0);
- }
- public SpawnTrainn(entityy)
- {
- DispatchKeyValueFloat(entityy, "orientationtype", 0.0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement