/*
 
Vice Multi-Player Functions

(c) Copyright 2005-2025, SA-MP Team & Saint Games

*/

// https://wiki.sa-mp.com/wiki/Useful_Functions

// https://raw.githubusercontent.com/Kaperstone/uf.inc/master/uf.inc

// https://sampwiki.blast.hk/wiki/Main_Page

// https://gtamods.com/wiki/List_of_opcodes

//------------------------------------------------------------------------------
// Include File Version "0.1.8.6"
//------------------------------------------------------------------------------

#if defined _vmp_included
	#endinput
#endif
#define _vmp_included

#pragma library vmp

//------------------------------------------------------------------------------

// Includes

#include <core>
#include <float>
#include <string>
#include <file>
#include <time>
#include <datagram>

//------------------------------------------------------------------------------

// Othes Includes

//------------------------------------------------------------------------------
// Defines
//------------------------------------------------------------------------------

// Misc

#define MAX_PLAYER_NAME							24

#define MAX_PLAYERS							100
#define MAX_ACTORS							100
#define MAX_VEHICLES							500		// Рекомендуется использовать 180
#define MAX_PICKUPS							300		// Рекомендуется использовать 300
#define MAX_OBJECTS							2000		// 
#define MAX_FIRES								40		// Рекомендуется использовать 40
#define MAX_SPHERES							100		// Рекомендуется использовать 32
#define MAX_CORONAS							32		//
#define MAX_PARTICLES							100		//
#define MAX_TEXT_DRAWS							(2048)	//
#define MAX_PLAYER_TEXT_DRAWS						(256)		//
#define MAX_2DTEXTS							(1024)	//
#define MAX_PLAYER_2DTEXTS						(1024)	//
#define MAX_3DTEXT_GLOBAL						(1024)
#define MAX_3DTEXT_PLAYER						(1024)

#define INVALID_PLAYER_ID						255
#define INVALID_ACTOR_ID						255
#define INVALID_VEHICLE_ID						(0xFFFF) // 65535 // RC 8-4 T1
#define INVALID_OBJECT_ID						(0xFFFF) // 65535 // RC 8-2
#define INVALID_FIRE_ID							255
#define INVALID_SPHERE_ID						255 		// RC 8-2
#define INVALID_CORONA_ID						255 		// RC 8-2
#define INVALID_PARTICLE_ID						255 		// RC 8-3 T2
#define INVALID_TEXT_DRAW						(0xFFFF)
#define INVALID_2DTEXT_ID						(0xFFFF) 	// RC 8-4
#define INVALID_PLAYER_2DTEXT_ID					(0xFFFF) 	// RC 8-4
#define INVALID_3DTEXT_ID						(0xFFFF)

#define NO_TEAM								255

// States
#define PLAYER_STATE_NONE						0
#define PLAYER_STATE_ONFOOT						1
#define PLAYER_STATE_DRIVER						2
#define PLAYER_STATE_PASSENGER					3
#define PLAYER_STATE_EXIT_VEHICLE				4 // (used internally)
#define PLAYER_STATE_ENTER_VEHICLE_DRIVER		5 // (used internally)
#define PLAYER_STATE_ENTER_VEHICLE_PASSENGER	6 // (used internally)
#define PLAYER_STATE_WASTED						7
#define PLAYER_STATE_SPAWNED					8
#define PLAYER_STATE_SPECTATING					9

//------------------------------------------------------------------------------

// Player Actions Ids // ActionID // for GetPlayerAction(playerid);

// or PedState

#define ACTION_NONE								0 // new from SA-MP
#define ACTION_NORMAL							1 // ON_FOOT
#define ACTION_ONFOOT							1

#define ACTION_WALK								6
//#define ACTION_WALK							7

#define ACTION_FIRST_PERSON_TARGET				12 // ACTION_SCOPE // New Saint Add

#define ACTION_SHOOTING							16 // ACTION_SHOT / ACTION_FIRE // New by Saint Add
#define ACTION_ATTACK_MELEE             		17 // Кулак когда стоит на месте, Отвёртка, Катана, Нож, Нож для Мяса, Мачете

#define ACTION_STOPUSECELLPHONE					19

#define ACTION_RUN_TO_VEHICLE					24 // Бежит к Транспорту

#define ACTION_USECELLPHONE             		36 //

#define ACTION_JUMP                     		41 // Прыжок

#define ACTION_IN_VEHICLE						50 // ACTION_DRIVING_VEHICLE / ACTION_INCAR

#define ACTION_DEATH							54 // Смерть
#define ACTION_WASTED							55 // Камера улетает в небо после смерти
#define ACTION_IM_JACKING_VEHICLE				56 // Кража Транспорта - Я выкидую Игрока из Авто
#define ACTION_ME_JACKING_VEHICLE				57 // Кража Транспорта - Меня выкидывают из Авто
#define ACTION_ENTER_VEHICLE					58 // Сажусь в Транспорт

#define ACTION_EXIT_VEHICLE						60 // Выхожу из Транспорта
#define ACTION_HANDS_UP							61 // New Saint Add
#define ACTION_BUSTED							62 // Арестован

/*
enum PedState
{
	PED_NONE,				// 0
	PED_IDLE,				// 1
	PED_LOOK_ENTITY,		// 2
	PED_LOOK_HEADING,		// 3
	PED_WANDER_RANGE,		// 4
	PED_WANDER_PATH,		// 5
	PED_SEEK_POS,			// 6
	PED_SEEK_ENTITY,		// 7
	PED_FLEE_POS,			// 8
	PED_FLEE_ENTITY,		// 9
	PED_PURSUE,				// 10
	PED_FOLLOW_PATH,		// 11
	PED_SNIPER_MODE,		// 12
	PED_ROCKET_MODE,		// 13
	PED_DUMMY,				// 14
	PED_PAUSE,				// 15
	PED_ATTACK,				// 16
	PED_FIGHT,				// 17
	PED_FACE_PHONE,			// 18
	PED_MAKE_CALL,			// 19
	PED_CHAT,				// 20
	PED_MUG,				// 21
	PED_AIM_GUN,			// 22
	PED_AI_CONTROL,			// 23
	PED_SEEK_CAR,			// 24
	PED_SEEK_IN_BOAT,		// 25
	PED_FOLLOW_ROUTE,		// 26
	PED_CPR,				// 27
	PED_SOLICIT,			// 28
	PED_BUY_ICECREAM,		// 29
	PED_INVESTIGATE,		// 30
	PED_STEP_AWAY,			// 31
	PED_ON_FIRE,			// 32
	PED_SUN_BATHE,			// 33
	PED_FLASH,				// 34
	PED_JOG,				// 35
	PED_ANSWER_MOBILE,		// 36

	PED_UNKNOWN,	// Same with IDLE, but also infects up to 5 peds with same pedType and WANDER_PATH, so they become stone too. HANG_OUT in Fire_Head's idb

	PED_STATES_NO_AI,		// 38

	PED_ABSEIL,				// 39
	PED_SIT,				// 40
	PED_JUMP,				// 41
	PED_FALL,				// 42
	PED_GETUP,				// 43
	PED_STAGGER,			// 44
	PED_DIVE_AWAY,			// 45

	PED_STATES_NO_ST,		// 46
	PED_ENTER_TRAIN,		// 47
	PED_EXIT_TRAIN,			// 48
	PED_ARREST_PLAYER,		// 49

	PED_DRIVING,			// 50
	PED_PASSENGER,			// 51
	PED_TAXI_PASSENGER,		// 52
	PED_OPEN_DOOR,			// 53
	PED_DIE,				// 54
	PED_DEAD,				// 55
	PED_CARJACK,			// 56
	PED_DRAG_FROM_CAR,		// 57
	PED_ENTER_CAR,			// 58
	PED_STEAL_CAR,			// 59
	PED_EXIT_CAR,			// 60
	PED_HANDS_UP,			// 61
	PED_ARRESTED,			// 62
	PED_DEPLOY_STINGER		// 63
};

*/

//------------------------------------------------------------------------------

// enum eWaitState // https://gtamods.com/wiki/0372

#define WAITSTATE_NONE							0
#define WAITSTATE_FALSE							0
#define WAITSTATE_TRAFFIC_LIGHTS					1
#define WAITSTATE_CROSS_ROAD						2
#define WAITSTATE_CROSS_ROAD_LOOK					3
#define WAITSTATE_LOOK_PED						4
#define WAITSTATE_LOOK_SHOP						5
#define WAITSTATE_LOOK_ACCIDENT					6
#define WAITSTATE_FACEOFF_GANG					7
#define WAITSTATE_DOUBLEBACK						8
#define WAITSTATE_HITWALL						9
#define WAITSTATE_TURN180						10
#define WAITSTATE_SURPRISE						11
#define WAITSTATE_STUCK							12
#define WAITSTATE_LOOK_ABOUT						13
#define WAITSTATE_PLAYANIM_DUCK					14
#define WAITSTATE_PLAYANIM_COWER					15
#define WAITSTATE_PLAYANIM_TAXI					16
#define WAITSTATE_PLAYANIM_HANDSUP					17
#define WAITSTATE_PLAYANIM_HANDSCOWER				18
#define WAITSTATE_PLAYANIM_CHAT					19
#define WAITSTATE_FINISH_FLEE						20
#define WAITSTATE_SIT_DOWN						21
#define WAITSTATE_SIT_DOWN_RVRS					22
#define WAITSTATE_SIT_UP						23
#define WAITSTATE_SIT_IDLE						24
#define WAITSTATE_USE_ATM						25
#define WAITSTATE_SUN_BATHE_PRE					26
#define WAITSTATE_SUN_BATHE_DOWN					27
#define WAITSTATE_SUN_BATHE_IDLE					28
#define WAITSTATE_RIOT							29
#define WAITSTATE_FAST_FALL						30
#define WAITSTATE_BOMBER						31
#define WAITSTATE_STRIPPER						32
#define WAITSTATE_GROUND_ATTACK					33
#define WAITSTATE_LANCESITTING					34
#define WAITSTATE_PLAYANIM_HANDSUP_SIMPLE				35

//------------------------------------------------------------------------------

// Vehicles
#define VEHICLE_TYPE_CAR						1
#define VEHICLE_TYPE_BIKE						2
#define VEHICLE_TYPE_HELI						3
#define VEHICLE_TYPE_BOAT						4
#define VEHICLE_TYPE_PLANE						5
#define VEHICLE_TYPE_RC							6 // new

// Weathers
#define WEATHER_SUNNY							0
#define WEATHER_CLOUDY							1
#define WEATHER_RAINING							2
#define WEATHER_FOGGY							3
#define WEATHER_EXTRASUNNY						4
#define WEATHER_STORM							5
#define WEATHER_INTERIOR						6

//------------------------------------------------------------------------------
/*
enum eAreaName
{
	AREA_MAIN_MAP,
	AREA_HOTEL,
	AREA_MANSION,
	AREA_BANK,
	AREA_MALL,
	AREA_STRIP_CLUB,
	AREA_LAWYERS,
	AREA_COFFEE_SHOP,
	AREA_CONCERT_HALL,
	AREA_STUDIO,
	AREA_RIFLE_RANGE,
	AREA_BIKER_BAR,
	AREA_POLICE_STATION,
	AREA_EVERYWHERE,
	AREA_DIRT,
	AREA_BLOOD,
	AREA_OVALRING,
	AREA_MALIBU_CLUB,
	AREA_PRINT_WORKS
};
*/
// Interiors
#define INTERIOR_OUTSIDE						0
#define INTERIOR_STREET							0 // RC 3
#define INTERIOR_HOTEL							1
#define INTERIOR_MANSION						2
#define INTERIOR_BANK							3
#define INTERIOR_MALL							4
#define INTERIOR_STRIPCLUB						5
#define INTERIOR_LAWYERS						6
#define INTERIOR_CAFEROBINA						7
#define INTERIOR_CONCERT						8
#define INTERIOR_STUDIO							9
#define INTERIOR_AMMUNATION						10
#define INTERIOR_APPARTMENT						11
#define INTERIOR_BIKERSBAR						11
#define INTERIOR_POLICEHQ						12
#define INTERIOR_UNKNOWN						12
#define INTERIOR_EVERYWHERE						13
#define INTERIOR_STADIUM1						14 // Dirt Bike
#define INTERIOR_STADIUM2						15
#define INTERIOR_STADIUM3						16 // Hotring
#define INTERIOR_CLUB							17
#define INTERIOR_PRINTWORKS						18

