This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

AFK KiSSS (Kick/Slay/Spec-Switcher for CS) (with bombdrop)


Post New Thread Reply   
 
Thread Tools Display Modes
juKay
Member
Join Date: Mar 2004
Location: Sweden
Old 06-28-2005 , 22:42  
Reply With Quote #31

Could be me, but wouldn't it look better if you changed:

All of [AFK KiSS xxxx] to [AFK KiSSS]: xxxx. As now you have both in the code.
juKay is offline
juKay
Member
Join Date: Mar 2004
Location: Sweden
Old 06-28-2005 , 22:46  
Reply With Quote #32

Another thing =)

You precache weapons/explode3.wav, but you are not using it. However you are using weapons/rocket1.wav
juKay is offline
juKay
Member
Join Date: Mar 2004
Location: Sweden
Old 06-28-2005 , 23:32  
Reply With Quote #33

Some more things, no I don't have much to do right now ;)

CheckPlayers() could be changed to this, not tested. You save some cpu cycles here becuse you no longer need to check if the player is alive, connected and or is a bot. You no longer need to check all "possible" users:

Code:
public checkPlayers() {     new players[32];     new count, player;     // Get all players that are alive     get_players(players, count, "ac");     for (new i = 0; i < count; i++) {         // Player we are checking right now         player = players[i];         if (!is_user_hltv(player) && g_spawned[player]) {             new newangle[3];             get_user_origin(player, newangle);             if ( newangle[0] == g_oldangles[player][0] && newangle[1] == g_oldangles[player][1] && newangle[2] == g_oldangles[player][2] ) {                 g_afktime[player] += CHECK_FREQ;                 check_afktime(player);                 // Needs to be here, otherwise the bomb will only be droped it afk_slayplayer is activated (remove from check_team(id))                 if(g_afktime[player] > BOMB_DROP_TIME && player == bombcarrier) {                     client_cmd(player,"use weapon_c4; drop")                     client_print(0, print_chat, "[AFK KiSSS - Bomb Drop]")                 }                 if (get_cvar_num("afk_slayplayers"))                     check_team(player);             } else {                 // Not sure if AMXX acceptes this                 g_oldangles[player] = {newangle[0], newangle[1], newangle[2]};                 g_afktime[player] = 0;             }         }     }     return PLUGIN_HANDLED; }

in check_team(id). Why are you doing this?
Code:
team = cs_get_user_team(id) for (new i = 1; i <= get_maxplayers(); i++) {     if(cs_get_user_team(i) == team && is_user_alive(i) && i != id && g_afktime[i] < 20)         return PLUGIN_HANDLED }

Btw it will give you errors since it will run cs_get_user_team() and is_user_alive() on players not on server since you are checking i=1 to i=get_maxplayers()


check_afktime() and check_team could be combinded and save you even more cpu.
juKay is offline
Isobold
Veteran Member
Join Date: Mar 2004
Old 06-29-2005 , 05:55  
Reply With Quote #34

Thx 4 all the hints. I do not have the time to check this all out, but I already planned a complete rewrite for the weekend for version 2.0. You are right that some of the functions are not very efficient, especially the afk-Checker (which is not my code) and the bomb-drop-calc at roundstart.

I did it never the less as on roundstart there normally is plenty of cpu-power and I didn't knew how to check for a bomb right. I will use your function for v.2 . Probably already on Friday...
Isobold is offline
bmann_420
AMX_Super Pooper
Join Date: Jan 2005
Location: [SuperCentral.co]
Old 06-30-2005 , 15:20  
Reply With Quote #35

Im Waiting for it, I like this plugin alot, and what hints he gave u shuld save u and everybody else hassle . Like i said im just waitin, and Good Job
__________________
bmann_420 is offline
juKay
Member
Join Date: Mar 2004
Location: Sweden
Old 06-30-2005 , 15:51  
Reply With Quote #36

I updated the bomb_events function above to also handle bomb planting.
juKay is offline
bmann_420
AMX_Super Pooper
Join Date: Jan 2005
Location: [SuperCentral.co]
Old 06-30-2005 , 17:39  
Reply With Quote #37

Register_logeven i changed, and it compiled. The others with public bomb_events and public check player list, those changes dont compile. But hey ive never really got into this so i dunno exactly what im doin , but i like to try, how ya gonna learn if u dont try to understand . thought id let u know
Code:
L 07/01/2005 - 20:35:09: [AMXX] Function is not present (function "bomb_events") (plugin "afkkicker.amxx")
L 07/01/2005 - 20:35:09: [AMXX] Run time error 10 (native) (plugin "afkkicker.amxx") - debug not enabled.
L 07/01/2005 - 20:35:09: [AMXX] To enable debug mode, add " debug" after the plugin name in plugins.ini (without quotes).
__________________
bmann_420 is offline
Isobold
Veteran Member
Join Date: Mar 2004
Old 07-01-2005 , 16:06  
Reply With Quote #38

Version 2.0.1 released

* Complete Code revised and partially rewritten...


Feature added:
* AFK-Count with a message at round start

* Code optimized and debugged.
* Plugin tested for more than 3 hours on our clan-server, works perfectly...

Seems not to throw errors anymore...


PLZ vote for this plugin, if you use and like it ...



@ jukay
Code:
team = cs_get_user_team(id) for (new i = 1; i <= get_maxplayers(); i++) {     if(cs_get_user_team(i) == team && is_user_alive(i) && i != id && g_afktime[i] < 20)         return PLUGIN_HANDLED }

This lines checked, wether there were still other teamplayers alive and not afk. I check this now earlier, so I do not have to recheck this for each afk-player... In return now I always have to check it, even if there is not even one afk-player...
Isobold is offline
lantz69
AMX Mod X Beta Tester
Join Date: Mar 2004
Location: Sweden, Skåne
Old 07-02-2005 , 06:20  
Reply With Quote #39

@ Isobold

Players on my server have reported that if you get switched into spectator by your plugin they can kill the players they are watching.

I gonna try this myself now and see if it works. It probably only works one round but maybe you can watch your code and see if that can be possible and fixx it if that is the case.

These are my settings
Code:
afk_options "1" // Set to 0 will not kick player but switch him to spec-team
afk_kicktime "150 // Kick people AFK longer than this time
afk_slaytime "60" // Slay people AFK and last survivor longer than this time
afk_minplayers "8" // Only kick AFKs when there is atleast this many players on the server
afk_slayplayers "1" // Shall we slay or shall we not
afk_adminimmunity "0") // Honor the immunity flag or not
afk_adminkickimmunity "0" // Honor the immunity flag or not
Thankful for answers

PS
Great plugin and keep up the good work
DS

..
__________________
Using: Amxmodx 1.8.1.xxxx, cstrike
http://www.vanilla.se/
lantz69 is offline
Isobold
Veteran Member
Join Date: Mar 2004
Old 07-02-2005 , 06:28  
Reply With Quote #40

I will do some testing and try to fix it then. Don't expect to much, I have no clue at the moment how this could happen...

Which way do you kill the others? Do you type kill into console, or are you still able to attack them?


Edit: v. 2.0.2 released. Did not tested yet, wether this resolves the problem, but I made 2 changes which could have caused the problem, even if I do not know why and how. Plz post your experiences, as I do not have the time to do these test before tomorrow.

Edit2: Concerning your settings, you have a little bug into them (if you copied it right from your config). Remove the ")" ...

Edit3: v. 2.0.3 released. New cvar: afk_show_counter 0
If set to 1, it will show the AFK-Counter-Msg every "#define SHOW_FREQ 20" seconds (change this line, to make it show more or less often).
Isobold 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 03:17.


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