AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to make invis people vis to only certain people? (https://forums.alliedmods.net/showthread.php?t=98370)

DarkGod 07-24-2009 20:32

How to make invis people vis to only certain people?
 
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. :crab:

Spunky 07-25-2009 03:16

Re: How to make invis people vis to only certain people?
 
I was working on something a while ago that would have required this, so I'm curious as well.

stupok 07-25-2009 03:51

Re: How to make invis people vis to only certain people?
 
search addtofullpack

DarkGod 07-25-2009 07:35

Re: How to make invis people vis to only certain people?
 
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.

joaquimandrade 07-25-2009 07:46

Re: How to make invis people vis to only certain people?
 
Quote:

Originally Posted by DarkGod (Post 881342)
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

DarkGod 07-25-2009 08:13

Re: How to make invis people vis to only certain people?
 
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?

ConnorMcLeod 07-25-2009 08:28

Re: How to make invis people vis to only certain people?
 
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;  }

DarkGod 07-25-2009 08:36

Re: How to make invis people vis to only certain people?
 
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.

joaquimandrade 07-25-2009 08:50

Re: How to make invis people vis to only certain people?
 
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)

DarkGod 07-25-2009 08:55

Re: How to make invis people vis to only certain people?
 
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! :crab:


All times are GMT -4. The time now is 18:30.

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