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 dwo6wjhxmts8 dodana przez Kolumb, 06.01.2013 13:24
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. 182. 183. 184. 185. 186. 187. 188. 189. 190. 191. 192. 193. 194. 195. 196. 197. 198. 199. 200. 201. 202. 203. 204. 205. 206.
case klasy
case 7:
{
player_class[id] = Imp
c_blink[id] = floatround(halflife_time())
LoadXP(id, player_class[id])
}
teraz pubiliki
public UTIL_Teleport(id,distance)
{
Set_Origin_Forward(id,distance)
new origin[3]
get_user_origin(id,origin)
//Particle burst ie. teleport effect
message_begin(MSG_BROADCAST ,SVC_TEMPENTITY) //message begin
write_byte(TE_PARTICLEBURST )
write_coord(origin[0]) // origin
write_coord(origin[1]) // origin
write_coord(origin[2]) // origin
write_short(20) // radius
write_byte(1) // particle color
write_byte(4) // duration * 10 will be randomized a bit
message_end()
}
stock Set_Origin_Forward(id, distance)
{
new Float:origin[3]
new Float:angles[3]
new Float:teleport[3]
new Float:heightplus = 10.0
new Float:playerheight = 64.0
new bool:recalculate = false
new bool:foundheight = false
pev(id,pev_origin,origin)
pev(id,pev_angles,angles)
teleport[0] = origin[0] + distance * floatcos(angles[1],degrees) * floatabs(floatcos(angles[0],degrees));
teleport[1] = origin[1] + distance * floatsin(angles[1],degrees) * floatabs(floatcos(angles[0],degrees));
teleport[2] = origin[2]+heightplus
while (!Can_Trace_Line_Origin(origin,teleport) || Is_Point_Stuck(teleport,48.0))
{
if (distance < 10)
break;
//First see if we can raise the height to MAX playerheight, if we can, it's a hill and we can teleport there
for (new i=1; i < playerheight+20.0; i++)
{
teleport[2]+=i
if (Can_Trace_Line_Origin(origin,teleport) && !Is_Point_Stuck(teleport,48.0))
{
foundheight = true
heightplus += i
break
}
teleport[2]-=i
}
if (foundheight)
break
recalculate = true
distance-=10
teleport[0] = origin[0] + (distance+32) * floatcos(angles[1],degrees) * floatabs(floatcos(angles[0],degrees));
teleport[1] = origin[1] + (distance+32) * floatsin(angles[1],degrees) * floatabs(floatcos(angles[0],degrees));
teleport[2] = origin[2]+heightplus
}
if (!recalculate)
{
set_pev(id,pev_origin,teleport)
return PLUGIN_CONTINUE
}
teleport[0] = origin[0] + distance * floatcos(angles[1],degrees) * floatabs(floatcos(angles[0],degrees));
teleport[1] = origin[1] + distance * floatsin(angles[1],degrees) * floatabs(floatcos(angles[0],degrees));
teleport[2] = origin[2]+heightplus
set_pev(id,pev_origin,teleport)
return PLUGIN_CONTINUE
}
stock bool:Can_Trace_Line_Origin(Float:origin1[3], Float:origin2[3])
{
new Float:Origin_Return[3]
new Float:temp1[3]
new Float:temp2[3]
temp1[x] = origin1[x]
temp1[y] = origin1[y]
temp1[z] = origin1[z]-30
temp2[x] = origin2[x]
temp2[y] = origin2[y]
temp2[z] = origin2[z]-30
trace_line(-1, temp1, temp2, Origin_Return)
if (get_distance_f(Origin_Return,temp2) < 1.0)
return true
return false
}
stock bool:Is_Point_Stuck(Float:Origin[3], Float:hullsize)
{
new Float:temp[3]
new Float:iterator = hullsize/3
temp[2] = Origin[2]
for (new Float:i=Origin[0]-hullsize; i < Origin[0]+hullsize; i+=iterator)
{
for (new Float:j=Origin[1]-hullsize; j < Origin[1]+hullsize; j+=iterator)
{
//72 mod 6 = 0
for (new Float:k=Origin[2]-CS_PLAYER_HEIGHT; k < Origin[2]+CS_PLAYER_HEIGHT; k+=6)
{
temp[0] = i
temp[1] = j
temp[2] = k
if (point_contents(temp) != -1)
return true
}
}
}
return false
}
stock Effect_Bleed(id,color)
{
new origin[3]
get_user_origin(id,origin)
new dx, dy, dz
for(new i = 0; i < 3; i++)
{
dx = random_num(-15,15)
dy = random_num(-15,15)
dz = random_num(-20,25)
for(new j = 0; j < 2; j++)
{
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
write_byte(TE_BLOODSPRITE)
write_coord(origin[0]+(dx*j))
write_coord(origin[1]+(dy*j))
write_coord(origin[2]+(dz*j))
write_short(sprite_blood_spray)
write_short(sprite_blood_drop)
write_byte(color) // color index
write_byte(8) // size
message_end()
}
}
}
moc klasy to c_blink
public Prethink_Blink(id)
{
if( get_user_button(id) & IN_ATTACK2 && !(get_user_oldbutton(id) & IN_ATTACK2) && is_user_alive(id))
{
if (on_knife[id])
{
if (halflife_time()-player_b_blink[id] <= 3) return PLUGIN_HANDLED
player_b_blink[id] = floatround(halflife_time())
UTIL_Teleport(id,300+15*player_intelligence[id])
}
}
if( get_user_button(id) & IN_ATTACK2 && !(get_user_oldbutton(id) & IN_ATTACK2) && is_user_alive(id))
{
if (on_knife[id])
{
if (halflife_time()-c_blink[id] <= 3) return PLUGIN_HANDLED
c_blink[id] = floatround(halflife_time())
UTIL_Teleport(id,300+15*player_intelligence[id])
}
}
Dodanych wklejek: 15354
Powered By (Pav32) Pastebin © 2011


Dodatki SourceMod


