Raised This Month: $ Target: $400
 0% 

Solved [CS:S]I want to resolve the repeated error in my cmd. Include Attachment


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kdaekiss
Junior Member
Join Date: Sep 2017
Old 09-01-2018 , 22:53   [CS:S]I want to resolve the repeated error in my cmd. Include Attachment
Reply With Quote #1

We've added a variable to the Round Start hook. as seen
But it will work.

Code:
classcheckTime = CreateTimer(10.0, classchecktimer, _);
And if you check the attached file, there will be an error here.

Code:
public Action:Round_End(Handle:event, const String:Name[], bool:Broadcast)
{
	if(classcheckTime != INVALID_HANDLE)
	{
		CloseHandle(classcheckTime); //here
		classcheckTime = INVALID_HANDLE;
	}
}
***Translation may be awkward.
Attached Thumbnails
Click image for larger version

Name:	cmderror.PNG
Views:	119
Size:	4.8 KB
ID:	171216  

Last edited by kdaekiss; 09-09-2018 at 00:22. Reason: I saw the comment and followed it up. Thank you.
kdaekiss is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 09-02-2018 , 01:07   Re: [CS:S]I want to resolve the repeated error in my cmd. Include Attachment
Reply With Quote #2

You haven't provided enough code.
Fyren is offline
kdaekiss
Junior Member
Join Date: Sep 2017
Old 09-03-2018 , 06:45   Re: [CS:S]I want to resolve the repeated error in my cmd. Include Attachment
Reply With Quote #3

Quote:
Originally Posted by Fyren View Post
You haven't provided enough code.
Because the structure was somewhat complicated, I uploaded the source as an attachment. Please check.
Attached Files
File Type: sp Get Plugin or Get Source (classmod.sp - 132 views - 24.9 KB)

Last edited by kdaekiss; 09-03-2018 at 06:50. Reason: Translation into unknown translation
kdaekiss is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 09-03-2018 , 18:20   Re: [CS:S]I want to resolve the repeated error in my cmd. Include Attachment
Reply With Quote #4

You probably want to set classcheckTime to INVALID_HANDLE in the timer's callback.
Fyren is offline
kdaekiss
Junior Member
Join Date: Sep 2017
Old 09-04-2018 , 06:33   Re: [CS:S]I want to resolve the repeated error in my cmd. Include Attachment
Reply With Quote #5

Quote:
Originally Posted by Fyren View Post
You probably want to set classcheckTime to INVALID_HANDLE in the timer's callback.
I've erased the line, but the error is still appearing in the CloseHandle until the end. But this part does it without any gaps. I do not know what the problem is. I use this when I refer to other plugins.
kdaekiss is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 09-04-2018 , 11:12   Re: [CS:S]I want to resolve the repeated error in my cmd. Include Attachment
Reply With Quote #6

No, you shouldn't remove any lines, just add setting it to INVALID_HANDLE in the callback. This is what's happening, in order:
  1. Round starts and you create the timer (handle is assigned value)
  2. 10s later, the timer ends (handle still has a value since you haven't changed it, but is dead because the timer finished)
  3. Round ends and you try to CloseHandle since it's not INVALID_HANDLE
Fyren is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 09-04-2018 , 13:12   Re: [CS:S]I want to resolve the repeated error in my cmd. Include Attachment
Reply With Quote #7

PHP Code:
classcheckTime CreateTimer(10.0classchecktimer);

OnRoundEnd:

if (
classcheckTime != null)
{
     
delete classcheckTime;
}

In timer callback (at the end)

     
classcheckTime null;
     return 
Plugin_Stop
Ilusion9 is offline
kdaekiss
Junior Member
Join Date: Sep 2017
Old 09-07-2018 , 07:02   Re: [CS:S]I want to resolve the repeated error in my cmd. Include Attachment
Reply With Quote #8

Quote:
Originally Posted by Fyren View Post
No, you shouldn't remove any lines, just add setting it to INVALID_HANDLE in the callback. This is what's happening, in order:
  1. Round starts and you create the timer (handle is assigned value)
  2. 10s later, the timer ends (handle still has a value since you haven't changed it, but is dead because the timer finished)
  3. Round ends and you try to CloseHandle since it's not INVALID_HANDLE

Then it becomes the origin again. It was like this from the beginning.
kdaekiss is offline
kdaekiss
Junior Member
Join Date: Sep 2017
Old 09-07-2018 , 07:04   Re: [CS:S]I want to resolve the repeated error in my cmd. Include Attachment
Reply With Quote #9

Quote:
Originally Posted by Ilusion9 View Post
PHP Code:
classcheckTime CreateTimer(10.0classchecktimer);

OnRoundEnd:

if (
classcheckTime != null)
{
     
delete classcheckTime;
}

In timer callback (at the end)

     
classcheckTime null;
     return 
Plugin_Stop
Your grammar is strange.
kdaekiss is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 09-08-2018 , 07:20   Re: [CS:S]I want to resolve the repeated error in my cmd. Include Attachment
Reply With Quote #10

Quote:
Originally Posted by kdaekiss View Post
Your grammar is strange.
new api syntax. learn it and use it.
Ilusion9 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 04:07.


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