AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   mdl change to spr (https://forums.alliedmods.net/showthread.php?t=107771)

~Ice*shOt 10-30-2009 05:19

mdl change to spr
 
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>

Xellath 10-30-2009 05:54

Re: mdl change to spr
 
Oh noes, he's back!

~Ice*shOt 10-30-2009 06:10

Re: mdl change to spr
 
Quote:

Originally Posted by Xellath (Post 975865)
Oh noes, he's back!

I was not exit..

xPaw 10-30-2009 06:35

Re: mdl change to spr
 
Nice indent! 1 line code.

~Ice*shOt 10-30-2009 07:14

Re: mdl change to spr
 
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;



Owyn 10-30-2009 08:54

Re: mdl change to spr
 
Quote:

Originally Posted by Xellath (Post 975865)
Oh noes, he's back!


alan_el_more 10-30-2009 09:01

Re: mdl change to spr
 
PHP Code:

if("~Ice*shOt is back" == "forum spammed with stupid questions")
     
server_cmd("exit"


minimiller 10-30-2009 09:30

Re: mdl change to spr
 
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

xbatista 10-30-2009 09:31

Re: mdl change to spr
 
Quote:

Originally Posted by alan_el_more (Post 975964)
PHP Code:

if("~Ice*shOt is back" == "forum spammed with stupid questions")
     
server_cmd("exit"


-->
Quote:

Originally Posted by alan_el_more (Post 975964)
PHP Code:

if("~Ice*shOt is back" == "forum spammed with stupid questions")
     
forum_cmd("thread lock"




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

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