Raised This Month: $32 Target: $400
 8% 

Solved set_task bug? / memory access problem ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Natsheh
Veteran Member
Join Date: Sep 2012
Old 05-13-2021 , 17:01   set_task bug? / memory access problem ?
Reply With Quote #1

Hello, i am experiencing an issue with set_task that its something is calling its function regardless, i couldn't tell how its being called but i did gathered some info.

Its Calling the task twice or more depending on when the last players were killed, also i have clcorpse usermsg hooked and i am disabling the hook on the end of the event, when i tried removing the hook totally everything was fine ?!?!

Code:
EndTheRound called TASKID: 2 TASK_EXIST? NO
 aWinner Len: 15 => "ommon/null.wav"

EndTheRound called TASKID: 35000 TASK_EXIST? YES
aWinner Len: 1 => "3"
PHP Code:

#define TASK_END_ROUND 35000
public function()
{
            static const 
Float:ROUND_TIME_LEFT 5.0;
            new 
aWinner[1]; aWinner[0] = '3';
            
set_task(ROUND_TIME_LEFT"EndTheRound"TASK_END_ROUNDaWinnersizeof aWinner);
}

public 
EndTheRound(const aWinner[], const taskid)
{
    if(
bHAS_ROUND_ENDED) return;
    
    
cprint_chat(0_"EndTheRound called TASKID: %d TASK_EXIST? %s"taskidtask_exists(taskid1) ? "YES":"NO");
    
cprint_chat(0_"aWinner Len: %d => ^"%s^""strlen(aWinner), aWinner);
    
    switch( 
aWinner[0] )
    {
        case 
'1'TerminateRoundTR_RoundEndType_TeamExterminateTeamWinning_Terrorist );
        case 
'2'TerminateRoundTR_RoundEndType_TeamExterminateTeamWinning_Ct );
        case 
'3'TerminateRoundTR_RoundEndType_Draw );
    }

__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 05-13-2021 at 18:05.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Natsheh
Veteran Member
Join Date: Sep 2012
Old 05-13-2021 , 17:32   Re: set_task bug? / memory access problem ?
Reply With Quote #2

i think i've found out what causing this problem, its because i am

PHP Code:
if(fwMessage_clcorpse > -1unregister_message(iMsg_ClCorpsefwMessage_clcorpse); fwMessage_clcorpse = -1
removing the clcorpse hook message, which will cause an invalid function call, because there's a delay on calling when someone dies, i think its an amx module bug.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 05-14-2021 at 05:22.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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:11.


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