Raised This Month: $51 Target: $400
 12% 

Anty retry for bh


Post New Thread Reply   
 
Thread Tools Display Modes
Natsheh
Veteran Member
Join Date: Sep 2012
Old 04-21-2023 , 09:15   Re: Anty retry for bh
Reply With Quote #11

Quote:
Originally Posted by mlibre View Post
yes in a simplified way
He meant you need to check for players identity for example player ip or steamid, and check if the same client with the same auth has reconneted.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 04-21-2023 at 09:16.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
mlibre
Veteran Member
Join Date: Nov 2015
Location: return PLUGIN_CONTINUE
Old 04-21-2023 , 09:47   Re: Anty retry for bh
Reply With Quote #12

Quote:
Originally Posted by Natsheh View Post
He meant you need to check for players identity for example player ip or steamid, and check if the same client with the same auth has reconneted.
I think I'm sure that the player's id will be the same until the map changes, that's why I check it since it won't be assigned to another, something like that is how I see it

Code:
client connect -->

playerA -> id = 1
playerB -> id = 2
playerC -> id = 3

client disconnect <--

playerB -> id = 2

client connect -->

playerD -> id = 4
playerE -> id = 5
playerB -> id = 2
the count is consecutive and does not retake the ids already assigned, unless you free it from memory

PHP Code:
public client_disconnect(id)
{
    
is_user_retry[id] = 0

I'm not entirely sure about it, it's what I realized doing tests with the bots
__________________

Last edited by mlibre; 04-21-2023 at 09:51.
mlibre is offline
JocAnis
Veteran Member
Join Date: Jun 2010
Old 04-21-2023 , 13:18   Re: Anty retry for bh
Reply With Quote #13

@mlibre good try!
But it wont work. In case: when playerA disconnect, and dont want to join again, you will infect a new connected player, because he got the ID of playerA who just disconnected..
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)
JocAnis is offline
mlibre
Veteran Member
Join Date: Nov 2015
Location: return PLUGIN_CONTINUE
Old 04-22-2023 , 17:10   Re: Anty retry for bh
Reply With Quote #14

Quote:
Originally Posted by JocAnis View Post
@mlibre good try!
But it wont work. In case: when playerA disconnect, and dont want to join again, you will infect a new connected player, because he got the ID of playerA who just disconnected..
has put me in doubt


Quote:
Originally Posted by fysiks View Post
The "userid" is NOT the first value. The first column is the entity index. The "userid" is the third column, the value after the name (unironically labeled "userid").

The entity index is always between 1 and 32. The userid is essentially a count of the number of new connections while the server is running. You get assigned a userid when you join and you keep that userid through all map changes until you disconnect. The counter resets when the server is hard restarted.
__________________
mlibre is offline
JocAnis
Veteran Member
Join Date: Jun 2010
Old 04-24-2023 , 13:55   Re: Anty retry for bh
Reply With Quote #15

then you wanted to do with get_user_userid( id ), not a entity ID
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)
JocAnis is offline
mlibre
Veteran Member
Join Date: Nov 2015
Location: return PLUGIN_CONTINUE
Old 04-25-2023 , 09:03   Re: Anty retry for bh
Reply With Quote #16

Quote:
Originally Posted by JocAnis View Post
then you wanted to do with get_user_userid( id ), not a entity ID
really in fact I had to use the celltrie, it didn't save the same old ID as I thought
__________________
mlibre is offline
JocAnis
Veteran Member
Join Date: Jun 2010
Old 04-25-2023 , 12:32   Re: Anty retry for bh
Reply With Quote #17

and reset his is_user_retry[ id ] on first infection, otherwise he will be infected on every round cuz of is_user_retry[ id ] = 1
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)
JocAnis is offline
mlibre
Veteran Member
Join Date: Nov 2015
Location: return PLUGIN_CONTINUE
Old 04-25-2023 , 13:09   Re: Anty retry for bh
Reply With Quote #18

true you're right, I missed it
__________________
mlibre is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 04-26-2023 , 11:30   Re: Anty retry for bh
Reply With Quote #19

When I retry and join team I just watched players finish off the round as the *dead*. How is it they are doing this? I had to install a respawn plugin to get to that point. Also one that shows HP when aiming is helpful. I got it to punish the infected on retry. Host can set the task to run like a timeout for X number of seconds as CVAR or use that timeout after disconnect or time before next map change. Further adjustment to script is likely needed.

Code:
new const szChant[]={"say ^"Player is not coming back soon.^""}; new sid[MAX_PLAYERS+1][5], bool: b_Bot[MAX_PLAYERS+1],g_cvar_end, g_cvar_time public plugin_precache() {     register_plugin("Biohazard", VERSION, "cheap_suit")     //SPiNX - few mods so players cannot exploit disconnecting when infected.     register_dictionary("common.txt")     g_cvar_end = register_cvar("retry_mapend", "1") //map end or time-out     g_cvar_time = register_cvar("retry_time", "20") //time to place on task . . . public client_putinserver(id) {     if(is_user_connected(id))     {         b_Bot[id] = is_user_bot(id) ? true : false         if(!g_botclient_pdata && g_czero)         {             static param[1]             param[0] = id             if(!task_exists(TASKID_CZBOTPDATA))                 set_task(1.0, "task_botclient_pdata", TASKID_CZBOTPDATA, param, 1)         }         if(get_pcvar_num(cvar_randomclass) && g_classcount > 1)             g_player_class[id] = _random(g_classcount)         if(!b_Bot[id])         {             get_user_info(id, "*sid", sid[id], charsmax(sid[]))             new iTask_Client_retry = str_to_num(sid[id])             if(task_exists(iTask_Client_retry))             {                 remove_task(iTask_Client_retry)                 g_zombie[id] = true                 set_task(2.0, "@Welcome", id)             }         }     } } @Welcome( id ) /////DO STUFF///// is_user_connected       ( id )         ? client_print(id, print_chat, "%L", LANG_PLAYER, "BACK")         & client_print(id, print_chat, "%L", LANG_PLAYER, "ON")         & get_cvar_pointer("bh_enabled") ? server_print("BioHazard not running...") : (g_zombie[id] ? server_cmd("amx_infect #%d", get_user_userid(id)) : server_print("User is not infected"))         : console_cmd(0, szChant)         & server_print("Client did not use retry exploit!") public client_disconnected(id) {     remove_task(TASKID_STRIPNGIVE + id)     remove_task(TASKID_UPDATESCR + id)     remove_task(TASKID_SPAWNDELAY + id)     remove_task(TASKID_WEAPONSMENU + id)     remove_task(TASKID_CHECKSPAWN + id)     g_disconnected[id] = true     remove_user_model(g_modelent[id])     if(!b_Bot[id] && g_zombie[id])     {         new iTask_Client_retry = str_to_num(sid[id])         set_task(get_pcvar_num(g_cvar_time)*1.0, "@Welcome", iTask_Client_retry, _, _, get_pcvar_num(g_cvar_end) ? ("d" ) : ("a", "1"))         sid[id][4] = 0;     } }
__________________

Last edited by DJEarthQuake; 04-27-2023 at 13:05. Reason: Further adjustment to script is likely needed.
DJEarthQuake 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 10:14.


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