﻿
MISI API
build v0.4.1, 9 apr 2018 by DenLover


Documentation:

Before starting, I recommend that you read the LUA documentation
on the official website of its developers https://lua.org/manual/5.3/

Next you will need this knowledge
to start writing game scripts.
LUA language is simple. You will quickly learn to write your first
scripts, if you have not yet encountered scripting, and if you have already studied
MISI you will learn right after installing the library into the game.

MISI interfaces are created as a set of separate methods (functions)
through which you can "communicate" with the game and its resources.
LUA itself is also simple in terms of referring to its inter-
It implements classes of objects in LUA they are called tables.
What is particularly simple for this scripter language is its simplified
syntax, you do not need to think about what types of data to substitute
at the moment the program will do everything for you. Simply enough
create a variable and assign it a value. It's simple, easy and
convenient especially for fast writing


Recommendations:

* MISI is an experimental tool for managing game resources. MISI is not a replacement
  standard development tools (Compilers, Map editors) and in no way declares this.
  The priority of MISI is to add new features to the game and simplify the creation of game modes (writing scripts).
* It is not recommended to use the GetPedStruct(index) methods in a loop, but this is possible,
  it is better to get the structure of the player once the game starts, and then work with it than using the method in the loop.
  Try to follow this rule with other methods, get the value 1 time,
  where possible - this will improve the stability of your script, reduce the risk of relegation.
* It is not recommended to permanently write a value in the memory area in a loop, yes it is possible,
  But it can prevent the game from writing its value to the same memory area as a result of the game's crash.
  Try to rewrite the value less often in the memory area and take into account the fact that the game does not write its value to it (to avoid collisions).
* Do not rush to fix the script when relegating the game. Try to run the game again.
* Do not strictly follow all the rules of my scripts. Sometimes they too may contain errors - they missed something or added something extra.
  Try to correct mistakes yourself, learn from your own and others' examples.
  Examples of crypts are designed to show how it is possible to scrip, but are not a mandatory style for development.
* Departures can occur because of an incorrectly written script, namely the lack of checks for writing
  invalid values ​​in important memory addresses. For example, you write a "paging" in a variable where an "integer"
  as a result, the game takes off. Be careful when building a script.
* Departures can occur because of the contents of the wrong syntax in the script. For example, you missed the end or then or
  use invalid key words/values. Watch for the correctness of writing LUA syntax in scripts.
* Departures can occur due to a lack of memory RAM in your PC.
* Departures can occur because of incorrect parsing of the LUA script.
  Sometimes this happens without obvious reasons when starting the game, just restart the game again.


System methods:

GetGameHandle()
GetMISIBuild()
wait(time)
ReadProcessMemory(address, size)
WriteProcessMemory(address, value, size)
WriteInLog(text)
GetLogSize()
SetLogSize(size)
IsReadPointer(address, size)
IsWritePointer(address, size)


Input Methods:

IsGameKeyPress(keycode)
GetKeyState(keycode)
IsKeyPress(keycode)
IsKeyDown(keycode)
IsKeyUp(keycode)


Game methods:

GetNetwork()
GetGameFrame()
GetSCRName()
GetMMPName()
GetSTYName()
GetGMPName()
GetGXTName()
GetMaxPedDensity()
GetShowPedAndCarID()
GetShowObjID()
GetShowBlood()
GetSoundMessage()
GetPoliceSkip()
GetMedicSkip()
GetFiremanSkip()
GetRiotMode()
* GetPlayerName(playerid)
* GetPlayerFrags(playerid)
* GetPlayerKills(playerid)

SetSCRName(filename)
SetMMPName(filename)
SetSTYName(filename)
SetGMPName(filename)
SetMaxPedDensity(value)
SetShowPedAndCarID(state)
SetShowObjID(state)
SetShowBlood(state)
SetSoundMessage(soundid)
SetPoliceSkip(state)
SetMedicSkip(state)
SetFiremanSkip(state)
SetRiotMode(mode)

GetDistanceOfPoints(x1, y1, z1, x2, y2, z2)
IsArea(x, y, z, minx, miny, mixz, maxx, maxy, maxz)


Ped methods:

GetPedID(ped)
GetPedStruct(id)
GetPedPlayer(ped)
GetPedCar(ped)
GetPedPos(ped)
GetPedRangeOfPoint(ped, x, y, z)
GetPedHealth(ped)
GetPedAngle(ped)
GetPedMaxSpeed(ped)
GetPedSpeed(ped)
GetPedSkin(ped)
GetPedModel(ped)
GetPedWanted(ped)
GetPedOccupation(ped)
GetPedThreatSearch(ped)
GetPedThreatReaction(ped)
GetPedInvisible(ped)
GetPedTask(ped)
GetPedCurrentWeaponID(ped)
GetPedCurrentAmmo(ped)
GetPedCurrentCarDoorID(ped)
GetPedFromPoint(x, y, z, range)

