Raised This Month: $ Target: $400
 0% 

mdl change to spr


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
minimiller
Veteran Member
Join Date: Aug 2007
Location: United Kingdom
Old 10-30-2009 , 09:30   Re: mdl change to spr
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <fakemeta>
 
#define CLASS_FIREBALL "Fireball"
 
new const FIREBALL_SPRITE[] = "models/fireball.spr"
 
new Floatg_LastFthrow[33]
 
new 
cvar_damagecvar_xdamagecvar_xforce
 
public plugin_precache()
{
     
engfunc(EngFunc_PrecacheModelFIREBALL_SPRITE);
}
public 
plugin_init()
{
 
register_plugin("Skill Fireball""1.0""Frostas")
 
cvar_xforce register_cvar("fb_xforce""1500")
 
cvar_damage register_cvar("fb_damage""200")
 
cvar_xdamage register_cvar("fb_xdamage","1")
 
register_forward(FM_PlayerPreThink"fw_PlayerPreThink")
}
public 
clcmd_throw(id)
{
 static 
FloatOrigin[3], FloatVelocity[3], FloatAngle[3], MinBox[3], MaxBox[3]
 
pev(idpev_originOrigin)
 
pev(idpev_velocityVelocity)
 
pev(idpev_anglesAngle)
 static 
HealthFloatdamage
 Health 
get_user_health(id)
 
damage get_pcvar_float(cvar_xdamage)
 
 if (
Health damage)
 {
  static 
ent ent engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target"))
  
  
set_pev(entpev_classnameCLASS_FIREBALL)
  
engfunc(EngFunc_SetModelentFIREBALL_SPRITE)
  
Angle[0] = random_float(1.0360.0)
  
Angle[1] = random_float(1.0360.0)
  
MinBox = { -1.0, -1.0, -1.0 }
  
MaxBox = { 1.01.01.0 }
  
  
set_pev(entpev_anglesAngle)
  
engfunc(EngFunc_SetSizeentMinBoxMaxBox)
  
engfunc(EngFunc_SetOriginentOrigin)
  
set_pev(entpev_movetypeMOVETYPE_TOSS)
  
set_pev(entpev_solidSOLID_TRIGGER)
  
set_pev(entpev_ownerid)
  
  
velocity_by_aim(idget_pcvar_num(cvar_xforce), Velocity)
  
set_pev(entpev_velocityVelocity)
  
  
set_pev(idpev_healthHealth damage)
 }
 else
 {
  
client_print(idprint_center"You haven't that HP")
 }
}
public 
fw_PlayerPreThink(id)
{
 if(!
is_user_alive(id))
  return 
FMRES_IGNORED
 
static FloatTime
 
static button
 button 
pev(idpev_button)
 
Time get_gametime()
 if (
button IN_USE)
 {
  if(
Time 1.1 g_LastFthrow[id])
  {
   
clcmd_throw(id)
   
g_LastFthrow[id] = Time
  
}
 }
 return 
PLUGIN_CONTINUE;

That'll be £20 plz
__________________
minimiller is offline
Send a message via MSN to minimiller
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:34.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode