Advertisement
Guest User

Untitled

a guest
Nov 12th, 2014
330
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. class MVHandler extends BroadcastHandler HideCategories(Movement,Collision,Lighting,LightColor,Karma,Force) ;
  2.  
  3. var array<string> AvailableWeapons ;
  4.  
  5. struct PData {
  6.  
  7. var string PlayerName ;
  8. var string weapon ;
  9.  
  10. };
  11.  
  12. var int z;
  13. var array<PData> PlayerData ;
  14.  
  15. function int Getplayer (PlayerReplicationInfo PRI) {
  16.  
  17. local int B ;
  18.  
  19. for (B=0; B < PlayerData.Length; B++) {
  20.  
  21. if ( PlayerData[B].PlayerName == PRI.PlayerName ) {
  22.  
  23. return B;
  24.  
  25. }
  26.  
  27. }
  28.  
  29. return -1 ;
  30. }
  31.  
  32. function BroadcastText (PlayerReplicationInfo SenderPRI, PlayerController Receiver, string Msg, name Type) {
  33.  
  34. local string weapon ;
  35. local string modon ;
  36. local array<string> Parts ;
  37. local int nr ;
  38.  
  39. nr = Getplayer (SenderPRI) ;
  40.  
  41. if (nr == -1) {
  42.  
  43. PlayerData.Insert(z, 1) ;
  44. PlayerData[z].PlayerName = SenderPRI.PlayerName ;
  45. PlayerData[z].weapon ="AGP_Characters.ClassSniper" ;
  46.  
  47. }
  48.  
  49. Split(Msg, " ", Parts) ;
  50. weapon = caps(Parts[1]) ;
  51. modon = caps(Parts[0]) ;
  52.  
  53. if ( (SenderPRI.PlayerName == Receiver.PlayerReplicationInfo.PlayerName) && (modon ~= "SNIPER") ) {
  54.  
  55. if (weapon ~= "MOS") {
  56.  
  57. PlayerData[nr].weapon="AGP_Characters.ClassSniperMos" ;
  58.  
  59. }
  60.  
  61. else if(weapon ~= "S24") {
  62.  
  63. PlayerData[nr].weapon="AGP_Characters.ClassSniper24_US" ;
  64.  
  65. }
  66. else if(weapon ~= "S") {
  67.  
  68. PlayerData[nr].weapon="AGP_Characters.ClassSniper" ;
  69.  
  70. }
  71. else if(weapon ~= "SVD") {
  72.  
  73. PlayerData[nr].weapon="AGP_Characters.ClassSniperSVD" ;
  74.  
  75. }
  76. else if(weapon ~= "SPR") {
  77.  
  78. PlayerData[nr].weapon="AGP_Characters.ClassSFSniper" ;
  79.  
  80. }
  81. else if(weapon ~= "V" || weapon ~= "VINTOREZ") {
  82.  
  83. PlayerData[nr].weapon="AGP_Characters.ClassGuerrillaSniper" ;
  84.  
  85. }
  86. else {
  87.  
  88. Level.Game.BroadcastHandler.Broadcast (None,"weapons: MOS, S24, S, SVD, SPR, V") ;
  89. return ;
  90.  
  91. }
  92.  
  93. Level.Game.BroadcastHandler.Broadcast (None,""$SenderPRI.PlayerName$ " picked a " $weapon$" for the next round") ;
  94.  
  95. }
  96. else {
  97.  
  98. Super.BroadcastText (SenderPRI,Receiver,Msg,Type) ;
  99.  
  100. }
  101.  
  102. }
  103.  
  104. defaultproperties {
  105.  
  106.  
  107.  
  108. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement