Raised This Month: $ Target: $400
 0% 

Invisibility


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Extremeone
Senior Member
Join Date: Jan 2005
Old 02-22-2005 , 13:32   Invisibility
Reply With Quote #1

I cant get this to work can anyone help?

Code:
#include <amxmodx> #include <fun> #include <amxmisc> new bool:spy[32] = false public plugin_init() {     register_plugin("AMX Spys","0.1","twistedeuphoria")     register_cvar("amx_autospy","1")     register_concmd("amx_spy","admin_makespy",ADMIN_BAN,"Make a player a spy.")     register_concmd("amx_unspy","admin_unmakespy",ADMIN_BAN,"Make a player normal.")     register_event("ResetHUD","makespy","b") } public client_putinserver(id) {     if((get_user_flags(id) && ADMIN_BAN) && (get_cvar_num("amx_autospy") == 1))     {         spy[id] = true         set_user_footsteps(id,1)         set_user_visibility(id, 0)          } } public client_disconnect(id) {     spy[id] = false } public admin_makespy(id) {     if(!get_user_flags(id) && ADMIN_BAN)         return PLUGIN_HANDLED     new target[32],tgtid     tgtid = cmd_target(id,target,2)     spy[tgtid] = true     set_user_footsteps(id,1)     set_user_visibility(id, 0)     return PLUGIN_HANDLED } public admin_unmakespy(id) {     if(!get_user_flags(id) && ADMIN_BAN)         return PLUGIN_HANDLED     new target[32],tgtid     tgtid = cmd_target(id,target,2)     spy[tgtid] = false     set_user_footsteps(id,0)     set_user_visibility(id, 1)     return PLUGIN_HANDLED } public makespy(id) {     if(spy[id] == true)     {         set_user_footsteps(id,1)         set_user_visibility(id, 0)     }     else     {         set_user_footsteps(id,0)         set_user_visibility(id, 1)     } }
Extremeone is offline
Dizzy
Veteran Member
Join Date: Jun 2004
Location: Massachusetts
Old 02-22-2005 , 13:42  
Reply With Quote #2

Wouldn't You Fool Around With The Alpha? 0,0,0?

like 255,255,255?

Or maybe you are using the wrong .incs

maybe you need another #include



your welcome if this helped
__________________
My Plugins

Purchase Mod - Stable
Type Sounds - Stable
Monster Spawner - Stable
Nade Giver - Maintenance
Dizzy is offline
Send a message via AIM to Dizzy
Extremeone
Senior Member
Join Date: Jan 2005
Old 02-22-2005 , 13:45  
Reply With Quote #3

doh thanks i did ferget to include engine
Extremeone is offline
Extremeone
Senior Member
Join Date: Jan 2005
Old 02-22-2005 , 13:53  
Reply With Quote #4

okay i fixed it

my problems were i didnt include engine and i used set_user_visibility instead of set_entity_visibility

Thanks again dizzy
Extremeone is offline
Extremeone
Senior Member
Join Date: Jan 2005
Old 02-22-2005 , 14:20  
Reply With Quote #5

ok this is weird my current script (below) is making everyone invisible

and i cant make them not spys with amx_unspy

can someone help?

Code:
#include <amxmodx> #include <fun> #include <amxmisc> #include <engine> new bool:spy[32] = false public plugin_init() {     register_plugin("AMX Spys","0.1","twistedeuphoria")     register_cvar("amx_autospy","1")     register_concmd("amx_spy","admin_makespy",ADMIN_BAN,"Make a player a spy.")     register_concmd("amx_unspy","admin_unmakespy",ADMIN_BAN,"Make a player normal.")     register_event("ResetHUD","makespy","b") } public client_putinserver(id) {     if((get_user_flags(id) && ADMIN_BAN) && (get_cvar_num("amx_autospy") == 1))     {         spy[id] = true         set_user_footsteps(id,1)         set_entity_visibility(id, 0)             } } public client_disconnect(id) {     spy[id] = false } public admin_makespy(id) {     if(!get_user_flags(id) && ADMIN_BAN)         return PLUGIN_HANDLED     new target[32],tgtid     tgtid = cmd_target(id,target,2)     spy[tgtid] = true     set_user_footsteps(id,1)     set_entity_visibility(id, 0)     return PLUGIN_HANDLED } public admin_unmakespy(id) {     if(!get_user_flags(id) && ADMIN_BAN)         return PLUGIN_HANDLED     new target[32],tgtid     tgtid = cmd_target(id,target,2)     spy[tgtid] = false     set_user_footsteps(id,0)     set_entity_visibility(id, 1)     return PLUGIN_HANDLED } public makespy(id) {     if(spy[id] == true)     {         set_user_footsteps(id,1)         set_entity_visibility(id, 0)     }     else     {         set_user_footsteps(id,0)         set_entity_visibility(id, 1)     } }
Extremeone is offline
Dizzy
Veteran Member
Join Date: Jun 2004
Location: Massachusetts
Old 02-22-2005 , 14:43  
Reply With Quote #6

Make it a clcmd

so when an admin (only) says it it does it on him

Plus you don't have to do it into the console

Code:
register_clcmd("say /spy","spy", ADMIN_LEVEL_A)

Then I Think It Would Only Do The Script On The Client That Commands It

Try That[/small]
__________________
My Plugins

Purchase Mod - Stable
Type Sounds - Stable
Monster Spawner - Stable
Nade Giver - Maintenance
Dizzy is offline
Send a message via AIM to Dizzy
Extremeone
Senior Member
Join Date: Jan 2005
Old 02-22-2005 , 14:46  
Reply With Quote #7

wat it should do is make admins with ban acess auto invisible and no footsteps

wat it does do is make everyone invisible with no footsteps


and also theres something wrong with amx_unspy i cant figure it out
Extremeone is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 02-22-2005 , 16:17  
Reply With Quote #8

You need to create "spy" with a size of 33, not 32. All of "get_user_flags(id) && ADMIN_BAN" should be "get_user_flags(id) & ADMIN_BAN", and the entity visibility will probably reset every round anyway.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 02-22-2005 , 17:33  
Reply With Quote #9

I fooled around with set_user_rendering and I got this cool little effect where the player is completely invisible, and there's a small little shadow underneath him .
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Johnny got his gun
Veteran Member
Join Date: Jan 2004
Location: Tokyo
Old 02-22-2005 , 18:12  
Reply With Quote #10

Don't use set_entity_visibility() to make players invisible, if you intend to do other stuff like running around etc. I think it causes a couple of sideeffects. It just adds a EF_NODRAW flag to EV_INT_effects. This thing likely has other uses... Maybe something like when you want to "disable" an entity for awhile.

Use set_user_rendering for that instead.

I could be wrong though, but this is how I remember it.
Johnny got his gun is offline
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 14:09.


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