Change sprite when function is called?
Mine idea is basically when I call some function I make ( let's say noclip ) - is it possible to change its sprite to another one, but only when one function is called?
So I turn noclip on and one sprite changes to another while noclip is on. And if noclip is off, the sprite changes back to normal. I know its possible, I saw it somewhere on one server... |
Yes, it is possible. Are you confusing sprite with model? Do you want to change the player's model while they are noclipped? Where and how do you want the sprite to be displayed?
|
Nope, I know sprite is not player model, I'm not that much n00b :)
For mod I'm making plugin, it has charging attacks, and different sprite for every attack thats charging. Mine idea is to replace that sprite by code if I use some action performed on me. So, if charging sprite is, let's say - charge.spr - I would like to change it via code to charge2.spr which is mine sprite and will work only if that function is happening right now. If function is not happening, or stoped, that sprite is returned to normal one. |
You would have to find what entity they use to display the charge up sprite, and then find that entity and change whatever keyvalue it is that determines what sprite it displays.
|
But that sprite is attached to player, not an entity, so I guess no entity finding is necesary? Or if it is, code snippet please... Coz I can't pretty much find it out myself...
|
ok u can do it this way
Code:
This way all you do is call changeClip(id) and it will automaticly figure out whether to give them clip or to take it away [EDIT] This isnt a very best way to do it if ur changing sprite alot. To do it better its best to built another change sprite function where u would specify id and what sprite so u dont have to keep changing sprite in all ur charging functions |
Noclip was just example - but the problem is how to actually find out whos using that sprite and then change it? Is something like this possible:
Code:
But yet if this above is true, then the main question is - how to replace that sprite? |
are u sure the playermodel itself doesnt have the 'sprite' built in? I have a player model that shoots lightning bolts, but the 'charging' effect is actualy built into the model. A plugin i have actually 'shoots' lightning.
|
Lynx ur confusing me and urself.
First of tell me how your setting the sprite? Player attachment or as an entity? In both ways you can just make a bool to identify that the player either has or doesnt have the sprite. Code:
|
Okay, this way - that sprite is a player attachment which follows his right hand and is attached to player as long as I'm holding Mouse1 to charge ( that's an weapon ). I need the code snippet which will replace any sprite under name, let's say, "bigbanga.spr", and replace it with "bigbang2.spr". Only on one player. For others it should remain unchanged. You get me now?
|
| All times are GMT -4. The time now is 14:03. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.