AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Can any tell me what (https://forums.alliedmods.net/showthread.php?t=51787)

Inogood 02-24-2007 02:29

Can any tell me what
 
wrong in this???:oops: :oops:

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
}

Arkshine 02-24-2007 03:37

Re: Can any tell me what
 
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 }

Inogood 02-24-2007 03:49

Re: Can any tell me what
 
Work???:) Its ok? Ohh yaa( My first plugin:))

Arkshine 02-24-2007 05:07

Re: Can any tell me what
 
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 }

Inogood 02-24-2007 05:47

Re: Can any tell me what
 
Thanks for help :) Now j go add this to new plugin subbmision

Arkshine 02-24-2007 05:52

Re: Can any tell me what
 
Quote:

Originally Posted by Inogood (Post 444785)
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

Inogood 02-24-2007 06:07

Re: Can any tell me what
 
Och men , too late:) :P http://forums.alliedmods.net/showthread.php?p=444791

Arkshine 02-24-2007 06:33

Re: Can any tell me what
 
2 Attachment(s)
Multilingual version.

Inogood 02-24-2007 06:58

Re: Can any tell me what
 
First j have in plan add some new's , but Thanks . J use this but not now

mateo10 02-24-2007 07:01

Re: Can any tell me what
 
Offtopic: Why do u use j and J instead of i and I?


All times are GMT -4. The time now is 00:38.

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