SetPedID(ped, id)
SetPedPos(ped, x, y, z)
SetPedHealth(ped, value)
SetPedAngle(ped, angle)
SetPedMaxSpeed(ped, value)
SetPedSpeed(ped, value)
SetPedSkin(ped, skinid)
SetPedModel(ped, model)
SetPedWanted(ped, value)
SetPedOccupation(ped, value)
SetPedThreatSearch(ped, value)
SetPedThreatReaction(ped, value)
SetPedInvisible(ped, value)
SetPedTask(ped, value)
SetPedCurrentWeaponID(ped, id)
SetPedCurrentAmmo(ped, ammo)
SetPedCurrentCarDoorID(ped, doorid)

DeletePedSprite(ped)
* IsPedDefined(ped)

Player methods:

GetPlayerArmour(player)
GetPlayerGameCam(player)
GetPlayerViewCam(player)
GetPlayerAuxCam(player)
GetPlayerWeaponSlot(player)
GetPlayerMoney(player)

SetPlayerArmour(player)
SetPlayerGameCam(player, x, y, z)
SetPlayerViewCam(player, x, y, z)
SetPlayerAuxCam(player, x, y, z)
SetPlayerWeaponSlot(player, slot)
SetPlayerMoney(player, value)


Car methods:

GetCarID(car)
GetCarPos(car)
GetCarAngle(car)
GetCarDamage(car, value)
GetCarModel(car)
GetCarColor(car)
GetCarEngine(car) 
GetCarDoorLock(car) 
GetCarEmergySiren(car) 
GetCarHorn(car)
GetCarDirection(car)
GetCarSpeed(car)
GetCarFromPoint(x, y, z, range)

SetCarPos(car, x, y, z)
SetCarAngle(car, angle)
SetCarDamage(car, value)
SetCarModel(car, model)
SetCarColor(car, color)
SetCarEngine(car, state)
SetCarDoorLock(car, state) 
SetCarEmergySiren(car, state) 
SetCarHorn(car, state)
SetCarDirection(car, x, y)


* Object methods:

GetObjModel(obj)
GetObjPos(obj)
GetObjAngle(obj)

SetObjPos(obj, x, y, z)


* Light methods:

GetLightPos(light)
GetLightRange(light)
GetLightIntensity(light)
GetLightColor(light)
GetLightTime(light)

SetLightPos(light, x, y, z)
SetLightRange(light, range)
SetLightIntensity(light, intensity)
SetLightColor(light, red, green, blue)
SetLightTime(light, time_on, time_off, time_random)


* Sound methods:

GetSoundPos(sound)
GetSoundID(sound)

SetSoundPos(sound, x, y, z)
SetSoundID(sound, soundid)


* Arrow methods:

GetArrowPos(arrow)
GetArrowAngle(arrow)
GetArrowZoom(arrow)
GetArrowCurrentZoom(arrow)
GetArrowColor(arrow)
GetArrowIcon(arrow)

SetArrowPos(arrow, x, y, z)
SetArrowAngle(arrow, angle)
SetArrowZoom(arrow, zoom)
SetArrowCurrentZoom(arrow, zoom)
SetArrowColor(arrow, color)
SetArrowIcon(arrow, iconid)


** STAGEC methods:

CreatePed(x, y, z, rotation, skin, occupation)
CreatePedInCar(car, skin, occupation)
CreateCar(x, y, z, rotation, model, trailermodel, color, mode)
CreateObj(x, y, z, rotation, model, value, mode)
CreateLight(x, y, z, range, intensity, red, green, blue, time_on, time_off, time_random)
CreateSound(x, y, z, soundid, playmode)
CreateBlock(x, y, z)
CreateArrow(x, y, z, model, color)
CreateExplode(x, y, z, mode, face_type)
CreatePedGroup(ped_leader, maxmembers)
CreateTimer(timesec)

AddPedInGroup(ped, ped_leader)
AddTimerTime(timer, timesec)
GivePedWeapon(ped, weaponid, ammo)
KillPed(ped)
KillCarPassengers(car)

