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

veteran plugins


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
szogun
Senior Member
Join Date: Apr 2016
Old 07-21-2017 , 07:01   veteran plugins
Reply With Quote #1

Hello
She would find someone to add an exception through a flag for people who do not have a certain number of hours
https://forums.alliedmods.net/showthread.php?t=255871
szogun is offline
blacklagoon
Senior Member
Join Date: Jun 2012
Old 07-21-2017 , 07:18   Re: veteran plugins
Reply With Quote #2

Try this it should work for custom flag 1 ! If you want another one change line 117 "ADMFLAG_" to the one you want !
Code:
if (!Decide(totalTime, last2WeeksTime)  || GetUserFlagBits(client) & ADMFLAG_CUSTOM1)
Not tested so tell me if there is an issue
Attached Files
File Type: sp Get Plugin or Get Source (veterans.sp - 122 views - 11.7 KB)

Last edited by blacklagoon; 07-21-2017 at 07:20.
blacklagoon is offline
szogun
Senior Member
Join Date: Apr 2016
Old 07-21-2017 , 12:10   Re: veteran plugins
Reply With Quote #3

Unfortunately, this does not work
szogun is offline
WatchDogs
Senior Member
Join Date: Oct 2015
Location: Iran
Old 07-21-2017 , 17:30   Re: veteran plugins
Reply With Quote #4

Quote:
Originally Posted by blacklagoon View Post
Try this it should work for custom flag 1 ! If you want another one change line 117 "ADMFLAG_" to the one you want !
Code:
if (!Decide(totalTime, last2WeeksTime)  || GetUserFlagBits(client) & ADMFLAG_CUSTOM1)
Not tested so tell me if there is an issue
If you want to check for flag you should put it in ThrowOut function.

And not this
Code:
if (!Decide(totalTime, last2WeeksTime)  || GetUserFlagBits(client) & ADMFLAG_CUSTOM1)
You are telling that if client had the flag, plugin should kick him !

This is the correct one:
PHP Code:
if (!Decide(totalTimelast2WeeksTime)  && !GetUserFlagBits(client) & ADMFLAG_CUSTOM1
Here is a version with new cvar "sm_veterans_flag" to set the admin flag for excluding(Empty for disabled).
Attached Files
File Type: sp Get Plugin or Get Source (veterans.sp - 112 views - 12.1 KB)
WatchDogs is offline
blacklagoon
Senior Member
Join Date: Jun 2012
Old 07-22-2017 , 02:19   Re: veteran plugins
Reply With Quote #5

Quote:
Originally Posted by WatchDogs View Post
If you want to check for flag you should put it in ThrowOut function.

And not this
Code:
if (!Decide(totalTime, last2WeeksTime)  || GetUserFlagBits(client) & ADMFLAG_CUSTOM1)
You are telling that if client had the flag, plugin should kick him !

This is the correct one:
PHP Code:
if (!Decide(totalTimelast2WeeksTime)  && !GetUserFlagBits(client) & ADMFLAG_CUSTOM1
Here is a version with new cvar "sm_veterans_flag" to set the admin flag for excluding(Empty for disabled).
True, was kinda tired yesterday
blacklagoon is offline
szogun
Senior Member
Join Date: Apr 2016
Old 07-22-2017 , 08:58   Re: veteran plugins
Reply With Quote #6

Quote:
Originally Posted by szogun View Post
Unfortunately, this does not work
Quote:
Originally Posted by WatchDogs View Post
If you want to check for flag you should put it in ThrowOut function.
And not this
Code:
if (!Decide(totalTime, last2WeeksTime)  || GetUserFlagBits(client) & ADMFLAG_CUSTOM1)
This is the correct one:
PHP Code:
if (!Decide(totalTimelast2WeeksTime)  && !GetUserFlagBits(client) & ADMFLAG_CUSTOM1
With this release, the plugin now ignores any settings for minimum hours lost
Quote:
Here is a version with new cvar "sm_veterans_flag" to set the admin flag for excluding(Empty for disabled).
Something does not work in this version.

Last edited by szogun; 07-22-2017 at 09:00.
szogun is offline
blacklagoon
Senior Member
Join Date: Jun 2012
Old 07-22-2017 , 09:09   Re: veteran plugins
Reply With Quote #7

try putting this check in throwout as watchdogs said
EDIT: try his plugin he did it for you a lot more cleaner than what we talked

Last edited by blacklagoon; 07-22-2017 at 09:18.
blacklagoon is offline
szogun
Senior Member
Join Date: Apr 2016
Old 07-22-2017 , 09:40   Re: veteran plugins
Reply With Quote #8

I do not know much about plugin modifications

Code:
ThrowOut(client, const String:reason[])
{
	new clientId = GetClientUserId(client);
	if (CheckCommandAccess(clientId, "generic_admin", ADMFLAG_CUSTOM1, false))
	{
		return;
	}
	if (!Decide(totalTime, last2WeeksTime) && !GetUserFlagBits(client) & ADMFLAG_CUSTOM1)  
	{
		return;
	}
	if (GetConVarInt(cvar_banTime) > 0)
	{
		BanClient(client, GetConVarInt(cvar_banTime), BANFLAG_AUTHID, reason, reason);
	}
	else
	{
		KickClient(client, reason);
	}
}
Code:
//// veterans.sp
//
// veterans.sp(104) : error 017: undefined symbol "totalTime"
//
// 1 Error.
//
// Compilation Time: 0,17 sec
szogun is offline
WatchDogs
Senior Member
Join Date: Oct 2015
Location: Iran
Old 07-22-2017 , 09:54   Re: veteran plugins
Reply With Quote #9

Quote:
Originally Posted by WatchDogs View Post
If you want to check for flag you should put it in ThrowOut function.

And not this
Code:
if (!Decide(totalTime, last2WeeksTime)  || GetUserFlagBits(client) & ADMFLAG_CUSTOM1)
You are telling that if client had the flag, plugin should kick him !

This is the correct one:
PHP Code:
if (!Decide(totalTimelast2WeeksTime)  && !GetUserFlagBits(client) & ADMFLAG_CUSTOM1
Here is a version with new cvar "sm_veterans_flag" to set the admin flag for excluding(Empty for disabled).
Simply use mine version it's OK.

Last edited by WatchDogs; 07-22-2017 at 09:54.
WatchDogs is offline
szogun
Senior Member
Join Date: Apr 2016
Old 07-23-2017 , 08:43   Re: veteran plugins
Reply With Quote #10

Either I do something wrong or the methods given here do not work
Attached Files
File Type: sp Get Plugin or Get Source (veterans1.sp - 127 views - 11.7 KB)
szogun 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 15:28.


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