Guest User

Untitled

a guest
Jun 20th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 7.46 KB | None | 0 0
  1. const
  2. Damage = 29;        // Dano
  3. Tempo1 = 5;         // Intervalo
  4. Tempo2 = 9;         // Intervalo
  5. Distancia = 150;    // Distancia
  6. Pasta = 'Config';   // Nome da Pasta de Configurações
  7. Cor1 = $FFFFFF;     // Branco
  8. Cor2 = $FF0000;     // Vermelho
  9. Cor3 = $008B00;     // Verde
  10. TimeWeapon = 5;     // Tempo para distribuição de armas
  11.  
  12. type
  13. Stats = record
  14. Classe: integer;
  15. X, Y: Single;
  16. Intervalo: integer;
  17. Paralisou: Boolean;
  18. Paralisado: Boolean;
  19. WTime: Integer;
  20. end;
  21.  
  22. var
  23. P: Array[1 .. 32] Of Stats;
  24. Loaded: boolean;
  25.  
  26. procedure ActivateServer();
  27. begin
  28. Command('/loadcon scripts/'+ScriptName+'/'+(Pasta)+'/JumpersConfigurations.ini');
  29. Command('/loadlist scripts/'+ScriptName+'/'+(Pasta)+'/JumpersList');
  30. Command('/loadwep scripts/'+ScriptName+'/'+(Pasta)+'/JumpersWeapons');
  31. Writeln('*** JUMPERS MODE ATIVADO ***');
  32. Loaded := False;
  33. end;
  34.  
  35. procedure AppOnIdle(Ticks: integer);
  36. var A, B: Byte; x, y: Single;
  37. begin
  38. If not Loaded Then
  39. If NumPlayers + NumBots = 0 Then begin
  40. Command('/loadwep scripts/'+ScriptName+'/'+(Pasta)+'/JumpersWeapons');
  41. Loaded := True;
  42. end;
  43.  
  44. For A := 1 To 32 Do
  45. If GetPlayerStat(A,'Alive') Then
  46. If GetPlayerStat(A,'Active') Then
  47. If P[A].WTime > 1 Then begin
  48. dec(P[A].WTime,1);
  49. end;
  50.  
  51. For A := 1 To 32 Do
  52. If GetPlayerStat(A,'Active') Then
  53. If GetPlayerStat(A,'Team') = 5 Then
  54. If P[A].Classe <> 0 Then begin
  55. P[A].Classe := 0;
  56. end;
  57.  
  58. For A := 1 To 32 Do
  59. If GetPlayerStat(A,'Active') Then
  60. If GetPlayerStat(A,'Team') = 1 Then
  61. If P[A].Classe <> 1 Then begin
  62. P[A].Classe := 1;
  63. end;
  64.  
  65. For A := 1 To 32 Do
  66. If GetPlayerStat(A,'Active') Then
  67. If GetPlayerStat(A,'Team') = 2 Then
  68. If P[A].Classe <> 2 Then begin
  69. P[A].Classe := 2;
  70. end;
  71.  
  72. For A := 1 To 32 Do
  73. if GetPlayerStat(A,'Alive') then
  74. if GetPlayerStat(A,'Active') then
  75. If P[A].classe = 1 Then
  76. For B := 1 To 32 Do  
  77. if GetPlayerStat(B,'Active') then if GetPlayerStat(B,'Alive') then
  78. if GetPlayerStat(A,'Team') <> GetPlayerStat(B,'Team') then
  79. if Round(Distance(GetPlayerStat(A,'x'),GetPlayerStat(A,'y'),GetPlayerStat(B,'x'),GetPlayerStat(B,'y'))) < Distancia Then begin  
  80. DoDamage(B,Damage);
  81. end;
  82.  
  83. For A := 1 To 32 Do
  84. if GetPlayerStat(A,'Alive') then
  85. if GetPlayerStat(A,'Active') then
  86. If P[A].classe = 1 Then
  87. for B := 1 To 32 do  
  88. if GetPlayerStat(B,'Active') then if GetPlayerStat(B,'Alive') then
  89. If GetPlayerStat(B,'Health') <= Damage Then
  90. if GetPlayerStat(A,'Team') <> GetPlayerStat(B,'Team') then
  91. if Round(Distance(GetPlayerStat(A,'x'),GetPlayerStat(A,'y'),GetPlayerStat(B,'x'),GetPlayerStat(B,'y'))) < Distancia Then begin  
  92. DoDamage(B,150);
  93. WriteConsole(B,'Você foi morto por'+' '+IDToName(A),Cor2);
  94. WriteConsole(A,'Você matou o(a)'+' '+IDToName(B),Cor3);
  95. SetScore(A,GetPlayerStat(A,'Kills')+1);
  96. SetScore(B,GetPlayerStat(B,'Deaths')+1);
  97. end;
  98.  
  99. For A := 1 To 32 Do
  100. If GetPlayerStat(A,'Active') Then
  101. If GetPlayerStat(A,'Alive') Then
  102. If GetPlayerStat(A,'Team') = 1 Then
  103. If P[A].Classe = 1 Then
  104. If P[A].Paralisado Then
  105. If P[A].Intervalo > 1 Then begin
  106. MovePlayer(A, (P[A].X), (P[A].Y));
  107. dec(P[A].Intervalo,1);
  108. end else P[A].Paralisado := False; WriteConsole(A,'*** ESTADO NORMAL ***',Cor1);
  109.  
  110. For A := 1 To 32 Do
  111. If GetPlayerStat(A,'Active') Then
  112. If GetPlayerStat(A,'Alive') Then
  113. If GetPlayerStat(A,'Team') = 2 Then
  114. If P[A].Classe = 2 Then
  115. If P[A].Paralisou Then
  116. If P[A].Intervalo > 1 Then begin
  117. dec(P[A].Intervalo,1);
  118. end else P[A].Paralisou := False; WriteConsole(A,'A energia elétrica da sua arma foi recarregada',Cor3);
  119.  
  120. For A := 1 To 32 Do
  121. If GetPlayerStat(A,'Team') = 1 Then
  122. If P[A].Classe = 1 Then
  123. If GetPlayerStat(A,'Active') Then
  124. If GetPlayerStat(A,'Alive') Then begin
  125. If not P[A].Paralisado Then begin
  126. DrawText(A,'JUMPER'+chr(13)+chr(10)+'HEALTH:'+' '+Inttostr(GetPlayerStat(A,'Health')*2/3)+'%',300,Cor1,0.08,14,310);
  127. end else DrawText(A,'*** PARALISADO ***',100,Cor2,0.08,14,320);
  128. end else DrawText(A,'JUMPER'+chr(13)+chr(10)+'HEALTH:'+' '+'0%',300,Cor2,0.08,14,310);
  129.  
  130. For A := 1 To 32 Do
  131. If GetPlayerStat(A,'Team') = 2 Then
  132. If P[A].Classe = 2 Then
  133. If GetPlayerStat(A,'Active') Then
  134. If GetPlayerStat(A,'Alive') Then begin
  135. If not P[A].PARALISOU Then begin
  136. DrawText(A,'PALADINO'+chr(13)+chr(10)+'ARMA DE CHOQUE CARREGADA!'+chr(13)+chr(10)+'HEALTH:'+' '+Inttostr(GetPlayerStat(A,'Health')*2/3)+'%',300,Cor3,0.08,14,320);
  137. end else DrawText(A,'PALADINO'+chr(13)+chr(10)+'ARMA DE CHOQUE CARREGANDO'+chr(13)+chr(10)+'HEALTH:'+' '+Inttostr(GetPlayerStat(A,'Health')*2/3)+'%'+chr(13)+chr(10)+Inttostr(P[A].Intervalo),300,Cor1,0.08,14,320);
  138. end else DrawText(A,'PALADINO'+chr(13)+chr(10)+'HEALTH:'+' '+'0%',300,Cor2,0.08,14,310);
  139.        end;
  140.  
  141. procedure OnWeaponChange(ID, PrimaryNum, SecondaryNum: byte);
  142. var Team: Integer;
  143. begin
  144. Team := GetPlayerStat(ID,'Team');
  145. Case Team of
  146. 1:begin If P[ID].WTime = 1 Then ForceWeapon(ID, 11, 255, 0); P[ID].WTime := TimeWeapon;
  147. end;
  148. 2:begin If P[ID].WTime = 1 Then ForceWeapon(ID, 5, 255, 0); P[ID].WTime := TimeWeapon;
  149. end;
  150.       end;
  151.             end;
  152.  
  153. procedure OnJoinTeam(ID, Team: byte);
  154. begin
  155. If (Team = 1) Then begin
  156. P[ID].Classe := 1;
  157. P[ID].Paralisado := False;
  158. WriteConsole(ID,'Dúvidas sobre a sua classe? !classinfo',Cor2);
  159. P[ID].WTime := TimeWeapon;
  160. end;
  161.  
  162. If (Team = 2) Then begin
  163. P[ID].Classe := 2;
  164. P[ID].Intervalo := Tempo2;
  165. P[ID].Paralisou := True;
  166. WriteConsole(ID,'Dúvidas sobre a sua classe? !classinfo',Cor2);
  167. P[ID].WTime := TimeWeapon;
  168. end;
  169.  
  170. If (Team = 3) Then begin
  171. P[ID].Classe := 0;
  172. Command('/setteam5 '+Inttostr(ID));
  173. P[ID].WTime := TimeWeapon;
  174. end;
  175.  
  176. If (Team = 4) Then begin
  177. P[ID].Classe := 0;
  178. Command('/setteam5 '+Inttostr(ID));
  179. P[ID].WTime := TimeWeapon;
  180. end;
  181.  
  182. If (Team = 5) Then begin
  183. P[ID].Classe := 0;
  184. P[ID].WTime := TimeWeapon;
  185. end;
  186.           end;
  187.  
  188. procedure OnJoinGame(ID, Team: byte);
  189. begin
  190. Command('/setteam5 '+Inttostr(ID));
  191. P[ID].Classe := 0;
  192. WriteConsole(ID,'Bem-vindo a Saga Jumpers V2, by Washington',Cor1);
  193. end;
  194.  
  195. procedure OnPlayerSpeak(ID: Byte; Text: string);
  196. begin
  197. Text := LowerCase(Text);
  198.  
  199. If (Text = '!classinfo') Then begin
  200. Case P[ID].Classe of
  201. 2:begin WriteConsole(ID,'*** PALADINO ***',Cor3); WriteConsole(ID,'Não tem poderes, porém tem sua arma Eficaz contra Jumpers',$FFFFFF); WriteConsole(ID,'OBS: Sua arma pode paralisar seus inimigos com o seu poder de choque',$FFFFFF);
  202. end;
  203. 0:begin WriteConsole(ID,'*** SPECTATOR ***',Cor3); WriteConsole(ID,'It is Obvius :D',$FFFFFF);
  204. end;
  205. 1:begin WriteConsole(ID,'*** JUMPER ***',Cor3); WriteConsole(ID,'Pode se teleportar usando sua arma em seus inimigos',$FFFFFF); WriteConsole(ID,'OBS: O poder de sua arma pode atravessar as paredes',$FFFFFF);
  206. end;
  207.      end;
  208.       end;
  209.                end;
  210.  
  211. function OnPlayerDamage(Victim, Shooter: byte; Damage: integer): integer;
  212. begin
  213. If GetPlayerStat(Shooter,'Team') = 1 Then
  214. If P[Shooter].Classe = 1 Then begin
  215. MovePlayer(Shooter, (GetPlayerStat(Victim,'x')),(GetPlayerStat(Victim,'y')));
  216. end;
  217.  
  218. If GetPlayerStat(Shooter,'Team') = 2 Then
  219. If P[Shooter].Classe = 2 Then
  220. If not P[Shooter].Paralisou Then
  221. If not P[Victim].Paralisado Then begin
  222. P[Victim].X := GetPlayerStat(Victim,'x');
  223. P[Victim].Y := GetPlayerStat(Victim,'y');
  224. P[Victim].Paralisado := True;
  225. P[Shooter].Paralisou := True;
  226. P[Victim].Intervalo := Tempo1;
  227. P[Shooter].Intervalo := Tempo2;
  228. end;
  229.  
  230. If GetPlayerStat(Victim,'Team') = 1 Then Result := Damage/4;
  231. If GetPlayerStat(Victim,'Team') = 2 Then Result := Damage;
  232. If GetPlayerStat(Shooter,'Team') = 1 Then Result := 0;
  233.          end;
  234.  
  235. procedure OnPlayerRespawn(ID: byte);
  236. begin
  237. For ID := 1 To 32 Do begin
  238. P[ID].WTime := TimeWeapon;
  239.     end;
  240. end;
Add Comment
Please, Sign In to add comment