Raised This Month: $433 Target: $400
 108% 

Bad Camper 1.4.239


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MrGarfield
Senior Member
Join Date: Feb 2013
Old 01-31-2020 , 11:57   Bad Camper 1.4.239
Reply With Quote #1

I use this plugin https://forums.alliedmods.net/showthread.php?p=156560, it works well, but I would like bots not to be taken into account.
while searching on the net I found
Quote:
punish_slap (if (is user bot (id)) return; id, Float: punishpercentage)
to put on line 734 but if I compile I have errors

thank you
MrGarfield is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 01-31-2020 , 12:14   Re: Bad Camper 1.4.239
Reply With Quote #2

that line makes no sense at all,

PHP Code:
if(is_user_bot(id)) 
{
    return;

or just this, but i don't like this way of coding:

PHP Code:
 if(is_user_bot(id)) return; 
__________________


My Plugins:
Napoleon_be is online now
Send a message via Skype™ to Napoleon_be
MrGarfield
Senior Member
Join Date: Feb 2013
Old 01-31-2020 , 12:29   Re: Bad Camper 1.4.239
Reply With Quote #3

ok i'm not very good at code i just do research on the net there is a better way to avoid that bots are not taken into account ?
MrGarfield is offline
ZaX
Member
Join Date: Jan 2015
Old 01-31-2020 , 16:11   Re: Bad Camper 1.4.239
Reply With Quote #4

PHP Code:
if(is_user_bot(id))
    return;
punish_slap(..) 
__________________
ZaX is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: All over the place.
Old 01-31-2020 , 22:11   Re: Bad Camper 1.4.239
Reply With Quote #5

Quote:
Originally Posted by MrGarfield View Post
I use this plugin https://forums.alliedmods.net/showthread.php?p=156560, it works well, but I would like bots not to be taken into account.
while searching on the net I found

to put on line 734 but if I compile I have errors

thank you
Code:
/* punish_slap(id, Float:punishPercentage) {     for (new slapCnt = 1; slapCnt <= floatround(3.0 * punishPercentage, floatround_ceil); slapCnt++)         user_slap(id, 0); } */ punish_slap(id, Float:punishPercentage){ for (new slapCnt = 1; slapCnt <= floatround(3.0 * punishPercentage, floatround_ceil); slapCnt++)         if(!is_user_bot(id) && is_user_alive(id) && is_user_connected(id))         {         user_slap(id, 0);         } }
__________________
"It's not the actual programming that's interesting. But it's what you can accomplish with the end results that are important." -Dennis Ritchie
"Mathematics, rightly viewed, possesses not only truth, but supreme beauty a beauty cold and austere, like that of sculpture..." -Bertrand Russell

Last edited by DJEarthQuake; 01-31-2020 at 22:19.
DJEarthQuake is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 01-31-2020 , 22:23   Re: Bad Camper 1.4.239
Reply With Quote #6

Quote:
Originally Posted by DJEarthQuake View Post
Code:
/* punish_slap(id, Float:punishPercentage) {     for (new slapCnt = 1; slapCnt <= floatround(3.0 * punishPercentage, floatround_ceil); slapCnt++)         user_slap(id, 0); } */ punish_slap(id, Float:punishPercentage){ for (new slapCnt = 1; slapCnt <= floatround(3.0 * punishPercentage, floatround_ceil); slapCnt++)         if(!is_user_bot(id) && is_user_alive(id) && is_user_connected(id))         {         user_slap(id, 0);         } }

If you are checking that the player is alive, there is no need to check that it is connected.

Syntax

native is_user_alive(index);


Description

Returns if the client is alive.

Note

This will never return true if a client is not connected. If you need
to know whether a client is alive, an additional call to
is_user_connected() is unnecessary.


Return

1 if client is alive, 0 otherwise
__________________
iceeedr is offline
Send a message via Skype™ to iceeedr
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: All over the place.
Old 01-31-2020 , 22:41   Re: Bad Camper 1.4.239
Reply With Quote #7

So. If they are dead as this is happening it stops. Also if they are alive and happen to disconnect it stops as well. I have seen enough errors I have experience on my side with this one. Originally I only had connected and thought why not expand the function. Why didn't you critique the previous examples that make matter worse?
__________________
"It's not the actual programming that's interesting. But it's what you can accomplish with the end results that are important." -Dennis Ritchie
"Mathematics, rightly viewed, possesses not only truth, but supreme beauty a beauty cold and austere, like that of sculpture..." -Bertrand Russell
DJEarthQuake is offline
MrGarfield
Senior Member
Join Date: Feb 2013
Old 02-01-2020 , 03:44   Re: Bad Camper 1.4.239
Reply With Quote #8

thank you I just tested it works for me the bots are no longer slap, but I would also like it to no longer mark bot alerts is it possible?


Last edited by MrGarfield; 02-01-2020 at 10:47.
MrGarfield is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 02-01-2020 , 12:59   Re: Bad Camper 1.4.239
Reply With Quote #9

Quote:
Originally Posted by DJEarthQuake View Post
So. If they are dead as this is happening it stops. Also if they are alive and happen to disconnect it stops as well. I have seen enough errors I have experience on my side with this one. Originally I only had connected and thought why not expand the function. Why didn't you critique the previous examples that make matter worse?
It is not a criticism, it is information, but if you do not want information, I can no longer express an opinion, without problems.
__________________
iceeedr is offline
Send a message via Skype™ to iceeedr
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: All over the place.
Old 02-03-2020 , 13:18   Re: Bad Camper 1.4.239
Reply With Quote #10

My bad iceedr. You have taught me a lot over the years in the midst of wolves. That was an off day. The extra check should not be necessary in this case.
__________________
"It's not the actual programming that's interesting. But it's what you can accomplish with the end results that are important." -Dennis Ritchie
"Mathematics, rightly viewed, possesses not only truth, but supreme beauty a beauty cold and austere, like that of sculpture..." -Bertrand Russell
DJEarthQuake is offline
Reply


Thread Tools
Display Modes

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 15:35.


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