AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Bad Camper 1.4.239 (https://forums.alliedmods.net/showthread.php?t=321234)

MrGarfield 01-31-2020 11:57

Bad Camper 1.4.239
 
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

Napoleon_be 01-31-2020 12:14

Re: Bad Camper 1.4.239
 
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; 


MrGarfield 01-31-2020 12:29

Re: Bad Camper 1.4.239
 
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 ?

ZaX 01-31-2020 16:11

Re: Bad Camper 1.4.239
 
PHP Code:

if(is_user_bot(id))
    return;
punish_slap(..) 


DJEarthQuake 01-31-2020 22:11

Re: Bad Camper 1.4.239
 
Quote:

Originally Posted by MrGarfield (Post 2682289)
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);         } }

iceeedr 01-31-2020 22:23

Re: Bad Camper 1.4.239
 
Quote:

Originally Posted by DJEarthQuake (Post 2682344)
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

DJEarthQuake 01-31-2020 22:41

Re: Bad Camper 1.4.239
 
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?

MrGarfield 02-01-2020 03:44

Re: Bad Camper 1.4.239
 
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?

http://lestetesbruleescz.free.fr/ima...200201163640_1

iceeedr 02-01-2020 12:59

Re: Bad Camper 1.4.239
 
Quote:

Originally Posted by DJEarthQuake (Post 2682347)
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.

DJEarthQuake 02-03-2020 13:18

Re: Bad Camper 1.4.239
 
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.


All times are GMT -4. The time now is 13:18.

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