[Include] [INC] Hard-code - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (
https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (
https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] [INC] Hard-code (
/showthread.php?tid=372029)
[INC] Hard-code -
Correlli - 25.08.2012
What is this?
This "code" was written for fun, it's hard to read the script if you're coding it with this style, so that's all what's "useful" for.
How to install?
You'll need to include
hcode.inc right after the
a_samp.inc:
Код:
#include "a_samp"
#include "hcode"
New definitions:
BEGIN as
{
END as
}
O as
(
C as
)
OB as
[
CB as
]
X as
;
CM as
,
ENUM as
enum
var as
new
con as
const
stat as
static
PUBLIC as
public
FORWARD as
forward
NATIVE as
native
STOCK as
stock
OP as
operator
CHAR as
char
SIZE as
sizeof
TAG as
tagof
GIVEBACK as
return
GBTRUE as
return true
GBFALSE as
return false
FOR as
for
WHILE as
while
IF as
if
ELSE as
else
ELSEIF as
else if
SWITCH as
switch
CASE as
case
OTHERWISE as
default
STOP as
break
GOON as
continue
DOIT as
do
GOTO as
goto
IS as
=
EQUAL as
==
NEQUAL as
!=
LESS as
<
MORE as
>
LESSIS as
<=
MOREIS as
>=
ADD as
+
TAKE as
-
ADDADD as
++
TAKETAKE as
--
ADDIS as
+=
TAKEIS as
-=
MULTI as
*
DIV as
/
AND as
&&
OR as
||
N as
!
Examples:
Example #1:
Hard code:
Код:
FORWARD HelloMsg O C X
PUBLIC HelloMsg O C GIVEBACK print O "Hello!" C X
PUBLIC OnGameModeInit O C
BEGIN
HelloMsg O C X
GIVEBACK true X
END
Normal code:
Код:
forward HelloMsg();
public HelloMsg() return print("Hello!");
public OnGameModeInit()
{
HelloMsg();
return true;
}
Example #2:
Hard code:
Код:
FOR O var a IS 0 X a LESS 5 X a ADDADD C
BEGIN
printf O "%i" CM a C X
IF O a EQUAL 2 C STOP X
END
Normal code:
Код:
for(new a = 0; a < 5; a++)
{
printf("%i", a);
if(a == 2) break;
}
Example #3:
Hard code:
Код:
var
a IS 0 X
IF O N a C print O "Hello there." C X
Normal code:
Код:
new
a = 0;
if(!a) print("Hello there.");
Example #4:
Hard code:
Код:
var
a IS 5 CM b IS 7 X
IF O a EQUAL 5 AND b EQUAL 6 C
print O "Variable \"a\" is equal to 5 AND variable \"b\" is equal to 6." C X
ELSE
print O "Variable \"a\" is NOT equal to 5 OR variable \"b\" is NOT equal to 6." C X
Normal code:
Код:
new
a = 5, b = 7;
if(a == 5 && b == 6)
print("Variable \"a\" is equal to 5 AND variable \"b\" is equal to 6.");
else
print("Variable \"a\" is NOT equal to 5 OR variable \"b\" is NOT equal to 6.");
Example #5:
Hard code:
Код:
var
string OB 24 CHAR CB IS "Hello" X // Packed string (6 cells).
printf O "%s, %i" CM string CM SIZE string C X
Normal code:
Код:
new
string[24 char] = "Hello"; // Packed string (6 cells).
printf("%s, %i", string, sizeof(string));
Download:
hcode.inc &
testcode.pwn -
http://www.solidfiles.com/d/9e79f46b79
Re: [INC] Hard-code -
jpeg - 25.08.2012
WoW! Very Nice!!!
Re: [INC] Hard-code -
Sniper Kitty - 25.08.2012
Why make coding harder? What's the point?
Re: [INC] Hard-code -
R4VER - 25.08.2012
good job mate but its a little bit useless (no offense )
but nice one

7/10
-
SDraw - 25.08.2012
It reminded me about Basic

But if you want hardcore coding, use PERL! xD That will be extreme!
Re: [INC] Hard-code -
shitbird - 25.08.2012
Rewrite the godfather using this include. I dare you.

Pretty cool include!
Re: [INC] Hard-code -
fiki574 - 25.08.2012
Quote:
Originally Posted by Sniper Kitty
Why make coding harder? What's the point?
|
If you manage to code like this, you can do anything - its good practice for your programming skills and brain functions!
Very nice!
Re: [INC] Hard-code -
JaKe Elite - 25.08.2012
Nice job.
I can use this to check my skills in scripting.
Re: [INC] Hard-code -
Calgon - 25.08.2012
Inspired by
https://sampforum.blast.hk/showthread.php?tid=171839?
Re: [INC] Hard-code -
Michael@Belgium - 26.08.2012
Quote:
Originally Posted by Sniper Kitty
Why make coding harder? What's the point?
|
Quote:
Originally Posted by fiki574_CRO
If you manage to code like this, you can do anything - its good practice for your programming skills and brain functions!
Very nice!
|
Seriously ?! I agree what Sniper Kitty says.
This include can be used for non-lazy persons; think more, think before you type/code if you use this include.