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

New API and Syntax


Post New Thread Reply   
 
Thread Tools Display Modes
Visual77
Veteran Member
Join Date: Jan 2009
Old 05-18-2017 , 15:12   Re: New API and Syntax
Reply With Quote #881

Yes, quite right. I misplaced the brackets
Thanks!
Visual77 is offline
Visual77
Veteran Member
Join Date: Jan 2009
Old 05-20-2017 , 16:30   Re: New API and Syntax
Reply With Quote #882

Do you still kill timers with KillTimer when you want to stop them
outside the callback?

Code:
if (healTimer[client] != null)
{
	KillTimer(healTimer[client]);	
	healTimer[client] = null;
}
Or is that now

Code:
if (healTimer[client] != null)
{
	delete healTimer[client]; 	
}
Visual77 is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 05-20-2017 , 16:36   Re: New API and Syntax
Reply With Quote #883

Just
Code:
delete healTimer[client];
if you don't need the extra options KillTimer offers, you don't need to check for null first.
__________________
asherkin is offline
Visual77
Veteran Member
Join Date: Jan 2009
Old 05-20-2017 , 16:39   Re: New API and Syntax
Reply With Quote #884

Quote:
Originally Posted by asherkin View Post
Just
Code:
delete healTimer[client];
if you don't need the extra options KillTimer offers, you don't need to check for null first.
Splendid, thanks.
Visual77 is offline
nergal
Veteran Member
Join Date: Apr 2012
Old 05-26-2017 , 21:16   Re: New API and Syntax
Reply With Quote #885

random question, would a linker (combines smx bytecodes into one large smx) have any sort of practical use in terms of virtual machine controlled languages?
__________________
nergal is offline
Nerus
Senior Member
Join Date: Aug 2010
Location: Poland
Old 06-11-2017 , 08:46   Re: New API and Syntax
Reply With Quote #886

Hi guys,

Is there a way to initialize multi-array table which default values?

Example:

PHP Code:
int points[MAX_PLAYERS_CSS][MAX_PLAYERS_CSS] = { { 0, ... }, ... }; 
Regards, Nerus.

Last edited by Nerus; 06-11-2017 at 08:47.
Nerus is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 06-11-2017 , 09:57   Re: New API and Syntax
Reply With Quote #887

You need to fully specify (at least) the outermost dimension.
__________________
asherkin is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 06-11-2017 , 12:50   Re: New API and Syntax
Reply With Quote #888

Data is automatically initialized to zero anyway unless you use decl.
Fyren is offline
Nerus
Senior Member
Join Date: Aug 2010
Location: Poland
Old 06-12-2017 , 11:25   Re: New API and Syntax
Reply With Quote #889

Quote:
Originally Posted by asherkin View Post
You need to fully specify (at least) the outermost dimension.
Quote:
Originally Posted by Fyren View Post
Data is automatically initialized to zero anyway unless you use decl.
Thx for tips, last question: can I clean values "set to default (0)" without use "for loops" on the multi-table array?
Nerus is offline
Reply


Thread Tools
Display Modes

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 08:23.


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