Raised This Month: $ Target: $400
 0% 

Spawn sprite problem - code inside, needs fix


Post New Thread Reply   
 
Thread Tools Display Modes
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 03-11-2005 , 21:01  
Reply With Quote #11

Code:
new theSprite; public plugin_precache() {    theSprite = precache_model("sprites/spritename.spr"); } public myfunction(id) {    new spriteorigin[3];    get_user_origin(id,spriteorigin);    // TE_SPRITE - additive sprite, plays 1 cycle    message_begin(MSG_BROADCAST,SVC_TEMPENTITY);    write_byte(17);    write_coord(spriteorigin[0]); // coord, coord, coord (position)    write_coord(spriteorigin[1]);    write_coord(spriteorigin[2]);    write_short(theSprite); // short (sprite index)    write_byte(20); // byte (scale in 0.1's)      write_byte(200); // byte (brightness)    message_end(); }
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
LynX
Veteran Member
Join Date: Oct 2004
Old 03-12-2005 , 02:23  
Reply With Quote #12

Okay, this from XxavlanchexX works, but one more question - how can I make that it plays for defined number of seconds?
__________________
Current plugin : SoulPunisher anti-cheat
Percentage done : {||--------} 20%

If you think v3x is a PIMP, paste this into your sig!

If you think Bailopan is DA BOMB, paste this into your sig
LynX is offline
Send a message via ICQ to LynX
FoX Rider
Member
Join Date: Feb 2005
Location: AK
Old 03-12-2005 , 03:44  
Reply With Quote #13

You mean..

set_task("10.0","fucntion")
__________________
Ride for fox..Die for fox.
FoX Rider is offline
LynX
Veteran Member
Join Date: Oct 2004
Old 03-12-2005 , 03:48  
Reply With Quote #14

I already have made that - but sprite isn't staying that long... I need a way how to define its life on map... Please help...
__________________
Current plugin : SoulPunisher anti-cheat
Percentage done : {||--------} 20%

If you think v3x is a PIMP, paste this into your sig!

If you think Bailopan is DA BOMB, paste this into your sig
LynX is offline
Send a message via ICQ to LynX
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 03-12-2005 , 13:03  
Reply With Quote #15

It only plays through one cycle. You could edit the sprite and add a ton of frames of the same image (although it may increase file size), but you'll still need to use set_task to continually display the sprite.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
knekter
Senior Member
Join Date: Mar 2004
Location: PA
Old 03-12-2005 , 13:16   easy
Reply With Quote #16

Why not use krotals sprite plugin???? It uses a player attachment message instead of TE_SPRITE. Go here:

http://forums.alliedmods.net/showthread.php?t=4603
__________________
More updates for Matrix Mod!
knekter is offline
Send a message via AIM to knekter Send a message via MSN to knekter
LynX
Veteran Member
Join Date: Oct 2004
Old 03-12-2005 , 14:10  
Reply With Quote #17

Well, the only problem about set_task is I already have it, the sprite is running on one function for diff amount of time ( as long as godmode, engclient_cmd, render, etc. ) - so I need it plays longer...
I'll try your idea knekter.
__________________
Current plugin : SoulPunisher anti-cheat
Percentage done : {||--------} 20%

If you think v3x is a PIMP, paste this into your sig!

If you think Bailopan is DA BOMB, paste this into your sig
LynX is offline
Send a message via ICQ to LynX
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 03-12-2005 , 15:40  
Reply With Quote #18

A player attachment has to be attached to a player (duh) and must be over their head. I suppose you could use some negative z values to make it appear in them, but it won't work for every case.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
LynX
Veteran Member
Join Date: Oct 2004
Old 03-12-2005 , 17:13  
Reply With Quote #19

Ok, thanks you all guys - but I think I'll make sprite which plays 6 seconds, soo its done with code! A BIG THANK TO YOU ALL!
__________________
Current plugin : SoulPunisher anti-cheat
Percentage done : {||--------} 20%

If you think v3x is a PIMP, paste this into your sig!

If you think Bailopan is DA BOMB, paste this into your sig
LynX is offline
Send a message via ICQ to LynX
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 22:04.


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