SetPedObjective(ped, obj, x, y, z, objective_type, mode)
SedPedGroupLeader(ped, ped_oldleader)
SetPedNoting(ped)
SetPedStayInCar(ped, state)
SetPedUseCarWeapon(ped, state)
SetPedStopDriving(ped)
SetPedExitBus(ped, state)
SetPedDriveCar(ped, car)
SetPedExitCar(ped)
SetPedRemoteControl(ped, car)
SetPedPatrolPoint(ped, x, y, z)
SetPedSkill(ped, skill_type, value)
SetPedGroupMinMembers(ped_leader, minmembers)
SetPedGroupType(ped_leader, group_type)
SetCarPutTrailer(car, trailer)
SetBlockType(block, field_type, slope_type)
SetBlockLID(block, flat_type, flip_type, light, rotation, tileid)
SetBlockSide(block, face_type, wall_type, bullet_type, flat_type, flip_type, rotation, tileid)
SetLowerArea(minx, miny, maxx, maxy)
SetPedPhoneState(ped, phone, cyclesring, mode)
SetZoneDensity(zone, car_density, car_good, car_bad, car_police, ped_density, ped_murgger, ped_thefter, ped_elvis, ped_gang, ped_police)
ShowDialog(dialogid, mode)
SetShadingLevel(value)
SetAmbientLevel(value, timeupdate)
SetTVDir(x, y)

RemovePedAllWeapons(ped)
RemovePedFromGroup(ped, ped_leader)
RemovePedFromCar(ped, x, y, z, rotation)
RemoveCar(car)
RemoveAllDialogs()

DeleteTimer(timer)
DeletePed(ped)
DeleteCar(car)
DeleteObj(obj)
DeleteForceObj(obj)
DeleteLight(light)
DeleteSound(sound)
DeleteBlock(block, mode)
DeleteArrow(arrow)

* Methods are not documented. Look for clues in the modules folder: obj.lua, light.lua, sound.lua, and so on.
** Experimental methods are not documented.
Use these methods neatly and only in 1 script.
If you have several scripts with the methods STAGEC.LUA.
Transfer all the functions to the main script - this will reduce the risk of using methods in an asymmetric manner.
Assynchronous (inconsistent) use of methods from STAGEC.LUA (this rule is only for STAGEC!):
Create_, Set_, Delete_ can lead to crash games!
When creating a new group using the CreatePedGroup method, gang members may lose protection from shots.
Perhaps this is because the structure of CHAR_DATA is overwritten, losing the link to the leader of the gang.
I also recommend making a delay after creating a new object.
See more STAGEC.LUA.


Description of methods:

GetGameHandle()

Arguments: There are no overload arguments.

Return: Returns the address of the memory offset of the current application.

* If you need to know the version of gta2.exe, use this method.
For the version of the game 11.44 will be 0x3F0000 and for version 9.6 0x400000
Patch version 10.3 also has a 0x400000 offset.


GetMISIBuild()

Arguments: There are no overload arguments.

Return Values: Returns a string with a full description of the current
build library: name, version, date, author.


wait(time)

Arguments: *1 overload.
Accepts the delay value in milliseconds.
This is the wrapped function of Sleep.

Return: Returns flow control after
specified time.

* This method is similar to gaming
delay method which creates a thread delay.
There is also an alternative to the LUA method of coroutine.yield.


ReadProcessMemory(address, size)

Arguments: *2 overloads. It takes the address of memory,
size in bytes.

Return: Returns 1 if the memory has been read successfully and
0 if the value could not be read.

* The method is useful for searching memory addresses for managing gaming
resources.


WriteProcessMemory(address, value, size)

Arguments: *3 overloads. It takes 3 values: memory address,
value, size of data in bytes.

Return: Returns 1 if the memory is successfully written and nil if the value could not be written.


WriteInLog(text)

Arguments: *1 overload. It takes a string to write to the MISI.log file.

Return: Returns 1 if the memory is successfully written and nil if the value could not be written.

* Adds text to the end of the log file. Sometimes the overwriting of the previous line occurs
this is due to the fact that several threads simultaneously access the same log file
(how to improve it can offer me in LS).


GetLogSize()

Arguments: There are no overloads.

Return: Returns the specified log size in bytes.
The range is from 10 MB to 1 GB. The default is 10 MB.


SetLogSize(size)

Arguments: *1 overload. Accepts the maximum value
the size of the log in bytes. The range of the log is from 10 MB to 1 GB.

Return: Returns 1 if the value was successfully written.

* Sets the maximum log size in bytes before
his new overwriting. The size should not exceed 1 GB.
It is important to remember that if several
scripts of different sizes will use the value
the last downloaded script is recommended
have 1 script with this method.


IsGameKeyPress(keycode)

Arguments: *1 overload. The method takes a virtual key
pressed (game) key. The range of working numbers is from 112 to 141.