//------------------------------------------------------------------------------

// Weapons // WeaponType.h

// https://wiki.sa-mp.com/wiki/Weapons

// https://gtamods.com/wiki/SCM_language_III/VC_definitions#WEAPONTYPE

// https://gtamods.com/wiki/031D

#define WEAPON_UNARMED							0
#define WEAPON_BRASSKNUCKLE						1
#define WEAPON_SCREWDRIVER						2   // отвёртка
#define WEAPON_GOLFCLUB							3
#define WEAPON_NITESTICK						4
#define WEAPON_KNIFECUR							5
#define WEAPON_KNIFE							5
#define WEAPON_BASEBALL_BAT						6
#define WEAPON_BAT							6
#define WEAPON_HAMMER							7
#define WEAPON_CLEAVER							8
#define WEAPON_MACHETE							9
#define WEAPON_KATANA							10
#define WEAPON_CHAINSAW							11
#define WEAPON_GRENADE							12
#define WEAPON_TEARGAS							14
#define WEAPON_MOLOTOV							15
#define WEAPON_MOLTOV							15
#define WEAPON_MISSILE							16 // ракета (снаряд) от RPG
#define WEAPON_ROCKET							16
#define WEAPON_COLT45							17
#define WEAPON_PISTOL							17
#define WEAPON_PYTHON							18
#define WEAPON_CHROMEGUN						19
#define WEAPON_SHOTGSPA							20
#define WEAPON_BUDDYSHOT						21
#define WEAPON_TEC9							22
#define WEAPON_UZI							23
#define WEAPON_INGRAMSL							24
#define WEAPON_MP5LNG							25
#define WEAPON_MP5							25
#define WEAPON_M4								26
#define WEAPON_RUGER							27
#define WEAPON_SNIPER							28
#define WEAPON_LASER							29
#define WEAPON_ROCKETLA							30
#define WEAPON_ROCKETLAUNCHER						30
#define WEAPON_FLAME							31
#define WEAPON_FLAMETHROWER						31
#define WEAPON_M60							32
#define WEAPON_MINIGUN							33
#define WEAPON_BOMB							34 // Detonator
#define WEAPON_DETONATOR						34
#define WEAPON_HELICANNON						35 // (M60 без прицела)
#define WEAPON_CAMERA							36 // WEAPONTYPE_CAMERA // TakePhotograph(shooter);

#define WEAPON_PAD37							37 // TOTALWEAPONS
#define WEAPON_HEALTH							37

#define WEAPON_ARMOUR							38

#define WEAPON_COLLISION						39 // Vehicle ??? // задавил тачкой
#define WEAPON_RAMMEDBYCAR						39

#define WEAPON_HELIBLADES						40 // Heli-Blades
#define WEAPON_RUNOVERBYCAR						40

#define WEAPON_EXPLOSION						41 // Explosion

#define WEAPON_DRIVEBY							42 // Drive-By // WEAPON_VEHICLE (cидя на байке с оружия)
#define WEAPON_UZI_DRIVEBY						42

#define WEAPON_DROWN							43 // Drown
#define WEAPON_DROWNING							43

#define WEAPON_COLLISION_GROUND					44 // Ground collision from VCMP 0.3z R2
#define WEAPON_FALL							44 // 0x2C

#define WEAPON_UNIDENTIFIED						45
#define WEAPON_ANYMELEE							46
#define WEAPON_ANYWEAPON						47

#define ICON_CONNECT							200 // like in SAMP
#define ICON_DISCONNECT							201 // like in SAMP

// Weapon Type End

//==============================================================================
// Vice Multi-Player Keys States
//==============================================================================

// Player ONFOOT Keys // RC 8-4 update

#define ONFOOT_KEY_UP				(8192)  // fixed // KEY_ANALOG_UP   (KEY_FORWARD)
#define ONFOOT_KEY_DOWN				(4096)  // fixed // KEY_ANALOG_DOWN (KEY_BACKWARD)
#define ONFOOT_KEY_LEFT				(2048)  // fixed // KEY_ANALOG_LEFT
#define ONFOOT_KEY_RIGHT			(1024)  // fixed // KEY_ANALOG_RIGHT

#define ONFOOT_KEY_FIRE				(64)    // fixed

#define ONFOOT_KEY_WEAPON_NEXT		(1)     // fixed // E
#define ONFOOT_KEY_WEAPON_PREVIOUS		(4)     // fixed // Q

//#define ONFOOT_KEY_ZOOM_IN		      (-1)    // not detected
//#define ONFOOT_KEY_ZOOM_OUT		      (-1)    // not detected

#define ONFOOT_KEY_JUMP				(512)   // fixed

#define ONFOOT_KEY_ENTER+EXIT			(256)	  // RC 8-4

#define ONFOOT_KEY_SPRINT			(128)   // fixed

#define ONFOOT_KEY_TARGET			(2)     // fixed // прицел (RPG, M4, M60, Ruger, Sniper, ...)

#define ONFOOT_KEY_CROUCH			(32)    // fixed

//#define ONFOOT_KEY_ACTION			(-1)	  // not detected

//#define ONFOOT_KEY_LOOK_BEHIND		(-1)    // not detected

//#define ONFOOT_KEY_WALK			(-1)    // not detected

//------------------------------------------------------------------------------

// Player INCAR Keys // RC 8-4 update

#define INCAR_KEY_UP				(128)   // fixed // KEY_UP	// 128
#define INCAR_KEY_DOWN				(512)   // fixed // KEY_DOWN	// 512
#define INCAR_KEY_LEFT				(2048)  // fixed // KEY_LEFT  // 2048
#define INCAR_KEY_RIGHT				(1024)  // fixed // KEY_RIGHT // 1024

#define INCAR_KEY_FIRE				(64)    // fixed

#define INCAR_KEY_ENTER+EXIT			(256)	  // RC 8-4

#define INCAR_KEY_HORN				(32)	  // fixed

//#define INCAR_KEY_SUBMISSION		(-1)    // not detect

#define INCAR_KEY_HANDBRAKE			(2)     // fixed // ручной тормоз

#define INCAR_KEY_LEAN_UP			(16) 	  // fixed // Num9
#define INCAR_KEY_LEAN_DOWN			(8)     // fixed // Num6

#define INCAR_KEY_LOOK_LEFT			(4)     // fixed // Q
#define INCAR_KEY_LOOK_RIGHT			(1)     // fixed // E

#define INCAR_KEY_LOOK_BEHIND			(INCAR_KEY_LOOK_LEFT + INCAR_KEY_LOOK_RIGHT)     // fixed // посмотреть назад // Q + E or Num1 + Num2 (if incar) // 5

//==============================================================================
/*
// Keys defines (macros) like in SA-MP

// https://wiki.sa-mp.com/wiki/Keys

#define KEY_ACTION			(1)
#define KEY_CROUCH			(2) 	  // KEY_CROUCH	2	~k~~PED_DUCK~	~k~~VEHICLE_HORN~	C	H / CAPSLOCK
#define KEY_FIRE				(4)
#define KEY_SPRINT			(8)
#define KEY_SECONDARY_ATTACK		(16)
#define KEY_JUMP				(32)
#define KEY_LOOK_RIGHT			(64)
#define KEY_HANDBRAKE			(128)
#define KEY_LOOK_LEFT			(256)
#define KEY_SUBMISSION			(512)
#define KEY_LOOK_BEHIND			(512)
#define KEY_WALK				(1024)

#define KEY_ANALOG_UP			(2048)  // NUM8 in OnFoot Only detected when "JOYPAD" configuration is selected for controller.
#define KEY_ANALOG_DOWN			(4096)  // NUM2 in OnFoot Only detected when "JOYPAD" configuration is selected for controller.
#define KEY_ANALOG_LEFT			(8192)  // NUM4
#define KEY_ANALOG_RIGHT		(16384) // NUM6

#define KEY_YES				(65536)  // Y
#define KEY_NO				(131072) // N
#define KEY_CTRL_BACK			(262144)	   // H

#define KEY_UP				(-128)   // стрелочки
#define KEY_DOWN				(128)
#define KEY_LEFT				(-128)
#define KEY_RIGHT				(128)
*/
//==============================================================================



//==============================================================================
// Forwards (Callback declarations)
//==============================================================================

forward OnIncomingConnection(playerid, ip_address[], port);			// added in RC 2-8-8

forward OnFilterScriptInit(); 							// added // fixed
forward OnFilterScriptExit(); 							// added // fixed

forward OnGameModeInit(); 								// added // fixed
forward OnGameModeExit(); 								// added // fixed

forward OnPlayerConnect(playerid); 							// added // fixed
forward OnPlayerDisconnect(playerid, reason); 					// added // fixed

forward OnPlayerRequestClass(playerid, classid); 				// added // fixed // fix update in RC 2-8-8
forward OnPlayerRequestSpawn(playerid); 						// added // fixed

forward OnPlayerSpawn(playerid); 							// added // fixed // fix update in RC 2-8-8
forward OnPlayerDeath(playerid, killerid, reason); 				// added // fixed // fix update in RC 2-5 (fixed all reason's)

forward OnPlayerStateChange(playerid, newstate, oldstate);			// added // fixed

forward OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid); // added // fixed

forward OnPlayerMoneyChange(playerid, newmoney, oldmoney);			// RC 8-5

forward OnPlayerKeyPress(playerid, key);						// RC 8-5 // 

forward OnPlayerKeyStateChange(playerid, newkeys, oldkeys);			// added // fixed

forward OnPlayerEnterVehicle(playerid, vehicleid, ispassenger); 		// added // fixed
forward OnPlayerExitVehicle(playerid, vehicleid); 				// added // fixed

//forward OnPlayerInfoChange(playerid); // from SA-MP 0.1b
forward OnPlayerUpdate(playerid);							// added // fixed

forward OnPlayerText(playerid, text[]); 						// added // fixed // fix update in RC 2-8-7
forward OnPlayerCommandText(playerid, cmdtext[]); 				// added // fixed

forward OnPlayerInputDialogText(playerid, text[]); // RC 8-5 T2

forward OnRconLoginAttempt(ip[], password[], success);			// added // fixed // fix update in RC 2-8-5 // fix update in RC 2-8-7
forward OnRconCommand(cmdtext[]); 							// added // fixed

forward OnPlayerPickUpPickup(playerid, pickupid); 				// added // fixed

forward OnObjectMoved(objectid);							// added in 0.1 beta RC 2-4 // TEST
forward OnObjectDamaged(objectid, sendler_playerid);				// RC 8 T6
forward OnObjectChangePos(objectid, sendler_playerid, Float:new_x, Float:new_y, Float:new_z); // RC 8-3 T3

forward OnFireExtinguished(fireid, sendler_playerid);				// RC 8 T4

