CallRemoteFunction - incorrectly conveys the dynamic parameters
#1

CallRemoteFunction - incorrectly conveys the dynamic parameters

FS CODE:
Код:
#define core_Detected(%0,%1) \
	CallRemoteFunction("ProtectionDetected",%0,%1)
INCLUDE (MODE):
Код:
public	ProtectionDetected( playerid, cheatid, {Float,_}:... )	{
	
		printf( "arg = %d, ProtectionDetected( %d, %d, %d )", numargs( ), getarg( 0, 0 ), getarg( 1, 0 ), getarg( 2, 0 ) );
}
call:
Quote:

core_Detected( "ddd", playerid, MONEY_CHEAT, ( itmp[ 0 ] - ac_PData[ i ][ ac_Money ] ) ); // playerid = 0, MONEY_CHEAT = 0, ( itmp[ 0 ] - ac_PData[ i ][ ac_Money ] ) = random size(say, at the moment 198 )

result of the call:
Quote:

[17:41:25] arg = 3, ProtectionDetected( 0, 0, 8192 )

If called directly from mode (/include):
Код:
rCmd[""]->ptest( playerid, success )
{
		ProtectionDetected( playerid, 0, 100 );
		return true;
}
Result:
Quote:

[17:41:16] arg = 3, ProtectionDetected( 0, 0, 100 ) - OK!

It turns out that the function CallRemoteFunction - wryly conveys the dynamic parameters.
Reply
#2

It's not a bug at all it's your coding.

This won't work correctly

#define core_Detected(%0,%1) \
CallRemoteFunction("ProtectionDetected",%0,%1)

Now think about what this will look like

core_Detected( "ddd", playerid, MONEY_CHEAT, ( itmp[ 0 ] - ac_PData[ i ][ ac_Money ] ) );

CallRemoteFunction("ProtectionDetected","ddd", playerid) ;

Not a bug at all.
Reply
#3

If I understand you correctly, you are wrong.
% 0 = "ddd"
% 1 = everything else (playerid, MONEY_CHEAT, (itmp [0] - ac_PData [i] [ac_Money] ....)


But even if I do not use my macro, the effect will be the same:
Код:
core_Detected ("ddd", i, MONEY_CHEAT, (itmp [0] - ac_PData [i] [ac_Money]));
CallRemoteFunction ("ProtectionDetected", "ddd", i, MONEY_CHEAT, (itmp [0] - ac_PData [i] [ac_Money]));
LOG:
Quote:

[20:34:11] 0 0 299
[20:34:11] arg = 3, ProtectionDetected (0, 0, 8192)
[20:34:11] arg = 3, ProtectionDetected (0, 0, 8192)

Incidentally note:
[/code]#define core_Detected(%0,%1) \
printf("%d %d %d",%1), CallRemoteFunction("ProtectionDetected",%0,%1)[/code]

prints: 0 0 299
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)