Return: Returns 1 if the key is pressed and nil if not pressed.

* You can find the key number from the file gk_codes.inc
This file is located in the MISI folder if it was installed
component "Game key codes Text" (in the installer misi_setup.exe).


GetKeyState(keycode)

Arguments: *1 overload. The method takes a virtual key (VK)
pressed key. The working numbers range from 0 to 256.

Return: Returns the value of the state of the pressed key.
Each key from 0 to 255 stores its state in the
range: 0 - the key is off, 1 - the key is on,
while it is assigned an additional negative value
when you press the key. If the key is pressed, the method returns -128
(each new power-up) or -127 (at each shutdown) and
0 if the key is released.

* You can find the key number from the file vk_codes.inc
This file is located in the MISI folder if it was installed
component "Virtual key codes Text" (in the installer misi_setup.exe).
This method constantly works when the key is pressed.
To handle a one-time click, we recommend that you use
the following method is IsKeyDown.


IsKeyPress(keycode)

Arguments: *1 overload. The method takes a virtual key (VK)
pressed key. The working numbers range from 0 to 256.

Return: Returns 1 if the key is pressed and nil if not pressed.

* You can find the key number from the file vk_codes.inc
This file is located in the MISI folder if it was installed
component "Virtual key codes Text" (in the installer misi_setup.exe).
This method constantly works when the key is pressed.
To handle a one-time click, we recommend that you use
the next method is IsKeyDown.


IsKeyDown(keycode)

Arguments: *1 overload. The method takes a virtual key (VK)
the released key. The working numbers range from 0 to 256.

Return: Returns 1 if the key has been pressed once and nil
if not yet released.

* You can find the key number from the file vk_codes.inc
This file is located in the MISI folder if it was installed
component "Virtual key codes Text" (in the installer misi_setup.exe).
This method works when you press the button once. For processing
constant pressing it is recommended to use the IsKeyPressed method
or GetKeyState.


IsKeyUp(keycode)

Arguments: *1 overload. The method takes a virtual key (VK)
the released key. The working numbers range from 0 to 256.

Return: Returns 1 if the key has been released and nil if
is still clamped.

* You can find the key number from the file vk_codes.inc
This file is located in the MISI folder if it was installed
component "Virtual key codes Text" (in the installer misi_setup.exe).
This method works one time when the key is released.
To process a single press, it is recommended that you use the IsKeyDown method.


GetDistanceOfPoins(x1, y1, z1, x2, x2, z2)

Arguments: *6 overloads. The method takes the coordinates of the axes
two points A and B and calculates their distance.

Return: Returns the distance between two points.

* Useful to know if the object is far away from the specified
points.


IsArea(x, y, z, minx1, miny1, minz1, maxx2, maxx2, maxz2)

Arguments: *9 overloads. The method takes the coordinates
point A and aria (area) and calculates whether the point A
inside this aria.

Return: Returns 1 if points
is inside this area and 0 if outside.

* Useful to find out whether the point (object) is in the specified
arias (regions). For example, we have a city rien and we need to know
whether the player has entered into it or not.


GetNetwork()

Arguments: There are no overload arguments.

Returns: Returns a positive value if it is running
network mode of the game (multiplayer) and 0 if it is a single.


GetGameFrame()

Arguments: There are no overload arguments.

Return: Returns a positive value for each
updating the game screen and 0 while waiting for the update.

* Constantly executed. Can be used in the body of cycles
while to create an OnUpdateFrame event
This method is useful
to reduce the load on the system as it is called less often
than an empty while that improves overall performance
in addition, it is synchronous with the performance of all game cycles.
An alternative to this method is to use the wait method.


GetSCRName()

Arguments: There are no overloads.

Return: Returns the string of the loaded (started)
SCR file.

* This file is a basic game script, in it
contains the compiled data of the game location.
This is the game logic: the arrays are spawns, announced
objects, counters, cycles, conditions.


GetSTYName()

Arguments: There are no overloads.

Return: Returns the string of the loaded (started)
STY file.

* This file is a graph: sprites, textures,
fonts.


GetGMPName()

Arguments: There are no overloads.

Return: Returns the string of the loaded (started)
GMP file.

* This file is a location model of its static
objects.


GetMMPName()

Arguments: There are no overloads.

Return: Returns the string of the loaded (started)
MMP file.

* This file is a header file with a description
resources that are included in the multiplayer location.


SetSCRName(filename)

Arguments: *1 overload.

Returns: Sets the value for the upcoming download
SCR file.

