Witamy w Nieoficjalnym polskim support'cie AMX Mod X
Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
|
Guest Message by DevFuse
Wklejka 1qezzoqx1i5cg dodana przez fdrest, 28.02.2012 20:38
do tłumaczenia 3
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55. 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. 67. 68. 69. 70. 71. 72. 73. 74. 75. 76. 77. 78. 79. 80. 81. 82. 83. 84. 85. 86. 87. 88. 89. 90. 91. 92. 93. 94. 95. 96. 97. 98. 99. 100. 101. 102. 103. 104. 105. 106. 107. 108. 109. 110. 111. 112. 113. 114. 115. 116. 117. 118. 119. 120. 121. 122. 123. 124. 125. 126. 127. 128. 129. 130. 131. 132. 133. 134. 135. 136. 137. 138. 139. 140. 141. 142. 143. 144. 145. 146. 147. 148. 149. 150. 151. 152. 153. 154. 155. 156. 157. 158. 159. 160. 161. 162. 163. 164. 165. 166. 167. 168. 169. 170. 171. 172. 173. 174. 175. 176. 177. 178. 179. 180. 181.
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <engine>
#define PLUGIN "R Paintball Moves"
#define VERSION "1.1"
#define AUTHOR "Rul4"
new Float: userSprintLast[33], Float: userSprintLastBat[33], Float: userSprintSound[33]
new userSprintSpeed[33], userSprintTiredness[33], userSprintAdvised[33]
new userWeapon[33][32]
new pbmoves, verbose, use_batmeter, rechargetime, max_stamina
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_cvar("rpaintballmoves", VERSION, FCVAR_SERVER|FCVAR_UNLOGGED);
set_cvar_string("rpaintballmoves", VERSION)
if (get_pcvar_num(pbmoves))
{
register_forward(FM_CmdStart, "fw_cmdstart");
}
}
public plugin_precache()
{
pbmoves = register_cvar("pbmoves_enabled", "1");
verbose = register_cvar("pbmoves_verbose", "1");
use_batmeter = register_cvar("pbmoves_usebatterymeter", "1");
rechargetime = register_cvar("pbmoves_rechargetime", "10.0");
max_stamina = register_cvar("pbmoves_maxstamina", "700");
precache_sound("player/sprint.wav");
precache_sound("player/gasp1.wav");
}
public fw_cmdstart( id, uc_handle, random_seed )
{
if ( !is_user_alive( id ) || !get_pcvar_num(pbmoves))
return FMRES_IGNORED
static buttons; buttons = get_uc( uc_handle, UC_Buttons )
new Float: gametime = get_gametime()
if ((gametime - userSprintLast[id] > get_pcvar_float(rechargetime) || !userSprintLast[id]))
{
userSprintTiredness[id] = 0
userSprintLast[id] = gametime
set_hudmessage(255, 255, 255, -1.0, 0.33, 0, 1.0, 1.0);
if (get_pcvar_num(verbose) && !userSprintAdvised[id])
{
userSprintAdvised[id] = true
show_hudmessage(id, "You are fresh! You can sprint with right-click...");
}
if (get_pcvar_num(use_batmeter))
{
userSprintLastBat[id] = gametime
message_begin(MSG_ONE,get_user_msgid("FlashBat"),{0,0,0},id);
write_byte(100);
message_end();
}
}
new currentweapon = get_user_weapon(id)
if (buttons & IN_ATTACK2 && currentweapon != CSW_SCOUT)
{
set_uc (uc_handle, UC_Buttons, buttons & ~IN_ATTACK2);
if (userSprintTiredness[id] >= get_pcvar_num(max_stamina))
{
userSprintAdvised[id] = false
set_hudmessage(255, 255, 255, -1.0, 0.33, 0, 0.1, 0.1);
if (get_pcvar_num(verbose))
show_hudmessage(id, "Too tired to sprint. Please wait...");
if (gametime - userSprintSound[id] > 1.0)
{
emit_sound(id, CHAN_AUTO, "player/gasp1.wav", 1.0, ATTN_NORM , 0, PITCH_NORM);
userSprintSound[id] = gametime
}
return FMRES_IGNORED;
}
userSprintTiredness[id] += 1
if (!(buttons & IN_DUCK))
{
if (currentweapon != CSW_KNIFE){
get_weaponname(currentweapon,userWeapon[id],30)
engclient_cmd(id, "weapon_knife")
}
userSprintSpeed[id] += 2;
if (userSprintSpeed[id] < 200)
userSprintSpeed[id] = 200;
if (userSprintSpeed[id] > 400)
userSprintSpeed[id] = 400;
userSprintLast[id] = gametime
//Some of this was inspired in +Speed 1.17 by Melanie
new Float:returnV[3], Float:Original[3]
VelocityByAim ( id, userSprintSpeed[id], returnV )
pev(id,pev_velocity,Original)
//Avoid floating in the air and ultra high jumps
if (vector_length(Original) < 600.0 || Original[2] < 0.0)
returnV[2] = Original[2]
set_pev(id,pev_velocity,returnV)
set_hudmessage(255, 255, 255, -1.0, 0.33, 0, 0.1, 0.1);
if (get_pcvar_num(verbose))
show_hudmessage(id, "Sprinting...");
if (userSprintLast[id] - userSprintSound[id] > 1.0)
{
emit_sound(id, CHAN_AUTO, "player/sprint.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
userSprintSound[id] = userSprintLast[id]
}
if (gametime - userSprintLastBat[id] > 0.2 && get_pcvar_num(use_batmeter))
{
userSprintLastBat[id] = gametime
new percentage = 100 - (userSprintTiredness[id] * 100 / get_pcvar_num(max_stamina))
message_begin(MSG_ONE,get_user_msgid("FlashBat"),{0,0,0},id);
write_byte(percentage);
message_end();
}
return FMRES_IGNORED;
} else
{
if (userSprintSpeed[id] > 2)
userSprintSpeed[id] -= 2;
else
userSprintSpeed[id] = 0;
userSprintLast[id] = gametime
new Float:returnV[3], Float:Original[3]
VelocityByAim ( id, userSprintSpeed[id], returnV )
pev(id,pev_velocity,Original)
//Avoid floating in the air and ultra high jumps
if (vector_length(Original) < 600.0 || Original[2] < 0.0)
returnV[2] = Original[2]
set_pev(id,pev_velocity,returnV)
set_hudmessage(255, 255, 255, -1.0, 0.33, 0, 0.1, 0.1);
if (get_pcvar_num(verbose))
show_hudmessage(id, "Sliding...");
return FMRES_IGNORED;
}
}
//restore weapon after sprinting
if(userWeapon[id][0])
{
engclient_cmd(id, userWeapon[id])
userWeapon[id][0] = 0
}
userSprintSpeed[id] = 0;
return FMRES_IGNORED;
}
Dodanych wklejek: 15354
Powered By (Pav32) Pastebin © 2011


Dodatki SourceMod


