Raised This Month: $ Target: $400
 0% 

how to get function from module, not plugin ??


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
maslyak
Junior Member
Join Date: Aug 2008
Old 08-19-2009 , 14:27   how to get function from module, not plugin ??
Reply With Quote #1

Hi, i am created th function

Code:
public SQL_ReadResult_assoc(Handle:query,  field[], {Float,_}:...)
{
	new status = callfunc_begin("SQL_ReadResult")
	log_amx("SQL_ReadResult returns %d", status)
	callfunc_push_int(getarg(0)) // hack, i don't know how to convert to int query :(
	param_convert(2)
	callfunc_push_str(field)
	if(numargs() == 3)
	{
		callfunc_push_float(float(getarg(2)))
	}
	else if(numargs() == 4)
	{
		static buildString[128];
		param_convert(3)
		
		new j = 0;
		while(getarg(2,j))
		{
			buildString[j] = getarg(2,j);
			j++;
		}
		buildString[j] = 0; // finish string
		
		callfunc_push_str(buildString)
		callfunc_push_int(getarg(3))
	}
	return callfunc_end()
}

but it can't find the function in callfunc_begin("SQL_ReadResult"). I know that there is not SQL_ReadResult in any plugin, its in a module
By the way i want to read results in SQL accosiated with names and think that only way is to write a C++ module. Is it right that in amxx you can't execute the module function with variable arguments ?
maslyak is offline
maslyak
Junior Member
Join Date: Aug 2008
Old 08-19-2009 , 16:33   Re: how to get function from module, not plugin ??
Reply With Quote #2

or why this doens't work ?
Code:
public SQL_ReadResult_assoc(Handle:query,  field[], {Float,_}:...)
{
	if(numargs() == 2)
		return SQL_ReadResult(query,  SQL_FieldNameToNum(query, field))
	else if(numargs() == 3)
	{
		return SQL_ReadResult(query, SQL_FieldNameToNum(query, field), getarg(2))
	}
	
	return SQL_ReadResult(query, SQL_FieldNameToNum(query, field), getarg(2), getarg(3))
}
the problem is in getarg()
maslyak 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 15:10.


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