Raised This Month: $ Target: $400
 0% 

Spite Help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
cjwprostar
Junior Member
Join Date: Dec 2005
Location: Texas
Old 12-29-2005 , 22:04   Spite Help
Reply With Quote #1

I've read some of the posts here and seached the net, but I'm still confused on how to display a sprite.
I know you need something like this.. (just the needed functions are shown)
Code:
new sprite new userorigin[33] public plugin_precache(){    sprite=precache_model("sprites/whatever.spr")    return PLUGIN_CONTINUE } public displaysprite(id){    get_user_origin(id,userorigin[id],0)    message_begin(MSG_ALL,SVC_TEMPENTITY)    write_byte(?)    write_coord(userorigin[id])    write_coord(userorigin[id])    write_coord(userorigin[id])    write_short(sprite)    message_end() }

Thx in advance
cjwprostar is offline
Send a message via AIM to cjwprostar Send a message via MSN to cjwprostar Send a message via Yahoo to cjwprostar
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 12-30-2005 , 01:07  
Reply With Quote #2

A sprite that's attached to a player, or a sprite that stays in one spot on the map?
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
cjwprostar
Junior Member
Join Date: Dec 2005
Location: Texas
Old 12-30-2005 , 02:38  
Reply With Quote #3

Stays in one spot and disappears after n seconds.
Also is there a way to change the size of the sprite.
cjwprostar is offline
Send a message via AIM to cjwprostar Send a message via MSN to cjwprostar Send a message via Yahoo to cjwprostar
BetaX
Member
Join Date: Nov 2005
Old 12-30-2005 , 18:46  
Reply With Quote #4

Code:
new sprite new userorigin[33] new time public plugin_precache(){    sprite=precache_model("sprites/whatever.spr")    return PLUGIN_CONTINUE } // You'll probably have to make a set_task somewhere for this thing... and where you put that down, slam down this:  time = get_systime(0) public displaysprite(id){    get_user_origin(id,userorigin[id],0)    if(time == time+n) { // Where n = your number...    message_begin(MSG_ALL,SVC_TEMPENTITY)    write_byte(17)    write_coord(userorigin[id])    write_coord(userorigin[id])    write_coord(userorigin[id])    write_short(0)    write_byte(YourScaleHere) // (in 0.1s!)    write_byte(brightnessofthesprite)    message_end()    } else {    message_begin(MSG_ALL,SVC_TEMPENTITY)    write_byte(17)    write_coord(userorigin[id])    write_coord(userorigin[id])    write_coord(userorigin[id])    write_short(whatever.spr)    write_byte(YourScaleHere)    write_byte(brightnessofthesprite)    message_end()    }     }

I also kinda doubt that you want it to make it userorigin[id].

I am pretty damn sure you want it to be userorigin[0] and then [1] and then [2] but... then again... I am the noob.

I didn't try this, so feel free to edit it. Consider it a rough draft
BetaX is offline
cjwprostar
Junior Member
Join Date: Dec 2005
Location: Texas
Old 12-30-2005 , 19:29  
Reply With Quote #5

Ok thanks I'll try it out.
I'm new to the message thing, what do the write_type()s do?
And it should be userorigin[33][3]..sry bout that.
cjwprostar is offline
Send a message via AIM to cjwprostar Send a message via MSN to cjwprostar Send a message via Yahoo to cjwprostar
BetaX
Member
Join Date: Nov 2005
Old 12-31-2005 , 03:05  
Reply With Quote #6

The write_* basically fills in what you want the SVC_TEMPENTITY to be.

There's a list somewhere around here if you're not sure what they are. For that, I'll list what each of the bytes/shorts do.


Code:
   write_byte(17) // What kind of tempentity it is, in this case a regular ol' sprite    write_coord(userorigin[id]) // X Coordinate    write_coord(userorigin[id]) // Y Coordinate    write_coord(userorigin[id]) // Z Coordinate    write_short(0) // The spr's name. Giving it 0 means it has none...    write_byte(YourScaleHere) // The scale of the sprite (in 0.1s)    write_byte(brightnessofthesprite) // And, well, the brightness of the sprite.
BetaX is offline
cjwprostar
Junior Member
Join Date: Dec 2005
Location: Texas
Old 12-31-2005 , 21:03  
Reply With Quote #7

Thanks alot that helped.
cjwprostar is offline
Send a message via AIM to cjwprostar Send a message via MSN to cjwprostar Send a message via Yahoo to cjwprostar
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 16:00.


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