forward OnVehicleSpawn(vehicleid);							// added + fixed in 0.1 beta RC 2-8
forward OnVehicleDeath(vehicleid, killerid);					// added + fixed in 0.1 beta RC 2-8
forward OnVehicleDamageStatusUpdate(vehicleid, playerid);			// added in 0.1 beta RC 2-8-7 // test

forward OnVehicleRespray(playerid, vehicleid, color1, color2);		// added in 0.1 beta RC 2-9 T4 // from SA-MP 0.2x

forward OnPlayerEnterCheckpoint(playerid);					// added + fixed in 0.1 beta RC 2-7
forward OnPlayerLeaveCheckpoint(playerid);					// added + fixed in 0.1 beta RC 2-7

forward OnPlayerEnterRaceCheckpoint(playerid);					// added in 0.1 beta RC 3
forward OnPlayerLeaveRaceCheckpoint(playerid);					// added in 0.1 beta RC 3

forward OnPlayerEnterSphere(playerid, sphereid);				// RC 8-2 // RC 8-3 T8 fix
forward OnPlayerLeaveSphere(playerid, sphereid);				// RC 8-2 // RC 8-3 T8 fix

forward OnPlayerEnterCorona(playerid, coronaid);				// added in 0.1.8.6
forward OnPlayerLeaveCorona(playerid, coronaid);				// added in 0.1.8.6

forward OnPlayerGiveDamageActor(playerid, damaged_actorid, Float:amount, weaponid, bodypart); // RC 8-2

forward OnActorDeath(actorid, killerid, reason, bodypart);			// RC 7 // OnPlayerKillActor

//------------------------------------------------------------------------------

// Stream Forwards (Callback declarations) // 0.1.8.5

forward OnPlayerStreamIn(playerid, forplayerid);
forward OnPlayerStreamOut(playerid, forplayerid);

forward OnActorStreamIn(actorid, forplayerid);
forward OnActorStreamOut(actorid, forplayerid);

forward OnVehicleStreamIn(vehicleid, forplayerid);
forward OnVehicleStreamOut(vehicleid, forplayerid);

forward OnObjectStreamIn(objectid, forplayerid);
forward OnObjectStreamOut(objectid, forplayerid);

forward OnPickupStreamIn(pickupid, forplayerid);
forward OnPickupStreamOut(pickupid, forplayerid);

forward On3DTextLabelStreamIn(textid, forplayerid);
forward On3DTextLabelStreamOut(textid, forplayerid);

forward On3DTextDrawStreamIn(textid, forplayerid);
forward On3DTextDrawStreamOut(textid, forplayerid);

forward OnFireStreamIn(fireid, forplayerid);
forward OnFireStreamOut(fireid, forplayerid);

forward OnSphereStreamIn(sphereid, forplayerid);
forward OnSphereStreamOut(sphereid, forplayerid);

//==============================================================================
// Natives
//==============================================================================

// Util Functions

native print(const string[]);									// fixed
native printf(const format[], {Float,_}:...);						// fixed
native format(output[], len, const format[], {Float,_}:...);			// fixed

native SendClientMessage(playerid, color, const format[]);				// fixed
native SendClientMessageToAll(color, const format[]);					// fixed

native SendPlayerMessageToPlayer(playerid, senderid, const message[]);		// added in 0.1 beta RC 2-8-7 // TEST // http://wiki.sa-mp.com/wiki/SendPlayerMessageToPlayer
native SendPlayerMessageToAll(senderid, const message[]);				// added in 0.1 beta RC 2-8-7 // TEST // http://wiki.sa-mp.com/wiki/SendPlayerMessageToAll

native SendDeathMessage(killer, killee, weapon);					// added in 0.1 beta RC 2-8 // RC 3 Update
native SendDeathMessageToPlayer(playerid, killer, killee, weapon);		// added in 0.1 bera RC 3

native GameTextForPlayer(playerid, const string[], time, style);			// added in 0.1 beta RC 2-8-7 // TEST // http://wiki.sa-mp.com/wiki/GameTextForPlayer
native GameTextForAll(const string[], time, style);					// added in 0.1 beta RC 2-8-7 // TEST // http://wiki.sa-mp.com/wiki/GameTextForAll

native SetTimer(funcname[], interval, repeating);				            // fixed
native SetTimerEx(funcname[], interval, repeating, const format[], {Float,_}:...);	// fixed
native KillTimer(timerid); 								    		// fixed

native GetTickCount(); // RC 2-4

native GetMaxPlayers(); // RC 2-4

native CallRemoteFunction(const function[], const format[], {Float,_}:...);	// RC 3
native CallLocalFunction(const function[], const format[], {Float,_}:...);	// RC 3

native Float:VectorSize(Float:x, Float:y, Float:z); // RC 8-3 T5

native Float:asin(Float:value);							    // fixed
native Float:acos(Float:value);							    // fixed
native Float:atan(Float:value); 							    // fixed
native Float:atan2(Float:x, Float:y); 						    // fixed

native GetPlayerPoolSize(); // RC 7
native GetActorPoolSize(); // RC 8 T2
native GetVehiclePoolSize(); // RC 7
native GetObjectPoolSize(); // RC 8 T1
native GetPickupPoolSize(); // RC 8-4 T6
native GetFirePoolSize(); // RC 8 T2
native GetSpherePoolSize(); // RC 8-4 T6
native GetCoronaPoolSize(); // RC 8-4 T6
native GetParticlePoolSize(); // RC 8-4 T6

// Util Functions End

//==============================================================================

// Per-player variable system (PVars) // RC 8-3-2 // добавили в версии с 0.3a R4 по 0.3a R8

native SetPVarInt(playerid, varname[], int_value);
native GetPVarInt(playerid, varname[]);
native SetPVarString(playerid, varname[], string_value[]);
native GetPVarString(playerid, varname[], string_return[], len);
native SetPVarFloat(playerid, varname[], Float:float_value);
native Float:GetPVarFloat(playerid, varname[]);
native DeletePVar(playerid, varname[]);

// PVar enumeration
#define PLAYER_VARTYPE_NONE			0
#define PLAYER_VARTYPE_INT			1
#define PLAYER_VARTYPE_STRING		2
#define PLAYER_VARTYPE_FLOAT		3

native GetPVarsUpperIndex(playerid);
native GetPVarNameAtIndex(playerid, index, ret_varname[], ret_len);
native GetPVarType(playerid, varname[]);

//==============================================================================

// Admin Functions

native IsPlayerAdmin(playerid);

native Kick(playerid);
native Ban(playerid);
native BanEx(playerid, const reason[]);
native BanIP(const ip[]);

native SendRconCommand(command[]);

// Deprecated:
// Устаревшее:
native GetServerVarAsString(const varname[], buffer[], len);	// RC 2-8-5 // http://wiki.sa-mp.com/wiki/GetServerVarAsString
native GetServerVarAsInt(const varname[]);				// RC 2-8-5 // http://wiki.sa-mp.com/wiki/GetServerVarAsInt
native GetServerVarAsBool(const varname[]);				// RC 2-8-5 // http://wiki.sa-mp.com/wiki/GetServerVarAsBool

// These are the same 3 functions as above although they avoid the name ambiguity/conflict with the SVar system.
// Это те же 3 функции, что и выше, хотя они позволяют избежать двусмысленности / конфликта имен с системой SVar.
native GetConsoleVarAsString(const varname[], buffer[], len);	// RC 8-3 T5 // http://wiki.sa-mp.com/wiki/GetConsoleVarAsString
native GetConsoleVarAsInt(const varname[]);				// RC 8-3 T5 // http://wiki.sa-mp.com/wiki/GetConsoleVarAsInt
native GetConsoleVarAsBool(const varname[]);				// RC 8-3 T5 // http://wiki.sa-mp.com/wiki/GetConsoleVarAsBool

// Admin Functions End

//==============================================================================

// Memory Functions // RC 8-4 // Only for Original Game ( not for reVC clients )

#define ASM_NOP 0x90

native UseMemoryMessages(bool);
native UseMemoryMessagesForPlayer(playerid, bool); // RC 8-5

native SetClientInstallPatchBYTE( playerid, adress, byte_data );			// 1 byte // char
native SetClientInstallPatchWORD( playerid, adress, word_data );			// 2 byte // short
native SetClientInstallPatchDWORD( playerid, adress, dword_data );			// 4 byte // int
native SetClientInstallPatchFLOAT( playerid, adress, Float:float_data );	// 4 byte // float

native SetClientNoOperation( playerid, adress, NopBytes );

native SetClientMemSet( playerid, adress, int_value, int_size );

native SetClientInstallPointerFLOAT( playerid, adress, Float:data ); // RC 8-5

// Memory Functions End

//==============================================================================

// Game Functions

//------------------------------------------------------------------------------

native GameModeExit();

native SetGameModeText(const string[]);

native SetTeamCount(teams);

//------------------------------------------------------------------------------

// Marker modes used by ShowPlayerMarkers()

#define PLAYER_MARKERS_MODE_OFF			(0)
#define PLAYER_MARKERS_MODE_GLOBAL		(1)
#define PLAYER_MARKERS_MODE_STREAMED	(2)

native ShowPlayerMarkers(mode); // RC 8 T1 Update // RC 8 T11
native LimitPlayerMarkerRadius(Float:marker_radius); // RC 8 T1 // RC 8 T11

native ShowVehicleMarkers(bool);		// RC 7

//------------------------------------------------------------------------------

native ToggleFriendlyFire(toggle);		// RC 2-9 T3 // аналог функции "SetPlayerFriendlyFire" from VC-MP 0.3z_r2 

native ToggleDeathDropWeapons(toggle);	// RC 2-9-2 T4

//------------------------------------------------------------------------------

#define CRITICAL_HITS_DISABLE 0 // (default)
#define CRITICAL_HITS_ENABLE 1
#define CRITICAL_HITS_HEADSHOTS_ONLY 2

native TogglePlayersCriticalHits( toggle );	// RC 8-4 T3

//------------------------------------------------------------------------------
	
native GetGravity();
native SetGravity( Float:gravity );

native GetWaterLevel();
native SetWaterLevel( Float:waterlevel );

native GetMaxHeliHeightLevel();
native SetMaxHeliHeightLevel( Float:level );

//------------------------------------------------------------------------------

native SetWorldTime( hour, minute );

//------------------------------------------------------------------------------

// https://gtamods.com/wiki/01B6

// https://sampwiki.blast.hk/wiki/SetWeather

// https://open.mp/docs/scripting/functions/SetWeather

native SetWeather( weatherid );

//------------------------------------------------------------------------------

// https://sampwiki.blast.hk/wiki/GetWeaponName

// https://open.mp/docs/scripting/functions/GetWeaponName

native GetWeaponName( weaponid, const weapon[], len ); // added in 0.1 beta RC 2-8

//------------------------------------------------------------------------------

native EnableZoneNames( enable ); // RC 8-3 T5 // https://wiki.sa-mp.com/wiki/EnableZoneNames
native EnableVehicleNames( enable ); // RC 8-3 T5

native EnableUsingRCVehicles( bool ); // RC 8-4 T4 // enable automatic teleport in rc vehicles when players press enter key

native Taxiboostjump( bool ); // from VC-MP 0.3z_r2 // 0x0572 // https://gtamods.com/wiki/0572 // RC 8-4 T17

//------------------------------------------------------------------------------

native AddPlayerClass(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo); // added + fixed
native AddPlayerClassEx(teamid, modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo); // added + fixed

//------------------------------------------------------------------------------

native AddStaticVehicle(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2); // fixed in 0.1 beta RC 2-8
native AddStaticVehicleEx(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2, respawn_delay); // fixed in 0.1 beta RC 2-8

