Raised This Month: $ Target: $400
 0% 

How to make invis people vis to only certain people?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 07-24-2009 , 20:32   How to make invis people vis to only certain people?
Reply With Quote #1

Code:
#include <amxmodx> #include <fun> public plugin_init() {    register_clcmd("say /invis", "cmdInvis")    register_clcmd("say /seeinvis", "cmdSeeInvis") } public cmdInvis(id) {    set_user_rendering(id,kRenderFxGlowShell,0,0, 0,kRenderTransAlpha, 20); } public cmdSeeInvis(id) {    //what do I need to put here to make it so only the person who does the command can see someone who's invis? }

I think that it should be obvious what I want but if not then I'll clarify.
I want it so that the person who types /seeinvis will be able to see invis people as if they had the alpha of something that I can set.
I know that this is possible because I've seen it somewhere else, I've no idea how it's done, though.

And please, forgive me for my horrible scripting skills. I'm not much of a scriptor, I'm more of a Server Manager.
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
Spunky
Senior Member
Join Date: May 2008
Location: Orlando, Fl.
Old 07-25-2009 , 03:16   Re: How to make invis people vis to only certain people?
Reply With Quote #2

I was working on something a while ago that would have required this, so I'm curious as well.
Spunky is offline
Send a message via AIM to Spunky
stupok
Veteran Member
Join Date: Feb 2006
Old 07-25-2009 , 03:51   Re: How to make invis people vis to only certain people?
Reply With Quote #3

search addtofullpack
__________________
stupok is offline
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 07-25-2009 , 07:35   Re: How to make invis people vis to only certain people?
Reply With Quote #4

Alright, thanks, stupok.
I looked up FM_AddToFullPack but I just got confused. I just looked at it for a while and I had no idea on how to use it to do what I wanted.
Is there anyone who could just make a little snippet that does what I want?
Or help me understand what addtofullpack does and how it works? Because right now I'm just really confused.
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 07-25-2009 , 07:46   Re: How to make invis people vis to only certain people?
Reply With Quote #5

Quote:
Originally Posted by DarkGod View Post
Alright, thanks, stupok.
I looked up FM_AddToFullPack but I just got confused. I just looked at it for a while and I had no idea on how to use it to do what I wanted.
Is there anyone who could just make a little snippet that does what I want?
Or help me understand what addtofullpack does and how it works? Because right now I'm just really confused.
AddToFullPack handles the data that is sent to each player individually.

it's header is:

public addToFullPack(es, e, ent, host, hostflags, player, pSet)

"host" is the entity that will receive the data about entity "ent"
"es" is the entity data

That said check:

http://forums.alliedmods.net/showpos...2&postcount=13
__________________
joaquimandrade is offline
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 07-25-2009 , 08:13   Re: How to make invis people vis to only certain people?
Reply With Quote #6

Code:
#include <amxmodx> #include <fun> #include <fakemeta> new invisible[33]; new viewInvisible[33]; public plugin_init() {    register_forward(FM_AddToFullPack,"fw_addtofullpack",1);    register_clcmd("say /invis","cmdInvis")        register_clcmd("say /seeinvis","cmdSeeInvis") } public cmdInvis(id) {    set_user_rendering(id,kRenderFxGlowShell,0,0, 0,kRenderTransAlpha, 0);    invisible[id] = true } public cmdSeeInvis(id) {    viewInvisible[id] = true }      public fw_addtofullpack(es_handle,e,ent,host,hostflags,player,pSet)  {     if(!player) return FMRES_IGNORED;     if(invisible[ent] && viewInvisible[host])     {         set_es(es_handle, ES_RenderFx, kRenderFxGlowShell)         set_es(es_handle, ES_RenderColor, {0, 0, 0})         set_es(es_handle, ES_RenderMode, kRenderTransAlpha)         set_es(es_handle, ES_RenderAmt, 255)     }     return FMRES_IGNORED;  }
Would this work?
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-25-2009 , 08:28   Re: How to make invis people vis to only certain people?
Reply With Quote #7

This should be enough :

Code:
#include <amxmodx> #include <fun> #include <fakemeta> new invisible[33]; new viewInvisible[33]; public plugin_init() {    register_forward(FM_AddToFullPack,"fw_addtofullpack",1);    register_clcmd("say /invis","cmdInvis")        register_clcmd("say /seeinvis","cmdSeeInvis") } public cmdInvis(id) { //   set_user_rendering(id,kRenderFxGlowShell,0,0, 0,kRenderTransAlpha, 0);    invisible[id] = !invisible[id] } public cmdSeeInvis(id) {    viewInvisible[id] = !viewInvisible[id] }      public fw_addtofullpack(es_handle,e,ent,host,hostflags,player,pSet)  {     if(!player) return FMRES_IGNORED;     if(invisible[ent] && !viewInvisible[host])     {     //    set_es(es_handle, ES_RenderFx, kRenderFxGlowShell)     //    set_es(es_handle, ES_RenderColor, {0, 0, 0})         set_es(es_handle, ES_RenderMode, kRenderTransAlpha)         set_es(es_handle, ES_RenderAmt, 0)     }     return FMRES_IGNORED;  }
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 07-25-2009 , 08:36   Re: How to make invis people vis to only certain people?
Reply With Quote #8

I'm confused. I don't really get what your modification do. I don't just want to use a code that works, I'd like to understand it, too, so that I can improve.

I'm sorry for acting like such a noob but that's what I am at scripting.
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 07-25-2009 , 08:50   Re: How to make invis people vis to only certain people?
Reply With Quote #9

Your code makes a player invisible and makes him visible to players marked as viewInvisible. His code makes players invisible to those not marked as viewInvisible. I don't know what is better but with his you don't have to apply invisibility to an ent so probably its better because if a player performs the action of setting himself invisible while dead i'm not sure it will work (Probably you would have to apply it on spawn)
__________________

Last edited by joaquimandrade; 07-25-2009 at 09:08.
joaquimandrade is offline
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 07-25-2009 , 08:55   Re: How to make invis people vis to only certain people?
Reply With Quote #10

Oh, okay, thanks.
My code was just a sample, though, I'm going to use it in a different way that I would have to use my method for.

Thank you all for the help!
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
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 18:30.


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