HR_Shaft

Multi-Team Vehicles v1.1 for Phasor v2

Mar 30th, 2014
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.52 KB | None | 0 0
  1.     --Creator: AelitePrime & H® Shaft
  2.     --Script Name: Multi-Team Vehicle Script
  3.     --Website: http://phasorscripts.wordpress.com/
  4.     --Xfire: eliteprime14789x
  5.     --Version: 1.1 12/31/2013
  6.     --Edited to fix/enable mtv on spawn/join
  7.  
  8.     -- Suggestion: use with my Taxi script: http://pastebin.com/EYqiMWU4 and/or use with my Pistol Entry script: http://pastebin.com/aDizsamK
  9.    
  10.  
  11. function GetRequiredVersion()
  12.     return 200
  13. end
  14.  
  15. function OnScriptLoad(process, game, persistent)
  16.     if game == "PC" or game == true then  
  17.         gametype_base = 0x671340       
  18.     else
  19.         gametype_base = 0x5F5498
  20.     end
  21.     if readbyte(gametype_base + 0x34) == 1 then
  22.         compatible = false
  23.         log_msg(4, "Multi-Team-Vehicles script is NOT compatible with TEAM games, FFA Only!")
  24.         log_msg(1, "Multi-Team-Vehicles script is NOT compatible with TEAM games, FFA Only!")      
  25.     else
  26.         compatible = true
  27.     end
  28. end
  29.  
  30. function OnPlayerSpawn(player, m_objectId)
  31.     if compatible then writebyte(getplayer(player) + 0x20, 0) end
  32. end
  33.  
  34. function OnPlayerJoin(player)
  35.     if getplayer(player) then
  36.         welcomemsg = registertimer(6000, "timedwelcome", player)
  37.         if compatible then writebyte(getplayer(player) + 0x20, 0) end
  38.     end
  39. end
  40.  
  41. function timedwelcome(id, count, player)
  42.     if count == 1 then
  43.         if getplayer(player) then
  44.             privatesay(player, "Multi-Team-Vehicles! You can enter the enemy hog!")
  45.         end
  46.     end
  47.     return false   
  48. end
  49.  
  50. function OnDamageLookup(receiver_id, causer_id, tagid)
  51.     if compatible then
  52.         if causer_id and receiver_id then
  53.             local c_player = objectidtoplayer(causer_id)
  54.             local r_player = objectidtoplayer(receiver_id)
  55.             if r_player and c_player and c_player ~= r_player then
  56.                 local count = r_player
  57.                 while(getteam(c_player) == count) do
  58.                     count = count + 1
  59.                 end
  60.                 writebyte(getplayer(r_player) + 0x20, count)
  61.                 mtv = registertimer(100, "multiteamtimer", r_player)
  62.             end
  63.         end
  64.     end
  65. end
  66.  
  67. function multiteamtimer(id, count, player)
  68.     if compatible then
  69.         writebyte(getplayer(player) + 0x20, 0)
  70.     end
  71.     return false
  72. end
  73.  
  74. function OnGameEnd(stage)
  75.     if stage == 1 then
  76.         if notice then
  77.             removetimer(notice)
  78.             notice = nil
  79.         end
  80.         if welcomemsg then
  81.             removetimer(welcomemsg)
  82.             welcomemsg = nil
  83.         end
  84.         if mtv then
  85.             removetimer(mtv)
  86.             mtv = nil
  87.         end        
  88.     end
  89. end
  90.  
  91. -- Created by H® Shaft thank you to Oxide, AelitePrime, Nugget & Wizard.
  92. -- Visit http://halorace.org/forum/index.php?topic=514.0 or
  93. -- Visit http://pastebin.com/u/HR_Shaft for more phasor scripts
Advertisement
Add Comment
Please, Sign In to add comment