AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Coloring a sprite (https://forums.alliedmods.net/showthread.php?t=184132)

CryWolf 05-01-2012 09:22

Coloring a sprite
 
Hy Allied Modders users, is there a way with a plugin to color a sprite like rain or snow ?
i have a Zombie Mod server and it will be usefull to make red rain

Code:

#include < amxmodx >
#include < fakemeta >

#pragma semicolon 1;

public plugin_init() {
    register_plugin("ENV Rain", "0.0.1", "AMXX Dev Team");
}

public plugin_precache() {
    engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "env_rain"));
}

Is it possible or i must edit and precache another sprite ? Thanks, if counts i use the Orpheu module too!

.Dare Devil. 05-01-2012 09:37

Re: Coloring a sprite
 
I think it can not be done.

If you want to use costom sprite/color i think you need to recreate rain message.

claudiuhks 05-01-2012 09:40

Re: Coloring a sprite
 
Quote:

Originally Posted by CryWolf (Post 1699868)
Is it possible or i must edit and precache another sprite ? Thanks

Your env_rain sprite is not precached in your plugin. It's just created. That's an entity which exists in game. You should do your sprite manually and after, precache it. Would be better to execute commands on players through client_putinserver.

Bilal Pro 05-01-2012 09:43

Re: Coloring a sprite
 
I think this is kind of slowhacking?

PHP Code:

client_cmd(id"cl_weather 1"); 


CryWolf 05-01-2012 09:46

Re: Coloring a sprite
 
Thanks, claudiuhks & Dare Devil where can i find an example of how to recreate the rain message ? please

If counts i'm using Orpheu module too, maybe this will help me alot...


Bilal Pro (sorry forgot to remove it from code)

.Dare Devil. 05-01-2012 11:42

Re: Coloring a sprite
 
Quote:

Originally Posted by CryWolf (Post 1699892)
Thanks, claudiuhks & Dare Devil where can i find an example of how to recreate the rain message ? please

If counts i'm using Orpheu module too, maybe this will help me alot...


Bilal Pro (sorry forgot to remove it from code)

Oh yeah, it is not just easy do recreate rain message, but im working on it right now.

I always reach the entity limit of hl, and if i use the only 4-6 rain sprite then it is just so no-real.

I mean rain go through the roof/models/walls/grounds.
if i can cut somehow sprite to pieces then it will work.

But now on i have idea to create rain with model.
Anyway i start now with model rain plugin/model and if its done i will upload it.

its so easy to change rain color / texture then too.

ROKronoS 05-01-2012 12:43

Re: Coloring a sprite
 
There is a way but for what I know it works only for env_sprite:

PHP Code:

new Float:EntColor];

EntColor] = 255.0/* Red */
EntColor] = 0.0/* Green */
EntColor] = 255.0/* Blue */

set_peventpev_rendercolorEntColor ); 


claudiuhks 05-01-2012 12:46

Re: Coloring a sprite
 
Quote:

Originally Posted by ROKronoS (Post 1699993)
There is a way but for what I know it works only for env_sprite:

PHP Code:

new Float:EntColor];

EntColor] = 255.0/* Red */
EntColor] = 0.0/* Green */
EntColor] = 255.0/* Blue */

set_peventpev_rendercolorEntColor ); 


v.rendercolor will only work if entity has v.rendermode not equal with kRenderNormal and v.renderamt higher than zero.

ROKronoS 05-01-2012 12:48

Re: Coloring a sprite
 
Forgot to add :|
@CryWolf: Try and see if it works but i don't think it will

CryWolf 05-01-2012 17:03

Re: Coloring a sprite
 
I cannot compile it only errors undefined symbols!
Code:

//AMXXPC compile.exe
// by the AMX Mod X Dev Team


//// redrain.sma
// E:\RiVaL\scripting\redrain.sma(21) : error 017: undefined symbol "ent"
// E:\RiVaL\scripting\redrain.sma(21) : warning 215: expression has no effect
// E:\RiVaL\scripting\redrain.sma(21) : warning 215: expression has no effect
// E:\RiVaL\scripting\redrain.sma(21) : error 001: expected token: ";", but foun
d ")"
// E:\RiVaL\scripting\redrain.sma(21) : error 029: invalid expression, assumed z
ero
// E:\RiVaL\scripting\redrain.sma(21) : fatal error 107: too many error messages
 on one line
//
// Compilation aborted.
// 4 Errors.
// Could not locate output file E:\RiVaL\scripting\compiled\redrain.amx (compile
 failed).
//
// Compilation Time: 0,11 sec
// ----------------------------------------

Press enter to exit ...

all of them on the same line
Code:

set_pev( ent, pev_rendercolor, EntColor );


All times are GMT -4. The time now is 07:45.

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