* This file is a basic game script, in it
contains the compiled data of the game location.
This is the game logic: the arrays are spawns, announced
objects, counters, cycles, conditions.


SetSTYName(filename)

Arguments: *1 overload.

Returns: Sets the value for the upcoming download
STY file.

* This file is a graph: sprites, textures,
fonts.


SetGMPName(filename)

Arguments: *1 overload.

Returns: Sets the value for the upcoming download
GMP file.

* This file is a location model of its static
objects.


SetMMPName(filename)

Arguments: *1 overload.

Returns: Sets the value for the upcoming download
MMP file.

* This file is a header file with a description
resources that are included in the multiplayer location.


GetPedStruct(id)
Arguments: *1 overload. It accepts the ID from 1 to 65535.

Return: Returns a reference to the ped structure.
Through this link, you can read / write the player's parameters.
Further, this structure is useful for changing: health,
armor, money.

* To get the structure of the player (there may be 6 of them all) use the range from 1 to 6.


GetPedCar(ped)

Arguments: *1 overload. Accepts the structure of the ped.

Return: Returns the structure of the car in which
sitting ped. If ped is not in the auto, instead of the structure, it returns 0.


GetPedPos(ped)

Arguments: *1 overload. Accepts the structure of the ped.

Return: Returns 3 values ​​current coordinates
player x, y, z.

* Useful to create triggers of events near the player.


GetPedRangeOfPoint(ped, x, y, z)

Arguments: *4 overload. The method takes the ped's structure and coordinates
points, calculates the distance from it to the ped.

Return: Returns the distance between the point and the ped.

* Useful to know if the player is far away from the specified
points.


GetPedHealth(ped)

Arguments: *1 overload. Accepts the structure of the ped.

Return: Returns the ped's health value.

* When setting the value 0, almost all hearts except one a
death comes from the slightest fall.


GetPedAngle(ped)

Arguments: *1 overload. Accepts the structure of the ped.

Return: Returns the rotation angle of the player's sprite in degrees.

* The range of the angle is from 0 to 360 degrees.


GetPedMaxSpeed(ped)

Arguments: *1 overload. Accepts the structure of the ped.

Return: Returns the player's maximum run speed.
Speed ​​of movement: 0.8 step (pedestrian), 1.0 running (player),
12.0 very quickly (flash).

* The operating range is from 0 to 12.
If you set a larger value, the camera will not keep up
for the player.


GetPedSpeed(ped)

Arguments: *1 overload. Accepts the structure of the ped.

Return: Returns the player's maximum run speed.
Speed ​​of movement: 0.8 step (pedestrian), 1.0 running (player),
12.0 very quickly (flash).

* If the value is large, the camera will not be able to
for the player.


GetPedSkin(ped)

Arguments: *1 overload. Accepts the structure of the ped.

Return: Returns the current skin number from 0 to 30.


GetPedModel(ped)

Arguments: *1 overload. Accepts the structure of the ped.

Return: Returns the number of the current ped'a model.
Model type: 0 pedestrian, drivers (flat),
2 game characters (three-dimensional).


GetPedWanted(ped)

Arguments: *1 overload. Accepts the structure of the ped.

Return: Returns the level of the player's search. Value Range
from 0 to 6.

* Gets the current number of player stars.


GetPedOccupation(ped)

Arguments: *1 overload. Accepts the structure of the ped.

Return: Returns the player's occupation return value.
The range is from 0 to 51.

* The value is responsible for the behavior of the ped.
More information about this parameter can be found on the forum
http://gtamp.com/forum/viewtopic.php?t=700&p=9464#p9464


GetPedThreatSearch(ped)

Arguments: *1 overload. Accepts the structure of the ped.

Return: Returns the value of the ped reaction.

* The value is responsible for the behavior of the ped.
More information about this parameter can be found on the forum
http://gtamp.com/forum


GetPedThreatReaction(ped)

Arguments: *1 overload. Accepts the structure of the ped.

Return: Returns the value of the ped's response type.

* Sets behavior to ped.
More information about this parameter can be found on the forum
http://gtamp.com/forum


GetPedInvisible(ped)

Arguments: *1 overload. Accepts the structure of the ped.

Return: Returns the value of the player's visibility for the police.
The range is from 0 to 9999.


GetPedTask(ped)

Arguments: *1 overload. Accepts the structure of the ped.

Return: Returns the value of the current "task".
The range is from 0 to 10. 7 stands on the ground, 9 is dead.


GetPedCurrentWeaponID(ped)

Arguments: *1 overload. Accepts the structure of the ped.

Return: Returns the ID of the selected weapon ped'a.
The range of numbers is from 0 to 15. If returned 0 weapons are not in hand.


