******'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
#2

Why you use bitwise functions, seriusly? if something.. bitwise like gives errors consider going to something more simpler, cause DUDE, bitwise in something that can be done better with plugin thien? And most likely, this could be asked for ****** not others, or you will not get an answer - as you see.
Reply
#3

I don't use usually bit operators. I don't even understand the last line.
Reply
#4

Yep, I have clues what it does, but it's way too complex... and it can have false results, but in fact, c'mon, it's so optimised that only gamerx could use it, man, the array is even static, simply saying, you can generate this code, but you can't ask for help with it, unless some amx modx forum or maybe something like C++ forum. (Athought it's not really maching any)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)