Raised This Month: $ Target: $400
 0% 

Can any tell me what


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Inogood
BANNED
Join Date: Feb 2007
Old 02-24-2007 , 02:29   Can any tell me what
Reply With Quote #1

wrong in this???

Quote:
Command - amx_newcolorskins <1|0>
1 = on
0 = off
Description - If you On this plugin Terrorist's are red ,ct's are blue
********************************************* ************************/
#include <amxmodx>
#include <amxmisc>
#include <fun>
new newb = 1
public plugin_init(){
register_plugin("New name","0.0","New player")
register_concmd("amx_newcolorskins","cmdnewb" ,1,"- turn color skins on and off ; defalut ON")
new parm[1]
set_task(0.1,"loop",0,parm,1,"b")
}
public cmdnewb(id){
set_hudmessage(200, 100, 0, -1.0, 0.25, 0, 1.0, 4.0, 0.1, 0.2, 2)
new arg[2]
read_argv(1,arg,1)
if(equal(arg,"1")){
newb = 1
console_print(id,"T's will now glow red and CT's will now glow blue.")
show_hudmessage(0,"T's now glow red and CT's now glow blue...")
} else if(equal(arg,"0")){
newb = 0
new players[32], inum
get_players(players,inum)
for(new a=0;a<inum;++a) {
set_user_rendering(players[a],kRenderFxNone,0,0,0,kRenderTransTexture,255)
}
console_print(id,"T's and CT's will now stop glowing.")
show_hudmessage(0,"T's and CT's will now stop glowing...")
} else {
if(newb==1){
console_print(id,"Usage: amx_newcolorskins <1|0> 1 = on 0 = off Currently: ON")
} else if(newb==0){
console_print(id,"Usage: amx_newcolorskins <1|0> 1 = on 0 = off Currently: OFF")
}
}
return PLUGIN_CONTINUE
}
public loop(parm[]){
if(newb==0){
//nothing
}
if(newb==1){
new players[32], inum
get_players(players,inum)
for(new a=0;a<inum;++a) {
if(get_user_team(players[a])==1){
set_user_rendering(players[a],kRenderFxGlowShell,255,0,0,kRenderNormal,40)
} else {
set_user_rendering(players[a],kRenderFxGlowShell,0,0,255,kRenderNormal,40)
}
}
}
return PLUGIN_CONTINUE
}
Inogood is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-24-2007 , 03:37   Re: Can any tell me what
Reply With Quote #2

What's the problem ?

Not tested but it compiles fine.



Code:
/* Command - amx_newcolorskins <1|0> 1 = on 0 = off Description - If you On this plugin Terrorist's are red ,ct's are blue ********************************************* *********************** */ #include <amxmodx> #include <amxmisc> #include <fun> #define PLUGIN "New name" #define VERSION "1.0" #define AUTHOR "New Player" new newb = 1 public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_concmd("amx_newcolorskins","cmdnewb" ,1,"- turn color skins on and off ; defalut ON")         new parm[1]     set_task(0.1,"loop",0,parm,1,"b") } public cmdnewb(id) {     set_hudmessage(200, 100, 0, -1.0, 0.25, 0, 1.0, 4.0, 0.1, 0.2, 2)         new arg[2]     read_argv(1,arg,1)         if(equal(arg,"1"))     {         newb = 1         console_print(id,"T's will now glow red and CT's will now glow blue.")         show_hudmessage(0,"T's now glow red and CT's now glow blue...")     }     else if(equal(arg,"0"))     {         newb = 0         new players[32], inum         get_players(players,inum)                 for(new a=0;a<inum;++a)             set_user_rendering(players[a],kRenderFxNone,0,0,0,kRenderTransTexture,255)         console_print(id,"T's and CT's will now stop glowing.")         show_hudmessage(0,"T's and CT's will now stop glowing...")     }     else     {         if(newb==1)             console_print(id,"Usage: amx_newcolorskins <1|0> 1 = on 0 = off Currently: ON")         else if(newb==0)             console_print(id,"Usage: amx_newcolorskins <1|0> 1 = on 0 = off Currently: OFF")     }     return PLUGIN_CONTINUE } public loop(parm[]) {     if(newb==0)     {     //nothing     }         if(newb==1)     {         new players[32], inum         get_players(players,inum)                 for(new a=0;a<inum;++a)         {             if(get_user_team(players[a])==1)                 set_user_rendering(players[a],kRenderFxGlowShell,255,0,0,kRenderNormal,40)             else                 set_user_rendering(players[a],kRenderFxGlowShell,0,0,255,kRenderNormal,40)         }     }     return PLUGIN_CONTINUE }
__________________
Arkshine is offline
Inogood
BANNED
Join Date: Feb 2007
Old 02-24-2007 , 03:49   Re: Can any tell me what
Reply With Quote #3

Work??? Its ok? Ohh yaa( My first plugin)