//==============================================================================

native CreateExplosion(type, Float:X, Float:Y, Float:Z); // 0x020C // https://gtamods.com/wiki/020C // added + fixed in 0.1 beta RC 2-3
native CreateExplosionForPlayer(playerid, Float:X, Float:Y, Float:Z, type);	// added in 0.1 beta RC 2-8-8 (T3)

//==============================================================================
/*
	POBJECT_PAVEMENT_STEAM = 0,
	POBJECT_PAVEMENT_STEAM_SLOWMOTION,
	POBJECT_WALL_STEAM,
	POBJECT_WALL_STEAM_SLOWMOTION,
	POBJECT_DARK_SMOKE,
	POBJECT_FIRE_HYDRANT,
	POBJECT_CAR_WATER_SPLASH,
	POBJECT_PED_WATER_SPLASH,
	POBJECT_SPLASHES_AROUND,
	POBJECT_SMALL_FIRE,
	POBJECT_BIG_FIRE,
	POBJECT_DRY_ICE,
	POBJECT_DRY_ICE_SLOWMOTION,
	POBJECT_WATER_FOUNTAIN_VERT,
	POBJECT_WATER_FOUNTAIN_HORIZ,
	POBJECT_FIRE_TRAIL,
	POBJECT_SMOKE_TRAIL,
	POBJECT_FIREBALL_AND_SMOKE,
	POBJECT_ROCKET_TRAIL,
	POBJECT_EXPLOSION_ONCE,
	POBJECT_CATALINAS_GUNFLASH,
	POBJECT_CATALINAS_SHOTGUNFLASH,

*/
native AddParticleObject(type, Float:PosX, Float:PosY, Float:PosZ, Float:speedX, Float:speedY, Float:speedZ, Float:Size, R = 0, G = 0, B = 0, Time = 0); // 039D // RC 8 T1
native AddParticleObjectForPlayer(playerid, type, Float:PosX, Float:PosY, Float:PosZ, Float:speedX, Float:speedY, Float:speedZ, Float:Size, R = 0, G = 0, B = 0, Time = 0); // 039D // RC 8 T1

//==============================================================================

native CreateParticle(type, Float:PosX, Float:PosY, Float:PosZ, Float:offsetX, Float:offsetY, Float:offsetZ, Float:size); // 0437 // RC 8-3 T2
native IsValidParticle(particleid); // RC 8-3 T2
native DestroyParticle(particleid); // RC 8-3 T2

//==============================================================================

native CreateFire(Float:X, Float:Y, Float:Z); // https://gtamods.com/wiki/02CF // RC 8 T2
native IsValidFire(fireid); // RC 8 T2
native DestroyFire(fireid); // RC 8 T2

//==============================================================================

// Sphere's Global (for All)

#define SPHERE_MAP_MARKER_DISABLE	0
#define SPHERE_MAP_MARKER_GLOBAL	1
#define SPHERE_MAP_MARKER_LOCAL	2

native CreateSphere( Float:PosX, Float:PosY, Float:PosZ, Float:size, marker = SPHERE_MAP_MARKER_DISABLE, r = 252, g = 138, b = 242, virtualworld = 0 ); // https://gtamods.com/wiki/03BC // RC 8-2 T3 // RC 8-3 T8 update
native IsValidSphere( sphereid ); // RC 8-2 T3
native DestroySphere( sphereid ); // https://gtamods.com/wiki/03BD // RC 8-2 T3

native IsPlayerInSphere( playerid, sphereid ); // RC 8-2 T4

native GetSphereVirtualWorld( sphereid ); // 0.1.8.6
native SetSphereVirtualWorld( sphereid, worldid ); // 0.1.8.6

//------------------------------------------------------------------------------

// Sphere's for Player

native CreateSphereForPlayer(playerid, Float:PosX, Float:PosY, Float:PosZ, Float:size, marker = SPHERE_MAP_MARKER_DISABLE, r = 252, g = 138, b = 242); // RC 8-2 T3 // RC 8-3 T8 update
native IsValidPlayerSphere(playerid, sphereid); // RC 8-2 T4
native DestroySphereForPlayer(playerid, sphereid); // RC 8-2 T3

native IsPlayerInPlayerSphere(playerid, sphereid); // RC 8-2 T4 // RC 8-3 T8 update // need test

//==============================================================================

// opcodes 024F or 04D5

native CreateCorona(Float:PosX, Float:PosY, Float:PosZ, Float:size, type, lensflare, r = 255, g = 255, b = 255); // RC 8-2 T3
native IsValidCorona(coronaid); // RC 8-2 T3
native DestroyCorona(coronaid); // RC 8-2 T3

//==============================================================================

// Building

native ToggleModelRenderForPlayer( playerid, Float:fX, Float:fY, Float:fZ, Float:fRadius, iModelID, iToggle ); // RC 8-2 T9 // https://gtamods.com/wiki/0363

native ReplaceBuildingModelForPlayer( playerid, Float:fX, Float:fY, Float:fZ, Float:fRadius, iFromModelID, iToModelID ); // RC 8-2 T7-5 // https://gtamods.com/wiki/03B6

//native RemoveBuildingForPlayer( playerid, modelid, Float:fX, Float:fY, Float:fZ, Float:fRadius ); // 0.1.8.6

// Building End

//==============================================================================

// Object Functions (a_objects.inc)

native CreateObject(modelid, Float:X, Float:Y, Float:Z, Float:rX, Float:rY, Float:rZ, virtualworld = 0, streaming = 1); // 0.1.8.6 update
native IsValidObject(objectid); 											// RC 2-4
native DestroyObject(objectid); 											// RC 2-4

native SetObjectData(objectid, Float:B, Float:C, Float:D, Float:E, Float:F, Float:G, Float:H, I, J, K); // RC 8-3 T1 // set object.dat config

native GetObjectModel(objectid); 											// RC 8-3 T5 // SA-MP 0.3.7 // https://wiki.sa-mp.com/wiki/GetObjectModel
native GetObjectModelID(objectid); 											// RC 8-2 T4

native GetObjectPos(objectid, &Float:X, &Float:Y, &Float:Z); 						// RC 2-4
native SetObjectPos(objectid, Float:X, Float:Y, Float:Z);	 						// RC 2-4 // https://gtamods.com/wiki/01BC

native GetObjectRot(objectid, &Float:RotX, &Float:RotY, &Float:RotZ); 					// RC 2-4
native SetObjectRot(objectid, Float:RotX, Float:RotY, Float:RotZ);    					// RC 2-4 // https://gtamods.com/wiki/0453

native GetObjectInterior(objectid);											// RC 8-3 T4
native SetObjectInterior(objectid, interiorid);									// RC 8-3 T4 // https://gtamods.com/wiki/0566

native GetObjectVirtualWorld(objectid);										// RC 8-3 T4
native SetObjectVirtualWorld(objectid, worldid);								// RC 8-3 T4

native SetObjectVelocity(objectid, Float:X, Float:Y, Float:Z);						// RC 8-3 T3 // https://gtamods.com/wiki/0381

//native MoveObject(objectid, Float:X, Float:Y, Float:Z, Float:Speed);  					// RC 2-4 // fix update in 0.1 beta RC 2-8-7
native MoveObject(objectid, Float:X, Float:Y, Float:Z, Float:Speed, Float:RotX = -1000.0, Float:RotY = -1000.0, Float:RotZ = -1000.0); // SA-MP 0.3d // RC 8-4 T1
native StopObject(objectid); 												// RC 2-4 // fixed
native IsObjectMoving(objectid);											// RC 8-3 T4 // SA-MP 0.3d

native ToggleObjectCollision(objectid, toggle); // 0382	 						// RC 2-4

native IsObjectVisible(objectid); // RC 8-4 T4
native ToggleObjectVisible(objectid, toggle); 									// RC 8-2 T9 // RC 8-4 T5 update for use in OnGameModeInit

native ToggleObjectMoving(objectid, toggle);									// RC 5 T1 // https://gtamods.com/wiki/0392
native ToggleObjectFreezePosState(objectid, toggle);								// RC 8 T5

native ToggleObjectArrow(objectid, toggle);									// RC 2-9 // https://gtamods.com/wiki/0188
native ToggleObjectArrowForPlayer(playerid, objectid, toggle);						// RC 2-9 // https://gtamods.com/wiki/0188

native AttachObjectToVehicle( objectid, vehicleid, Float:OffsetX, Float:OffsetY, Float:OffsetZ );	// RC 4-2 T3
native AttachObjectToObject( objectid, attachtoid, Float:OffsetX, Float:OffsetY, Float:OffsetZ );	// RC 8-3 T1
native AttachObjectToPlayer( objectid, playerid, Float:OffsetX, Float:OffsetY, Float:OffsetZ );		// RC 8-3 T1
native AttachObjectToActor( objectid, actorid, Float:OffsetX, Float:OffsetY, Float:OffsetZ );		// RC 8-3 T1

// Object Functions End

//==============================================================================

// Player Objects

// https://wiki.sa-mp.com/wiki/CreatePlayerObject
// https://wiki.sa-mp.com/wiki/IsValidPlayerObject
// https://wiki.sa-mp.com/wiki/DestroyPlayerObject

// Player Objects End

//==============================================================================

// Pickup Functions

// https://gtamods.com/wiki/0213#Pickup_types // in VC 1-18

native AddStaticPickup( model, type, Float:X, Float:Y, Float:Z, virtualworld = 0 );	// https://gtamods.com/wiki/0213 // https://sampwiki.blast.hk/wiki/AddStaticPickup
native CreatePickup( model, type, Float:X, Float:Y, Float:Z, virtualworld = 0 );	// https://gtamods.com/wiki/0213 // https://sampwiki.blast.hk/wiki/AddStaticPickup

native IsValidPickup( pickupid );						// 0.1.8.5
native DestroyPickup( pickupid );						// https://gtamods.com/wiki/0215 // https://sampwiki.blast.hk/wiki/DestroyPickup

native GetPickupPos( pickupid, &Float:X, &Float:Y, &Float:Z );		// 0.1.8.6
native SetPickupPos( pickupid, Float:X, Float:Y, Float:Z );			// 0.1.8.6

native GetPickupVirtualWorld( pickupid );					// 0.1.8.6
native SetPickupVirtualWorld( pickupid, worldid );			// 0.1.8.6

native GetPickupModel( pickupid );						// 0.1.8.5
native GetPickupType( pickupid );						// 0.1.8.5

native TogglePickupArrow(pickupid, toggle);				// https://gtamods.com/wiki/03DC
native TogglePickupArrowForPlayer(playerid, pickupid, toggle);	// https://gtamods.com/wiki/03DC

// Pickup Functions End

//==============================================================================

// Text Draw functions from SA-MP 0.2x // for Server Added in RC 2-9 // RC 3

// RC 8 T7-2 Fix Update #1
// RC 8-3-2 Fix Update #2
// RC 8-3-3 Fix Update #3

#define TEXT_DRAW_FONT_BANK			0 // VC Style
#define TEXT_DRAW_FONT_STANDARD		1 // Subtitles
#define TEXT_DRAW_FONT_HEADING		2 // GTA
#define TEXT_DRAW_FONT_SPRITE_DRAW		4 // TXD Sprites like in SA-MP
#define TEXT_DRAW_FONT_MODEL_PREVIEW	5

native Text:TextDrawCreate(Float:x, Float:y, text[]);		// fixed
native IsValidTextDraw(Text:text);					// RC 8-3-2
native TextDrawDestroy(Text:text);					// fixed

native TextDrawSetString(Text:text, string[]);			// fixed

