AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   create a flame for few seconds (https://forums.alliedmods.net/showthread.php?t=240735)

faki 05-21-2014 09:02

create a flame for few seconds
 
I want to create a flame with spr for 10 seconds, after this seconds is pass - flame is need to be hiding by script.

Thanks for any answers.
I try with some functions from molotov coctail but without success.
I want simple and easy to use stock or code.

DavidJr 05-21-2014 09:18

Re: create a flame for few seconds
 
You need to make an entity then attach the sprites, then set_task for 10 minutes to remove.

PHP Code:

new const EntityName[] = "flame";
new const 
Sprites[] = "sprites/flame.spr";

CreateFlame()
{
    new 
iEnt engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString));
    
    
set_pev(iEntpev_classnameEntityName);
    
engfunc(EngFunc_SetModeliEntSprites);
    
    
set_task(10.0"task_RemoveFlame"iEnt);
}

public 
task_RemoveFlame(iEnt)
{
    if (!
pev_valid(iEnt)) return;
    
    
engfunc(EngFunc_RemoveEntityiEnt);



ezio_auditore 05-21-2014 09:38

Re: create a flame for few seconds
 
What about origin

faki 05-21-2014 09:43

Re: create a flame for few seconds
 
@DavidJr, This crashed the server, any other suggestions ?

PP i want to put in
create_blast2(const Float:originF[3])

DavidJr 05-21-2014 09:49

Re: create a flame for few seconds
 
Try with TE_BEAMFOLLOW:

PHP Code:

new const EntityName[] = "flame";
new const 
Mdl[] = "models/bullet.mdl";

new 
Sprite;

public 
plugin_precache()
{
    
Sprite precache_model("sprites/flame.spr");
}

CreateFlame()
{
    new 
iEnt engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString));
    
    
set_pev(iEntpev_classnameEntityName);
    
engfunc(EngFunc_SetModeliEntMdl);
    
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY);
    
write_byte(TE_BEAMFOLLOW);
    
write_short(iEnt);
    
write_short(Sprite);
    
write_byte(10);
    
write_byte(5);
    
write_byte(255);
    
write_byte(255);
    
write_byte(255);
    
write_byte(200);
    
message_end();



faki 05-21-2014 09:54

Re: create a flame for few seconds
 
Same, still crash the server
Code:

FATAL ERROR (shutting down): Host_Error: no precache: ******************@x************************************8t******************8x*********$******************

DavidJr 05-21-2014 10:07

Re: create a flame for few seconds
 
add precache_model(Mdl); in plugin_precache

faki 05-21-2014 11:04

Re: create a flame for few seconds
 
Server is crashed again.

DavidJr 05-21-2014 11:35

Re: create a flame for few seconds
 
What's the message?

faki 05-21-2014 11:38

Re: create a flame for few seconds
 
No have, server just stop when i throw a grenade


All times are GMT -4. The time now is 09:47.

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