AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   need help with .spr (https://forums.alliedmods.net/showthread.php?t=93105)

~Ice*shOt 05-24-2009 12:00

need help with .spr
 
PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <cstrike>
#include <hamsandwich>
#define CLASS_FIREBALL "wow_fireball"
new const WOW_FIREBALL[][] =
{
"models/w_paintball.mdl"

new 
cvar_fdamagecvar_fsdamagecvar_fforce
new Floatg_LastFthrow[33]
public 
plugin_init() 
{

cvar_fdamage register_cvar("zswarm_fdamage""100")
cvar_fsdamage register_cvar("zswarm_fsdamage","1")
cvar_fforce register_cvar("zswarm_fforce""1500")
register_forward(FM_Touch"fw_Touch")
register_forward(FM_Touch"fw_Touch")
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_fsdamage)

if (
Health damage)
{
static 
ent ent engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target"))

set_pev(entpev_classnameCLASS_FIREBALL)
engfunc(EngFunc_SetModelentWOW_FIREBALL[random(sizeof WOW_FIREBALL)])
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_fforce), Velocity)
set_pev(entpev_velocityVelocity)

set_pev(idpev_healthHealth damage)
}
else
{
client_print(idprint_center"%L"LANG_PLAYER"FLESH_HEALTH")
}
}
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_ATTACK) && (button IN_ATTACK2))
{
if(
Time 1.1 g_LastFthrow[id])
{
clcmd_throw(id)
g_LastFthrow[id] = Time
}
}
return 
FMRES_IGNORED

 
public 
fw_Touch(pToucherpTouched)
{
if ( 
pev_valid(pToucher))
{
static 
className[32], className2[32]
pev(pToucherpev_classnameclassName31)
if ( 
pev_valid(pTouched)) pev(pTouchedpev_classnameclassName231)

if ( 
equal(classNameCLASS_FIREBALL))
{
static 
attacker attacker pev(pToucherpev_owner)

if ( 
pev_valid(pTouched))
{
if ( 
equal(className2"player") && is_user_connected(pTouched))
{
static 
origin[3], Floatdamage
get_user_origin
(pTouchedorigin)
damage get_pcvar_float(cvar_fdamage)
static 
CsTeams:team[2]
team[0] = cs_get_user_team(pTouched), team[1] = cs_get_user_team(attacker)

if (
attacker == pTouched)
return 
FMRES_SUPERCEDE

if (!get_cvar_num("mp_friendlyfire") && team[0] == team[1]) 
return 
FMRES_SUPERCEDE
message_begin
(MSG_BROADCASTSVC_TEMPENTITY);
write_byte(TE_BLOOD);
write_coord(origin[0]);
write_coord(origin[1]);
write_coord(origin[2] + 10);
write_coord(random_num(-360360));
write_coord(random_num(-360360));
write_coord(-10);
write_byte(70);
write_byte(random_num(1535));
message_end() 
ExecuteHam(Ham_TakeDamagepTouchedpToucherattackerdamageDMG_GENERIC)
}
else if ( 
equal(className2"func_breakable")) dllfunc(DLLFunc_UsepTouchedattacker
else if ( 
equal(className2CLASS_FIREBALL)) return FMRES_SUPERCEDE 

engfunc(EngFunc_RemoveEntitypToucher)
}
}

return 
FMRES_IGNORED

public 
plugin_precache()

precache_model("models/w_paintball.mdl")


you can make a instead model to .spr? i want to this shoot a fire or flame

Arkshine 05-24-2009 12:14

Re: need help with .spr
 
Juste change WOW_FIREBALL by a sprite.

~Ice*shOt 05-24-2009 12:27

Re: need help with .spr
 
do not understand .. Give example

Exolent[jNr] 05-24-2009 13:02

Re: need help with .spr
 
He says that this:
Code:
new const WOW_FIREBALL[][] = { "models/w_paintball.mdl" }
Shows that the entity's model will be a model.
All you have to do is find a sprite you want and use that.

Let's say for the example that you want to use the sprite "sprites/newpaintball.spr".
All you have to do is this:
Code:
new const WOW_FIREBALL[][] = { "sprites/newpaintball.spr" }

xbatista 05-24-2009 13:17

Re: need help with .spr
 
Don't think that will work good :crab: :crab: :crab:
Sprites will be black

~Ice*shOt 05-24-2009 13:30

Re: need help with .spr
 
xbatista to remove the black ?

Exolent[jNr] 05-24-2009 13:42

Re: need help with .spr
 
Quote:

Originally Posted by ~Ice*shOt (Post 833801)
xbatista to remove the black ?

entity_set_int(entity, EV_INT_rendermode, kRenderTransAlpha);
entity_set_float(entity, EV_FL_renderamt, 255.0);

~Ice*shOt 05-24-2009 14:10

Re: need help with .spr
 
Thx, but you can ister it ? please :)


All times are GMT -4. The time now is 01:33.

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