native TextDrawFont(Text:text, font);				// fixed // https://gtamods.com/wiki/0349
native TextDrawPosition(Text:text, Float:x, Float:y);		// RC 8-4-2
native TextDrawLetterSize(Text:text, Float:x, Float:y);	// fixed // https://gtamods.com/wiki/033F // SetTextScale // LetterSize Float:y необходимо умножить на 2 чтобы было как в gta_vc.exe
native TextDrawTextSize(Text:text, Float:x, Float:y);		// fixed in RC 8-3-3 // https://gtamods.com/wiki/0343 // + // https://gtamods.com/wiki/0344 // X = CFont::SetWrapx // Y = CFont::SetCentreSize
native TextDrawAlignment(Text:text, alignment);			// fixed // https://gtamods.com/wiki/03E4 // + // https://gtamods.com/wiki/0342
native TextDrawColor(Text:text, color);				// fixed // https://gtamods.com/wiki/0340
native TextDrawUseBox(Text:text, use);				// fixed // https://gtamods.com/wiki/0345
native TextDrawBoxColor(Text:text, color);			// fixed // https://gtamods.com/wiki/0346
native TextDrawSetShadow(Text:text, size);			// fixed // CFont::SetDropShadowPosition
native TextDrawSetOutline(Text:text, size);			// ----- // none in VC
native TextDrawBackgroundColor(Text:text, color);		// fixed // CFont::SetDropColor
native TextDrawSetProportional(Text:text, set);			// fixed // https://gtamods.com/wiki/0348

native TextDrawShowForPlayer(playerid, Text:text);		// fixed
native TextDrawHideForPlayer(playerid, Text:text);		// fixed

native TextDrawShowForAll(Text:text);				// fixed
native TextDrawHideForAll(Text:text);				// fixed

// Text Draw functions from SA-MP 0.2x // for Server Added in RC 2-9 // RC 3

//----------------------------------------------------------------------------------------------------------

// Per-player TextDraws from SA-MP 0.3e and ++ // RC 8-3-2

native PlayerText:CreatePlayerTextDraw(playerid, Float:x, Float:y, text[]);
native IsValidPlayerTextDraw(playerid, PlayerText:text); // RC 8-3-2
native PlayerTextDrawDestroy(playerid, PlayerText:text);

native PlayerTextDrawFont(playerid, PlayerText:text, font);
native PlayerTextDrawPosition(playerid, PlayerText:text, Float:x, Float:y); // RC 8-5
native PlayerTextDrawLetterSize(playerid, PlayerText:text, Float:x, Float:y);
native PlayerTextDrawTextSize(playerid, PlayerText:text, Float:x, Float:y);
native PlayerTextDrawAlignment(playerid, PlayerText:text, alignment);
native PlayerTextDrawColor(playerid, PlayerText:text, color);
native PlayerTextDrawUseBox(playerid, PlayerText:text, use);
native PlayerTextDrawBoxColor(playerid, PlayerText:text, color);
native PlayerTextDrawSetShadow(playerid, PlayerText:text, size);
native PlayerTextDrawSetOutline(playerid, PlayerText:text, size); // none in VC
native PlayerTextDrawBackgroundColor(playerid, PlayerText:text, color);
native PlayerTextDrawSetProportional(playerid, PlayerText:text, set);

native PlayerTextDrawSetString(playerid, PlayerText:text, string[]);

native PlayerTextDrawShow(playerid, PlayerText:text);
native PlayerTextDrawHide(playerid, PlayerText:text);

// Per-player TextDraws End

//----------------------------------------------------------------------------------------------------------

// 3DTextDraws

native Text3D:Create3DTextDraw(text[], color, Float:X, Float:Y, Float:Z, Float:DrawDistance = 14.0, virtualworld = 0, useLOS = 0);
native IsValid3DTextDraw(Text3D:id);
native Delete3DTextDraw(Text3D:id);

native Update3DTextLabelDraw(Text3D:id, color, text[]);

// 3DTextDraws End

//==========================================================================================================

native TogglePlayerInputDialog(playerid, toggle); // RC 8-5 T2
native SetPlayerInputDialogPos(playerid, Float:x, Float:y); // RC 8-5 T2

//==========================================================================================================

// D3D8 // 2DText // RC 8-3 T8

native Create2DText(text[], color, fontname[], int_size, Float:X, Float:Y); // RC 8-3 T8
native IsValid2DText(textid); // RC 8-3 T8
native Destroy2DText(textid); // RC 8-3 T8

native SetString2DText(textid, string[]); // RC 8-3 T8

native Set2DTextPos(textid, Float:x, Float:y); // RC 8-3 T8
native Set2DTextColor(textid, color); // RC 8-3 T8

native Toggle2DTextForPlayer(playerid, textid, toggle); // RC 8-3 T8
native Toggle2DTextForAll(textid, toggle); // RC 8-3 T8

//----------------------------------------------------------------------------------------------------------

// D3D8 // Player 2DText // RC 8-3-2 update

native CreatePlayer2DText(playerid, text[], color, fontname[], int_size, Float:X, Float:Y); // RC 8-3 T9
native IsValidPlayer2DText(playerid, textid); // RC 8-3 T9
native DestroyPlayer2DText(playerid, textid); // RC 8-3 T8

native SetStringPlayer2DText(playerid, textid, string[]); // RC 8-3 T9

native SetPlayer2DTextPos(playerid, textid, Float:x, Float:y); // RC 8-3 T9
native SetPlayer2DTextColor(playerid, textid, color); // RC 8-3 T8

native TogglePlayer2DTextForPlayer(playerid, textid, toggle); // RC 8-3 T9

//==========================================================================================================

// Global 3D Text Labels // RC 8-4-2

native Text3D:Create3DTextLabel(text[], color, Float:X, Float:Y, Float:Z, Float:DrawDistance, virtualworld, testLOS=0);
native IsValid3DTextLabel(Text3D:id); // none in SA-MP
native Delete3DTextLabel(Text3D:id);

native Update3DTextLabelText(Text3D:id, color, text[]);

native Attach3DTextLabelToPlayer(Text3D:id, playerid, Float:OffsetX, Float:OffsetY, Float:OffsetZ);
native Attach3DTextLabelToActor(Text3D:id, actorid, Float:OffsetX, Float:OffsetY, Float:OffsetZ); // none in SA-MP
native Attach3DTextLabelToVehicle(Text3D:id, vehicleid, Float:OffsetX, Float:OffsetY, Float:OffsetZ);
native Attach3DTextLabelToObject(Text3D:id, objectid, Float:OffsetX, Float:OffsetY, Float:OffsetZ); // none in SA-MP

//----------------------------------------------------------------------------------------------------------
/*
// Per-player 3D Text Labels

native PlayerText3D:CreatePlayer3DTextLabel(playerid, text[], color, Float:X, Float:Y, Float:Z, Float:DrawDistance, attachedplayer=INVALID_PLAYER_ID, attachedvehicle=INVALID_VEHICLE_ID, testLOS=0);
native DeletePlayer3DTextLabel(playerid, PlayerText3D:id);
native UpdatePlayer3DTextLabelText(playerid, PlayerText3D:id, color, text[]);
*/
//----------------------------------------------------------------------------------------------------------

#define MAX_CHATBUBBLE_LENGTH 144
native SetPlayerChatBubble(playerid, text[], color, Float:drawdistance, expiretime); // RC 8-5

//==========================================================================================================

// Vehicle Functions // a_vehicles.inc //

//==========================================================================================================

native CreateVehicle(vehicletype, Float:x, Float:y, Float:z, Float:rotation, color1, color2, respawn_delay); // RC 2-8
native IsValidVehicle(vehicleid);						// fixed
native DestroyVehicle(vehicleid);						// RC 2-8 // RC 3 Update

native IsVehicleStreamedIn(vehicleid, forplayerid);			// RC 8-5 // 0.1.8.5

native GetVehicleVirtualWorld(vehicleid);					// RC 3 // RC 4-2 T5 Update
native SetVehicleVirtualWorld(vehicleid, worldid);			// RC 3 // RC 4-2 T5 Update

native GetVehicleModel(vehicleid);						// fixed

native SetVehicleToRespawn(vehicleid);					// RC 2-8-2 (RC 2-8-4) // fixed

native GetVehicleHealth(vehicleid, &Float:health);			// fixed
native SetVehicleHealth(vehicleid, Float:health);			// fixed

native RepairVehicle(vehicleid);						// RC 8-2 // SA-MP 0.3a // https://wiki.sa-mp.com/wiki/RepairVehicle
native RepairVehicleModel(vehicleid);					// RC 2-5 // fixed

native SetVehicleImmunities(vehicleid, bBullet, bFire, bExplosion, bCollision, bMelee); // 0x02AC // https://gtamods.com/wiki/02AC // RC 8-4 T17
native SetVehicleTiresVulnerable(vehicleid, bool); // 0x053F // https://gtamods.com/wiki/053F // RC 8-4 T17

native GetVehicleColor( vehicleid, &color1, &color2 ); // https://gtamods.com/wiki/03F3
native ChangeVehicleColor( vehicleid, color1, color2 ); // https://gtamods.com/wiki/0229 // https://sampwiki.blast.hk/wiki/ChangeVehicleColor

native KillVehicleEngine(vehicleid); // 0x02D4 // https://gtamods.com/wiki/02D4 // RC 2-4 // from VC-MP 0.3z_r2

native ToggleVehicleControl(vehicleid, bool);				// RC 8 T10 // CEntity flag 0x50

native SetVehicleFreezePosState(vehicleid, bool); // 0x0519 // https://gtamods.com/wiki/0519 // RC 5-2 T10 // RC 6

native BlowUpVehicle(vehicleid);						// RC 4-2 T3

native OpenVehicleTrunk(vehicleid);						// fixed

#define VEHICLE_DOOR_BONNET 0
#define VEHICLE_DOOR_BOOT 1
#define VEHICLE_DOOR_LEFT_FRONT 2
#define VEHICLE_DOOR_RIGHT_FRONT 3
#define VEHICLE_DOOR_LEFT_REAR 4
#define VEHICLE_DOOR_RIGHT_REAR 5

native SetVehicleOpenDoor(vehicleid, doorid, toggle);			// RC 8 T13

native ToggleVehicleTaxiLight(vehicleid, toggle); // 0x0216 // https://gtamods.com/wiki/0216

//------------------------------------------------------------------------------

// damage control

native SetVehicleDoorsStatus(vehicleid, bool);				// RC 2-5 // fixed
native SetVehicleLightsStatus(vehicleid, bool);				// RC 2-5 // fixed

// Tires // https://wiki.sa-mp.com/wiki/TireStates

native SetVehicleTyre(vehicleid, bool); // RC 8-3 T7 // from VC-MP 0.3z_r2 // 0x04FE // https://gtamods.com/wiki/04FE

native GetVehicleTireStatus(vehicleid, tireid); // RC 8-3 T7
native SetVehicleTireStatus(vehicleid, tireid, status); // RC 8-3 T7 // from SA-MP 0.2.5

native GetVehicleTiresStatus(vehicleid, &tire_fl, &tire_bl, &tire_fr, &tire_br); // RC 8-3 T7 Update
native SetVehicleTiresStatus(vehicleid, tire_fl, tire_bl, tire_fr, tire_br); // RC 8-3 T7 Update

//------------------------------------------------------------------------------

native SetVehicleEnableAlarm(vehicleid, time);				// RC 3 // time 10000 = 10 sek // аналог SetVehicleAlarm from vcmp 0.3z r2 

