HR_Shaft

Multi-Team Vehicle Script v1.3 for Phasor v2+

Jul 16th, 2014
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.94 KB | None | 0 0
  1. --[[ ### Multi-Team Vehicle Script v1.3 ###]]--
  2. --[[ ###   by H® Shaft for Phasor v2+   ###]]--
  3.  
  4. -- Allows you to enter the enemy's vehicle during FREE-for-All (FFA) games, not compatible with team games
  5. -- Good to use with my Taxi script http://pastebin.com/00FcbiVs
  6. --Version: 1.3 7/14/2014 -- added onplayerjoin, and ondamagelookup edits
  7.  
  8. function GetRequiredVersion()
  9.     return 200
  10. end
  11.  
  12. function OnScriptLoad(process, game, persistent)
  13.     if game == "PC" or game == true then
  14.         GAME = "PC"
  15.         gametype_base = 0x671340       
  16.     else
  17.         GAME = "CE"
  18.         gametype_base = 0x5F5498
  19.     end
  20.     if readbyte(gametype_base + 0x34) == 1 then
  21.         compatible = false
  22.     else
  23.         compatible = true
  24.     end
  25. end
  26.  
  27. function OnPlayerSpawn(player, m_objectId)
  28.     if compatible then writebyte(getplayer(player) + 0x20, 0) end
  29. end
  30.  
  31. function OnPlayerJoin(player)
  32.     if getplayer(player) then
  33.         if compatible then writebyte(getplayer(player) + 0x20, 0) end
  34.     end
  35. end
  36.  
  37. function OnDamageLookup(receiver_id, causer_id, tagid)
  38.     if compatible then
  39.         if causer_id and receiver_id then
  40.             local c_player = objectidtoplayer(causer_id)
  41.             local r_player = objectidtoplayer(receiver_id)
  42.             if r_player and c_player and c_player ~= r_player then
  43.                 if getteam(c_player) == getteam(r_player) then
  44.                     local count = r_player
  45.                     while(getteam(c_player) == count) do
  46.                         count = count + 1
  47.                     end
  48.                     writebyte(getplayer(r_player) + 0x20, count)
  49.                     mtv = registertimer(100, "multiteamtimer", r_player)
  50.                 end    
  51.             end
  52.         end
  53.     end
  54. end
  55.  
  56. function multiteamtimer(id, count, player)
  57.     if compatible then
  58.         writebyte(getplayer(player) + 0x20, 0)
  59.     end
  60.     return false
  61. end
  62.  
  63. function OnGameEnd(stage)
  64.     if stage == 1 then
  65.         if mtv then
  66.             mtv = nil
  67.         end        
  68.     end
  69. end
  70.  
  71. --[[ Created by H® Shaft & AelitePrime
  72. Thanks to Oxide, AelitePrime, Nugget & Wizard
  73. Visit http://halorace.org/forum/index.php?topic=514.0 or
  74. Visit http://pastebin.com/u/HR_Shaft for more phasor scripts
  75. ]]
Advertisement
Add Comment
Please, Sign In to add comment