GetPedCurrentAmmo(ped)

Arguments: *1 overload. Accepts the structure of the ped.

Return: Returns the number of cartridges in the selected weapon.
ped'a.


GetPedCurrentCarDoorID(ped)

Arguments: *1 overload. Accepts the structure of the ped.

Return: Returns the current door number to which the ped should sit.
Default 0 driver's door, from 1 passenger door.


GetPedFromPoint(x, y, z, range)

Arguments: *4 overload. It takes the coordinates x, y, z and the radius in which it searches for a random ped.

Return: *1 value. Returns an array with the structure of the found peds.
If no ped'd is found, it returns an array with a value of 0


SetPedPos(ped, x, y, z)

Arguments: *4 overload. It takes the structure of the ped and coordinates of the position x, y, z.

Return: Returns 1 value was assigned successfully and nil if not.

* Useful to create triggers of events near the player.


SetPedHealth(ped, value)

Arguments: *2 overloads. It takes the structure of the ped and the amount of health.

Return: Returns 1 value was assigned successfully and nil if not.

* When setting the value 0, almost all hearts except one a
death comes from the slightest fall.


SetPedAngle(ped, value)

Arguments: *2 overloads. Accepts the structure of the ped and the angle of rotation of the sprite.
The range of the angle is from 0 to 360 degrees.

Return: Returns 1 value was assigned successfully and nil if not.


SetPedMaxSpeed ​​(ped, value)

Arguments: *2 overloads. Accepts the structure of the ped and the speed of movement.
Speed ​​of movement: 0.8 step (pedestrian), 1.0 running (player),
12.0 very quickly (flash).

Return: Returns 1 value was assigned successfully and nil if not.

* Sets a constant speed of movement.
If you set a larger value, the camera will not keep up
for the player.


SetPedSpeed(ped, value)

Arguments: *2 overloads. Accepts the structure of the ped and the speed of movement.
Speed ​​of movement: 0.8 step (pedestrian), 1.0 running (player),
12.0 very quickly (flash).

Return: Returns 1 value was assigned successfully and nil if not.

* Sets the time speed of movement.
If you set a large value, the camera will not keep up
for the player.


SetPedSkin(ped, skin)

Arguments: *2 overloads. Accepts the structure of the ped and the skin number.
The range of numbers is from 0 to 30.

Return: Returns 1 value was assigned successfully and nil if not.


SetPedModel(ped, model)

Arguments: *2 overloads. Accepts the structure of the ped.
Model type: 0 pedestrian, drivers (flat),
2 game characters (three-dimensional).

Return: Returns 1 value was assigned successfully and nil if not.


SetPedWanted(ped, value)

Arguments: *2 overloads. Accepts the structure of the ped and the level of tracing.
player police. The range of tracing is from 0 to 6.

Return: Returns 1 value was assigned successfully and nil if not.

* Sets the number of stars to the player. At 0 players
the police will not be looking for, and with 6 stars behind it there will be
hunt an army on tanks.


SetPedOccupation(ped, value)

Arguments: *2 overloads. Accepts the structure of the ped and the number of the occupation.
The range is from 0 to 51.

Return: Returns 1 value was assigned successfully and nil if not.

* The value is responsible for the behavior of the ped.
More information about this parameter can be found on the forum
http://gtamp.com/forum/viewtopic.php?t=700&p=9464#p9464


SetPedThreatSearch(ped, value)

Arguments: *2 overloads. It takes the structure of the ped and the meaning of the reaction.

Return: Returns 1 value was assigned successfully and nil if not.

* The value is responsible for the behavior of the ped.
More information about this parameter can be found on the forum
http://gtamp.com/forum


SetPedThreatReaction(ped, value)

Arguments: *2 overloads. It takes the structure of the ped and the type of reaction.

Return: Returns 1 value was assigned successfully and nil if not.

* Sets behavior to ped.
More information about this parameter can be found on the forum
http://gtamp.com/forum


SetPedInvisible (ped, value)

Arguments: *2 overloads. It takes the structure of the ped and the value of the visibility.
The range is from 0 to 9999.

Return: Returns 1 value was assigned successfully and nil if not.


SetPedTask(ped, value)

Arguments: *2 overloads. Accepts the structure of the ped and the task number.

Return: Returns 1 value was assigned successfully and nil if not.
The range is from 0 to 10.


SetPedCurrentWeaponID(ped, value)

Arguments: *2 overloads. Accepts the structure of the ped and ID of the weapon.
The range of numbers is from 0 to 15.

Return: Returns 1 value was assigned successfully and nil if not.


