25.08.2012, 08:34
(
Последний раз редактировалось Correlli; 26.08.2012 в 16:57.
)
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:
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:
Normal code:
Example #2:
Hard code:
Normal code:
Example #3:
Hard code:
Normal code:
Example #4:
Hard code:
Normal code:
Example #5:
Hard code:
Normal code:
Download:
hcode.inc & testcode.pwn - http://www.solidfiles.com/d/9e79f46b79
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"
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
Код:
forward HelloMsg(); public HelloMsg() return print("Hello!"); public OnGameModeInit() { HelloMsg(); return true; }
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
Код:
for(new a = 0; a < 5; a++) { printf("%i", a); if(a == 2) break; }
Hard code:
Код:
var a IS 0 X IF O N a C print O "Hello there." C X
Код:
new a = 0; if(!a) print("Hello there.");
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
Код:
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.");
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
Код:
new string[24 char] = "Hello"; // Packed string (6 cells). printf("%s, %i", string, sizeof(string));
hcode.inc & testcode.pwn - http://www.solidfiles.com/d/9e79f46b79