Last edited by Inogood; 02-24-2007 at 03:55.
Inogood is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-24-2007 , 05:07   Re: Can any tell me what
Reply With Quote #4

I've tested this and it works fine.

I think it's a little more optimize. ( I hope -_-' )

Code:
/* Description - If you On this plugin Terrorist's are red ,ct's are blue Cvars - ncs_enabled <1|0>      1 = on      0 = off Command - amx_newcolorskins <1|0>      1 = on      0 = off ********************************************* *********************** */ #include <amxmodx> #include <amxmisc> #include <fun> #include <cstrike> #define PLUGIN   "Color Skins" #define VERSION "1.0" #define AUTHOR  "Inogood" #define COLOR_LEVEL ADMIN_BAN new togglecolor public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         togglecolor = register_cvar("ncs_enabled","1")     register_concmd("amx_newcolorskins","cmd_toggle" ,COLOR_LEVEL,"- <1=on 0=off> : Turn color skins on and off (default ON)")         new parm[1]     set_task(0.1,"loop",0,parm,1,"b") } public cmd_toggle(id, level, cid) {     new arg, arg1[32]         if(id)     {         if(!cmd_access(id,level,cid,2))             return PLUGIN_HANDLED         read_argv(1,arg1,31)     }     else         format(arg1,31,"%d",level)         set_hudmessage(200, 100, 0, -1.0, 0.25, 0, 1.0, 7.0, 0.1, 0.2, 2)         arg = str_to_num(arg1)     switch(arg)     {         case 0 :         {             if( !get_pcvar_num(togglecolor) )                 console_print(id,"[COLOR SKIN] Plugin already enabled.")             else             {                 new players[32], inum                 get_players(players,inum)                         for(new a=0;a<inum;++a)                     set_user_rendering(players[a],kRenderFxNone,0,0,0,kRenderTransTexture,255)                             console_print(id,"T's and CT's will now stop glowing.")                 show_hudmessage(0,"T's and CT's will now stop glowing...")                             set_pcvar_num(togglecolor,0)             }         }         case 1 :         {             if( get_pcvar_num(togglecolor) )                 console_print(id,"[COLOR SKIN] Plugin already enabled.")             else             {                 console_print(id,"T's will now glow red and CT's will now glow blue.")                 show_hudmessage(0,"T's now glow red and CT's now glow blue...")                             set_pcvar_num(togglecolor,1)             }         }     }     return PLUGIN_HANDLED } public loop(parm[]) {     if( !get_pcvar_num(togglecolor) ) return PLUGIN_HANDLED         new players[32], inum     get_players(players,inum)             for( new a = 0;a < inum; ++a )     {         new CsTeams:userTeam = cs_get_user_team(players[a])                     switch(userTeam)         {             case CS_TEAM_CT : set_user_rendering(players[a],kRenderFxGlowShell,0,0,255,kRenderNormal,40)             case CS_TEAM_T  : set_user_rendering(players[a],kRenderFxGlowShell,255,0,0,kRenderNormal,40)         }           }         return PLUGIN_CONTINUE }
__________________

Last edited by Arkshine; 02-24-2007 at 05:09.
Arkshine is offline
Inogood
BANNED
Join Date: Feb 2007
Old 02-24-2007 , 05:47   Re: Can any tell me what
Reply With Quote #5

Thanks for help Now j go add this to new plugin subbmision
Inogood is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-24-2007 , 05:52   Re: Can any tell me what
Reply With Quote #6

Quote:
Originally Posted by Inogood View Post
Thanks for help Now j go add this to new plugin subbmision
I'm not sure that it's a good idea. -_-

You shouldn't post your first plugin since it seems that you have a lack of knownlegde. (me too -_-) :p
__________________

Last edited by Arkshine; 02-24-2007 at 06:04.
Arkshine is offline
Inogood
BANNED
Join Date: Feb 2007
Old 02-24-2007 , 06:07   Re: Can any tell me what
Reply With Quote #7

Och men , too late http://forums.alliedmods.net/showthread.php?p=444791
Inogood is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-24-2007 , 06:33   Re: Can any tell me what
Reply With Quote #8

Multilingual version.
Attached Files
File Type: sma Get Plugin or Get Source (newcolorskins.sma - 594 views - 2.5 KB)
File Type: txt newcolorskins.txt (501 Bytes, 99 views)
__________________

Last edited by Arkshine; 02-24-2007 at 06:41.
Arkshine is offline
Inogood
BANNED
Join Date: Feb 2007
Old 02-24-2007 , 06:58   Re: Can any tell me what
Reply With Quote #9

First j have in plan add some new's , but Thanks . J use this but not now
Inogood is offline
mateo10
Veteran Member
Join Date: Jan 2006
Old 02-24-2007 , 07:01   Re: Can any tell me what
Reply With Quote #10

Offtopic: Why do u use j and J instead of i and I?
mateo10 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 00:38.


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