SetPedCurrentAmmo(ped, ammo)

Arguments: *2 overloads. Accepts the structure of the ped and the number of cartridges.
The available value range is from 0 to 65535.

Return: Returns 1 value was assigned successfully and nil if not.


SetPedCurrentCarDoorID(ped, doorid)

Arguments: *2 overloads. Accepts the structure of the ped and the door number.

Return: Returns 1 value was assigned successfully and nil if not.

* 0 driver's door, starting at 1 passenger's door.


DeletePedSprite(ped)

Arguments: *1 overload. Accepts the structure of the ped.

Return: Returns 1 value was assigned successfully and nil if not.

* Deletes the sprites ped (and starts the garbage collector?)


GetPlayerStruct(ped)
Arguments: *1 overload. Accepts the structure of the ped.

Return: Returns the player structure.
Further, this structure is useful for changing:
armor, camera position and so on.


GetPlayerArmour(player)

Arguments: *1 overload. Accepts the player's structure.

Return: Returns the amount of the player's reservation.
The range is from 0 to 65535.


GetPlayerGameCam(player)

Arguments: *1 overload. Accepts the player's structure.

Return: Returns 3 x, y, z positions of the player's game camera.
The range of coordinates is from 0 to 255.


GetPlayerViewCam(player)

Arguments: *1 overload. Accepts the player's structure.

Return: Returns 3 x, y, z positions for the camera view.
The range of coordinates is from 0 to 255.


GetPlayerAuxCam(player)

Arguments: *1 overload. Accepts the player's structure.

Return: Returns 3 x, y, z values ​​of the player's start position.
The range of coordinates is from 0 to 255.

* Player's starting point coordinates?


GetPlayerWeaponSlot(player)

Arguments: *1 overload. Accepts the player's structure.

Return: Returns the player's current slot of weapons.
Returns 0 if there is no weapon in the hands.


GetPlayerMoney(player)

Arguments: * 1 overload. Accepts the player's structure.

Return: Returns the player's current amount of money.


SetPlayerArmour(player, value)

Arguments: *2 overloads. Accepts the player's structure and the amount of armor.

Return: Returns 1 if the armor is successfully installed and nil if not.
The available value range is from 0 to 65535.


SetPlayerGameCam(player, x, y, z)

Arguments: *4 overload. Accepts the player's structure and
coordinates x, y, z positions for the game camera.
The range of coordinates is from 0 to 255.

Return: Returns 1 if the coordinates are set and nil if not.


SetPlayerViewCam(player, x, y, z)

Arguments: *4 overload. Accepts the player's structure and
x, y, z coordinates of the position of the camera view.
The range of coordinates is from 0 to 255.

Return: Returns 1 if the coordinates are set and nil if not.


SetPlayerAuxCam(player, x, y, z)

Arguments: *4 overload. Accepts the player's structure and
coordinates of the position x, y, z of the start of the player.
The range of coordinates is from 0 to 255.

Return: Returns 1 if the coordinates are set and nil if not.


SetPlayerWeaponSlot(player, slot)

Arguments: *2 overloads. Accepts the player's structure and slot number.

Return: 1 if the slot is successfully installed and nil if not.


SetPlayerMoney(player, value)

Arguments: * 2 overloads. Accepts the structure of the player and the amount of money.

Return: 1 if the slot is successfully installed and nil if not.


GetCarID(car)

Arguments: *1 overload. Accepts the structure of car.

Return: Returns 1 value of the ID car.
The range is from 1 to 65535.


GetCarPos(car)

Arguments: *1 overload. Accepts the structure of car.

Return: * 3 values. Returns the current x, y, z coordinates of the transport position.
The range of coordinates is from 0 to 255.


GetCarAngle(car)

Arguments: *1 overload. Accepts the structure of car.

Return: Returns the rotation angle of the transport sprite in degrees.

* The range of the angle is from 0 to 360 degrees.


GetCarDamage(car)

Arguments: *1 overload. Accepts the structure of car.

Return: Returns the degree of damage to the vehicle.
The range is from 0 to 127.

* This parameter is responsible for the state of the machine.
At 0 the transport is whole, and at 127 it explodes from the slightest
collision with visual damage (burning, mint)
no.


GetCarModel(car)

Arguments: *1 overload. Accepts the structure of car.

Return: Returns the transport model.
The range of values ​​is from 0 to 255 (total is declared in nyc.gci: 86).

* Corresponds to the model number from the nyc.gci configuration file


GetCarColor(car)

Arguments: *1 overload. Accepts the structure of car.

Return: Returns the color number of the transport.
The range is from 0 to 36.


