******'s Code Generator
#1

I've got this generator (founded in useful functions):
http://y-less.pastebin.ca/1733121

But it doesn't work good.

I generated the function with these numbers:
Код:
592, 577, 511, 512, 593, 520, 553, 476, 519, 460, 513, 548, 425, 417, 487, 488, 497, 563, 447, 469, 537, 538, 449
Код:
stock bool:
	IsNonRampVehicle(val)
{
	static
		s_iValArray[] =
		{
			1073742081, 135268353, -107367609,  50331841,   262408,
			   98305
		};
	if (val > 593)
	{
		return true;
	}
	val -= 417;
	if (val < 0)
	{
		return true;
	}
	return !(s_iValArray[val >> 5] & (1 << (val & 0x1F)));
}
I added this function and this:
Код:
public OnRconCommand(cmd[])
{
	printf("%s: %d",cmd, Test(strval(cmd)));
	return 1;
}
(for test).

Код:
Console input: 592 //here ok
[21:49:26] 592: 0
Console input: 577
[21:49:29] 577: 0
Console input: 511
[21:49:32] 511: 0
Console input: 512
[21:49:34] 512: 0
Console input: 593
[21:49:35] 593: 0
Console input: 520
[21:49:37] 520: 0
Console input: 553
[21:49:39] 553: 0
Console input: 476
[21:49:41] 476: 0
Console input: 519
[21:49:44] 519: 0
Console input: 460
[21:49:47] 460: 0
Console input: 0
[21:49:51] 0: 1
Console input: 1
[21:49:52] 1: 1
Console input: 2
[21:49:53] 2: 1
Console input: 3
[21:49:54] 3: 1
Console input: 4
[21:49:54] 4: 1
Console input: 5
[21:49:55] 5: 1
Console input: 6
[21:49:56] 6: 1
Console input: 7
[21:49:56] 7: 1
Console input: 510 //there's no 510!
[21:49:57] 510: 0
Console input: 510 //again
[21:50:05] 510: 0
Console input: 511 //ok
[21:50:06] 511: 0
Why these returned numbers are inverted?
Why 510 returns ok?
Reply


Messages In This Thread
******'s Code Generator - by ziomal432 - 04.04.2010, 19:54
Re: ******'s Code Generator - by RSX - 04.04.2010, 21:14
Re: ******'s Code Generator - by ziomal432 - 04.04.2010, 21:45
Re: ******'s Code Generator - by RSX - 04.04.2010, 21:52

Forum Jump:


Users browsing this thread: 3 Guest(s)