AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   1950's Cloaking Device (https://forums.alliedmods.net/showthread.php?t=10011)

DarkShadowST 02-06-2005 02:15

1950's Cloaking Device
 
1 Attachment(s)
Rather then make you 100% invisible or like, partially invisible
I made this:

Untested (I'm drunk and my friends aren't on :cry: )

Edit: Everything works 'cept cd_power

Tell me if it sux

Code:
/*     1950's Cloaking Device Created By DarkShadowST         Invisibility plugins are kinda strange:         You can only be fully invisible (not really fair to other people)     OR     Partially invisible (not really fair to you)         This makes it so every x seconds you fade back in for x seconds and then fade out again     Looks really creepy when you're trying to track the movement of someone wearing     this cloaking device...         First plugin in Forever         I called it 1950's Cloaking Device because nothing worked perfectly in the 1950's     (Source: NASA - Korean War - People in General) */ #include <amxmodx> #include <fun> #include <amxmisc> #define ACCESS_LEVEL ADMIN_SLAY new PLUGIN_NAME[] = "1950's Cloaking Device" new PLUGIN_AUTHOR[] = "DarkShadowST" new PLUGIN_VERSION[] = "0.1" new cloaked_users[33]; //Hold  the Id's of cloaked users public plugin_init() {         register_plugin(PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_AUTHOR);     register_concmd("amx_cloaking","set_cd_device",ACCESS_LEVEL," Usage: amx_cloaking Person <1|0>");     register_cvar("cd_worktime","2.0");             //The Time you are invisible     register_cvar("cd_downtime","1.0");             //The Time you are not invisible     register_cvar("cd_power","0");              //Your alpha value incase u don't like completely invisible } public set_cd_device(id) {         if(!(get_user_flags(id)&ACCESS_LEVEL)) {         client_print(id,print_console,"[AMXX] You Do Not Have Access To This Command");         return PLUGIN_HANDLED;     }     if(read_argc() < 3 || read_argc() > 3) {         client_print(id,print_console,"[AMXX] Usage: amx_cloaking <Player|@CT|@T|all> <1|0>");         return PLUGIN_HANDLED;     }     new target[40];     new choice[4];     read_argv(1,target,39);     read_argv(2,choice,3);     /////All Players////////////////////////////////////////////////////     if(equali(target,"all") || equali(target,"*")) {                 if(equali(choice,"1") || equali(choice,"on")) {                     new players[32], inum             get_players(players,inum,"a")             for(new i = 0; i < inum; ++i) {                             if(get_user_flags(players[i])&ADMIN_IMMUNITY)                     continue                                 if(cloaked_users[players[i]] == 1)                     continue                                     set_user_rendering(players[i],kRenderFxGlowShell,0,0,0,kRenderTransAlpha,str_to_num("cd_power"))                                 cloaked_users[players[i]] = 1;                 new player_id[3];                 player_id[0] = players[i];                 set_task(get_cvar_float("cd_worktime"),"cd_disable",(1573+players[i]),player_id,1);             }             new admin[33]             get_user_name(id,admin,32)             switch(get_cvar_num("amx_show_activity")) {                             case 2: client_print(0,print_chat,"[AMXX] Admin %s: Has Enabled Cloaking Device on Everybody",admin)                 case 1: client_print(0,print_chat,"[AMX] Admin Has Enabled Cloaking Device on Everybody")             }             client_print(id,print_console,"[AMX] Cloaking Device Enabled for Everyone")             return PLUGIN_HANDLED         }         if(equali(choice,"0") || equali(choice,"off")) {                     new players[32], inum             get_players(players,inum,"a")             for(new i = 0; i < inum; ++i) {                             if(get_user_flags(players[i])&ADMIN_IMMUNITY)                     continue                                 if(cloaked_users[players[i]] == 0)                     continue                                     //set_user_rendering(players[i],kRenderFxGlowShell,0,0,0,kRenderTransAlpha,250)                 set_user_rendering(players[i]);                                 cloaked_users[players[i]] = 0;                 remove_task(1573+players[i]);             }             new admin[33]             get_user_name(id,admin,32)             switch(get_cvar_num("amx_show_activity")) {                             case 2: client_print(0,print_chat,"[AMXX] Admin %s: Has Disabled Cloaking Device on Everybody",admin)                 case 1: client_print(0,print_chat,"[AMX] Admin Has Disabled Cloaking Device on Everybody")             }             client_print(id,print_console,"[AMX] Cloaking Device Disabled for Everyone")             return PLUGIN_HANDLED         }         client_print(id,print_console,"[AMXX] Usage: amx_cloaking <Player|@CT|@T|all> <1|0>");         return PLUGIN_HANDLED     }     /////Team Specific//(CT)/////////////////////////////////////////////////     if(equali(target,"@CT")) {                 if(equali(choice,"1") || equali(choice,"on")) {                     new players[32], inum             get_players(players,inum,"ae","CT")             for(new i = 0; i < inum; ++i) {                             if(get_user_flags(players[i])&ADMIN_IMMUNITY)                     continue                                 if(cloaked_users[players[i]] == 1)                     continue                                     set_user_rendering(players[i],kRenderFxGlowShell,0,0,0,kRenderTransAlpha,str_to_num("cd_power"));                                 cloaked_users[players[i]] = 1;                 new player_id[2];                 player_id[0] = players[i];                 set_task(get_cvar_float("cd_worktime"),"cd_disable",1573+id,player_id,1);             }             new admin[33]             get_user_name(id,admin,32)             switch(get_cvar_num("amx_show_activity")) {                             case 2: client_print(0,print_chat,"[AMXX] Admin %s: Has Enabled Cloaking Device for all the CT's",admin)                 case 1: client_print(0,print_chat,"[AMX] Admin Has Enabled Cloaking Device for all the CT's")             }             client_print(id,print_console,"[AMX] Cloaking Device Enabled for all CT's")             return PLUGIN_HANDLED         }         if(equali(choice,"0") || equali(choice,"off")) {                     new players[32], inum             get_players(players,inum,"ae","CT")             for(new i = 0; i < inum; ++i) {                             if(get_user_flags(players[i])&ADMIN_IMMUNITY)                     continue                                 if(cloaked_users[players[i]] == 0)                     continue                                     //set_user_rendering(players[i],kRenderFxGlowShell,0,0,0,kRenderTransAlpha,255)                 set_user_rendering(players[i]);                                 cloaked_users[players[i]] = 0;                 new player_id[2];                 player_id[0] = players[i];                 remove_task(1573+players[i]);             }             new admin[33]             get_user_name(id,admin,32)             switch(get_cvar_num("amx_show_activity")) {                             case 2: client_print(0,print_chat,"[AMXX] Admin %s: Has Disabled Cloaking Device for all the CT's",admin)                 case 1: client_print(0,print_chat,"[AMX] Admin Has Enabled Cloaking Device for all the CT's")             }             client_print(id,print_console,"[AMX] Cloaking Device Disabled for all CT's")             return PLUGIN_HANDLED         }         client_print(id,print_console,"[AMXX] Usage: amx_cloaking <Player|@CT|@T|all> <1|0>");         return PLUGIN_HANDLED     }     /////Team Specific//(T)/////////////////////////////////////////////////     if(equali(target,"@T") || equali(target,"@TERRORIST")) {                 if(equali(choice,"1") || equali(choice,"on")) {                     new players[32], inum             get_players(players,inum,"ae","TERRORIST")             for(new i = 0; i < inum; ++i) {                             if(get_user_flags(players[i])&ADMIN_IMMUNITY)                     continue                                 if(cloaked_users[players[i]] == 1)                     continue                                     set_user_rendering(players[i],kRenderFxGlowShell,0,0,0,kRenderTransAlpha,str_to_num("cd_power"));                                 cloaked_users[players[i]] = 1;                 new player_id[2];                 player_id[0] = players[i];                 set_task(get_cvar_float("cd_worktime"),"cd_disable",1573+id,player_id,1);             }             new admin[33]             get_user_name(id,admin,32)             switch(get_cvar_num("amx_show_activity")) {                             case 2: client_print(0,print_chat,"[AMXX] Admin %s: Has Enabled Cloaking Device for all the Terrorists",admin)                 case 1: client_print(0,print_chat,"[AMX] Admin Has Enabled Cloaking Device for all the Terrorists")             }             client_print(id,print_console,"[AMX] Cloaking Device Enabled for all Terrorists")             return PLUGIN_HANDLED         }         if(equali(choice,"0") || equali(choice,"off")) {                     new players[32], inum             get_players(players,inum,"ae","TERRORIST")             for(new i = 0; i < inum; ++i) {                             if(get_user_flags(players[i])&ADMIN_IMMUNITY)                     continue                                 if(cloaked_users[players[i]] == 0)                     continue                                     //set_user_rendering(players[i],kRenderFxGlowShell,0,0,0,kRenderTransAlpha,255)                 set_user_rendering(players[i]);                                 cloaked_users[players[i]] = 0;                 new player_id[2];                 player_id[0] = players[i];                 remove_task(1573+players[i]);             }             new admin[33]             get_user_name(id,admin,32)             switch(get_cvar_num("amx_show_activity")) {                             case 2: client_print(0,print_chat,"[AMXX] Admin %s: Has Disabled Cloaking Device for all the Terrorists",admin)                 case 1: client_print(0,print_chat,"[AMX] Admin Has Disabled Cloaking Device for all the Terrorists")             }             client_print(id,print_console,"[AMX] Cloaking Device Disabled for all CT's")             return PLUGIN_HANDLED         }         client_print(id,print_console,"[AMXX] Usage: amx_cloaking <Player|@CT|@T|all> <1|0>");         return PLUGIN_HANDLED     }     new player = cmd_target(id,target,7)     if(!player) return PLUGIN_HANDLED     if(equali(choice,"1") || equali(choice,"on")) {                     /*if(get_user_flags(player)&ADMIN_IMMUNITY) {                 client_print(id,print_console,"[AMXX] Client has Immunity");                 return PLUGIN_HANDLED;             }*/             if(cloaked_users[player] == 1) {                 client_print(id,print_console,"[AMXX] Client Already Has Cloaking Device");                 return PLUGIN_HANDLED;             }                         set_user_rendering(player,kRenderFxGlowShell,0,0,0,kRenderTransAlpha,str_to_num("cd_power"));                             cloaked_users[player] = 1;             new player_id[2];             player_id[0] = player;             set_task(get_cvar_float("cd_worktime"),"cd_disable",1573+id,player_id,1);                         new admin[33]             new pname[33]             get_user_name(id,admin,32)             get_user_name(player,pname,32)             switch(get_cvar_num("amx_show_activity")) {                             case 2: client_print(0,print_chat,"[AMXX] Admin %s: Has Enabled Cloaking Device for %s",admin,pname)                 case 1: client_print(0,print_chat,"[AMX] Admin Has Enabled Cloaking Device for %s",pname)             }             client_print(id,print_console,"[AMX] Cloaking Device Enabled for %s",pname)             return PLUGIN_HANDLED     }     if(equali(choice,"0") || equali(choice,"off")) {                 /*if(get_user_flags(player)&ADMIN_IMMUNITY) {             client_print(id,print_console,"[AMXX] Client has Immunity");             return PLUGIN_HANDLED;         }*/         if(cloaked_users[player] == 0) {             client_print(id,print_console,"[AMXX] Client Doesn't Have a Cloaking Device");             return PLUGIN_HANDLED;         }         //set_user_rendering(player,kRenderFxGlowShell,0,0,0,kRenderTransAlpha,250));         set_user_rendering(player);                     cloaked_users[player] = 0;         new player_id[2];         player_id[0] = player;         remove_task(1573 + player);                     new admin[33]         new pname[33]         get_user_name(id,admin,32)         get_user_name(player,pname,32)         switch(get_cvar_num("amx_show_activity")) {                     case 2: client_print(0,print_chat,"[AMXX] Admin %s: Has Disabled Cloaking Device for %s",admin,pname)             case 1: client_print(0,print_chat,"[AMX] Admin Has Disabled Cloaking Device for %s",pname)         }         client_print(id,print_console,"[AMX] Cloaking Device Disabled for %s",pname)         return PLUGIN_HANDLED     }     client_print(id,print_console,"[AMXX] Usage: amx_cloaking <Player|@CT|@T|all> <1|0>");     return PLUGIN_HANDLED } public cd_disable(player_id[]) {         new id = player_id[0];     set_user_rendering(id);     set_task(get_cvar_float("cd_downtime"),"cd_enable",1573+id,player_id,1);     return PLUGIN_CONTINUE; } public cd_enable(player_id[]) {         new id = player_id[0];     set_user_rendering(id,kRenderFxGlowShell,0,0,0,kRenderTransAlpha,str_to_num("cd_power"));     set_task(get_cvar_float("cd_worktime"),"cd_disable",1573+id,player_id,1);     return PLUGIN_CONTINUE; } public client_connect(id) {         cloaked_users[id] = 0;     return PLUGIN_CONTINUE; } public client_disconnect(id) {         if(cloaked_users[id] == 1) {         cloaked_users[id] = 0;         remove_task(1573 + id);     }     return PLUGIN_CONTINUE; }

v3x 02-06-2005 03:26

In the top of the sma you should put how to use it (even though it prints in chat) :).
Quote:

amx_cloaking <Player|@CT|@T|all> <1|0>

DarkShadowST 02-06-2005 04:25

Yea...
 
Okay....yea....I tested it w/ my friends
it works awesome
'cept cd_power doesn't work right :?
you just have to settle w/ flashing completely invis & w/e

I think it's tight as shit....we played arond w/ it and it's sooo cool
plus it works between rounds which pwns

the alcohol is wearing off :cry:

Quote:

In the top of the sma you should put how to use it (even though it prints in chat) Smile.
^ You did it for me :D ty...just so everyone knows...that's how u use it

manorastroman 02-06-2005 13:21

sounds like fun! but you dont need to put the sma inside your post

DarkShadowST 02-06-2005 16:34

I know....I usually post the .sma becuase that way you don't have to dl the .sma and open it to see it, you can just glance at it as you read the post...

DarkShadowST 02-06-2005 22:43

Any chance I could get this approved?
Pretty please?

Lord_Destros 07-29-2005 13:22

The x seconds is completely invis right? I can see how this is interesting :D. Will try testing it. Also, does it turn on auto for everyone, or do clients have to do something.

Lord_Destros 07-29-2005 14:17

one awkward problem, every time i try downloading this, it Mcafee tells me it found a virus in my temp folder, wtf...........its never done this before on any other plugins (it says this for the sma).

MattOG 07-29-2005 14:43

Quote:

Originally Posted by Lord_Destros
one awkward problem, every time i try downloading this, it Mcafee tells me it found a virus in my temp folder, wtf...........its never done this before on any other plugins (it says this for the sma).

Same, the temp file it puts on your comp (while it downloads) is apparently infected with a univ.script/99a virus ( I'm assuming that means universal script).

Not sure what you done here. Try deleting the .sma you've posted, open up the one you got, and save a clean copy of it. Then repost that for every1 to download.

Proach 07-29-2005 15:41

or justy copy the code in the posted above and paste it in a text file then save it as an .sma ;)


All times are GMT -4. The time now is 03:42.

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