Finally got somthing working!
Press TAB and your wanted level is clear.
Ok, i found some sort of a tutorial, i will post it here, ile try to figure it out! [HEhe, ROckstar, i dont need your DLC we will have somthing cooler, and for FREE]
| GTA IV has many script functions called "Native API" or "natives".|
Alice lua script can call any of this functions from itself.
Everyone who knows something about assembler and function call
concept will understand all this native-sh1t what i wrote below
without any problems :
[!!! its recomended to look at examples and read this at one time]
----- General functions -----
To push integer/float parameter into the calling native func use
PushInt(Value) / PushFloat(Value)
To push script pointer use
PushVarPtr() -- no params, if native changes pushed value
-- u must use this function and after native
-- calling read the value of this variable
To get integer/float param from stack after native call use
Value = GetIntParam(ParamNumber) /
Value = GetFloatParam(ParamNumber)
To get the integer/float result of function (if exists) use
Val = GetIntResult() / Val = GetFloatResult()
At least, to call native function use
CallNative("NATIVE_FUNCTION_NAME") -- names are declared in
-- other files
(WARNING : You can't use functions which operate with models,
and now i don't know what is the reason of this .)
----- Other needed functions (not for natives) -----
Game must be started to use native functions, so we need a check:
bool IsPlayerPoolCreated() -- if player pool is ok then we can
-- use some native functions
bool IsKeyPressed(AnsiKeyNum) -- checking any ansi key state
Wait(Milliseconds) -- stops script for a needed time
PrintFloatToLog(Value) / PrintStrToLog("STRING") -- prints
-- to log
----- Call example -----
-- GET_PLAYER_CHAR(0, &Var)
-- declarations of functions u will see soon ,
-- and now look at additional files
PushInt(0) -- 0 param
PushVarPtr() -- 1 param (this is our &Var)
CallNative("GET_PLAYER_CHAR") -- making a call
PLAYER_CHAR = GetIntParam(1) -- reading the value
-- from 1 parameter
----- Player structure organization -----
int GET_PLAYER_ID() -- get player id , using only for getting
-- results of next functions
-- (always 0 in single player mode);
int CONVERT_INT_TO_PLAYERINDEX( GET_PLAYER_ID() ) -- get player
-- index from id , this is player definition variable
-- (in SA was $PLAYER_CHAR) (always 0 in single player mode);
GET_PLAYER_CHAR( CONVERT_INT_TO_PLAYERINDEX( GET_PLAYER_ID() ), &PlayerChar )
-- get player char from player index , this is "player as ped/actor"
-- definition variable (in SA was $PLAYER_ACTOR);
" I wasted 2 days to fill free with lua coding , it's not so hard as you thought ." - says the author.
Dont forget to say Thanks to these guys!
|4. About :|
Authors : Alexander /Alexander Blade / Alexander Koryakin ,
THX 2 : GooD, Listener, Seemann, Sacky, Lua developers ...
wait... GooD? i know this guy!
edit: i dont know how, but i have a pool cue now
Edited by -TRASE-, 23 December 2008 - 01:53 PM.