native ToggleVehicleArrow(vehicleid, toggle);				// RC 2-9 T2 // RC 3 T2 fix Update // https://gtamods.com/wiki/0186
native ToggleVehicleArrowForPlayer(playerid, vehicleid, toggle);	// RC 2-9 T2 // RC 3 T2 fix Update // https://gtamods.com/wiki/0186

native ToggleVehicleFire(vehicleid, toggle);				// RC 8 T1
native ToggleVehicleFireForPlayer(playerid, vehicleid, toggle);	// RC 8 T1

native SetVehicleTeleport(vehicleid, Float:x, Float:y, Float:z); 	// RC 8-3 T8

native GetVehiclePos(vehicleid, &Float:x, &Float:y, &Float:z); 	// fixed
native SetVehiclePos(vehicleid, Float:x, Float:y, Float:z); 	// RC 2-6 // RC 8-3 T8 update

native IsVehicleInRangeOfPoint(playerid, Float:range, Float:x, Float:y, Float:z); // RC 8-3 T5
native Float:GetVehicleDistanceFromPoint(playerid, Float:X, Float:Y, Float:Z); // RC 8-3 T5 // SA-MP 0.3c R3 // https://wiki.sa-mp.com/wiki/GetVehicleDistanceFromPoint

native GetVehicleZAngle(vehicleid, &Float:z_angle);			// fixed
native SetVehicleZAngle(vehicleid, Float:z_angle);			// RC 2-4

native GetVehicleRotation(vehicleid, &Float:rx, &Float:ry, &Float:rz); // RC 8 T1 // need test
native GetVehicleRotationQuat(vehicleid, &Float:w, &Float:x, &Float:y, &Float:z); // RC 8 T1 // need test

//------------------------------------------------------------------------------

// CPhysical

// MoveSpeed
native GetVehicleVelocity( vehicleid, &Float:X, &Float:Y, &Float:Z );	// SA-MP 0.3a //  RC 2-7
native SetVehicleVelocity( vehicleid, Float:X, Float:Y, Float:Z );		// SA-MP 0.3a // RC 2-7

// TurnSpeed
native GetVehicleAngularVelocity( vehicleid, &Float:X, &Float:Y, &Float:Z );	// 0.1.8.6
native SetVehicleAngularVelocity( vehicleid, Float:X, Float:Y, Float:Z );		// SA-MP 0.3b // RC 8-2

// (B)
native GetVehicleMass( vehicleid, &Float:fMass ); // RC 8 T7
native SetVehicleMass( vehicleid, Float:fMass ); // part of opcode 01EC // RC 8 T6-2 // RC 8 T7

native GetVehicleTurnMass( vehicleid, &Float:fTurnMass ); // RC 8-4 T5
native SetVehicleTurnMass( vehicleid, Float:fTurnMass ); // part of opcode 01EC // RC 8-4 T5

native GetVehicleForceMultiplier( vehicleid, &Float:fValue ); // RC 8-4 T5
native SetVehicleForceMultiplier( vehicleid, Float:fValue ); // RC 8-4 T5

native GetVehicleAirResistance( vehicleid, &Float:fValue ); // RC 8-4 T5
native SetVehicleAirResistance( vehicleid, Float:fValue ); // RC 8-4 T5

native GetVehicleElasticity( vehicleid, &Float:fValue ); // RC 8-4 T5
native SetVehicleElasticity( vehicleid, Float:fValue ); // RC 8-4 T5

native GetVehicleBuoyancy( vehicleid, &Float:fValue ); // RC 8-4 T5
native SetVehicleBuoyancy( vehicleid, Float:fValue ); // RC 8-4 T5

// CPhysical End

//------------------------------------------------------------------------------

native GetVehicleCurrentGear( vehicleid ); // RC 8 T6-5 // RC 8 T7

//------------------------------------------------------------------------------

// HANDLING

// (K)

native SetVehicleTractionLoss(vehicleid, Float:fValue);
native SetPlayerVehicleTractionLoss(playerid, vehicleid, Float:fValue);

// (L)

native SetVehicleTractionBias(vehicleid, Float:fValue);
native SetPlayerVehicleTractionBias(playerid, vehicleid, Float:fValue);

// (M)

native SetVehicleNumberOfGears(vehicleid, number); // RC 8-4-5
native SetPlayerVehicleNumberOfGears(playerid, vehicleid, number); // RC 8-4-5

// (N)

native SetVehicleMaxVelocity(vehicleid, Float:fMaxVelocity);
native SetPlayerVehicleMaxVelocity(playerid, vehicleid, Float:fValue);

// (O)

native SetVehicleEngineAcceleration(vehicleid, Float:fValue);
native SetPlayerVehicleAcceleration(playerid, vehicleid, Float:fValue); // EngineAcceleration

// (P)

#define DRIVE_TYPE_FRONT 1
#define DRIVE_TYPE_REAR 2
#define DRIVE_TYPE_FULL 3

native SetVehicleDriveType(vehicleid, type); // RC 8 T6-4 // RC 8 T7 // Для всех
native SetPlayerVehicleDriveType(playerid, vehicleid, type); // RC 8-4-2 // RC 8-4-5 // Для одного или нескольких игроков

// (Q)

#define ENGINE_TYPE_P 1 // бензин
#define ENGINE_TYPE_D 2 // дизель
#define ENGINE_TYPE_E 3 // электро

native SetVehicleEngineType(vehicleid, type); // RC 8 T6-4 // RC 8 T7 // Для всех
native SetPlayerVehicleEngineType(playerid, vehicleid, type); // RC 8-4-2 // RC 8-4-5 // Для одного или нескольких игроков

// HANDLING END

//------------------------------------------------------------------------------

#define VEHICLE_FLAG_0x1F9 1
#define VEHICLE_FLAG_0x1FA 2
#define VEHICLE_FLAG_0x1FB 3
#define VEHICLE_FLAG_0x1FC 4
#define VEHICLE_FLAG_0x1FD 5
#define VEHICLE_FLAG_0x1FE 6
#define VEHICLE_FLAG_0x1FF 7
#define VEHICLE_FLAG_0x200 8

native SetVehicleFlag(vehicle, flag, value); // RC 8 T9 // experimental func

native SetVehicleFlagNew(vehicle, flag, bit, bool); // 0.1.8.5.5 // bit's 0-7 // bool 0-1

//------------------------------------------------------------------------------

native SetVehicleAlpha(vehicle, value); // RC 8-2 T8
native ToggleVehicleCollision(vehicle, toggle); // RC 8-2 T8
native ToggleVehicleVisible(vehicle, toggle); // RC 8-2 T8

//==============================================================================

//------------------------------------------------------------------------------

//------------------------------------------------------------------------------

// Player Functions // a_players.inc //

//------------------------------------------------------------------------------

native IsPlayerConnected( playerid );

//------------------------------------------------------------------------------

native GetPlayerIp( playerid, const name[], len );
native GetPlayerPing( playerid );

//------------------------------------------------------------------------------

native IsPlayerInGamePause( playerid ); // 0.1.8.6

native GetPlayerVersion( playerid, const version[], len ); // Returns the SA-MP client revision as reported by the player // SA-MP 0.3e // RC 8-3 T5 // https://wiki.sa-mp.com/wiki/GetPlayerVersion

//------------------------------------------------------------------------------

native GetPlayerName( playerid, const name[], len );
native SetPlayerName( playerid, const name[] );

//------------------------------------------------------------------------------

native GetPlayerScore( playerid );
native SetPlayerScore( playerid, score );

//------------------------------------------------------------------------------

native GetPlayerMoney(playerid); 						// added // fixed // re-fixed in 0.1 beta RC 2-8
native SetPlayerMoney(playerid, money); 					// added // fixed // в SA-MP нет такой функции она создаётся вручную (.pwn)
native GivePlayerMoney(playerid, money); 					// added // fixed
native ResetPlayerMoney(playerid);						// added // fixed

//------------------------------------------------------------------------------

native DisablePlayerGamePauseMenu( playerid, disable ); // 0.1.8.6

//------------------------------------------------------------------------------

native GetPlayerTeam(playerid);						// added // ?????
native SetPlayerTeam(playerid, teamid);					// added // fixed

//------------------------------------------------------------------------------

native GetPlayerColor(playerid); // added in RC 2-8-8 // test
native SetPlayerColor(playerid, color); // added in RC 2-8-8 // test

//---------------------------------------------------------------------------------

native SetPlayerMarkerForPlayer(playerid, showplayerid, color); // added in RC 2-8-9 // test

native RemovePlayerMarker(playerid); // from VC-MP 0.3z_r2 // added in RC 2-9-3 T1 // test // fixed

//---------------------------------------------------------------------------------

native SetWorldBounds(Float:x_max, Float:x_min, Float:y_max, Float:y_min); // from VC-MP 0.3z_r2 // RC 8-4-2

// http://wiki.sa-mp.com/wiki/SetPlayerWorldBounds
// https://team.sa-mp.com/wiki/SetPlayerWorldBounds.html

native SetPlayerWorldBounds(playerid, Float:x_max, Float:x_min, Float:y_max, Float:y_min); // added in 0.1 beta RC 2-8-5

//---------------------------------------------------------------------------------

native SetSpawnInfo(playerid, team, skin, Float:x, Float:y, Float:z, Float:rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo); // added in 0.1 beta RC 2-9-2 // test

native SpawnPlayer(playerid); 						// added in 0.1 beta RC 2-8 // test

native ForceClassSelection(playerid);					// added in 0.1 beta RC 2-8-8 // test

//---------------------------------------------------------------------------------

native GetPlayerPos(playerid, &Float:x, &Float:y, &Float:z);	// added // fixed
native SetPlayerPos(playerid, Float:x, Float:y, Float:z);		// added // fixed // fix update in RC 2-8-8 (now work in OnPlayerRequestClass)
native SetPlayerPosFindZ(playerid, Float:x, Float:y, Float:z);	// added // ?????

//---------------------------------------------------------------------------------

native IsPlayerInRangeOfPoint(playerid, Float:range, Float:x, Float:y, Float:z); // added // fixed // from SA-MP 0.3a // https://wiki.sa-mp.com/wiki/IsPlayerInRangeOfPoint

native Float:GetPlayerDistanceFromPoint(playerid, Float:X, Float:Y, Float:Z); // SA-MP 0.3c R3 // RC 8-3 T5 // https://wiki.sa-mp.com/wiki/GetPlayerDistanceFromPoint

//---------------------------------------------------------------------------------

native GetPlayerFacingAngle(playerid, &Float:ang);			// added // fixed
native SetPlayerFacingAngle(playerid, Float:ang);			// added // fixed

//---------------------------------------------------------------------------------

native GetPlayerInterior(playerid);						// added // fixed
native SetPlayerInterior(playerid, interiorid);				// added // fixed

//---------------------------------------------------------------------------------

native GetPlayerVirtualWorld(playerid);			// RC 3 // RC 4-2 T5 Update
native SetPlayerVirtualWorld(playerid, worldid);	// RC 3 // RC 4-2 T5 Update

//---------------------------------------------------------------------------------

native GetPlayerVelocity(playerid, &Float:X, &Float:Y, &Float:Z);	// RC 2-8-7 // как в SA-MP 0.3a и выше
native SetPlayerVelocity(playerid, Float:X, Float:Y, Float:Z);	// RC 2-8-7 // как в SA-MP 0.3a и выше

//---------------------------------------------------------------------------------

#define PLAYER_SKIN_ID_MIN 0
#define PLAYER_SKIN_ID_MAX 184 // RC 8-4 update

native GetPlayerSkin(playerid);						// RC 8-4 update
native SetPlayerSkin(playerid, skinid);					// RC 8-4 update

//---------------------------------------------------------------------------------

