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

task problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
A k c 3 n 7
Junior Member
Join Date: Oct 2014
Location: Romania
Old 10-22-2017 , 13:43   task problem
Reply With Quote #1

hi, i have this code
Code:
#define TASK_FOG 112

public client_putinserver( Client )
{
	if( is_user_bot( Client ) || is_user_hltv( Client ) )
		return;	
	
	if( !task_exists( Client + TASK_FOG ) )
	set_task( 0.1, "task_MakeFogToPlayer", Client + TASK_FOG );	
}
public bomb_planted ( Client ) {

        remove_task( Client + TASK_FOG);  
}    

public task_MakeFogToPlayer( Client )
{
	
        Client -= TASK_FOG;
	if( !is_user_connected( Client ) )
		return;
		
	MakeFog( Client, 255, 255, 255, 111, 18, 3, 58 );
}


MakeFog( Client, const iRed, const iGreen, const iBlue, const iSD, const iED, const iD1, const iD2 )
{
	static iMsgIdFog;
	
	message_begin( Client == 0 ? MSG_ALL : MSG_ONE_UNRELIABLE, !iMsgIdFog ? ( iMsgIdFog = get_user_msgid( "Fog" ) ) : iMsgIdFog, {0, 0, 0}, Client );
	write_byte( iRed );  // R
	write_byte( iGreen );  // G
	write_byte( iBlue );  // B
	write_byte( iSD ); // SD
	write_byte( iED );  // ED
	write_byte( iD1 );   // D1
	write_byte( iD2 );  // D2
	message_end(  );
}
i want to remove fog from when bomb is planted but doesn't work
__________________


Last edited by A k c 3 n 7; 10-22-2017 at 14:24.
A k c 3 n 7 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-22-2017 , 14:09   Re: task problem
Reply With Quote #2

Without the full code, we can't really tell if it's done correctly. Are you sure that bomb_planted() is actually being called? Try to do some debugging to see if things are being called as you are expecting.
__________________
fysiks is offline
A k c 3 n 7
Junior Member
Join Date: Oct 2014
Location: Romania
Old 10-22-2017 , 14:19   Re: task problem
Reply With Quote #3

this is full code
__________________

A k c 3 n 7 is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 10-22-2017 , 14:31   Re: task problem
Reply With Quote #4

That's not the full code...because you can't even compile that.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
A k c 3 n 7
Junior Member
Join Date: Oct 2014
Location: Romania
Old 10-22-2017 , 14:34   Re: task problem
Reply With Quote #5

HTML Code:
#include < amxmodx > 
#include < engine >

#define TASK_FOG 112

public bomb_planted( Client ) {

	
       remove_task( Client + TASK_FOG) ;
}

public client_putinserver( Client )
{
	if( is_user_bot( Client ) || is_user_hltv( Client ) )
		return;	
	
	if( !task_exists( Client + TASK_FOG ) )
	set_task( 0.1, "task_MakeFogToPlayer", Client + TASK_FOG );	
}

public task_MakeFogToPlayer( Client )
{
	
        Client -= TASK_FOG;
	if( !is_user_connected( Client ) )
		return;
		
	MakeFog( Client, 255, 255, 255, 111, 18, 3, 58 );
}

MakeFog( Client, const iRed, const iGreen, const iBlue, const iSD, const iED, const iD1, const iD2 )
{
	static iMsgIdFog;
	
	message_begin( Client == 0 ? MSG_ALL : MSG_ONE_UNRELIABLE, !iMsgIdFog ? ( iMsgIdFog = get_user_msgid( "Fog" ) ) : iMsgIdFog, {0, 0, 0}, Client );
	write_byte( iRed );  // R
	write_byte( iGreen );  // G
	write_byte( iBlue );  // B
	write_byte( iSD ); // SD
	write_byte( iED );  // ED
	write_byte( iD1 );   // D1
	write_byte( iD2 );  // D2
	message_end(  );
}
__________________


Last edited by A k c 3 n 7; 10-22-2017 at 14:35.
A k c 3 n 7 is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 10-22-2017 , 14:37   Re: task problem
Reply With Quote #6

Why do people ask for help but don't want to post their code?
Where is plugin_init()

Quote:
Originally Posted by fysiks View Post
Try to do some debugging to see if things are being called as you are expecting.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.

Last edited by wickedd; 10-22-2017 at 14:39.
wickedd is offline
A k c 3 n 7
Junior Member
Join Date: Oct 2014
Location: Romania
Old 10-22-2017 , 14:41   Re: task problem
Reply With Quote #7

i did without plugin init where is problem?
__________________

A k c 3 n 7 is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 10-22-2017 , 14:45   Re: task problem
Reply With Quote #8

Quote:
Originally Posted by A k c 3 n 7 View Post
i did without plugin init where is problem?
You just answered you own question.

Edit: Take a look at this
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.

Last edited by wickedd; 10-22-2017 at 15:16.
wickedd is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-22-2017 , 14:57   Re: task problem
Reply With Quote #9

bomb_planted() is a forward defined in csx.inc so you must include csx before the forward will even work.

If you did some debugging, you'd see that bomb_planted() was never getting called.
__________________
fysiks is offline
A k c 3 n 7
Junior Member
Join Date: Oct 2014
Location: Romania
Old 10-22-2017 , 15:26   Re: task problem
Reply With Quote #10

i tryed bomb_explode() logevent_roundend() but doesn't work nothing
__________________

A k c 3 n 7 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 14:39.


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