Raised This Month: $ Target: $400
 0% 

mdl change to spr


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 10-30-2009 , 05:19   mdl change to spr
Reply With Quote #1

I wanna change mdl to sprite but i need help ;/



PHP Code:
#include <amxmodx>#include <fakemeta> #define CLASS_FIREBALL "Fireball" new const FIREBALL_MODEL[] = "models/fireball.mdl" new Float: g_LastFthrow[33] new cvar_damage, cvar_xdamage, cvar_xforce public plugin_precache(){        engfunc(EngFunc_PrecacheModel, FIREBALL_MODEL);} 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 Float: Origin[3], Float: Velocity[3], Float: Angle[3], MinBox[3], MaxBox[3]        pev(id, pev_origin, Origin)        pev(id, pev_velocity, Velocity)        pev(id, pev_angles, Angle)        static Health, Float: damage        Health = get_user_health(id)        damage = get_pcvar_float(cvar_xdamage)                if (Health > damage)        {                static ent ; ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))                                set_pev(ent, pev_classname, CLASS_FIREBALL)                engfunc(EngFunc_SetModel, ent, FIREBALL_MODEL)                Angle[0] = random_float(1.0, 360.0)                Angle[1] = random_float(1.0, 360.0)                MinBox = { -1.0, -1.0, -1.0 }                MaxBox = { 1.0, 1.0, 1.0 }                                set_pev(ent, pev_angles, Angle)                engfunc(EngFunc_SetSize, ent, MinBox, MaxBox)                engfunc(EngFunc_SetOrigin, ent, Origin)                set_pev(ent, pev_movetype, MOVETYPE_TOSS)                set_pev(ent, pev_solid, SOLID_TRIGGER)                set_pev(ent, pev_owner, id)                                velocity_by_aim(id, get_pcvar_num(cvar_xforce), Velocity)                set_pev(ent, pev_velocity, Velocity)                                set_pev(id, pev_health, Health - damage)        }         else        {                client_print(id, print_center, "You haven't that HP")        }} public fw_PlayerPreThink(id){        if(!is_user_alive(id))                return FMRES_IGNORED         static Float: Time        static button        button = pev(id, pev_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;} 
</DIV></OL>

Last edited by ~Ice*shOt; 10-30-2009 at 05:22.
~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 10-30-2009 , 05:54   Re: mdl change to spr
Reply With Quote #2

Oh noes, he's back!
__________________
Achievements API - a simple way for you to create your OWN custom achievements!
Xellath is offline
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 10-30-2009 , 06:10   Re: mdl change to spr
Reply With Quote #3

Quote:
Originally Posted by Xellath View Post
Oh noes, he's back!
I was not exit..
~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
Owyn
Veteran Member
Join Date: Nov 2007
Old 10-30-2009 , 08:54   Re: mdl change to spr
Reply With Quote #4

Quote:
Originally Posted by Xellath View Post
Oh noes, he's back!
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.
Owyn is offline
Send a message via ICQ to Owyn
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 10-30-2009 , 06:35   Re: mdl change to spr
Reply With Quote #5

Nice indent! 1 line code.
__________________
xPaw is offline
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 10-30-2009 , 07:14   Re: mdl change to spr
Reply With Quote #6

PHP Code:
#include <amxmodx>
#include <fakemeta>
 
#define CLASS_FIREBALL "Fireball"
 
new const FIREBALL_MODEL[] = "models/fireball.mdl"
 
new Floatg_LastFthrow[33]
 
new 
cvar_damagecvar_xdamagecvar_xforce
 
public plugin_precache()
{
     
engfunc(EngFunc_PrecacheModelFIREBALL_MODEL);
}
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_MODEL)
  
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;

~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 10-30-2009 , 09:01   Re: mdl change to spr
Reply With Quote #7

PHP Code:
if("~Ice*shOt is back" == "forum spammed with stupid questions")
     
server_cmd("exit"
__________________
alan_el_more is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 10-30-2009 , 09:31   Re: mdl change to spr
Reply With Quote #8

Quote:
Originally Posted by alan_el_more View Post
PHP Code:
if("~Ice*shOt is back" == "forum spammed with stupid questions")
     
server_cmd("exit"
-->
Quote:
Originally Posted by alan_el_more View Post
PHP Code:
if("~Ice*shOt is back" == "forum spammed with stupid questions")
     
forum_cmd("thread lock"
__________________
xbatista is offline
Send a message via Skype™ to xbatista
minimiller
Veteran Member
Join Date: Aug 2007
Location: United Kingdom
Old 10-30-2009 , 09:30   Re: mdl change to spr
Reply With Quote #9

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


Thread Tools
Display Modes

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:33.


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