#define PED_FLAG_0x14C 1 // byteShootFlags

// bit 0 // bIsStanding : 1;		
// bit 1 // bWasStanding : 1;		
// bit 2 // b03 : 1;				
// bit 3 // bIsPointingGunAt : 1;
// bit 4 // bIsLooking : 1;			
// bit 5 // b06 : 1;					
// bit 6 // bIsRestoringLook : 1;		
// bit 7 // bIsAimingGun : 1;		

#define PED_FLAG_0x14D 2 // byteJumpFlags

// bit 0 // bIsRestoringGun : 1;		
// bit 1 // bCanPointGunAtTarget : 1;
// bit 2 // bIsTalking : 1;				
// bit 3 // bIsInTheAir : 1;
// bit 4 // bIsLanding : 1;			
// bit 5 // bIsRunning : 1;				
// bit 6 // bHitSomethingLastFrame : 1;		
// bit 7 // bVehEnterDoorIsBlocked : 1;

#define PED_FLAG_0x14E 3

// bit 0 // bCanPedEnterSeekedCar : 1;
// bit 1 // bRespondsToThreats : 1;	
// bit 2 // bRenderPedInCar : 1;
// bit 3 // bChangedSeat : 1;
// bit 4 // bUpdateAnimHeading : 1;		
// bit 5 // bRemoveHead : 1;				
// bit 6 // bFiringWeapon : 1;	
// bit 7 // bFindNewNodeAfterStateRestore : 1;

#define PED_FLAG_0x14F 4

// bit 0 // 	
// bit 1 // 	
// bit 2 // bPedIsBleeding : 1;			
// bit 3 // bStopAndShoot : 1;
// bit 4 // bIsPedDieAnimPlaying : 1;		
// bit 5 // 				
// bit 6 // 	
// bit 7 // 

#define PED_FLAG_0x150 5

// bit 0 // bKindaStayInSamePlace : 1;
// bit 1 // bBeingChasedByPolice : 1;
// bit 2 // bNotAllowedToDuck : 1;			
// bit 3 // bCrouchWhenShooting : 1;
// bit 4 // bIsDucking : 1;
// bit 5 // bGetUpAnimStarted : 1;		
// bit 6 // bDoBloodyFootprints : 1;
// bit 7 // b40 : 1;

#define PED_FLAG_0x151 6

// bit 0 // 	
// bit 1 // 	
// bit 2 // 			
// bit 3 // 
// bit 4 // 		
// bit 5 // 				
// bit 6 // 	
// bit 7 // 

#define PED_FLAG_0x152 7
#define PED_FLAG_0x153 8
#define PED_FLAG_0x154 9
#define PED_FLAG_0x155 10
#define PED_FLAG_0x156 11
#define PED_FLAG_0x157 12
#define PED_FLAG_0x158 13

native TogglePlayerPedFlag( playerid, flag, bit, bool ); // 0.1.8.5 T8

//---------------------------------------------------------------------------------

native GetPlayerHealth(playerid, &Float:health); 			// added // fixed // opcode 0x0225 // https://gtamods.com/wiki/0225
native SetPlayerHealth(playerid, Float:health); 			// added // fixed // opcode 0x0222 // https://gtamods.com/wiki/0222 // https://sampwiki.blast.hk/wiki/SetPlayerHealth // 0x354 // opcode 0x0222 / 0x0223

//---------------------------------------------------------------------------------

native GetPlayerArmour(playerid, &Float:armour); 			// added // fixed
native SetPlayerArmour(playerid, Float:armour); 			// added // fixed

//---------------------------------------------------------------------------------

native GetPlayerWantedLevel(playerid);					// added // fixed // + fix update in RC 2-8-9
native SetPlayerWantedLevel(playerid, level); 				// added // fixed in 0.1 beta RC 2-8-4

//---------------------------------------------------------------------------------

native GetPlayerGravity(playerid, &Float:gravity);			// RC 2-9 T3 // test
native GetPlayerWaterLevel(playerid, &Float:level);			// RC 2-9 T3 // test
native GetPlayerMaxHeliHeightLevel(playerid, &Float:level);		// RC 2-9 T3 // test
native GetPlayerGameSpeed(playerid, &Float:speed); // RC 8-3 T7

//---------------------------------------------------------------------------------

native TogglePlayerClock(playerid, toggle); // RC 8-3 T7 // http://wiki.sa-mp.com/wiki/TogglePlayerClock

native SetPlayerWeather(playerid, weatherid); // https://wiki.sa-mp.com/wiki/SetPlayerWeather

//---------------------------------------------------------------------------------

native TogglePlayerWidescreen(playerid, toggle); // https://gtamods.com/wiki/02A3
native TogglePlayerGreenScanlines(playerid, toggle); // https://gtamods.com/wiki/04C7
native TogglePlayerWhiteScanlines(playerid, toggle); // https://gtamods.com/wiki/0507

//---------------------------------------------------------------------------------

native TogglePlayerDriveby(playerid, toggle);				// RC 8-3 T7 // аналог функции // 0x0501 // native DisableDriveby(playerid,bool); // VC-MP 0.3z_r2

native IsPlayerInWater(playerid); 						// RC 7

native TogglePlayerWaterDeath(playerid, toggle);			// RC 8 T8

native SetPlayerDriveOnWater(playerid, toggle); 			// added // fixed

native EnableStuntBikeForPlayer(playerid, toggle);			// RC 2-9 // аналог функции // http://thijn.vrocker-hosting.co.uk/VCWiki/index.php/EnableStuntBike

native SetPlayerInfiniteRun(playerid, toggle); // 0x0330 // https://gtamods.com/wiki/0330
native SetPlayerFastReload(playerid, toggle);  // 0x0331 // https://gtamods.com/wiki/0331
native SetPlayerFireProof(playerid, toggle);   // 0x055B / 0x055D // https://gtaundergroundmod.com/pages/ug-mp/documentation/native/SetPlayerFireProof

native SetPlayerDrunk(playerid, visuals, handling); 			// 0x052C + 0x03FD // added RC 2 // fixed // как в VC-MP 0.3z R2 // http://thijn.vrocker-hosting.co.uk/VCWiki/index.php/SetPlayerDrunk

native TogglePlayerCollision(playerid, toggle);				// RC 8 T8 // experimental func // test

native TogglePlayerControllable(playerid, toggle);			// added // fixed

native TogglePlayerFreezePos(playerid, toggle); // RC 8 T12 // 0x04D7 // https://gtamods.com/wiki/04D7

native TogglePlayerBleeding(playerid, toggle); // 0x0332 // https://gtamods.com/wiki/0332

native TogglePlayerCellPhone(playerid, toggle);				// added // fixed in 0.1 beta RC 2-5

native SetPlayerFlashHUD(playerid, hudid); 				// 0x03E7 // https://gtamods.com/wiki/03E7 // RC 8-3 T6

native TogglePlayerRadar(playerid, toggle);				// 0x0581 // https://gtamods.com/wiki/0581 // RC 8 T1
native TogglePlayerRadarBlank(playerid, toggle, style = 1);		// 0x057E // https://gtamods.com/wiki/057E // RC 8 T1 // RC 8-2 T9 update (new param style = 1 (VC style) or 2 (SA style))

//---------------------------------------------------------------------------------

// MAX MAP ICON = 32 (0 - 31) // NUMRADARBLIPS = 75 // from reVC

#define MAPICON_LOCAL			  0 // displays in the player's local are
#define MAPICON_GLOBAL			  1 // displays always
#define MAPICON_LOCAL_CHECKPOINT  2 // displays in the player's local area and has a checkpoint marker
#define MAPICON_GLOBAL_CHECKPOINT 3 // displays always and has a checkpoint marker

native SetPlayerMapIcon(playerid, iconid, Float:x, Float:y, Float:z, markertype, color, style = MAPICON_LOCAL);	// added + fixed in 0.1 beta RC 2-4 // RC 2-8-8 update
native RemovePlayerMapIcon(playerid, iconid);												// added // fix update in 0.1 beta RC 2-7

//---------------------------------------------------------------------------------
/*

RADARBLIPS 50

CreateRadarBlip
IsValidRadarBlip(blipid); // RC 8-5
DestroyRadarBlip

*/
//---------------------------------------------------------------------------------

native GetPlayerKeys(playerid, &keys); // RC 8 T9

//---------------------------------------------------------------------------------

native GetPlayerState(playerid); 						// added // fix update in 0.1 beta RC 2-5

//---------------------------------------------------------------------------------

native GetPlayerAction(playerid);	// RC 2-8-9 test

//---------------------------------------------------------------------------------

native IsPlayerInVehicle(playerid, vehicleid);				// added // fixed
native IsPlayerInAnyVehicle(playerid);					// added // fixed

native GetPlayerVehicleID(playerid);					// added // fixed

native GetPlayerVehicleSeat(playerid); // from SA-MP 0.3a 		// added in 0.1 beta RC 2-8-6 // TEST

native GetPlayerSurfingVehicleID(playerid); // RC 8 T6
native GetPlayerSurfingObjectID(playerid); // RC 8 T6

//---------------------------------------------------------------------------------

native PutPlayerInVehicle(playerid, vehicleid, seatid);				// added in 0.1 beta RC 2-4 // fixed // 0x036A // RC 2-9-4 fix update
native RemovePlayerFromVehicle(playerid);							// added in 0.1 beta RC 2-4 // fixed // 0x03E2
native RemovePlayerFromVehicleAndPutAt(playerid, Float:x, Float:y, Float:z);	// added in 0.1 beta RC 2-4 // fixed // 0x0362

//---------------------------------------------------------------------------------

native ResetPlayerWeapons(playerid);					// added // fixed // Re-Create in 0.1 beta RC 2-8 // 0x03B8 / 0x048F -> 4FF740

native GetPlayerWeapon(playerid);						// added // fixed // GetCurrentWeapon // 0x046F / 0x0470

native GetPlayerWeaponState(playerid); // RC 8-3 T6 // SA-MP 0.3a // https://wiki.sa-mp.com/wiki/GetPlayerWeaponState

native GivePlayerWeapon(playerid, weaponid, ammo);			// added // fixed // Re-Create in 0.1 beta RC 2-8 

native SetPlayerArmedWeapon(playerid, weaponid);			// added // fixed // Re-Create in 0.1 beta RC 2-8 // now can change if PLAYER_STATE_DRIVER // 0x01B8 / 0x01B9 // SetCurrentPlayerWeapon

native GetPlayerWeaponData(playerid, slot, &weapon, &ammo);		// added // fix update in RC 3

native GetPlayerAmmo(playerid);						// added in 0.1 beta RC 2-8-5 // fix update in RC 2-9
native SetPlayerAmmo(playerid, weaponslot, ammo);			// added in 0.1 beta RC 2-8-5 // fix update in RC 3

//---------------------------------------------------------------------------------

native PlayerPlaySound( playerid, soundid, Float:x, Float:y, Float:z ); // 0x018C // https://gtamods.com/wiki/018C // http://wiki.sa-mp.com/wiki/PlayerPlaySound
native PlayerPlayMusic( playerid, musicid ); // 0x0394 // https://gtamods.com/wiki/0394

// 05D7

native SetInteriorAudioForPlayer( playerid, interiorid, audioid ); // RC 8-4

native UseAudioStreamMessages( bool ); // RC 8-4
native PlayAudioStreamForPlayer( playerid, url[], Float:posX = 0.0, Float:posY = 0.0, Float:posZ = 0.0, Float:distance = 50.0, usepos = 0 ); // 0.3d RC 1 // RC 8-3-5 // RC 8-4
native StopAudioStreamForPlayer( playerid ); // 0.3d RC 1 // RC 8-3-5 // RC 8-4

