Alright, so here's my dirty way of doing it:
- Globally declare
- When the BM checks if( isBlock( ent ) ) in client_PreThink, add in
PHP Code:
if( isBlock( ent ) )
{
if( blockType != BM_WHATEVERYOUNAMEDIT ) // common sense required
{
rnum[id] = random( sizeof BLOCK_COLORS )
}
// stuff for blocks...
}
inside of the code block.
- Replace the function I previously gave you with:
PHP Code:
actionColoredBlock(id)
{
new origin[3];
get_user_origin(id, origin);
message_begin(MSG_BROADCAST,SVC_TEMPENTITY,origin);
write_byte(TE_DLIGHT);
write_coord(origin[0]);
write_coord(origin[1]);
write_coord(origin[2]);
write_byte(50);
write_byte(BLOCK_COLORS[rnum[id]][0]);
write_byte(BLOCK_COLORS[rnum[id]][1]);
write_byte(BLOCK_COLORS[rnum[id]][2]);
write_byte(255);
write_byte(50);
message_end();
}
Keep in mind that this probably isn't the most efficient way to do it, since it's in preThink, but I couldn't think of any other way to do it.
Let me know if it works.
__________________