Raised This Month: $ Target: $400
 0% 

Solved [ANY] create a function with "any data" parameter?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ekshon
Junior Member
Join Date: Nov 2020
Old 12-31-2021 , 11:43   [ANY] create a function with "any data" parameter?
Reply With Quote #1

Can we create functions with "any" parameter that might be int / float ?

Code:
stock void SetTopTimer( any value )
{
	//if <int> do nothing
	//if <float> convert to <int>

	PrintToServer( "%d", value );
}

stock void OnRoundStart()
{
	//I need both to work
	SetTopTimer( 5.0 );
	SetTopTimer( 5 );
}
UPD:
Ok, it works. lol, solved

Last edited by ekshon; 12-31-2021 at 12:17.
ekshon 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 03:39.


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