Advertisement
Guest User

Untitled

a guest
Aug 20th, 2013
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.40 KB | None | 0 0
  1. #include <sourcemod>
  2. #include <sdktools>
  3. #include <sdkhooks>
  4.  
  5. public Plugin:myinfo =
  6. {
  7.     name = "spinfix",
  8.     author = "aMasheep",
  9.     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",
  10.     version = "1.0",
  11.     url = "www.hellfragger.no"
  12. }
  13.  
  14. public OnPluginStart()
  15. {
  16.     new ent = -1;
  17.     while ((ent = FindEntityByClassname(ent, "func_tanktrain")) != -1)
  18.     {
  19.         new String:classname[32];
  20.         GetEdictClassname(ent, classname, 32);
  21.         DispatchKeyValueFloat(ent, "orientationtype", 0.0);
  22.     }    
  23.    
  24.     new entt = -1;
  25.     while ((entt = FindEntityByClassname(entt, "func_tracktrain")) != -1)
  26.     {
  27.         new String:classname[32];
  28.         GetEdictClassname(entt, classname, 32);
  29.         DispatchKeyValueFloat(entt, "orientationtype", 0.0);
  30.     }    
  31. }
  32.  
  33. public OnEntityCreated(entity, const String:classname[])
  34. {
  35.     if (StrEqual(classname, "func_tanktrain"))
  36.     {
  37.         SDKHook(entity, SDKHook_SpawnPost, SpawnTrain);
  38.     }
  39.    
  40.     if (StrEqual(classname, "func_tracktrain"))
  41.     {
  42.         SDKHook(entity, SDKHook_SpawnPost, SpawnTrainn);
  43.     }
  44. }
  45.  
  46. public SpawnTrain(entity)
  47. {
  48.     DispatchKeyValueFloat(entity, "orientationtype", 0.0);
  49.    
  50. }
  51.  
  52. public SpawnTrainn(entityy)
  53. {
  54.     DispatchKeyValueFloat(entityy, "orientationtype", 0.0);
  55.    
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement