Raised This Month: $ Target: $400
 0% 

Not clear on [index]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pdoubleopdawg
Senior Member
Join Date: Aug 2005
Old 09-09-2005 , 23:31   Not clear on [index]
Reply With Quote #1

I havn't used this much before but:
I want to make a boolean for checking one of my plugins.

I want to turn it off for only the selected player. Would it be

Boolean[target]=false
?
Would that turn it off for that specific player only?
pdoubleopdawg is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 09-09-2005 , 23:45  
Reply With Quote #2

Code:
new bool:variable[33] = { true, ... }; // zomg turn it off! variable[id] = false;
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
pdoubleopdawg
Senior Member
Join Date: Aug 2005
Old 09-10-2005 , 01:15  
Reply With Quote #3

as_undisco_all only turns off the glow for the person performing the command. Why?
amx_undisco doesn't do jack.

Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <fun> #define PLUGIN "Admin System" #define VERSION "0.1" #define AUTHOR "DahVid" new players[32],num,i //use these one too many time! :) new bool:is_disco[33] public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_clcmd("as_disco","disco",ADMIN_BAN,"as_disco <user>")     register_clcmd("as_undisco","undisco",ADMIN_BAN,"as_undisco <user>")     register_clcmd("as_disco_all","disco_allstart",ADMIN_BAN,"as_discoall (disco's all users!")     register_clcmd("as_undisco_all","undisco_all",ADMIN_BAN,"as_undiscoall (Undiscos everyone!") } public disco(id) {     if(!is_user_admin(id)) {         console_print(id,"[ASMod]Sorry, this command is for administrators ONLY!")         return PLUGIN_HANDLED     }     new player[33]     read_argv(1,player,32)     new target=cmd_target(id,player,9)     if(!is_user_connected(target)) {         console_print(id,"[ASMod]The player you have entered has not been found in the server or he has immunity.")     }     is_disco[target]=true     //Thanks to GHW_Chronic for the idea!     set_task(0.3,"disco_start",target,_,_,"b")         return PLUGIN_CONTINUE } public disco_start(target) {     if(is_disco[target]==false) {         return PLUGIN_HANDLED     }     if(!is_user_connected(target)) {         return PLUGIN_HANDLED     }     new red,green,blue,alpha     red=random_num(0,255)     green=random_num(0,255)     blue=random_num(0,255)     alpha=random_num(30,220)         message_begin(MSG_ONE,get_user_msgid("ScreenFade"),{0,0,0},target)     write_short(~0)     write_short(~0)     write_short(1<<12)     write_byte(red)     write_byte(green)     write_byte(blue)     write_byte(alpha)     message_end()         set_user_rendering(target,kRenderFxGlowShell,red,green,blue,kRenderTransAlpha,alpha)         return PLUGIN_CONTINUE } public disco_allstart() {     get_players(players,num)     for(i=0;i<=num;i++) {         new player = players[i]         is_disco[player]=true         set_task(0.3,"disco_all",player,_,_,"b")     } } public disco_all() {     get_players(players,num)     for(i=0;i<=num;i++) {         new player = players[i]         if(is_disco[player]==false) {             return PLUGIN_HANDLED         }         if(!is_user_connected(player)) {             return PLUGIN_HANDLED         }         new red,green,blue,alpha         red=random_num(0,255)         green=random_num(0,255)         blue=random_num(0,255)         alpha=random_num(30,220)                 message_begin(MSG_ONE,get_user_msgid("ScreenFade"),{0,0,0},player)         write_short(~0)         write_short(~0)         write_short(1<<12)         write_byte(red)         write_byte(green)         write_byte(blue)         write_byte(alpha)         message_end()                 set_user_rendering(player,kRenderFxGlowShell,red,green,blue,kRenderTransAlpha,alpha)     }     return PLUGIN_HANDLED } public undisco(target) {     is_disco[target]=false     set_user_rendering(target,kRenderFxGlowShell,0,0,0,kRenderNormal,25) } public undisco_all(player) {     is_disco[player]=false     set_user_rendering(player,kRenderFxGlowShell,0,0,0,kRenderNormal,25) }
pdoubleopdawg is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 09-10-2005 , 01:28  
Reply With Quote #4

Well, there is no amx_undisco, so that's probably why it doesn't do anything.

As for as_undisco_all, let's look at the function that is called:
Code:
public undisco_all(player) {     is_disco[player]=false     set_user_rendering(player,kRenderFxGlowShell,0,0,0,kRenderNormal,25) }
Right there you're just setting is_disco for only the player who called it, which is why it is only turning it off for one person.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
pdoubleopdawg
Senior Member
Join Date: Aug 2005
Old 09-10-2005 , 01:30  
Reply With Quote #5

Ohhh. I think I get it. I'll give it a go.
pdoubleopdawg is offline
pdoubleopdawg
Senior Member
Join Date: Aug 2005
Old 09-10-2005 , 01:37  
Reply With Quote #6

That was a typo. I tried as_undisco. It does only does it for me. I fixed the as_undisco_all.

So, how to catch the first argument of function disco?
pdoubleopdawg is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 09-10-2005 , 11:24  
Reply With Quote #7

Quote:
Code:
new player[33]     read_argv(1,player,32)     new target=cmd_target(id,player,9)

its already done :/
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
pdoubleopdawg
Senior Member
Join Date: Aug 2005
Old 09-10-2005 , 15:41  
Reply With Quote #8

I mean... How to get who was targetted into the undisco function!!
pdoubleopdawg is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 09-10-2005 , 15:44  
Reply With Quote #9

Just like that...
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Reply


Thread Tools
Display Modes

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


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