|
发表于 2011-12-21 17:18:42
|
显示全部楼层
来自 中国–广东–广州
7# 点通粉丝 - 148.if(range < get_pcvar_float(cvar_damagerange))
- 149.{
- 150.new Float:explodeknock = get_pcvar_float(cvar_knock)*(get_pcvar_float(cvar_damagerange)-range)/get_pcvar_float(cvar_damagerange)
- 151.set_velocity_from_origin(i, vecOrigin, explodeknock)
- 152.}
- 153.if(range <= get_pcvar_float(cvar_shakerange) && is_user_alive(i))
- 154.{
- 155.message_begin(MSG_ONE,get_user_msgid("ScreenShake"),{0,0,0},i)
- 156.write_short(1<<12)
- 157.write_short(1<<12)
- 158.write_short(1<<12)
- 159.message_end()
- 160.}
- 161.}
- 162.
- 163.makesmoke(iEntity, vecOrigin)
- 164.set_pev(iEntity, pev_iuser1, 0)
- 165.}
- 166.forward_return(FMV_CELL, iResult)
- 167.
- 168.return FMRES_SUPERCEDE
- 169.}
- 170.public fw_SetModel(iEntity, szModel[])
- 171.{
- 172.if(strlen(szModel) < 8)
- 173.return FMRES_IGNORED
- 174.
- 175.if(szModel[7] != 'w' || szModel[8] != '_')
- 176.return FMRES_IGNORED
- 177.
- 178.if(szModel[9] == 'h' && szModel[10] == 'e')
- 179.{
- 180.new Float:dmgtime
- 181.pev(iEntity, pev_dmgtime, dmgtime)
- 182.set_pev(iEntity, pev_dmgtime, get_gametime()+get_pcvar_float(cvar_grenadetime))
- 183.set_pev(iEntity, pev_iuser1, HEEXPLODE)
- 184.}
- 185.
- 186.return FMRES_IGNORED
- 187.}
- 188.public makesmoke(iEntity, Float:position[3])
- 189.{
- 190.new Float:origin[8][3], Float:iorigin[12][3], Float:iposition[3]
- 191.
- 192.if(pev(iEntity, pev_flags) & FL_ONGROUND)
- 193.{
- 194.iposition[0]=position[0]
- 195.iposition[1]=position[1]
- 196.iposition[2]=position[2]
- 197.get_spherical_coord(iposition, 40.0, 0.0, -15.0, iorigin[0])
- 198.get_spherical_coord(iposition, 40.0, 90.0, -15.0, iorigin[1])
- 199.get_spherical_coord(iposition, 40.0, 180.0, -15.0, iorigin[2])
- 200.get_spherical_coord(iposition, 40.0, 270.0, -15.0, iorigin[3])
- 201.get_spherical_coord(iposition, 100.0, 0.0, -15.0, iorigin[4])
- 202.get_spherical_coord(iposition, 100.0, 45.0, -15.0, iorigin[5])
- 203.get_spherical_coord(iposition, 100.0, 90.0, -15.0, iorigin[6])
- 204.get_spherical_coord(iposition, 100.0, 135.0, -15.0, iorigin[7])
- 205.get_spherical_coord(iposition, 100.0, 180.0, -15.0, iorigin[8])
- 206.get_spherical_coord(iposition, 100.0, 225.0, -15.0, iorigin[9])
- 207.get_spherical_coord(iposition, 100.0, 270.0, -15.0, iorigin[10])
- 208.get_spherical_coord(iposition, 100.0, 315.0, -15.0, iorigin[11])
- 209.for(new i = 0; i < MDLCOUNT; i++)
- 210.{
- 211.new Float:velocity[MDLCOUNT][3]
- 212.velocity[i][0] = random_float(-500.0,500.0)
- 213.velocity[i][1] = random_float(-500.0,500.0)
- 214.velocity[i][2] = random_float(-300.0,300.0)
- 215.makebreakmodels(position, 1.0, 1.0, 1.0, velocity[i][0], velocity[i][1], velocity[i][2], szbreakmodels[random_num(0, sizeof szbreakmodels-1)], 1, get_pcvar_num(cvar_mdltime))
- 216.}
- 217.for(new e = 0; e < 12; e++) make_smoke(iorigin[e], g_smokeSpr2, 16, 100)
- 218.position[2]+=120.0
- 219.}
- 220.get_spherical_coord(position, 0.0, 0.0, 135.0, origin[0])
- 221.get_spherical_coord(position, 0.0, 80.0, 80.0, origin[1])
- 222.get_spherical_coord(position, 41.0, 43.0, 60.0, origin[2])
- 223.get_spherical_coord(position, 90.0, 90.0, 40.0, origin[3])
- 224.get_spherical_coord(position, 80.0, 25.0, 135.0, origin[4])
- 225.get_spherical_coord(position, 101.0, 100.0, 112.0, origin[5])
- 226.get_spherical_coord(position, 68.0, 35.0, 139.0, origin[6])
- 227.get_spherical_coord(position, 0.0, 95.0, 105.0, origin[7])
- 228.
- 229.for(new c = 0; c < 8; c++) make_smoke(origin[c], g_smokeSpr, 40, 30)
- 230.}
- 231.stock make_smoke(Float:position[3], sprite_index, size, light)
- 232.{
- 233.engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, position, 0)
- 234.write_byte(TE_SPRITE)
- 235.engfunc(EngFunc_WriteCoord, position[0])
- 236.engfunc(EngFunc_WriteCoord, position[1])
- 237.engfunc(EngFunc_WriteCoord, position[2])
- 238.write_short(sprite_index)
- 239.write_byte(size)
- 240.write_byte(light)
- 241.message_end()
- 242.}
- 243.stock makebreakmodels(Float:vecOrigin[3], Float:sizex, Float:sizey, Float:sizez, Float:velocityx, Float:velocityy, Float:velocityz, const models_index, count, livetime)
- 244.{
- 245.engfunc(EngFunc_MessageBegin, MSG_ALL, SVC_TEMPENTITY, vecOrigin, 0)
- 246.write_byte(TE_BREAKMODEL)
- 247.engfunc(EngFunc_WriteCoord, vecOrigin[0])
- 248.engfunc(EngFunc_WriteCoord, vecOrigin[1])
- 249.engfunc(EngFunc_WriteCoord, vecOrigin[2])
- 250.engfunc(EngFunc_WriteCoord, sizex)
- 251.engfunc(EngFunc_WriteCoord, sizey)
- 252.engfunc(EngFunc_WriteCoord, sizez)
- 253.engfunc(EngFunc_WriteCoord, velocityx)
- 254.engfunc(EngFunc_WriteCoord, velocityy)
- 255.engfunc(EngFunc_WriteCoord, velocityz)
- 256.write_byte(10)
- 257.write_short(models_index)
- 258.write_byte(count)
- 259.write_byte(livetime*10)
- 260.write_byte(0x40)
- 261.message_end()
- 262.}
- 263.stock get_velocity_from_origin( ent, Float:fOrigin[3], Float:fSpeed, Float:fVelocity[3] )
- 264.{
- 265.new Float:fEntOrigin[3]
- 266.pev( ent, pev_origin, fEntOrigin )
- 267.
- 268.new Float:fDistance[3]
- 269.fDistance[0] = fEntOrigin[0] - fOrigin[0]
- 270.fDistance[1] = fEntOrigin[1] - fOrigin[1]
- 271.fDistance[2] = fEntOrigin[2] - fOrigin[2]
- 272.
- 273.new Float:fTime = ( vector_distance( fEntOrigin,fOrigin ) / fSpeed )
- 274.
- 275.fVelocity[0] = fDistance[0] / fTime
- 276.fVelocity[1] = fDistance[1] / fTime
- 277.fVelocity[2] = fDistance[2] / fTime
- 278.
- 279.return ( fVelocity[0] && fVelocity[1] && fVelocity[2] )
- 280.}
- 281.stock set_velocity_from_origin(ent, Float:fOrigin[3], Float:fSpeed)
- 282.{
- 283.new Float:fVelocity[3]
- 284.get_velocity_from_origin(ent,fOrigin,fSpeed,fVelocity)
- 285.fVelocity[2]/=2
- 286.set_pev(ent,pev_velocity,fVelocity)
- 287.return 1
- 288.}
- 289.stock get_spherical_coord(const Float:ent_origin[3], Float:redius, Float:level_angle, Float:vertical_angle, Float:origin[3])
- 290.{
- 291.new Float:length
- 292.length=redius*floatcos(vertical_angle, degrees)
- 293.origin[0]=ent_origin[0]+length*floatcos(level_angle,degrees)
- 294.origin[1]=ent_origin[1]+length*floatsin(level_angle,degrees)
- 295.origin[2]=ent_origin[2]+redius*floatsin(vertical_angle,degrees)
- 296.}
复制代码 |
|