GetCarEngine(car)

Arguments: *1 overload. Accepts the structure of car.

Return: Returns the status of the transport engine.
The range is from 0 to 255 (0 does not work, 1 is off, 3 is on).


GetCarDoorLock(car)

Arguments: *1 overload. Accepts the structure of car.

Return: Returns the status of the transport doors.
The range is from 0 to 255 (1 is closed, 3 is open).

* Even with a closed lock ped can be thrown out of the car.


GetCarEmergySiren(car)

Arguments: *1 overload. Accepts the structure of car.

Return: Returns the status of the transport siren.
The range is from 0 to 255 (2 is off, 4 is on).

* Works only with office machines (fire, ambulance, police, military police).


GetCarHorn(car)

Arguments: *1 overload. Accepts the structure of car.

Return: Returns the status of the transport beep.
The range is from 0 to 255 (0 beep is off, 248 beep is on).

* Includes a "hooter" in the transport.


GetCarDirection(car)

Arguments: *1 overload. Accepts the structure of car.

Return: *2 values. Returns the x, y coordinates of the traffic.
The range of coordinates is from 0.0 to 255.0.


GetCarSpeed(car)

Arguments: *1 overload. Accepts the structure of car.

Return: *1 value. Returns the speed of the vehicle.


GetCarFromPoint(x, y, z, range)

Arguments: *4 overload. It takes the coordinates x, y, z and the radius in which it searches for a random auto.

Return: *1 value. Returns an array with a series of cars found.
If no auto is found, then the array returns from partition 0


SetCarPos(car, x, y, z)

Arguments: *4 overload. It takes the car structure and coordinates of the position x, y, z of the transport position.
The range of coordinates is from 0 to 255.

Return: Returns 1 if the coordinates have been successfully changed and nil if not.
car.


SetCarAngle(car, value)

Arguments: *2 overloads. Accepts the car structure and the rotation angle value
sprite car. The range is from 0 to 360.

Return: Returns 1 value was assigned successfully and nil if not.

* Accepts the angle in degrees.


SetCarDamage(car, value)

Arguments: *2 overloads. Accepts the structure of the car and the degree of damage.
The range is from 0 to 127.

Return: Returns 1 value was assigned successfully and nil if not.

* This parameter is responsible for the state of the machine.
At 0 the transport is whole, and at 127 it explodes from the slightest
collision with visual damage (burning, mint)
can not see.


SetCarModel(car, model)

Arguments: *2 overloads. Accepts the car structure and model number.

Return: Returns 1 value was assigned successfully and nil if not.
The range of values ​​is from 0 to 255 (total is declared in nyc.gci: 86).

* Set the appropriate model settings from nyc.gci.
If you do not have the necessary parts / flags when changing the model on the machine
the game can fly out. Special transport such as: ambulance, fire, police, military police,
You can turn it into a simple one without turning the turret, while you can shoot from the turret.


SetCarColor(car, color)

Arguments: *2 overloads. Accepts the car structure and the color number.

Return: Returns 1 value was assigned successfully and nil if not.
The range is from 0 to 36.


SetCarEngine(car, state)

Arguments: *2 overloads. It takes the structure of the car and the status of the engine.

Return: Returns 1 value was assigned successfully and nil if not.
The range is from 0 to 255 (0 does not work, 1 is off, 3 is on).

* At a value of 0, the engine turns off and the car can not drive,
The sound of the engine and the siren (if it was turned on) also turns off.


SetCarDoorLock(car, state)

Arguments: *2 overloads. Accepts the structure of the car and the status of the doors.

Return: Returns 1 value was assigned successfully and nil if not.
The range is from 0 to 255 (1 is closed, 3 is open).

* Even with a closed lock ped can be thrown out of the car.


SetCarEmergySiren(car, state)

Arguments: *2 overloads. It takes the structure of the car and the status of the siren.

Return: Returns 1 value was assigned successfully and nil if not.
The range is from 0 to 255 (2 is off, 4 is on).

* Works only with office machines (fire, ambulance, police, military police).
Includes a siren in the transport.


SetCarHorn(car, state)

Arguments: *2 overloads. It takes the structure of the car and the status of the beep.

Return: Returns 1 value was assigned successfully and nil if not.
The range is from 0 to 255 (0 is off, 248 is on).

* Includes in the transport sound of a hooter.


SetCarDirection(car, x, y)

Arguments: *3 overloads. It takes the car structure and the coordinates x, y.

Return: Returns 1 value was assigned successfully and nil if not.
The range is from 0.0 to 255.0.

* Sets the speed of the car.
