Raised This Month: $ Target: $400
 0% 

help with my code?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 03-16-2006 , 23:53  
Reply With Quote #1

Tag mismatch is a line above that the
new cvar1 line.
it should be new Float:cvar1

and then %f instead of %s
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 03-16-2006 , 23:55  
Reply With Quote #2

So is the code I posted above good now?
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 03-16-2006 , 23:58  
Reply With Quote #3

No because you need a string of the name.

new Cvar[12]
get_cvar_string("KNDPUNISH" , Cvar, 11)
then use %s
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 03-17-2006 , 00:03  
Reply With Quote #4

Code:
#include <amxmodx> #include <amxmisc> #define PLUGIN "ktd" #define VERSION "0.1" #define AUTHOR "SweatyBanana" public plugin_init()     {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_cvar("KTD_PUNISH","kick")     register_event("ResetHUD", "ktd", "b") } public ktd(id)     {     new Frags = get_user_frags(id)     new Deaths = get_user_deaths(id)     new MAXFRAGDEATH = 3 * Deaths     new LIMITWARN = 2 * Deaths     new name[32]           if(Frags > 6)         {         if(Frags >= LIMITWARN)             {             get_user_name(id,name,31)             client_print(0,print_chat,"WARNING: %s will be kicked soon for too high of a Kill/Death ratio.",name)         }         if(Frags >= MAXFRAGDEATH)             {             get_user_name(id,name,31)             client_print(0,print_chat,"[KTD] %s has been kicked due to too high of a Kill/Death ratio.",name)             new Cvar[12]             get_cvar_string("KTDPUNISH" , Cvar, 11)             server_cmd("%s ^"%s^" ^" too high of a Kill/Death ratio^"", Cvar, name);                     }         else             {             client_print(0,print_chat,"[KTD] END OF ROUND: Checking scores.")                     }     }     return PLUGIN_CONTINUE     }

hmmm...just finished working on this...hope it works
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 03-17-2006 , 10:57  
Reply With Quote #5

new problem:

Code:
#include <amxmodx> #include <amxmisc> #define PLUGIN "ktd" #define VERSION "0.1" #define AUTHOR "SweatyBanana" public plugin_init()       {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_event("ResetHUD", "ktd", "b")       register_cvar("ktd_ratio","6") } public ktd(id)     {     new Frags = get_user_frags(id)     new Deaths = get_user_deaths(id)     new MAXFRAGDEATH = 3 * Deaths     new LIMITWARN = 2 * Deaths     new name[32]           new RAT = get_cvar_string("ktd_ratio", 2)     if(Frags > RAT)         {         if(Frags >= LIMITWARN)             {             get_user_name(id,name,31)             client_print(0,print_chat,"WARNING: %s will be kicked soon for too high of a Kill/Death ratio.",name)         }         if(Frags >= MAXFRAGDEATH)             {             get_user_name(id,name,31)             client_print(0,print_chat,"[KTD] %s has been kicked due to too high of a Kill/Death ratio.",name)             server_cmd("kick ^"%s^" ^" too high of a Kill/Death ratio^"", name);                       }         else             {             client_print(0,print_chat,"[KTD] END OF ROUND: Checking scores.")                       }     }     return PLUGIN_CONTINUE       }
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 03-17-2006 , 14:11  
Reply With Quote #6

Code:
#include <amxmodx> #define PLUGIN "ktd" #define VERSION "0.1" #define AUTHOR "SweatyBanana" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_event("ResetHUD", "ktd", "b")     register_cvar("ktd_ratio","6") } public ktd(id) {         new Frags = get_user_frags(id)     new Deaths = get_user_deaths(id)     new MAXFRAGDEATH = 3 * Deaths     new LIMITWARN = 2 * Deaths     new RAT = get_cvar_num("ktd_ratio")         if( Frags > RAT  && Deaths > 0 ) {                 if(Frags >= LIMITWARN)             client_print( 0, print_chat, "WARNING: %s will be kicked soon for too high of a Kill/Death ratio.",name(id) )                 if(Frags >= MAXFRAGDEATH) {             client_print( 0, print_chat, "[KTD] %s has been kicked due to too high of a Kill/Death ratio.",name(id) )             server_cmd("kick ^"%s^" ^" too high of a Kill/Death ratio^"", name(id) )         }                 else             client_print(0,print_chat,"[KTD] END OF ROUND: Checking scores.")     } } stock name(index) {     new temp[32]     get_user_name(index, temp, 31)     return temp }
[ --<-@ ] Black Rose is offline
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 03-17-2006 , 14:24  
Reply With Quote #7

ok...but I want it to be only if you have more than 6 kills.

I know what to do...and ty.
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 03-17-2006 , 14:31  
Reply With Quote #8

oh, now i realize why u want just more than 6 kills, if some hacker has like 259 - 0 he wouldn't be kicked.
hehe
[ --<-@ ] Black Rose is offline
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 03-17-2006 , 15:06  
Reply With Quote #9

yup lol.

all I needed to do was check if he had more than the set number of max kills/deaths.
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 03-17-2006 , 16:17  
Reply With Quote #10

but if the guy has 5 - 0 and then get one kill, it would kick him w/o warnings.
[ --<-@ ] Black Rose 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 16:35.


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