native PlayAudioFileForPlayer( playerid, filename[] ); // RC 8-5 T6 // by Oleg_Shteker

//---------------------------------------------------------------------------------

native ClearPlayerObjective( playerid ); // RC 8-3 T7 // opcode 0x011C // https://gtamods.com/wiki/011C

//---------------------------------------------------------------------------------

native TogglePlayerArrow(playerid, toggle); // RC 8-3 T8
native TogglePlayerArrowForPlayer(playerid, forplayerid, toggle); // RC 8-3 T8

//---------------------------------------------------------------------------------

native GetPlayerWaitState(playerid); // RC 7

// SetPlayerWaitState - это аналог нерабочей функции SetPlayerAnimation из VC-MP 0.3z_r2

native SetPlayerWaitState(playerid, stateid, time); // https://gtamods.com/wiki/0372 // added in 0.1 beta RC 2-8-6 // RC 7 T1 Fix

native ApplyPlayerAnimation(playerid, animgroupid, animid, Float:blend); // 0.1 beta RC 5-2 // RC 6 // RC 7 T1 Fix

//---------------------------------------------------------------------------------

native GetPlayerFPS(playerid); // RC 8-3 T9

native GetPlayerScreenResolution(playerid, &int_width, &int_height); // RC 8-3 T7

//---------------------------------------------------------------------------------

native Float:GetPlayerCameraAspectRatio(playerid); // SA-MP 0.3z // RC 8-3 T7 // RC 8-3-2 Fix

native GetPlayerCameraFrontVector(playerid, &Float:x, &Float:y, &Float:z); // SA-MP 0.3a // RC 8-4-2

#define CAMERA_FADE_IN	0
#define CAMERA_FADE_OUT	1

native SetPlayerCameraFade(playerid, iTime, InOut, r = 0, g = 0, b = 0); // 0x016A // RC 8 T3

native SetPlayerCameraShake(playerid, iTime); // 0x0003 // RC 8-3 T7

native GetPlayerCameraMode(playerid); // SA-MP 0.3c R3

native GetPlayerCameraPos(playerid, &Float:x, &Float:y, &Float:z); // RC 8 T2
native SetPlayerCameraPos(playerid, Float:x, Float:y, Float:z); 

#define CAMERA_MOVE	1
#define CAMERA_CUT	2

native SetPlayerCameraLookAt(playerid, Float:x, Float:y, Float:z, cut = CAMERA_CUT);

native SetCameraBehindPlayer(playerid);

//---------------------------------------------------------------------------------

native SetPlayerCheckpoint(playerid, Float:x, Float:y, Float:z, Float:size, r = 252, g = 138, b = 242);	// added in 0.1 beta RC 2-7 // RC 4 update
native DisablePlayerCheckpoint(playerid);							// added in 0.1 beta RC 2-7 // TEST
native IsPlayerInCheckpoint(playerid);							// added in 0.1 beta RC 2-7 // TEST

// corona types added in RC 8-2

#define CORONA_TYPE_STAR		0
#define CORONA_TYPE_STAR2		1
#define CORONA_TYPE_MOON		2
#define CORONA_TYPE_REFLECT		3
#define CORONA_TYPE_HEADLIGHTLINE	4
#define CORONA_TYPE_HEX			5
#define CORONA_TYPE_CIRCLE		6
#define CORONA_TYPE_RINGA		7
#define CORONA_TYPE_STREEK		8

// https://gtamods.com/wiki/024F

native SetPlayerRaceCheckpoint(playerid, type, Float:size, Float:x, Float:y, Float:z, r = 252, g = 138, b = 242); // RC 3 // RC 4 update // ВНИМАНИЕ отличается от SA-MP параметрами
native DisablePlayerRaceCheckpoint(playerid); // RC 3
native IsPlayerInRaceCheckpoint(playerid); // RC 3

//====================================================================================

// Spectating // added in 0.1 beta RC 2-9-3 T2

// https://team.sa-mp.com/wiki/Spectate_Modes.html

// https://team.sa-mp.com/wiki/TogglePlayerSpectating.html
// https://team.sa-mp.com/wiki/PlayerSpectatePlayer.html
// https://team.sa-mp.com/wiki/PlayerSpectateVehicle.html

#define SPECTATE_MODE_NORMAL		1
#define SPECTATE_MODE_FIXED		2
#define SPECTATE_MODE_SIDE		3

native TogglePlayerSpectating(playerid, toggle);
native PlayerSpectatePlayer(playerid, targetplayerid, mode = SPECTATE_MODE_NORMAL);
native PlayerSpectateVehicle(playerid, targetvehicleid, mode = SPECTATE_MODE_NORMAL);

//====================================================================================

// Vice Multi-Player Actor Functions // added in RC 2-9-2 and ++;

// https://sampwiki.blast.hk/wiki/Category:Actor

native CreateActor( modelid, Float:X, Float:Y, Float:Z, Float:Rotation ); // RC 2-9-2 T1
native DestroyActor( actorid ); 

native IsValidActor( actorid );

native IsActorStreamedIn( actorid, forplayerid ); // https://sampwiki.blast.hk/wiki/IsActorStreamedIn // SA-MP 0.3.7 // RC 8-5 // 0.1.8.5

native GetActorVirtualWorld( actorid );		// RC 3 // RC 4-2 T5 Update
native SetActorVirtualWorld( actorid, vworld );	// RC 3 // RC 4-2 T5 Update

native ToggleActorCollision( actorid, toggle ); // RC 8 T8 // experimental func // test
native ToggleActorCollisionForPlayer( playerid, actorid, toggle ); // RC 8 T8 // experimental func // test

native ToggleActorVisible( actorid, toggle ); // RC 8-2 T9 // 0x0337
native ToggleActorVisibleForPlayer( playerid, actorid, toggle ); // RC 8-2 T9

native GetActorPos( actorid, &Float:X, &Float:Y, &Float:Z );
native SetActorPos( actorid, Float:X, Float:Y, Float:Z );

native GetActorFacingAngle( actorid, &Float:ang );
native SetActorFacingAngle( actorid, Float:ang );

native SetActorSkin( actorid, skinid ); // 0.1.8.6

native IsActorFreezePosState( actorid ); // 0.1.8.6
native SetActorFreezePosState( actorid, freeze = false ); // 0.1.8.6 // 0x04D7 // https://gtamods.com/wiki/04D7

native GetActorHealth( actorid, &Float:health ); // https://sampwiki.blast.hk/wiki/GetActorHealth // SA-MP 0.3.7 // RC 2-9-2 T4
native SetActorHealth( actorid, Float:health );  // https://sampwiki.blast.hk/wiki/SetActorHealth // SA-MP 0.3.7 // RC 2-9-2 T4 // https://gtamods.com/wiki/0223

native SetActorInvulnerable( actorid, invulnerable = true ); // RC 2-9-2 T5
native IsActorInvulnerable( actorid ); // RC 2-9-2 T5

native ToggleActorCriticalHits( actorid, bool ); // https://gtamods.com/wiki/0446 // RC 8-3 T4

#define ANIMGROUP_STD_PED		0
#define ANIMGROUP_PLAYER_PED		30
#define ANIMGROUP_PLAYER_ROCKET_PED	31
#define ANIMGROUP_PLAYER_1ARMED_PED	32
#define ANIMGROUP_PLAYER_2ARMED_PED	33
#define ANIMGROUP_PLAYER_BBBAT_PED	34
#define ANIMGROUP_PLAYER_CHAINSAW_PED	35
#define ANIMGROUP_SHUFFLE_PED		36
#define ANIMGROUP_OLD_PED		37
#define ANIMGROUP_GANG1_PED		38
#define ANIMGROUP_GANG2_PED		39
#define ANIMGROUP_FAT_PED		40		
#define ANIMGROUP_OLDFAT_PED		41
#define ANIMGROUP_JOGGER_PED		42
#define ANIMGROUP_STD_WOMANPED		43
#define ANIMGROUP_SHOPPING_WOMANPED	44
#define ANIMGROUP_BUSY_WOMANPED		45
#define ANIMGROUP_SEXY_WOMANPED		46
#define ANIMGROUP_FAT_WOMANPED		47
#define ANIMGROUP_OLD_WOMANPED		48
#define ANIMGROUP_JOGGER_WOMANPED	49
#define ANIMGROUP_PANIC_CHUNKYPED	50 // last

native SetActorAnimGroup(actorid, animgroupid); // RC 8 T8 // 0x0245 // eax+1F4h // https://gtamods.com/wiki/0245

#define ACTOR_MOVE_TYPE_WALK		0 // RC 2-9-3 // fixed
#define ACTOR_MOVE_TYPE_RUN		1 // RC 2-9-3 // fixed
#define ACTOR_MOVE_TYPE_SPRINT	2 // RC 2-9-3 // fixed in RC 8-4-7

native ActorMoveTo(actorid, movetype, Float:X, Float:Y, Float:Z ); // only for test // RC 2-9-3 "movetype" update

//------------------------------------------------------------------------------------

native ResetActorWeapons(actorid); // ClearWeapons // ClearAllWeapons // RemoveActorWeapons // opcode 0x048F // 0x4FF740 // RC 8-3 T7

native SetActorWeapon(actorid, weaponid); // RC 3 // only for test

//------------------------------------------------------------------------------------

#define ACTOR_PED_FLAG_0x14C 1 // #define PED_FLAG_0x14C 1
#define ACTOR_PED_FLAG_0x14D 2

native ToggleActorPedFlag(actorid, flag, bit, bool); // 0.1.8.5 T8

native ToggleActorBleeding(actorid, toggle); // RC 3 // https://gtamods.com/wiki/0332

native ToggleActorArrow(actorid, toggle); // RC 3 // https://gtamods.com/wiki/0187
native ToggleActorArrowForPlayer(playerid, actorid, toggle); // RC 3 // https://gtamods.com/wiki/0187

native SetActorWaitState( actorid, stateid, time ); // https://gtamods.com/wiki/0372 // RC 5-2 T10 // RC 6 T1 // RC 7 T1 Fix

native ApplyActorAnimation( actorid, animgroupid, animid, Float:blend ); // RC 5-2 T10 // RC 7 T1 Fix
native ClearActorAnimations( actorid ); // 0.1.8.6 // 0.3.7 // https://sampwiki.blast.hk/wiki/ClearActorAnimations // https://gtamods.com/wiki/0579

native PutActorInVehicle(actorid, vehicleid, seatid); // RC 3 // only for test
native RemoveActorFromVehicleAndPutAt(actorid, Float:x, Float:y, Float:z); // RC 3 // only for test

native ActorExitFromCurrentVehicle(actorid); // RemoveActorFromVehicle // RC 3 // only for test

native ActorEnterVehicle(actorid, vehicleid, passenger); // 0.1.8.5.5

native ClearActorObjective(actorid); // RC 8-3 T7 // opcode 0x011C

native SetActorToKillActor(actorid, actortargetid); // RC 8-2 T9
native SetActorToKillPlayer(actorid, playerid); // RC 8-2 T9 // RC 8-2 T10 update

native DetachActorFromEntity(actorid); // 0x0465 // RC 8-3 T7

#define FACING_FORWARD	0
#define FACING_LEFT		1
#define FACING_BACK		2
#define FACING_RIGHT	3

native AttachActorToVehicle(actorid, vehicleid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, iFacing, Float:fRange, iWeapon); // 0x0464 // RC 8-3 T7
native AttachActorToObject(actorid, objectid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, iFacing, Float:fRange, iWeapon); // 0x04F4 // RC 8-3 T7


//====================================================================================


