AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Invisibility (https://forums.alliedmods.net/showthread.php?t=10539)

Extremeone 02-22-2005 13:32

Invisibility
 
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)     } }

Dizzy 02-22-2005 13:42

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

:D

your welcome if this helped :)

Extremeone 02-22-2005 13:45

doh thanks i did ferget to include engine

Extremeone 02-22-2005 13:53

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 02-22-2005 14:20

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)     } }

Dizzy 02-22-2005 14:43

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 :D

Try That[/small]

Extremeone 02-22-2005 14:46

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

XxAvalanchexX 02-22-2005 16:17

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.

v3x 02-22-2005 17:33

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 :).

Johnny got his gun 02-22-2005 18:12

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.


All times are GMT -4. The time now is 14:09.

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