-376 Removals
+430 Additions
; #### SAMP UDF R16 ####; #### SAMP UDF R16 ####
; SAMP Version: 0.3.7; SAMP Version: 0.3.7
; Written by Chuck_Floyd ; Written by Chuck_Floyd
; https://github.com/FrozenBrain; https://github.com/FrozenBrain
; Modified by Suchty112; Modified by Suchty112
; https://github.com/Suchty112; https://github.com/Suchty112
; Modified by: paul-phoenix; Modified by: paul-phoenix
; https://github.com/paul-phoenix; https://github.com/paul-phoenix
; Modified by: Agrippa1994; Modified by: Agrippa1994
; https://github.com/agrippa1994; https://github.com/agrippa1994
; Modified by: RawDev and ELon; Modified by: RawDev and ELon
; Refactoring by: Peek
; https://github.com/pkfln
; Do not remove these lines.; Do not remove these lines.
; ####################; ####################
; ErrorLevels; ######################### Error levels #########################
global ERROR_OK := 0global ERROR_OK := 0
global ERROR_PROCESS_NOT_FOUND := 1global ERROR_PROCESS_NOT_FOUND := 1
global ERROR_OPEN_PROCESS := 2global ERROR_OPEN_PROCESS := 2
global ERROR_INVALID_HANDLE := 3global ERROR_INVALID_HANDLE := 3
global ERROR_MODULE_NOT_FOUND := 4global ERROR_MODULE_NOT_FOUND := 4
global ERROR_ENUM_PROCESS_MODULES := 5global ERROR_ENUM_PROCESS_MODULES := 5
global ERROR_ZONE_NOT_FOUND := 6global ERROR_ZONE_NOT_FOUND := 6
global ERROR_CITY_NOT_FOUND := 7global ERROR_CITY_NOT_FOUND := 7
global ERROR_READ_MEMORY := 8global ERROR_READ_MEMORY := 8
global ERROR_WRITE_MEMORY := 9global ERROR_WRITE_MEMORY := 9
global ERROR_ALLOC_MEMORY := 10global ERROR_ALLOC_MEMORY := 10
global ERROR_FREE_MEMORY := 11global ERROR_FREE_MEMORY := 11
global ERROR_WAIT_FOR_OBJECT := 12global ERROR_WAIT_FOR_OBJECT := 12
global ERROR_CREATE_THREAD := 13global ERROR_CREATE_THREAD := 13
; GTA Addresses; ######################### GTA addresses #########################
global ADDR_ZONECODE := 0xA49AD4 ;Player Zoneglobal ADDR_ZONECODE := 0xA49AD4 ;Player Zone
global ADDR_POSITION_X := 0xB6F2E4 ;Player X Positionglobal ADDR_POSITION_X := 0xB6F2E4 ;Player X Position
global ADDR_POSITION_Y := 0xB6F2E8 ;Player Y Positionglobal ADDR_POSITION_Y := 0xB6F2E8 ;Player Y Position
global ADDR_POSITION_Z := 0xB6F2EC ;Player Z Positionglobal ADDR_POSITION_Z := 0xB6F2EC ;Player Z Position
global ADDR_CPED_PTR := 0xB6F5F0 ;Player CPED Pointerglobal ADDR_CPED_PTR := 0xB6F5F0 ;Player CPED Pointer
global ADDR_CPED_HPOFF := 0x540 ;Player Healthglobal ADDR_CPED_HPOFF := 0x540 ;Player Health
global ADDR_CPED_ARMOROFF := 0x548 ;Player Armourglobal ADDR_CPED_ARMOROFF := 0x548 ;Player Armour
global ADDR_CPED_MONEY := 0x0B7CE54 ;Player Moneyglobal ADDR_CPED_MONEY := 0x0B7CE54 ;Player Money
global ADDR_CPED_INTID := 0xA4ACE8 ;Player Interior-IDglobal ADDR_CPED_INTID := 0xA4ACE8 ;Player Interior-ID
global ADDR_CPED_SKINIDOFF := 0x22 ;Player Skin-IDglobal ADDR_CPED_SKINIDOFF := 0x22 ;Player Skin-ID
;;
global ADDR_VEHICLE_PTR := 0xBA18FC ;Vehicle CPED Pointerglobal ADDR_VEHICLE_PTR := 0xBA18FC ;Vehicle CPED Pointer
global ADDR_VEHICLE_HPOFF := 0x4C0 ;Vehicle Healthglobal ADDR_VEHICLE_HPOFF := 0x4C0 ;Vehicle Health
global ADDR_VEHICLE_DOORSTATE := 0x4F8 ;Vehicle Door Statusglobal ADDR_VEHICLE_DOORSTATE := 0x4F8 ;Vehicle Door Status
global ADDR_VEHICLE_ENGINESTATE := 0x428 ;Vehicle Engine Statusglobal ADDR_VEHICLE_ENGINESTATE := 0x428 ;Vehicle Engine Status
global ADDR_VEHICLE_LIGHTSTATE := 0x584 ;Vehicle Light Statusglobal ADDR_VEHICLE_LIGHTSTATE := 0x584 ;Vehicle Light Status
global ADDR_VEHICLE_MODEL := 0x22 ;Vehicle Car-ID & Car-Nameglobal ADDR_VEHICLE_MODEL := 0x22 ;Vehicle Car-ID & Car-Name
global ADDR_VEHICLE_TYPE := 0x590 ;Vehicle Typ-ID (1 = Car)global ADDR_VEHICLE_TYPE := 0x590 ;Vehicle Typ-ID (1 = Car)
global ADDR_VEHICLE_DRIVER := 0x460 ;Vehicle Driverglobal ADDR_VEHICLE_DRIVER := 0x460 ;Vehicle Driver
global ADDR_VEHICLE_X := 0x44 ;Vehicle Speed Xglobal ADDR_VEHICLE_X := 0x44 ;Vehicle Speed X
global ADDR_VEHICLE_Y := 0x48 ;Vehicle Speed Yglobal ADDR_VEHICLE_Y := 0x48 ;Vehicle Speed Y
global ADDR_VEHICLE_Z := 0x4C ;Vehicle Speed Zglobal ADDR_VEHICLE_Z := 0x4C ;Vehicle Speed Z
global oAirplaneModels := [417, 425, 447, 460, 469, 476, 487, 488, 497, 511, 512, 513, 519, 520, 548, 553, 563, 577, 592, 593]global oAirplaneModels := [417, 425, 447, 460, 469, 476, 487, 488, 497, 511, 512, 513, 519, 520, 548, 553, 563, 577, 592, 593]
global oBikeModels := [481,509,510]global oBikeModels := [481,509,510]
global ovehicleNames := ["Landstalker","Bravura","Buffalo","Linerunner","Perrenial","Sentinel","Dumper","Firetruck","Trashmaster","Stretch","Manana","Infernus","Voodoo","Pony","Mule","Cheetah","Ambulance","Leviathan","Moonbeam","Esperanto","Taxi","Washington","Bobcat","Whoopee","BFInjection","Hunter","Premier","Enforcer","Securicar","Banshee","Predator","Bus","Rhino","Barracks","Hotknife","Trailer","Previon","Coach","Cabbie","Stallion","Rumpo","RCBandit","Romero","Packer","Monster","Admiral","Squalo","Seasparrow","Pizzaboy","Tram","Trailer","Turismo","Speeder","Reefer","Tropic","Flatbed","Yankee","Caddy","Solair","Berkley'sRCVan","Skimmer","PCJ-600","Faggio","Freeway","RCBaron","RCRaider","Glendale","Oceanic","Sanchez","Sparrow","Patriot","Quad","Coastguard","Dinghy","Hermes","Sabre","Rustler","ZR-350","Walton","Regina","Comet","BMX","Burrito","Camper","Marquis","Baggage","Dozer","Maverick","NewsChopper","Rancher","FBIRancher","Virgo","Greenwood","Jetmax","Hotring","Sandking","BlistaCompact","PoliceMaverick","Boxvillde","Benson","Mesa","RCGoblin","HotringRacerA","HotringRacerB","BloodringBanger","Rancher","SuperGT","Elegant","Journey","Bike","MountainBike","Beagle","Cropduster","Stunt","Tanker","Roadtrain","Nebula","Majestic","Buccaneer","Shamal","hydra","FCR-900","NRG-500","HPV1000","CementTruck","TowTruck","Fortune","Cadrona","FBITruck","Willard","Forklift","Tractor","Combine","Feltzer","Remington","Slamvan","Blade","Freight","Streak","Vortex","Vincent","Bullet","Clover","Sadler","Firetruck","Hustler","Intruder","Primo","Cargobob","Tampa","Sunrise","Merit","Utility","Nevada","Yosemite","Windsor","Monster","Monster","Uranus","Jester","Sultan","Stratum","Elegy","Raindance","RCTiger","Flash","Tahoma","Savanna","Bandito","FreightFlat","StreakCarriage","Kart","Mower","Dune","Sweeper","Broadway","Tornado","AT-400","DFT-30","Huntley","Stafford","BF-400","NewsVan","Tug","Trailer","Emperor","Wayfarer","Euros","Hotdog","Club","FreightBox","Trailer","Andromada","Dodo","RCCam","Launch","PoliceCar","PoliceCar","PoliceCar","PoliceRanger","Picador","S.W.A.T","Alpha","Phoenix","GlendaleShit","SadlerShit","Luggage","Luggage","Stairs","Boxville","Tiller","UtilityTrailer"]global ovehicleNames := ["Landstalker","Bravura","Buffalo","Linerunner","Perrenial","Sentinel","Dumper","Firetruck","Trashmaster","Stretch","Manana","Infernus","Voodoo","Pony","Mule","Cheetah","Ambulance","Leviathan","Moonbeam","Esperanto","Taxi","Washington","Bobcat","Whoopee","BFInjection","Hunter","Premier","Enforcer","Securicar","Banshee","Predator","Bus","Rhino","Barracks","Hotknife","Trailer","Previon","Coach","Cabbie","Stallion","Rumpo","RCBandit","Romero","Packer","Monster","Admiral","Squalo","Seasparrow","Pizzaboy","Tram","Trailer","Turismo","Speeder","Reefer","Tropic","Flatbed","Yankee","Caddy","Solair","Berkley'sRCVan","Skimmer","PCJ-600","Faggio","Freeway","RCBaron","RCRaider","Glendale","Oceanic","Sanchez","Sparrow","Patriot","Quad","Coastguard","Dinghy","Hermes","Sabre","Rustler","ZR-350","Walton","Regina","Comet","BMX","Burrito","Camper","Marquis","Baggage","Dozer","Maverick","NewsChopper","Rancher","FBIRancher","Virgo","Greenwood","Jetmax","Hotring","Sandking","BlistaCompact","PoliceMaverick","Boxvillde","Benson","Mesa","RCGoblin","HotringRacerA","HotringRacerB","BloodringBanger","Rancher","SuperGT","Elegant","Journey","Bike","MountainBike","Beagle","Cropduster","Stunt","Tanker","Roadtrain","Nebula","Majestic","Buccaneer","Shamal","hydra","FCR-900","NRG-500","HPV1000","CementTruck","TowTruck","Fortune","Cadrona","FBITruck","Willard","Forklift","Tractor","Combine","Feltzer","Remington","Slamvan","Blade","Freight","Streak","Vortex","Vincent","Bullet","Clover","Sadler","Firetruck","Hustler","Intruder","Primo","Cargobob","Tampa","Sunrise","Merit","Utility","Nevada","Yosemite","Windsor","Monster","Monster","Uranus","Jester","Sultan","Stratum","Elegy","Raindance","RCTiger","Flash","Tahoma","Savanna","Bandito","FreightFlat","StreakCarriage","Kart","Mower","Dune","Sweeper","Broadway","Tornado","AT-400","DFT-30","Huntley","Stafford","BF-400","NewsVan","Tug","Trailer","Emperor","Wayfarer","Euros","Hotdog","Club","FreightBox","Trailer","Andromada","Dodo","RCCam","Launch","PoliceCar","PoliceCar","PoliceCar","PoliceRanger","Picador","S.W.A.T","Alpha","Phoenix","GlendaleShit","SadlerShit","Luggage","Luggage","Stairs","Boxville","Tiller","UtilityTrailer"]
global oweaponNames := ["Fist","Brass Knuckles","Golf Club","Nightstick","Knife","Baseball Bat","Shovel","Pool Cue","Katana","Chainsaw","Purple Dildo","Dildo","Vibrator","Silver Vibrator","Flowers","Cane","Grenade","Tear Gas","Molotov Cocktail", "", "", "", "9mm","Silenced 9mm","Desert Eagle","Shotgun","Sawnoff Shotgun","Combat Shotgun","Micro SMG/Uzi","MP5","AK-47","M4","Tec-9","Country Rifle","Sniper Rifle","RPG","HS Rocket","Flamethrower","Minigun","Satchel Charge","Detonator","Spraycan","Fire Extinguisher","Camera","Night Vis Goggles","Thermal Goggles","Parachute"]global oweaponNames := ["Fist","Brass Knuckles","Golf Club","Nightstick","Knife","Baseball Bat","Shovel","Pool Cue","Katana","Chainsaw","Purple Dildo","Dildo","Vibrator","Silver Vibrator","Flowers","Cane","Grenade","Tear Gas","Molotov Cocktail", "", "", "", "9mm","Silenced 9mm","Desert Eagle","Shotgun","Sawnoff Shotgun","Combat Shotgun","Micro SMG/Uzi","MP5","AK-47","M4","Tec-9","Country Rifle","Sniper Rifle","RPG","HS Rocket","Flamethrower","Minigun","Satchel Charge","Detonator","Spraycan","Fire Extinguisher","Camera","Night Vis Goggles","Thermal Goggles","Parachute"]
global oradiostationNames := ["Playback FM", "K Rose", "K-DST", "Bounce FM", "SF-UR", "Radio Los Santos", "Radio X", "CSR 103.9", "K-JAH West", "Master Sounds 98.3", "WCTR Talk Radio", "User Track Player", "Radio Off"]global oradiostationNames := ["Playback FM", "K Rose", "K-DST", "Bounce FM", "SF-UR", "Radio Los Santos", "Radio X", "CSR 103.9", "K-JAH West", "Master Sounds 98.3", "WCTR Talk Radio", "User Track Player", "Radio Off"]
global oweatherNames := ["EXTRASUNNY_LA", "SUNNY_LA", "EXTRASUNNY_SMOG_LA", "SUNNY_SMOG_LA", "CLOUDY_LA", "SUNNY_SF", "EXTRASUNNY_SF", "CLOUDY_SF", "RAINY_SF", "FOGGY_SF", "SUNNY_VEGAS", "EXTRASUNNY_VEGAS", "CLOUDY_VEGAS", "EXTRASUNNY_COUNTRYSIDE", "SUNNY_COUNTRYSIDE", "CLOUDY_COUNTRYSIDE", "RAINY_COUNTRYSIDE", "EXTRASUNNY_DESERT", "SUNNY_DESERT", "SANDSTORM_DESERT", "UNDERWATER", "EXTRACOLOURS_1", "EXTRACOLOURS_2"]global oweatherNames := ["EXTRASUNNY_LA", "SUNNY_LA", "EXTRASUNNY_SMOG_LA", "SUNNY_SMOG_LA", "CLOUDY_LA", "SUNNY_SF", "EXTRASUNNY_SF", "CLOUDY_SF", "RAINY_SF", "FOGGY_SF", "SUNNY_VEGAS", "EXTRASUNNY_VEGAS", "CLOUDY_VEGAS", "EXTRASUNNY_COUNTRYSIDE", "SUNNY_COUNTRYSIDE", "CLOUDY_COUNTRYSIDE", "RAINY_COUNTRYSIDE", "EXTRASUNNY_DESERT", "SUNNY_DESERT", "SANDSTORM_DESERT", "UNDERWATER", "EXTRACOLOURS_1", "EXTRACOLOURS_2"]
; SAMP Addresses; ########################## SAMP addresses ##########################
global ADDR_SAMP_INCHAT_PTR := 0x21a10cglobal ADDR_SAMP_INCHAT_PTR := 0x21a10c
global ADDR_SAMP_INCHAT_PTR_OFF := 0x55global ADDR_SAMP_INCHAT_PTR_OFF := 0x55
global ADDR_SAMP_USERNAME := 0x219A6Fglobal ADDR_SAMP_USERNAME := 0x219A6F
global FUNC_SAMP_SENDCMD := 0x65c60global FUNC_SAMP_SENDCMD := 0x65c60
global FUNC_SAMP_SENDSAY := 0x57f0global FUNC_SAMP_SENDSAY := 0x57f0
global FUNC_SAMP_ADDTOCHATWND := 0x64520global FUNC_SAMP_ADDTOCHATWND := 0x64520
global ADDR_SAMP_CHATMSG_PTR := 0x21a0e4global ADDR_SAMP_CHATMSG_PTR := 0x21a0e4
global FUNC_SAMP_SHOWGAMETEXT := 0x9c2c0global FUNC_SAMP_SHOWGAMETEXT := 0x9c2c0
global FUNC_SAMP_PLAYAUDIOSTR := 0x62da0global FUNC_SAMP_PLAYAUDIOSTR := 0x62da0
global FUNC_SAMP_STOPAUDIOSTR := 0x629a0global FUNC_SAMP_STOPAUDIOSTR := 0x629a0
; ########################## Dialog Styles ##########################
global DIALOG_STYLE_MSGBOX := 0
global DIALOG_STYLE_INPUT := 1; ########################## Dialog styles ##########################
global DIALOG_STYLE_LIST := 2global DIALOG_STYLE_MSGBOX := 0
global DIALOG_STYLE_PASSWORD := 3global DIALOG_STYLE_INPUT := 1
global DIALOG_STYLE_TABLIST := 4global DIALOG_STYLE_LIST := 2
global DIALOG_STYLE_TABLIST_HEADERS := 5global DIALOG_STYLE_PASSWORD := 3
global DIALOG_STYLE_TABLIST := 4
global DIALOG_STYLE_TABLIST_HEADERS := 5
; ######################### Dialog structure #########################
global SAMP_DIALOG_STRUCT_PTR := 0x21A0B8
global SAMP_DIALOG_PTR1_OFFSET := 0x1C
global SAMP_DIALOG_LINES_OFFSET := 0x44C
global SAMP_DIALOG_INDEX_OFFSET := 0x443
global SAMP_DIALOG_BUTTON_HOVERING_OFFSET := 0x465
global SAMP_DIALOG_BUTTON_CLICKED_OFFSET := 0x466
global SAMP_DIALOG_PTR2_OFFSET := 0x20
global SAMP_DIALOG_LINECOUNT_OFFSET := 0x150
global SAMP_DIALOG_OPEN_OFFSET := 0x28
global SAMP_DIALOG_STYLE_OFFSET := 0x2C
global SAMP_DIALOG_ID_OFFSET := 0x30
global SAMP_DIALOG_TEXT_PTR_OFFSET := 0x34
global SAMP_DIALOG_CAPTION_OFFSET := 0x40
global FUNC_SAMP_SHOWDIALOG := 0x6B9C0
global FUNC_SAMP_CLOSEDIALOG := 0x6C040
; ######################### Dialog Structure #########################
global SAMP_DIALOG_STRUCT_PTR := 0x21A0B8
global SAMP_DIALOG_PTR1_OFFSET := 0x1C
global SAMP_DIALOG_LINES_OFFSET := 0x44C
global SAMP_DIALOG_INDEX_OFFSET := 0x443
global SAMP_DIALOG_BUTTON_HOVERING_OFFSET := 0x465
global SAMP_DIALOG_BUTTON_CLICKED_OFFSET := 0x466
global SAMP_DIALOG_PTR2_OFFSET := 0x20
global SAMP_DIALOG_LINECOUNT_OFFSET := 0x150
global SAMP_DIALOG_OPEN_OFFSET := 0x28
global SAMP_DIALOG_STYLE_OFFSET := 0x2C
global SAMP_DIALOG_ID_OFFSET := 0x30
global SAMP_DIALOG_TEXT_PTR_OFFSET := 0x34
global SAMP_DIALOG_CAPTION_OFFSET := 0x40
global FUNC_SAMP_SHOWDIALOG := 0x6B9C0
global FUNC_SAMP_CLOSEDIALOG := 0x6C040
; ######################### Scoreboard #########################
global FUNC_UPDATESCOREBOARD := 0x8A10global FUNC_UPDATESCOREBOARD := 0x8A10
global SAMP_INFO_OFFSET := 0x21A0F8global SAMP_INFO_OFFSET := 0x21A0F8
global ADDR_SAMP_CRASHREPORT := 0x5CF2Cglobal ADDR_SAMP_CRASHREPORT := 0x5CF2C
global SAMP_PPOOLS_OFFSET := 0x3CDglobal SAMP_PPOOLS_OFFSET := 0x3CD
global SAMP_PPOOL_PLAYER_OFFSET := 0x18global SAMP_PPOOL_PLAYER_OFFSET := 0x18
global SAMP_SLOCALPLAYERID_OFFSET := 0x4global SAMP_SLOCALPLAYERID_OFFSET := 0x4
global SAMP_ISTRLEN_LOCALPLAYERNAME_OFFSET := 0x1Aglobal SAMP_ISTRLEN_LOCALPLAYERNAME_OFFSET := 0x1A
global SAMP_SZLOCALPLAYERNAME_OFFSET := 0xAglobal SAMP_SZLOCALPLAYERNAME_OFFSET := 0xA
global SAMP_PSZLOCALPLAYERNAME_OFFSET := 0xAglobal SAMP_PSZLOCALPLAYERNAME_OFFSET := 0xA
global SAMP_PREMOTEPLAYER_OFFSET := 0x2Eglobal SAMP_PREMOTEPLAYER_OFFSET := 0x2E
global SAMP_ISTRLENNAME___OFFSET := 0x1Cglobal SAMP_ISTRLENNAME___OFFSET := 0x1C
global SAMP_SZPLAYERNAME_OFFSET := 0xCglobal SAMP_SZPLAYERNAME_OFFSET := 0xC
global SAMP_PSZPLAYERNAME_OFFSET := 0xCglobal SAMP_PSZPLAYERNAME_OFFSET := 0xC
global SAMP_ILOCALPLAYERPING_OFFSET := 0x26global SAMP_ILOCALPLAYERPING_OFFSET := 0x26
global SAMP_ILOCALPLAYERSCORE_OFFSET := 0x2Aglobal SAMP_ILOCALPLAYERSCORE_OFFSET := 0x2A
global SAMP_IPING_OFFSET := 0x28global SAMP_IPING_OFFSET := 0x28
global SAMP_ISCORE_OFFSET := 0x24global SAMP_ISCORE_OFFSET := 0x24
global SAMP_ISNPC_OFFSET := 0x4global SAMP_ISNPC_OFFSET := 0x4
global SAMP_PLAYER_MAX := 1004global SAMP_PLAYER_MAX := 1004
global CheckpointCheck := 0xC7DEEA
global rmaddrs := [0xC7DEC8, 0xC7DECC, 0xC7DED0]
; Sizes; ######################### Checkpoints #########################
global SIZE_SAMP_CHATMSG := 0xFCglobal ADDR_CP_CHECK := 0xC7DEEA
; Internalglobal ADDR_REDMARKER := [0xC7DEC8, 0xC7DECC, 0xC7DED0]
global hGTA := 0x0
global dwGTAPID := 0x0
global dwSAMP := 0x0; ######################### Sizes #########################
global pMemory := 0x0global SIZE_SAMP_CHATMSG := 0xFC
global pParam1 := 0x0
global pParam2 := 0x0
global pParam3 := 0x0; ######################### Internal #########################
global pParam4 := 0x0global hGTA := 0x0
global pParam5 := 0x0global dwGTAPID := 0x0
global pInjectFunc := 0x0global dwSAMP := 0x0
global nZone := 1global pMemory := 0x0
global nCity := 1global pParam1 := 0x0
global bInitZaC := 0global pParam2 := 0x0
global iRefreshScoreboard := 0global pParam3 := 0x0
global oScoreboardData := ""global pParam4 := 0x0
global iRefreshHandles := 0global pParam5 := 0x0
global iUpdateTick := 2500 ;time in ms, used for getPlayerNameById etc. to refresh dataglobal pInjectFunc := 0x0
global nZone := 1
global nCity := 1
global bInitZaC := 0
global iRefreshScoreboard := 0
global oScoreboardData := ""
global iRefreshHandles := 0
global iUpdateTick := 2500 ;time in ms, used for GetPlayerNameById etc. to refresh data
; ###############################################################################################################################; ###############################################################################################################################
; # #
; # SAMP-Funktionen: #; # SAMP-Funktionen: #
; # - IsSAMPAvailable() Prüft, ob man in den Chat schreiben kann & ob GTA geladen ist #; # --------------------------------------------------------------------------------------------------------------------------- #
; # - IsInChat() Prüft, ob der Spieler gerade chattet oder in einem Dialog ist #; # #
; # - GetPlayername() Liest den Namen des Spielers aus #; # - IsSAMPAvailable() Prüft, ob man in den Chat schreiben kann & ob GTA geladen ist #
; # - GetId() Liest die Id des Spielers aus #; # - IsInChat() Prüft, ob der Spieler gerade chattet oder in einem Dialog ist #
; # - SendChat(wText) Sendet eine Nachricht od. einen Befehl direkt an den Server #; # - GetPlayerName() Liest den Namen des Spielers aus #
; # - AddChatMessage(wText) Fügt eine Zeile in den Chat ein (nur für den Spieler sichtbar) #; # - GetPlayerId() Liest die ID des Spielers aus #
; # - ShowGameText(wText, dwTime, dwTextsize) Zeigt einen Text inmitten des Bildschirmes an #; # - SendChat(wText) Sendet eine Nachricht oder einen Befehl direkt an den Server #
; # - AddChatMessage(wText) Fügt eine Zeile in den Chat ein (nur für den Spieler sichtbar) #
; # - ShowGameText(wText, dwTime, dwTextstyle) Zeigt einen Text inmitten des Bildschirmes an #
; # - PlayAudioStream(wUrl) Spielt einen "Audio Stream" ab #; # - PlayAudioStream(wUrl) Spielt einen "Audio Stream" ab #
; # - StopAudioStream() Stoppt den aktuellen Audio Stream #; # - StopAudioStream() Stoppt den aktuellen Audio Stream #
; # - GetChatLine(Line, Output) Liest die eingestellte Zeile aus, #; # - GetChatLine(Line, ByRef Output) Liest die eingestellte Zeile aus, #
; # Optionale Parameter (timestamp=0, color=0) #; # Optionale Parameter (timestamp=0, color=0) #
; # - BlockChatInput() Eine Funktion um Messages zum Server zu blockieren #; # - BlockChatInput() Eine Funktion, um Messages zum Server zu blockieren #
; # - UnBlockChatInput() Eine Funktion um Messages zum Server zu entblockieren #; # - UnBlockChatInput() Eine Funktion, um Messages zum Server zu entblockieren #
; # #
; # --------------------------------------------------------------------------------------------------------------------------- #; # --------------------------------------------------------------------------------------------------------------------------- #
; # #; # #
; # - GetServerName() Ermittelt den Server-Namen (HostName) #; # - GetServerName() Ermittelt den Server-Namen (HostName) #
; # - GetServerIP() Ermittelt die IP des Servers #; # - GetServerIp() Ermittelt die IP des Servers #
; # - SetIP() Kann eine ServerIP setzen; # - SetServerIp(IP) Kann eine ServerIP setzen #
; # - GetServerPort() Ermittelt den Port des Servers #; # - GetServerPort() Ermittelt den Port des Servers #
; # - CountOnlinePlayers() Ermittelt wie viele Spieler auf dem Server Online sind. #; # - CountOnlinePlayers() Ermittelt wie viele Spieler auf dem Server Online sind. #
; # #; # #
; # --------------------------------------------------------------------------------------------------------------------------- #; # --------------------------------------------------------------------------------------------------------------------------- #
; # #; # #
; # - GetWeatherID() Ermittelt ob der Spieler freezed ist #; # - GetWeatherId() Gibt die aktuelle Wetter ID zurück #
; # - GetWeatherName() Ermittelt ob der Spieler freezed ist #; # - GetWeatherName() Gibt den aktuellen Wetternamen zurück #
; # #; # #
; # --------------------------------------------------------------------------------------------------------------------------- #; # --------------------------------------------------------------------------------------------------------------------------- #
; # #; # #
; # - PatchRadio() (interner stuff) #; # - PatchRadio() (interner stuff) #
; # - UnPatchRadio() (interner stuff) #; # - UnPatchRadio() (interner stuff) #
; # #; # #
; ###############################################################################################################################; ###############################################################################################################################
; # SAMP Dialog Funktionen (v0.3.7): #; # SAMP Dialog Funktionen (v0.3.7): #
; # --------------------------------------------------------------------------------------------------------------------------- #; # --------------------------------------------------------------------------------------------------------------------------- #
; # - IsDialogOpen() - Prüft, ob gerade ein Dialog angezeigt wird (gibt true oder false zurück) #; # #
; # - GetDialogStyle() - Liest den Typ des (zuletzt) angezeigten Dialogs aus (0-5) #; # - IsDialogOpen() Prüft, ob gerade ein Dialog angezeigt wird (gibt true oder false zurück) #
; # - GetDialogID() - Liest die ID des (zuletzt) angezeigten Dialogs aus (auch vom Server) #; # - GetDialogStyle() Liest den Typ des (zuletzt) angezeigten Dialogs aus (0-5) #
; # - GetDialogID(id) - Setzt die ID des (zuletzt) angezeigten Dialogs auf [id] #; # - GetDialogId() Liest die ID des (zuletzt) angezeigten Dialogs aus (auch vom Server) #
; # - GetDialogIndex() - Liest die (zuletzt) ausgewählte Zeile des Dialogs aus #; # - SetDialogId(id) Setzt die ID des (zuletzt) angezeigten Dialogs #
; # - GetDialogCaption() - Liest die Überschrift des (zuletzt) angezeigten Dialogs aus #; # - GetDialogIndex() Liest die (zuletzt) ausgewählte Zeile des Dialogs aus #
; # - GetDialogText() - Liest den Text des (zuletzt) angezeigten Dialogs aus (auch bei Listen) #; # - GetDialogCaption() Liest die Überschrift des (zuletzt) angezeigten Dialogs aus #
; # - GetDialogLineCount() - Liest die Anzahl der Zeilen/Items des (zuletzt) angezeigten Dialogs aus #; # - GetDialogText() Liest den Text des (zuletzt) angezeigten Dialogs aus (auch bei Listen) #
; # - GetDialogLine(index) - Liest die Zeile an der Stelle [index] mittels getDialogText aus #; # - GetDialogLineCount() Liest die Anzahl der Zeilen/Items des (zuletzt) angezeigten Dialogs aus #
; # - GetDialogLines() - Liest die Zeilen mittels getDialogText aus (gibt ein Array zurück) #; # - GetDialogLine(index) Liest die Zeile an der Stelle [index] mittels GetDialogText aus #
; # - GsDialogButton1Selected() - Prüft, ob Button1 des Dialogs ausgewählt ist #; # - GetDialogLines() Liest die Zeilen mittels GetDialogText aus (gibt ein Array zurück) #
; # - GetDialogStructPtr() - Liest den Base Pointer zur Dialogstruktur aus (intern genutzt) #; # - IsDialogButton1Selected() Prüft, ob Button1 des Dialogs ausgewählt ist #
; # #; # - GetDialogStructPtr() Liest den Base Pointer zur Dialogstruktur aus (intern genutzt) #
; # - ShowDialog(style, caption, text, button1, button2, id) - Zeigt einen Dialog an (nur lokal) #; # #
; ###############################################################################################################################; # - ShowDialog(style, caption, text, Zeigt einen Dialog an (nur lokal) #
; # button1, button2, id) #
; # #
; ###############################################################################################################################; ###############################################################################################################################
; # #
; # Extra-Player-Funktionen: #; # Extra-Player-Funktionen: #
; # - GetTargetPed(dwPED) Zeigt die PED-ID, des Spielers, auf den man zielt. #; # --------------------------------------------------------------------------------------------------------------------------- #
; # #
; # - GetTargetPed(dwPED) Zeigt die PED-ID, des Spielers, auf den man zielt. #
; # - GetPedById(dwId) Zeigt die PED-Id zu der Id. #; # - GetPedById(dwId) Zeigt die PED-Id zu der Id. #
; # - GetIdByPed(dwId) Zeigt die Id der PED-Id. #; # - GetIdByPed(dwId) Zeigt die Id der PED-Id. #
; # - GetStreamedInPlayersInfo() Zeigt Informationen über die gestreamten Spieler. #; # - GetStreamedInPlayersInfo() Zeigt Informationen über die gestreamten Spieler. #
; # - CallFuncForAllStreamedInPlayers() Führt bestimmte Funktionen, für die gestreamten Spieler aus. #; # - CallFuncForAllStreamedInPlayers() Führt bestimmte Funktionen, für die gestreamten Spieler aus. #
; # - GetDist(pos1,pos2) Rechnet den Abstand zwischen zwei Positionen aus. #; # - GetDist(pos1,pos2) Rechnet den Abstand zwischen zwei Positionen aus. #
; # - GetClosestPlayerPed() Zeigt die PED-ID, des Spielers, der am nahesten zu einem steht. #; # - GetClosestPlayerPed() Zeigt die PED-ID, des Spielers, der am nahesten zu einem steht. #
; # - GetClosestPlayerId() Zeigt die Id, des Spielers, der am nahesten zu einem steht. #; # - GetClosestPlayerId() Zeigt die Id, des Spielers, der am nahesten zu einem steht. #
; # - GetPedCoordinates(dwPED) Zeigt die Koordinaten, der PED-ID. #; # - GetPedCoordinates(dwPED) Zeigt die Koordinaten, der PED-ID. #
; # - GetTargetPosById(dwId) Zeigt die Position, zu der angegebenen Id. #; # - GetTargetPosById(dwId) Zeigt die Position, zu der angegebenen Id. #
; # - GetTargetPlayerSkinIdByPed(dwPED) Zeigt den Skin, zu der angegebenen PED-ID. #; # - GetTargetPlayerSkinIdByPed(dwPED) Zeigt den Skin, zu der angegebenen PED-ID. #
; # - GetTargetPlayerSkinIdById(dwId) Zeigt den Skin, zu der angegebenen ID. #; # - GetTargetPlayerSkinIdById(dwId) Zeigt den Skin, zu der angegebenen ID. #
; # - CalcScreenCoors(fX,fY,fZ) > WordToScreen Funktion < #; # - CalcScreenCoords(fX, fY, fZ) WorldToScreen Funktion #
; # #; # #
; ###############################################################################################################################
; # Extra-Player-Fahrzeug-Funktionen: #; # Extra-Player-Fahrzeug-Funktionen: #
; # - GetVehiclePointerByPed(dwPED) Zeigt die PED-ID des Autos. #; # --------------------------------------------------------------------------------------------------------------------------- #
; # - GetVehiclePointerById(dwId) Zeigt die PED-ID des Autos. #; # #
; # - GetVehiclePointerByPed(dwPED) Zeigt die PED-ID des Autos. #
; # - GetVehiclePointerById(dwId) Zeigt die PED-ID des Autos. #
; # - IsTargetInAnyVehicleByPed(dwPED) Zeigt ob der Spieler in einem Auto ist. #; # - IsTargetInAnyVehicleByPed(dwPED) Zeigt ob der Spieler in einem Auto ist. #
; # - IsTargetInAnyVehicleById(dwId) Zeigt ob der Spieler in einem Auto ist. #; # - IsTargetInAnyVehicleById(dwId) Zeigt ob der Spieler in einem Auto ist. #
; # - GetTargetVehicleHealthByPed(dwPED) Zeigt ob der Spieler in einem Auto ist. #; # - GetTargetVehicleHealthByPed(dwPED) Zeigt ob der Spieler in einem Auto ist. #
; # - GetTargetVehicleHealthById(dwId) Zeigt ob der Spieler in einem Auto ist. #; # - GetTargetVehicleHealthById(dwId) Zeigt ob der Spieler in einem Auto ist. #
; # - GetTargetVehicleTypeByPed(dwPED) Ermittelt den FahrzeugTyp (Auto, LKW etc.) #; # - GetTargetVehicleTypeByPed(dwPED) Ermittelt den FahrzeugTyp (Auto, LKW etc.) #
; # - GetTargetVehicleTypeById(dwId) Ermittelt den FahrzeugTyp (Auto, LKW etc.) #; # - GetTargetVehicleTypeById(dwId) Ermittelt den FahrzeugTyp (Auto, LKW etc.) #
; # - GetTarGetVehicleModelIdByPed(dwPED) Ermittelt die FahrzeuGmodell ID #; # - GetTargetVehicleModelIdByPed(dwPED) Ermittelt die FahrzeuGmodell ID #
; # - GetTargetVehicleModelIdById(dwId) Ermittelt die Fahrzeugmodell ID #; # - GetTargetVehicleModelIdById(dwId) Ermittelt die Fahrzeugmodell ID #
; # - GetTargetVehicleModelNameByPed(dwPED) Ermittelt den Fahrzeugmodell Namen #; # - GetTargetVehicleModelNameByPed(dwPED) Ermittelt den Fahrzeugmodell Namen #
; # - GetTargetVehicleModelNameById(dwId) Ermittelt den Fahrzeugmodell Namen #; # - GetTargetVehicleModelNameById(dwId) Ermittelt den Fahrzeugmodell Namen #
; # - GetTargetVehicleLightStateByPed(dwPED) Ermittelt den Lichtzustand des Autos #; # - GetTargetVehicleLightStateByPed(dwPED) Ermittelt den Lichtzustand des Autos #
; # - GetTargetVehicleLightStateById(dwId) Ermittelt den Lichtzustand des Autos #; # - GetTargetVehicleLightStateById(dwId) Ermittelt den Lichtzustand des Autos #
; # - GetTargetVehicleEngineStateByPed(dwPED) Ermittelt den Motorzustand des Autos #; # - GetTargetVehicleLockStateByPed(dwPED) Ermittelt ob das Auto auf oder zu ist #
; # - GetTargetVehicleEngineStateById(dwId) Ermittelt den Motorzustand des Autos #; # - GetTargetVehicleLockStateById(dwId) Ermittelt ob das Auto auf oder zu ist #
; # - GetTargetVehicleLockStateByPed(dwPED) Ermittelt ob das Auto auf oder zu ist #; # - GetTargetVehicleColor1ByPed(dwPED) Ermittelt die 1. Color-ID des Autos #
; # - GetTargetVehicleLockStateById(dwId) Ermittelt ob das Auto auf oder zu ist #; # - GetTargetVehicleColor1ById(dwId) Ermittelt die 1. Color-ID des Autos #
; # - GetTargetVehicleColor1ByPed(dwPED) Ermittelt die 1. Color-ID des Autos #; # - GetTargetVehicleColor2ByPed(dwPED) Ermittelt die 2. Color-ID des Autos #
; # - GetTargetVehicleColor1ById(dwId) Ermittelt die 1. Color-ID des Autos #; # - GetTargetVehicleColor2ById(dwId) Ermittelt die 2. Color-ID des Autos #
; # - GetTargetVehicleColor2ByPed(dwPED) Ermittelt die 2. Color-ID des Autos #; # - GetTargetVehicleSpeedByPed(dwPED) Ermittelt die Geschwindigkeit des Autos #
; # - GetTargetVehicleColor2ById(dwId) Ermittelt die 2. Color-ID des Autos #; # - GetTargetVehicleSpeedById(dwId) Ermittelt die Geschwindigkeit des Autos #
; # - GetTargetVehicleSpeedByPed(dwPED) Ermittelt die Geschwindigkeit des Autos #; # #
; # - GetTargetVehicleSpeedById(dwId) Ermittelt die Geschwindigkeit des Autos #
; # #
; ###############################################################################################################################; ###############################################################################################################################
; # #
; # Scoreboard-Funktionen: #; # Scoreboard-Funktionen: #
; # --------------------------------------------------------------------------------------------------------------------------- #
; # #
; # - GetPlayerScoreById(dwId) Zeigt den Score zu der Id #; # - GetPlayerScoreById(dwId) Zeigt den Score zu der Id #
; # - GetPlayerPingById(dwId) Zeigt den Ping zu der Id #; # - GetPlayerPingById(dwId) Zeigt den Ping zu der Id #
; # - GetPlayerNameById(dwId) Zeigt den Namen zu der Id #; # - GetPlayerNameById(dwId) Zeigt den Namen zu der Id #
; # - GetPlayerIdByName(wName) Zeigt die Id zu dem Namen #; # - GetPlayerIdByName(wName) Zeigt die Id zu dem Namen #
; # - UpdateScoreboardDataEx() Aktualisiert Scoreboard Inhalte (wird implizit aufgerufen) #; # - UpdateScoreboardDataEx() Aktualisiert Scoreboard Inhalte (wird implizit aufgerufen) #
; # - UpdateOScoreboardData() Aktualisiert Scoreboard Inhalte (wird implizit aufgerufen) #; # - UpdateOScoreboardData() Aktualisiert Scoreboard Inhalte (wird implizit aufgerufen) #
; # - IsNPCById(dwId) Zeigt an ob die ID ein NPC #; # - IsNPCById(dwId) Zeigt an ob die ID ein NPC #
; # #; # #
; ###############################################################################################################################; ###############################################################################################################################
; # #
; # Spielerfunktionen: #; # Spielerfunktionen: #
; # --------------------------------------------------------------------------------------------------------------------------- #
; # #
; # - GetPlayerHealth() Ermittelt die HP des Spielers #; # - GetPlayerHealth() Ermittelt die HP des Spielers #
; # - GetPlayerArmour() Ermittelt den Rüstungswert des Spielers #; # - GetPlayerArmor() Ermittelt den Rüstungswert des Spielers #
; # - GetPlayerInteriorId() Ermittelt die Interior ID wo der Spieler ist #; # - GetPlayerInteriorId() Ermittelt die Interior ID wo der Spieler ist #
; # - GetPlayerSkinId() Ermittelt die Skin ID des Spielers #; # - GetPlayerSkinId() Ermittelt die Skin ID des Spielers #
; # - GetPlayerMoney() Ermittelt den Kontostand des Spielers (nur GTA Intern) #; # - GetPlayerMoney() Ermittelt den Kontostand des Spielers (nur GTA Intern) #
; # - GetPlayerWanteds() Ermittelt die Wantedanzahl des Spielers (nur bis 6 Wanteds) #; # - GetPlayerWanteds() Ermittelt die Wantedanzahl des Spielers (nur bis 6 Wanteds) #
; # - GetPlayerWeaponId() Ermittelt die Waffen ID des Spielers #; # - GetPlayerWeaponId() Ermittelt die Waffen ID des Spielers #
; # - GetPlayerWeaponName() Ermittelt den Namen, der Waffe des Spielers #; # - GetPlayerWeaponName() Ermittelt den Namen, der Waffe des Spielers #
; # - GetPlayerState() Ermittelt den "Status" des Spielers (Zu Fuß, Fahrer, Tot) #; # - GetPlayerState() Ermittelt den "Status" des Spielers (Zu Fuss, Fahrer, Tot) #
; # - GetPlayerMapPosX() Ermittelt die X-Position auf der Map im Menu #; # - GetPlayerMapPosX() Ermittelt die X-Position auf der Map im Menu #
; # - GetPlayerMapPosY() Ermittelt die Y-Position auf der Map im Menu #; # - GetPlayerMapPosY() Ermittelt die Y-Position auf der Map im Menu #
; # - GetPlayerMapZoom() Ermittelt den Zoom auf der Map im Menu #; # - GetPlayerMapZoom() Ermittelt den Zoom auf der Map im Menu #
; # - IsPlayerFreezed() Ermittelt ob der Spieler freezed ist #; # - IsPlayerFreezed() Ermittelt ob der Spieler freezed ist #
; # #; # #
; ###############################################################################################################################; ###############################################################################################################################
; # #
; # Fahrzeugfunktionen: #; # Fahrzeugfunktionen: #
; # --------------------------------------------------------------------------------------------------------------------------- #
; # #
; # - IsPlayerInAnyVehicle() Ermittelt, ob sich der Spieler in einem Fahrzeug befindet #; # - IsPlayerInAnyVehicle() Ermittelt, ob sich der Spieler in einem Fahrzeug befindet #
; # - GetVehicleHealth() Ermittelt die HP des Fahrzeugs, in dem der Spieler sitzt #; # - GetVehicleHealth() Ermittelt die HP des Fahrzeugs, in dem der Spieler sitzt #
; # - IsPlayerDriver() Ermittelt ob der Spieler Fahrer des Auto's ist #; # - IsPlayerDriver() Ermittelt ob der Spieler Fahrer des Autos ist #
; # - GetVehicleType() Ermittelt den FahrzeugTyp (Auto, LKW etc.) #; # - GetVehicleType() Ermittelt den FahrzeugTyp (Auto, LKW etc.) #
; # - GetVehicleModelId() Ermittelt die Fahrzeugmodell ID #; # - GetVehicleModelId() Ermittelt die Fahrzeugmodell ID #
; # - GetVehicleModelName() Ermittelt den Fahrzeugmodell Namen #; # - GetVehicleModelName() Ermittelt den Fahrzeugmodell Namen #
; # - GetVehicleLightState() Ermittelt den Lichtzustand des Autos #; # - GetVehicleLightState() Ermittelt den Lichtzustand des Autos #
; # - GetVehicleEngineState() Ermittelt den Motorzustand des Autos #; # - GetVehicleEngineState() Ermittelt den Motorzustand des Autos #
; # - GetVehicleLockState() Ermittelt ob das Auto auf oder zu ist #; # - GetVehicleLockState() Ermittelt ob das Auto auf oder zu ist #
; # - GetVehicleColor1() Ermittelt die 1. Farb ID des Autos #; # - GetVehicleColor1() Ermittelt die 1. Farbe ID des Autos #
; # - GetVehicleColor2() Ermittelt die 2. Farb ID des Autos #; # - GetVehicleColor2() Ermittelt die 2. Farbe ID des Autos #
; # - GetVehicleSpeed() Ermittelt die Geschwindigkeit des Autos #; # - GetVehicleSpeed() Ermittelt die Geschwindigkeit des Autos #
; # - GetPlayerRadiostationID() Ermittelt die Radiostation-ID des Autos #; # - GetPlayerRadiostationId() Ermittelt die Radiostation-ID des Autos #
; # - GetPlayerRadiostationName() Ermittelt den Radiostation-Namen des Autos #; # - GetPlayerRadiostationName() Ermittelt den Radiostation-Namen des Autos #
; # #; # #
; ###############################################################################################################################; ###############################################################################################################################
; # #
; # Standpunktbestimmung: #; # Standpunktbestimmung: #
; # - GetCoordinates() Ermittelt die aktuelle Position (Koordinaten) #; # --------------------------------------------------------------------------------------------------------------------------- #
; # - GetPlayerPos(X,Y,Z) siehe oben drüber #; # #
; # #; # - GetPlayerCoordinates() Ermittelt die aktuelle Position (Koordinaten) #
; # - GetPlayerPos(X, Y, Z) siehe oben drüber #
; # #
; # --------------------------------------------------------------------------------------------------------------------------- #; # --------------------------------------------------------------------------------------------------------------------------- #
; # #; # #
; # - InitZonesAndCities() Initialisiert eine Liste aller Standartgebiete #; # - InitZonesAndCities() Initialisiert eine Liste aller Standartgebiete #
; # (Voraussetzung für die folgenden Funktionen dieser Kategorie) #; # (Voraussetzung für die folgenden Funktionen dieser Kategorie) #
; # - CalculateZone(X, Y, Z) Bestimmt die Zone (= Stadtteil) aus den geg. Koordinaten #; # - CalculateZone(X, Y, Z) Bestimmt die Zone (= Stadtteil) aus den geg. Koordinaten #
; # - CalculateCity(X, Y, Z) Bestimmt die Stadt aus den geg. Koordinaten #; # - CalculateCity(X, Y, Z) Bestimmt die Stadt aus den geg. Koordinaten #
; # - GetCurrentZonecode() Ermittelt die aktulle Zone in Kurzform #; # - GetCurrentZonecode() Ermittelt die aktulle Zone in Kurzform (Entfernt, da es nicht funktioniert) #
; # - AddZone(Name, X1, Y1, Z1, X2, Y2, Z2) Fügt eine Zone zum Index hinzu #; # - AddZone(Name, X1, Y1, Z1, X2, Y2, Z2) Fügt eine Zone zum Index hinzu #
; # - AddCity(Name, X1, Y1, Z1, X2, Y2, Z2) Fügt eine Stadt zum Index hinzu #; # - AddCity(Name, X1, Y1, Z1, X2, Y2, Z2) Fügt eine Stadt zum Index hinzu #
; # - IsPlayerInRangeOfPoint(X, Y, Z, Radius) Bestimmt ob der Spieler in der Nähe der Koordinaten ist #; # - IsPlayerInRangeOfPoint(X, Y, Z, Radius) Bestimmt ob der Spieler in der Nähe der Koordinaten ist #
; # - IsIsPlayerInRangeOfPoint2D(X, Y, Radius) Bestimmt ob der Spieler in der Nähe der Koordinaten ist #; # - IsPlayerInRangeOfPoint2D(X, Y, Radius) Bestimmt ob der Spieler in der Nähe der Koordinaten ist #
; # - GetPlayerZone() #; # - GetPlayerZone() #
; # - GetPlayerCity() #; # - GetPlayerCity() #
; # #; # #
; ###############################################################################################################################; ###############################################################################################################################
; # Sonstiges: #; # Sonstiges: #
; # - checkHandles() #; # --------------------------------------------------------------------------------------------------------------------------- #
; # - AntiCrash() Hilft gegen das abstürzen bei Warningscodes #; # #
; # - AntiCrash() Hilft gegen das abstürzen bei Warningscodes #
; # #
; ###############################################################################################################################; ###############################################################################################################################
; # Speicherfunktionen (intern genutzt): #; # Speicherfunktionen (intern genutzt): #
; # Memory Functions: #; # --------------------------------------------------------------------------------------------------------------------------- #
; # - checkHandles() #; # #
; # - refreshGTA() #; # - checkHandles() #
; # - refreshSAMP() #; # - refreshGTA() #
; # - refreshMemory() #; # - refreshSAMP() #
; # - getPID(szWindow) #; # - refreshMemory() #
; # - openProcess(dwPID, dwRights) #; # - getPID(szWindow) #
; # - closeProcess(hProcess) #; # - openProcess(dwPID, dwRights) #
; # - getModuleBaseAddress(sModule, dwPID) #; # - closeProcess(hProcess) #
; # - readString(hProcess, dwAddress, dwLen) #; # - getModuleBaseAddress(sModule, dwPID) #
; # - readFloat(hProcess, dwAddress) #; # - readString(hProcess, dwAddress, dwLen) #
; # - readDWORD(hProcess, dwAddress) #; # - readFloat(hProcess, dwAddress) #
; # - readMem(hProcess, dwAddress, dwLen=4, type="UInt") #; # - readDWORD(hProcess, dwAddress) #
; # - writeString(hProcess, dwAddress, wString) #; # - readMem(hProcess, dwAddress, dwLen=4, type="UInt") #
; # - writeRaw(hProcess, dwAddress, data, dwLen) #; # - writeString(hProcess, dwAddress, wString) #
; # - Memory_ReadByte(process_handle, address) #; # - writeRaw(hProcess, dwAddress, data, dwLen) #
; # - callWithParams(hProcess, dwFunc, aParams, bCleanupStack = true) #; # - Memory_ReadByte(process_handle, address) #
; # - virtualAllocEx(hProcess, dwSize, flAllocationType, flProtect) #; # - callWithParams(hProcess, dwFunc, aParams, bCleanupStack = true) #
; # - virtualFreeEx(hProcess, lpAddress, dwSize, dwFreeType) #; # - virtualAllocEx(hProcess, dwSize, flAllocationType, flProtect) #
; # - createRemoteThread(hProcess, lpThreadAttributes, dwStackSize, lpStartAddress, lpParameter, #; # - virtualFreeEx(hProcess, lpAddress, dwSize, dwFreeType) #
; # - dwCreationFlags, lpThreadId) #; # - createRemoteThread(hProcess, lpThreadAttributes, dwStackSize, lpStartAddress, lpParameter, dwCreationFlags, #
; # - waitForSingleObject(hThread, dwMilliseconds) #; # lpThreadId) #
; # - __ansiToUnicode(sString, nLen = 0) #; # - __ansiToUnicode(sString, nLen = 0) #
; # - __unicodeToAnsi(wString, nLen = 0) #; # - __unicodeToAnsi(wString, nLen = 0) #
; # #
; ###############################################################################################################################; ###############################################################################################################################
; ##### SAMP-Funktionen #####
; ##### SAMP-Funktionen #####
IsSAMPAvailable() {IsSAMPAvailable() {
if(!checkHandles()) if(!checkHandles())
return false return false
dwChatInfo := readDWORD(hGTA, dwSAMP + ADDR_SAMP_CHATMSG_PTR) dwChatInfo := readDWORD(hGTA, dwSAMP + ADDR_SAMP_CHATMSG_PTR)
if(dwChatInfo == 0 || dwChatInfo == "ERROR") if(dwChatInfo == 0 || dwChatInfo == "ERROR")
{ {
return false return false
} }
else else
{ {
return true return true
} }
}}
IsInChat() {IsInChat() {
if(!checkHandles()) if(!checkHandles())
return -1 return -1
dwPtr := dwSAMP + ADDR_SAMP_INCHAT_PTR dwPtr := dwSAMP + ADDR_SAMP_INCHAT_PTR
dwAddress := readDWORD(hGTA, dwPtr) + ADDR_SAMP_INCHAT_PTR_OFF dwAddress := readDWORD(hGTA, dwPtr) + ADDR_SAMP_INCHAT_PTR_OFF
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return -1 return -1
} }
dwInChat := readDWORD(hGTA, dwAddress) dwInChat := readDWORD(hGTA, dwAddress)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return -1 return -1
} }
ErrorLevel := ERROR_OK ErrorLevel := ERROR_OK
if(dwInChat > 0) { if(dwInChat > 0) {
return true return true
} else { } else {
return false return false
} }
}}
GetPlayername() {GetPlayerName() {
if(!checkHandles()) if(!checkHandles())
return "" return ""
dwAddress := dwSAMP + ADDR_SAMP_USERNAME dwAddress := dwSAMP + ADDR_SAMP_USERNAME
sUsername := readString(hGTA, dwAddress, 25) sUsername := readString(hGTA, dwAddress, 25)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return "" return ""
} }
ErrorLevel := ERROR_OK ErrorLevel := ERROR_OK
return sUsername return sUsername
}}
getId() {GetPlayerId() {
s:=GetPlayername() s := GetPlayerName()
return GetPlayerIdByName(s) return GetPlayerIdByName(s)
}}
SendChat(wText) {SendChat(wText) {
wText := "" wText wText := "" wText
if(!checkHandles()) if(!checkHandles())
return false return false
dwFunc:=0 dwFunc:=0
if(SubStr(wText, 1, 1) == "/") { if(SubStr(wText, 1, 1) == "/") {
dwFunc := dwSAMP + FUNC_SAMP_SENDCMD dwFunc := dwSAMP + FUNC_SAMP_SENDCMD
} else { } else {
dwFunc := dwSAMP + FUNC_SAMP_SENDSAY dwFunc := dwSAMP + FUNC_SAMP_SENDSAY
} }
callWithParams(hGTA, dwFunc, [["s", wText]], false) callWithParams(hGTA, dwFunc, [["s", wText]], false)
ErrorLevel := ERROR_OK ErrorLevel := ERROR_OK
return true return true
}}
AddChatMessage(wText) {AddChatMessage(wText) {
wText := "" wText wText := "" wText
if(!checkHandles()) if(!checkHandles())
return false return false
dwFunc := dwSAMP + FUNC_SAMP_ADDTOCHATWND dwFunc := dwSAMP + FUNC_SAMP_ADDTOCHATWND
dwChatInfo := readDWORD(hGTA, dwSAMP + ADDR_SAMP_CHATMSG_PTR) dwChatInfo := readDWORD(hGTA, dwSAMP + ADDR_SAMP_CHATMSG_PTR)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return false return false
} }
callWithParams(hGTA, dwFunc, [["p", dwChatInfo], ["s", wText]], true) callWithParams(hGTA, dwFunc, [["p", dwChatInfo], ["s", wText]], true)
ErrorLevel := ERROR_OK ErrorLevel := ERROR_OK
return true return true
}}
ShowGameText(wText, dwTime, dwSize) {ShowGameText(wText, dwTime, dwTextstyle) {
wText := "" wText wText := "" wText
dwTime += 0 dwTime += 0
dwTime := Floor(dwTime) dwTime := Floor(dwTime)
dwSize += 0 dwTextstyle += 0
dwSize := Floor(dwSize) dwTextstyle := Floor(dwTextstyle)
if(!checkHandles()) if(!checkHandles())
return false return false
dwFunc := dwSAMP + FUNC_SAMP_SHOWGAMETEXT dwFunc := dwSAMP + FUNC_SAMP_SHOWGAMETEXT
callWithParams(hGTA, dwFunc, [["s", wText], ["i", dwTime], ["i", dwSize]], false) callWithParams(hGTA, dwFunc, [["s", wText], ["i", dwTime], ["i", dwTextstyle]], false)
ErrorLevel := ERROR_OK ErrorLevel := ERROR_OK
return true return true
}}
PlayAudioStream(wUrl) {PlayAudioStream(wUrl) {
wUrl := "" wUrl wUrl := "" wUrl
if(!checkHandles()) if(!checkHandles())
return false return false
dwFunc := dwSAMP + FUNC_SAMP_PLAYAUDIOSTR dwFunc := dwSAMP + FUNC_SAMP_PLAYAUDIOSTR
PatchRadio() PatchRadio()
callWithParams(hGTA, dwFunc, [["s", wUrl], ["i", 0], ["i", 0], ["i", 0], ["i", 0], ["i", 0]], false) callWithParams(hGTA, dwFunc, [["s", wUrl], ["i", 0], ["i", 0], ["i", 0], ["i", 0], ["i", 0]], false)
UnPatchRadio() UnPatchRadio()
ErrorLevel := ERROR_OK ErrorLevel := ERROR_OK
return true return true
}}
StopAudioStream() {StopAudioStream() {
if(!checkHandles()) if(!checkHandles())
return false return false
dwFunc := dwSAMP + FUNC_SAMP_STOPAUDIOSTR dwFunc := dwSAMP + FUNC_SAMP_STOPAUDIOSTR
PatchRadio() PatchRadio()
callWithParams(hGTA, dwFunc, [["i", 1]], false) callWithParams(hGTA, dwFunc, [["i", 1]], false)
UnPatchRadio() UnPatchRadio()
ErrorLevel := ERROR_OK ErrorLevel := ERROR_OK
return true return true
}}
PatchRadio()PatchRadio() {
{
if(!checkHandles()) if(!checkHandles())
return false return false
VarSetCapacity(nop, 4, 0) VarSetCapacity(nop, 4, 0)
NumPut(0x90909090,nop,0,"UInt") NumPut(0x90909090,nop,0,"UInt")
dwFunc := dwSAMP + FUNC_SAMP_PLAYAUDIOSTR dwFunc := dwSAMP + FUNC_SAMP_PLAYAUDIOSTR
writeRaw(hGTA, dwFunc, &nop, 4) writeRaw(hGTA, dwFunc, &nop, 4)
writeRaw(hGTA, dwFunc+4, &nop, 1) writeRaw(hGTA, dwFunc+4, &nop, 1)
dwFunc := dwSAMP + FUNC_SAMP_STOPAUDIOSTR dwFunc := dwSAMP + FUNC_SAMP_STOPAUDIOSTR
writeRaw(hGTA, dwFunc, &nop, 4) writeRaw(hGTA, dwFunc, &nop, 4)
writeRaw(hGTA, dwFunc+4, &nop, 1) writeRaw(hGTA, dwFunc+4, &nop, 1)
return true return true
}}
UnPatchRadio()UnPatchRadio() {
{
if(!checkHandles()) if(!checkHandles())
return false return false
VarSetCapacity(old, 4, 0) VarSetCapacity(old, 4, 0)
dwFunc := dwSAMP + FUNC_SAMP_PLAYAUDIOSTR dwFunc := dwSAMP + FUNC_SAMP_PLAYAUDIOSTR
NumPut(0x74003980,old,0,"UInt") NumPut(0x74003980,old,0,"UInt")
writeRaw(hGTA, dwFunc, &old, 4) writeRaw(hGTA, dwFunc, &old, 4)
NumPut(0x39,old,0,"UChar") NumPut(0x39,old,0,"UChar")
writeRaw(hGTA, dwFunc+4, &old, 1) writeRaw(hGTA, dwFunc+4, &old, 1)
dwFunc := dwSAMP + FUNC_SAMP_STOPAUDIOSTR dwFunc := dwSAMP + FUNC_SAMP_STOPAUDIOSTR
NumPut(0x74003980,old,0,"UInt") NumPut(0x74003980,old,0,"UInt")
writeRaw(hGTA, dwFunc, &old, 4) writeRaw(hGTA, dwFunc, &old, 4)
NumPut(0x09,old,0,"UChar") NumPut(0x09,old,0,"UChar")
writeRaw(hGTA, dwFunc+4, &old, 1) writeRaw(hGTA, dwFunc+4, &old, 1)
return true return true
}}
BlockChatInput() {BlockChatInput() {
if(!checkHandles()) if(!checkHandles())
return false return false
VarSetCapacity(nop, 2, 0) VarSetCapacity(nop, 2, 0)
dwFunc := dwSAMP + FUNC_SAMP_SENDSAY dwFunc := dwSAMP + FUNC_SAMP_SENDSAY
NumPut(0x04C2,nop,0,"Short") NumPut(0x04C2,nop,0,"Short")
writeRaw(hGTA, dwFunc, &nop, 2) writeRaw(hGTA, dwFunc, &nop, 2)
dwFunc := dwSAMP + FUNC_SAMP_SENDCMD dwFunc := dwSAMP + FUNC_SAMP_SENDCMD
writeRaw(hGTA, dwFunc, &nop, 2) writeRaw(hGTA, dwFunc, &nop, 2)
return true return true
}}
UnBlockChatInput() {UnBlockChatInput() {
if(!checkHandles()) if(!checkHandles())
return false return false
VarSetCapacity(nop, 2, 0) VarSetCapacity(nop, 2, 0)
dwFunc := dwSAMP + FUNC_SAMP_SENDSAY dwFunc := dwSAMP + FUNC_SAMP_SENDSAY
NumPut(0xA164,nop,0,"Short") NumPut(0xA164,nop,0,"Short")
writeRaw(hGTA, dwFunc, &nop, 2) writeRaw(hGTA, dwFunc, &nop, 2)
dwFunc := dwSAMP + FUNC_SAMP_SENDCMD dwFunc := dwSAMP + FUNC_SAMP_SENDCMD
writeRaw(hGTA, dwFunc, &nop, 2) writeRaw(hGTA, dwFunc, &nop, 2)
return true return true
}}
GetServerName() {GetServerName() {
if(!checkHandles()) if(!checkHandles())
return -1 return -1
dwAdress := readMem(hGTA, dwSAMP + 0x21A0F8, 4, "int") dwAdress := readMem(hGTA, dwSAMP + 0x21A0F8, 4, "int")
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return -1 return -1
} }
if(!dwAdress) if(!dwAdress)
return -1 return -1
ServerName := readString(hGTA, dwAdress + 0x121, 200) ServerName := readString(hGTA, dwAdress + 0x121, 200)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return -1 return -1
} }
ErrorLevel := ERROR_OK ErrorLevel := ERROR_OK
return ServerName return ServerName
}}
GetServerIP() {GetServerIp() {
if(!checkHandles()) if(!checkHandles())
return -1 return -1
dwAdress := readMem(hGTA, dwSAMP + 0x21A0F8, 4, "int") dwAdress := readMem(hGTA, dwSAMP + 0x21A0F8, 4, "int")
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return -1 return -1
} }
if(!dwAdress) if(!dwAdress)
return -1 return -1
ServerIP := readString(hGTA, dwAdress + 0x20, 100) ServerIP := readString(hGTA, dwAdress + 0x20, 100)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return -1 return -1
} }
ErrorLevel := ERROR_OK ErrorLevel := ERROR_OK
return ServerIP return ServerIP
}}
SetIP(IP) {SetServerIp(IP) {
if(!checkHandles()) if(!checkHandles())
return False return False
dwAddress := readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET) dwAddress := readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET)
if(ErrorLevel || dwAddress==0) { if(ErrorLevel || dwAddress==0) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return False return False
} }
writeString(hGTA, dwAddress + SAMP_SZIP_OFFSET, IP) writeString(hGTA, dwAddress + SAMP_SZIP_OFFSET, IP)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_WRITE_MEMORY ErrorLevel := ERROR_WRITE_MEMORY
return False return False
} }
return True return True
}}
GetServerPort() {GetServerPort() {
if(!checkHandles()) if(!checkHandles())
return -1 return -1
dwAdress := readMem(hGTA, dwSAMP + 0x21A0F8, 4, "int") dwAdress := readMem(hGTA, dwSAMP + 0x21A0F8, 4, "int")
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return -1 return -1
} }
if(!dwAdress) if(!dwAdress)
return -1 return -1
ServerPort := readMem(hGTA, dwAdress + 0x225, 4, "int") ServerPort := readMem(hGTA, dwAdress + 0x225, 4, "int")
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return -1 return -1
} }
ErrorLevel := ERROR_OK ErrorLevel := ERROR_OK
return ServerPort return ServerPort
}}
GetWeatherID() {GetWeatherId() {
if(!checkHandles()) if(!checkHandles())
return -1 return -1
dwGTA := getModuleBaseAddress("gta_sa.exe", hGTA) dwGTA := getModuleBaseAddress("gta_sa.exe", hGTA)
WeatherID := readMem(hGTA, dwGTA + 0xC81320, 2, "byte") WeatherID := readMem(hGTA, dwGTA + 0xC81320, 2, "byte")
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return -1 return -1
} }
ErrorLevel := ERROR_OK ErrorLevel := ERROR_OK
return WeatherID return WeatherID
}}
GetWeatherName() {GetWeatherName() {
if(IsPlayerInAnyVehicle() == 0) if(IsPlayerInAnyVehicle() == 0)
return -1 return -1
if(id >= 0 && id < 23) if(id >= 0 && id < 23)
{ {
return oweatherNames[id-1] return oweatherNames[id-1]
} }
return "" return ""
}}
; ##### Spielerfunktionen #####; ##### Spielerfunktionen #####
GetPlayerHealth() {GetPlayerHealth() {
if(!checkHandles()) if(!checkHandles())
return -1 return -1
dwCPedPtr := readDWORD(hGTA, ADDR_CPED_PTR) dwCPedPtr := readDWORD(hGTA, ADDR_CPED_PTR)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return -1 return -1
} }
dwAddr := dwCPedPtr + ADDR_CPED_HPOFF dwAddr := dwCPedPtr + ADDR_CPED_HPOFF
fHealth := readFloat(hGTA, dwAddr) fHealth := readFloat(hGTA, dwAddr)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return -1 return -1
} }
ErrorLevel := ERROR_OK ErrorLevel := ERROR_OK
return Round(fHealth) return Round(fHealth)
}}
GetPlayerArmor() {GetPlayerArmor() {
if(!checkHandles()) if(!checkHandles())
return -1 return -1
dwCPedPtr := readDWORD(hGTA, ADDR_CPED_PTR) dwCPedPtr := readDWORD(hGTA, ADDR_CPED_PTR)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return -1 return -1
} }
dwAddr := dwCPedPtr + ADDR_CPED_ARMOROFF dwAddr := dwCPedPtr + ADDR_CPED_ARMOROFF
fHealth := readFloat(hGTA, dwAddr) fHealth := readFloat(hGTA, dwAddr)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return -1 return -1
} }
ErrorLevel := ERROR_OK ErrorLevel := ERROR_OK
return Round(fHealth) return Round(fHealth)
}}
GetPlayerInteriorId() {GetPlayerInteriorId() {
if(!checkHandles()) if(!checkHandles())
return -1 return -1
iid := readMem(hGTA, ADDR_CPED_INTID, 4, "Int") iid := readMem(hGTA, ADDR_CPED_INTID, 4, "Int")
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return -1 return -1
} }
ErrorLevel := ERROR_OK ErrorLevel := ERROR_OK
return iid return iid
}}
GetPlayerSkinID() {GetPlayerSkinId() {
if(!checkHandles()) if(!checkHandles())
return -1 return -1
dwCPedPtr := readDWORD(hGTA, ADDR_CPED_PTR) dwCPedPtr := readDWORD(hGTA, ADDR_CPED_PTR)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return -1 return -1
} }
dwAddr := dwCPedPtr + ADDR_CPED_SKINIDOFF dwAddr := dwCPedPtr + ADDR_CPED_SKINIDOFF
SkinID := readMem(hGTA, dwAddr, 2, "byte") SkinID := readMem(hGTA, dwAddr, 2, "byte")
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return -1 return -1
} }
ErrorLevel := ERROR_OK ErrorLevel := ERROR_OK
return SkinID return SkinID
}}
GetPlayerMoney() {GetPlayerMoney() {
if(!checkHandles()) if(!checkHandles())
return "" return ""
money := readMem(hGTA, ADDR_CPED_MONEY, 4, "Int") money := readMem(hGTA, ADDR_CPED_MONEY, 4, "Int")
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return "" return ""
} }
ErrorLevel := ERROR_OK ErrorLevel := ERROR_OK
return money return money
}}
GetPlayerWanteds() {GetPlayerWanteds() {
if(!checkHandles()) if(!checkHandles())
return -1 return -1
dwPtr := 0xB7CD9C dwPtr := 0xB7CD9C
dwPtr := readDWORD(hGTA, dwPtr) dwPtr := readDWORD(hGTA, dwPtr)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return -1 return -1
} }
Wanteds := readDWORD(hGTA, dwPtr) Wanteds := readDWORD(hGTA, dwPtr)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return -1 return -1
} }
ErrorLevel := ERROR_OK ErrorLevel := ERROR_OK
return Wanteds return Wanteds
}}
GetPlayerWeaponId() {GetPlayerWeaponId() {
if(!checkHandles()) if(!checkHandles())
return 0 return 0
WaffenId := readMem(hGTA, 0xBAA410, 4, "byte") WaffenId := readMem(hGTA, 0xBAA410, 4, "byte")
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return -1 return -1
} }
return WaffenId return WaffenId
}}
GetPlayerWeaponName() {GetPlayerWeaponName() {
id := GetPlayerWeaponId() id := GetPlayerWeaponId()
if(id >= 0 && id < 44) if(id >= 0 && id < 44)
{ {
return oweaponNames[id+1] return oweaponNames[id+1]
} }
return "" return ""
}}
GetPlayerState() {GetPlayerState() {
if(!checkHandles()) if(!checkHandles())
return -1 return -1
dwCPedPtr := readDWORD(hGTA, ADDR_CPED_PTR) dwCPedPtr := readDWORD(hGTA, ADDR_CPED_PTR)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return -1 return -1
} }
State := readDWORD(hGTA, dwCPedPtr + 0x530) State := readDWORD(hGTA, dwCPedPtr + 0x530)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return -1 return -1
} }
ErrorLevel := ERROR_OK ErrorLevel := ERROR_OK
return State return State
}}
IsPlayerInMenu() {IsPlayerInMenu() {
if(!checkHandles()) if(!checkHandles())
return -1 return -1
IsInMenu := readMem(hGTA, 0xBA67A4, 4, "byte") IsInMenu := readMem(hGTA, 0xBA67A4, 4, "byte")
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return -1 return -1
} }
ErrorLevel := ERROR_OK ErrorLevel := ERROR_OK
return IsInMenu return IsInMenu
}}
GetPlayerMapPosX() {GetPlayerMapPosX() {
if(!checkHandles()) if(!checkHandles())
return -1 return -1
MapPosX := readFloat(hGTA, 0xBA67B8) MapPosX := readFloat(hGTA, 0xBA67B8)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return -1 return -1
} }
ErrorLevel := ERROR_OK ErrorLevel := ERROR_OK
return MapPosX return MapPosX
}}
GetPlayerMapPosY() {GetPlayerMapPosY() {
if(!checkHandles()) if(!checkHandles())
return -1 return -1
MapPosY := readFloat(hGTA, 0xBA67BC) MapPosY := readFloat(hGTA, 0xBA67BC)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return -1 return -1
} }
ErrorLevel := ERROR_OK ErrorLevel := ERROR_OK
return MapPosY return MapPosY
}}
GetPlayerMapZoom() {GetPlayerMapZoom() {
if(!checkHandles()) if(!checkHandles())
return -1 return -1
MapZoom := readFloat(hGTA, 0xBA67AC) MapZoom := readFloat(hGTA, 0xBA67AC)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return -1 return -1
} }
ErrorLevel := ERROR_OK ErrorLevel := ERROR_OK
return MapZoom return MapZoom
}}
IsPlayerFreezed() {IsPlayerFreezed() {
if(!checkHandles()) if(!checkHandles())
return -1 return -1
dwGTA := getModuleBaseAddress("gta_sa.exe", hGTA) dwGTA := getModuleBaseAddress("gta_sa.exe", hGTA)
IPF := readMem(hGTA, dwGTA + 0x690495, 2, "byte") IPF := readMem(hGTA, dwGTA + 0x690495, 2, "byte")
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return -1 return -1
} }
ErrorLevel := ERROR_OK ErrorLevel := ERROR_OK
return IPF return IPF
}}
; ##### Fahrzeugfunktionen #####; ##### Fahrzeugfunktionen #####
IsPlayerInAnyVehicle()IsPlayerInAnyVehicle()
{{
if(!checkHandles()) if(!checkHandles())
return -1 return -1
dwVehPtr := readDWORD(hGTA, ADDR_VEHICLE_PTR) dwVehPtr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return -1 return -1
} }
return (dwVehPtr > 0) return (dwVehPtr > 0)
}}
IsPlayerDriver() {IsPlayerDriver() {
if(!checkHandles()) if(!checkHandles())
return -1 return -1
dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR) dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return -1 return -1
} }
if(!dwAddr) if(!dwAddr)
return -1 return -1
dwCPedPtr := readDWORD(hGTA, ADDR_CPED_PTR) dwCPedPtr := readDWORD(hGTA, ADDR_CPED_PTR)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return -1 return -1
} }
dwVal := readDWORD(hGTA, dwAddr + ADDR_VEHICLE_DRIVER) dwVal := readDWORD(hGTA, dwAddr + ADDR_VEHICLE_DRIVER)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return -1 return -1
} }
ErrorLevel := ERROR_OK ErrorLevel := ERROR_OK
return (dwVal==dwCPedPtr) return (dwVal==dwCPedPtr)
}}
GetVehicleHealth() {GetVehicleHealth() {
if(!checkHandles()) if(!checkHandles())
return -1 return -1
dwVehPtr := readDWORD(hGTA, ADDR_VEHICLE_PTR) dwVehPtr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return -1 return -1
} }
dwAddr := dwVehPtr + ADDR_VEHICLE_HPOFF dwAddr := dwVehPtr + ADDR_VEHICLE_HPOFF
fHealth := readFloat(hGTA, dwAddr) fHealth := readFloat(hGTA, dwAddr)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return -1 return -1
} }
ErrorLevel := ERROR_OK ErrorLevel := ERROR_OK
return Round(fHealth) return Round(fHealth)
}}
GetVehicleType() {GetVehicleType() {
if(!checkHandles()) if(!checkHandles())
return 0 return 0
dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR) dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return 0 return 0
} }
if(!dwAddr) if(!dwAddr)
return 0 return 0
cVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_TYPE, 1, "Char") cVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_TYPE, 1, "Char")
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return 0 return 0
} }
ErrorLevel := ERROR_OK ErrorLevel := ERROR_OK
if(!cVal) if(!cVal)
{ {
mid := GetVehicleModelId() mid := GetVehicleModelId()
Loop % oAirplaneModels.MaxIndex() Loop % oAirplaneModels.MaxIndex()
{ {
if(oAirplaneModels[A_Index]==mid) if(oAirplaneModels[A_Index]==mid)
return 5 return 5
} }
return 1 return 1
} }
else if(cVal==5) else if(cVal==5)
return 2 return 2
else if(cVal==6) else if(cVal==6)
return 3 return 3
else if(cVal==9) else if(cVal==9)
{ {
mid := GetVehicleModelId() mid := GetVehicleModelId()
Loop % oBikeModels.MaxIndex() Loop % oBikeModels.MaxIndex()
{ {
if(oBikeModels[A_Index]==mid) if(oBikeModels[A_Index]==mid)
return 6 return 6
} }
return 4 return 4
} }
return 0 return 0
}}
GetVehicleModelId() {GetVehicleModelId() {
if(!checkHandles()) if(!checkHandles())
return 0 return 0
dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR) dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return 0 return 0
} }
if(!dwAddr) if(!dwAddr)
return 0 return 0
sVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_MODEL, 2, "Short") sVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_MODEL, 2, "Short")
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return 0 return 0
} }
ErrorLevel := ERROR_OK ErrorLevel := ERROR_OK
return sVal return sVal
}}
GetVehicleModelName() {GetVehicleModelName() {
id:=GetVehicleModelId() id:=GetVehicleModelId()
if(id > 400 && id < 611) if(id > 400 && id < 611)
{ {
return ovehicleNames[id-399] return ovehicleNames[id-399]
} }
return "" return ""
}}
GetVehicleLightState() {GetVehicleLightState() {
if(!checkHandles()) if(!checkHandles())
return -1 return -1
dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR) dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return -1 return -1
} }
if(!dwAddr) if(!dwAddr)
return -1 return -1
dwVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_LIGHTSTATE, 4, "Int") dwVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_LIGHTSTATE, 4, "Int")
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return -1 return -1
} }
ErrorLevel := ERROR_OK ErrorLevel := ERROR_OK
return (dwVal>0) return (dwVal>0)
}}
GetVehicleEngineState() {GetVehicleEngineState() {
if(!checkHandles()) if(!checkHandles())
return -1 return -1
dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR) dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return -1 return -1
} }
if(!dwAddr) if(!dwAddr)
return -1 return -1
cVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_ENGINESTATE, 1, "Char") cVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_ENGINESTATE, 1, "Char")
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return -1 return -1
} }
ErrorLevel := ERROR_OK ErrorLevel := ERROR_OK
return (cVal==24 || cVal==56 || cVal==88 || cVal==120) return (cVal==24 || cVal==56 || cVal==88 || cVal==120)
}}
GetVehicleLockState() {GetVehicleLockState() {
if(!checkHandles()) if(!checkHandles())
return -1 return -1
dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR) dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return -1 return -1
} }
if(!dwAddr) if(!dwAddr)
return -1 return -1
dwVal := readDWORD(hGTA, dwAddr + ADDR_VEHICLE_DOORSTATE) dwVal := readDWORD(hGTA, dwAddr + ADDR_VEHICLE_DOORSTATE)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return -1 return -1
} }
ErrorLevel := ERROR_OK ErrorLevel := ERROR_OK
return (dwVal==2) return (dwVal==2)
}}
GetVehicleColor1() {GetVehicleColor1() {
if(!checkHandles()) if(!checkHandles())
return 0 return 0
dwAddr := readDWORD(hGTA, 0xBA18FC) dwAddr := readDWORD(hGTA, 0xBA18FC)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return 0 return 0
} }
if(!dwAddr) if(!dwAddr)
return 0 return 0
sVal := readMem(hGTA, dwAddr + 1076, 1, "byte") sVal := readMem(hGTA, dwAddr + 1076, 1, "byte")
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return 0 return 0
} }
ErrorLevel := ERROR_OK ErrorLevel := ERROR_OK
return sVal return sVal
}}
GetVehicleColor2() {GetVehicleColor2() {
if(!checkHandles()) if(!checkHandles())
return 0 return 0
dwAddr := readDWORD(hGTA, 0xBA18FC) dwAddr := readDWORD(hGTA, 0xBA18FC)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return 0 return 0
} }
if(!dwAddr) if(!dwAddr)
return 0 return 0
sVal := readMem(hGTA, dwAddr + 1077, 1, "byte") sVal := readMem(hGTA, dwAddr + 1077, 1, "byte")
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return 0 return 0
} }
ErrorLevel := ERROR_OK ErrorLevel := ERROR_OK
return sVal return sVal
}}
GetVehicleSpeed() {GetVehicleSpeed() {
if(!checkHandles()) if(!checkHandles())
return -1 return -1
dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR) dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return "" return ""
} }
fSpeedX := readMem(hGTA, dwAddr + ADDR_VEHICLE_X, 4, "float") fSpeedX := readMem(hGTA, dwAddr + ADDR_VEHICLE_X, 4, "float")
fSpeedY := readMem(hGTA, dwAddr + ADDR_VEHICLE_Y, 4, "float") fSpeedY := readMem(hGTA, dwAddr + ADDR_VEHICLE_Y, 4, "float")
fSpeedZ := readMem(hGTA, dwAddr + ADDR_VEHICLE_Z, 4, "float") fSpeedZ := readMem(hGTA, dwAddr + ADDR_VEHICLE_Z, 4, "float")
fVehicleSpeed := sqrt((fSpeedX * fSpeedX) + (fSpeedY * fSpeedY) + (fSpeedZ * fSpeedZ)) fVehicleSpeed := sqrt((fSpeedX * fSpeedX) + (fSpeedY * fSpeedY) + (fSpeedZ * fSpeedZ))
fVehicleSpeed := (fVehicleSpeed * 100) * 1.43 ;Der Wert "1.43" ist meistens auf jedem Server anders. Die Geschwindigkeit wird somit erhöht bzw. verringert fVehicleSpeed := (fVehicleSpeed * 100) * 1.43 ;Der Wert "1.43" ist meistens auf jedem Server anders. Die Geschwindigkeit wird somit erhöht bzw. verringert
return fVehicleSpeed return fVehicleSpeed
}}
GetPlayerRadiostationID() {GetPlayerRadiostationId() {
if(!checkHandles()) if(!checkHandles())
return -1 return -1
if(IsPlayerInAnyVehicle() == 0) if(IsPlayerInAnyVehicle() == 0)
return -1 return -1
dwGTA := getModuleBaseAddress("gta_sa.exe", hGTA) dwGTA := getModuleBaseAddress("gta_sa.exe", hGTA)
RadioStationID := readMem(hGTA, dwGTA + 0x4CB7E1, 1, "byte") RadioStationID := readMem(hGTA, dwGTA + 0x4CB7E1, 1, "byte")
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return -1 return -1
} }
return RadioStationID return RadioStationID
}}
GetPlayerRadiostationName() {GetPlayerRadiostationName() {
if(IsPlayerInAnyVehicle() == 0) if(IsPlayerInAnyVehicle() == 0)
return -1 return -1
id := GetPlayerRadiostationID() id := GetPlayerRadiostationID()
if(id == 0) if(id == 0)
return -1 return -1
if(id >= 0 && id < 14) if(id >= 0 && id < 14)
{ {
return oradiostationNames[id] return oradiostationNames[id]
} }
return "" return ""
}}
; ##### Extra-Player-Funktionen #####; ##### Extra-Player-Funktionen #####
GetTargetPed() {GetTargetPed() {
if(!checkHandles()) if(!checkHandles())
return 0 return 0
dwAddress := readDWORD(hGTA, 0xB6F3B8) dwAddress := readDWORD(hGTA, 0xB6F3B8)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return 0 return 0
} }
if(!dwAddress) if(!dwAddress)
return 0 return 0
dwAddress := readDWORD(hGTA, dwAddress+0x79C) dwAddress := readDWORD(hGTA, dwAddress+0x79C)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return 0 return 0
} }
ErrorLevel := ERROR_OK ErrorLevel := ERROR_OK
return dwAddress return dwAddress
}}
CalcScreenCoors(fX,fY,fZ)CalcScreenCoords(fX, fY, fZ) {
{
if(!checkHandles()) if(!checkHandles())
return false return false
dwM := 0xB6FA2C dwM := 0xB6FA2C
m_11 := readFloat(hGTA, dwM + 0*4) m_11 := readFloat(hGTA, dwM + 0*4)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return false return false
} }
m_12 := readFloat(hGTA, dwM + 1*4) m_12 := readFloat(hGTA, dwM + 1*4)
m_13 := readFloat(hGTA, dwM + 2*4) m_13 := readFloat(hGTA, dwM + 2*4)
m_21 := readFloat(hGTA, dwM + 4*4) m_21 := readFloat(hGTA, dwM + 4*4)
m_22 := readFloat(hGTA, dwM + 5*4) m_22 := readFloat(hGTA, dwM + 5*4)
m_23 := readFloat(hGTA, dwM + 6*4) m_23 := readFloat(hGTA, dwM + 6*4)
m_31 := readFloat(hGTA, dwM + 8*4) m_31 := readFloat(hGTA, dwM + 8*4)
m_32 := readFloat(hGTA, dwM + 9*4) m_32 := readFloat(hGTA, dwM + 9*4)
m_33 := readFloat(hGTA, dwM + 10*4) m_33 := readFloat(hGTA, dwM + 10*4)
m_41 := readFloat(hGTA, dwM + 12*4) m_41 := readFloat(hGTA, dwM + 12*4)
m_42 := readFloat(hGTA, dwM + 13*4) m_42 := readFloat(hGTA, dwM + 13*4)
m_43 := readFloat(hGTA, dwM + 14*4) m_43 := readFloat(hGTA, dwM + 14*4)
dwLenX := readDWORD(hGTA, 0xC17044) dwLenX := readDWORD(hGTA, 0xC17044)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return false return false
} }
dwLenY := readDWORD(hGTA, 0xC17048) dwLenY := readDWORD(hGTA, 0xC17048)
frX := fZ * m_31 + fY * m_21 + fX * m_11 + m_41 frX := fZ * m_31 + fY * m_21 + fX * m_11 + m_41
frY := fZ * m_32 + fY * m_22 + fX * m_12 + m_42 frY := fZ * m_32 + fY * m_22 + fX * m_12 + m_42
frZ := fZ * m_33 + fY * m_23 + fX * m_13 + m_43 frZ := fZ * m_33 + fY * m_23 + fX * m_13 + m_43
fRecip := 1.0/frZ fRecip := 1.0/frZ
frX *= fRecip * dwLenX frX *= fRecip * dwLenX
frY *= fRecip * dwLenY frY *= fRecip * dwLenY
if(frX<=dwLenX && frY<=dwLenY && frZ>1) if(frX<=dwLenX && frY<=dwLenY && frZ>1)
return [frX,frY,frZ] return [frX,frY,frZ]
}}
GetPedById(dwId) {GetPedById(dwId) {
dwId += 0 dwId += 0
dwId := Floor(dwId) dwId := Floor(dwId)
if(dwId < 0 || dwId >= SAMP_PLAYER_MAX) if(dwId < 0 || dwId >= SAMP_PLAYER_MAX)
return 0 return 0
if(iRefreshScoreboard+iUpdateTick > A_TickCount) if(iRefreshScoreboard+iUpdateTick > A_TickCount)
{ {
if(oScoreboardData[dwId]) if(oScoreboardData[dwId])
{ {
if(oScoreboardData[dwId].HasKey("PED")) if(oScoreboardData[dwId].HasKey("PED"))
return oScoreboardData[dwId].PED return oScoreboardData[dwId].PED
} }
return 0 return 0
} }
if(!updateOScoreboardData()) if(!updateOScoreboardData())
return 0 return 0
if(oScoreboardData[dwId]) if(oScoreboardData[dwId])
{ {
if(oScoreboardData[dwId].HasKey("PED")) if(oScoreboardData[dwId].HasKey("PED"))
return oScoreboardData[dwId].PED return oScoreboardData[dwId].PED
} }
return 0 return 0
}}
GetIdByPed(dwPed) {GetIdByPed(dwPed) {
dwPed += 0 dwPed += 0
dwPed := Floor(dwPed) dwPed := Floor(dwPed)
if(!dwPed) if(!dwPed)
return -1 return -1
if(iRefreshScoreboard+iUpdateTick > A_TickCount) if(iRefreshScoreboard+iUpdateTick > A_TickCount)
{ {
For i, o in oScoreboardData For i, o in oScoreboardData
{ {
if(o.HasKey("PED")) if(o.HasKey("PED"))
{ {
if(o.PED==dwPed) if(o.PED==dwPed)
return i return i
} }
} }
return -1 return -1
} }
if(!updateOScoreboardData()) if(!updateOScoreboardData())
return -1 return -1
For i, o in oScoreboardData For i, o in oScoreboardData
{ {
if(o.HasKey("PED")) if(o.HasKey("PED"))
{ {
if(o.PED==dwPed) if(o.PED==dwPed)
return i return i
} }
} }
return -1 return -1
}}
GetStreamedInPlayersInfo() {GetStreamedInPlayersInfo() {
r:=[] r:=[]
if(iRefreshScoreboard+iUpdateTick > A_TickCount) if(iRefreshScoreboard+iUpdateTick > A_TickCount)
{ {
For i, o in oScoreboardData For i, o in oScoreboardData
{ {
if(o.HasKey("PED")) if(o.HasKey("PED"))
{ {
p := GetPedCoordinates(o.PED) p := GetPedCoordinates(o.PED)
if(p) if(p)
{ {
o.POS := p o.POS := p
r[i] := o r[i] := o
} }
} }
} }
return r return r
} }
if(!updateOScoreboardData()) if(!updateOScoreboardData())
return "" return ""
For i, o in oScoreboardData For i, o in oScoreboardData
{ {
if(o.HasKey("PED")) if(o.HasKey("PED"))
{ {
p := GetPedCoordinates(o.PED) p := GetPedCoordinates(o.PED)
if(p) if(p)
{ {
o.POS := p o.POS := p
r[i] := o r[i] := o
} }
} }
} }
return r return r
}}
CallFuncForAllStreamedInPlayers(cfunc,dist=0x7fffffff) {CallFuncForAllStreamedInPlayers(cfunc, dist=0x7fffffff) {
cfunc := "" cfunc cfunc := "" cfunc
dist += 0 dist += 0
if(!IsFunc(cfunc)) if(!IsFunc(cfunc))
return false return false
p := GetStreamedInPlayersInfo() p := GetStreamedInPlayersInfo()
if(!p) if(!p)
return false return false
if(dist<0x7fffffff) if(dist<0x7fffffff)
{ {
lpos := GetCoordinates() lpos := GetPlayerCoordinates()
if(!lpos) if(!lpos)
return false return false
For i, o in p For i, o in p
{ {
if(dist>GetDist(lpos,o.POS)) if(dist>GetDist(lpos,o.POS))
%cfunc%(o) %cfunc%(o)
} }
} }
else else
{ {
For i, o in p For i, o in p
%cfunc%(o) %cfunc%(o)
} }
return true return true
}}
GetDist(pos1,pos2) {GetDist(pos1, pos2) {
if(!pos1 || !pos2) if(!pos1 || !pos2)
return 0 return 0
return Sqrt((pos1[1]-pos2[1])*(pos1[1]-pos2[1])+(pos1[2]-pos2[2])*(pos1[2]-pos2[2])+(pos1[3]-pos2[3])*(pos1[3]-pos2[3])) return Sqrt((pos1[1]-pos2[1])*(pos1[1]-pos2[1])+(pos1[2]-pos2[2])*(pos1[2]-pos2[2])+(pos1[3]-pos2[3])*(pos1[3]-pos2[3]))
}}
GetClosestPlayerPed() {GetClosestPlayerPed() {
dist := 0x7fffffff ;max int32 dist := 0x7fffffff ;max int32
p := GetStreamedInPlayersInfo() p := GetStreamedInPlayersInfo()
if(!p) if(!p)
return -1 return -1
lpos := GetCoordinates() lpos := GetPlayerCoordinates()
if(!lpos) if(!lpos)
return -1 return -1
id := -1 id := -1
For i, o in p For i, o in p
{ {
t:=GetDist(lpos,o.POS) t:=GetDist(lpos,o.POS)
if(t<dist) if(t<dist)
{ {
dist := t dist := t
id := i id := i
} }
} }
PED := GetPedById(id) PED := GetPedById(id)
return PED return PED
}}
GetClosestPlayerId() {GetClosestPlayerId() {
dist := 0x7fffffff ;max int32 dist := 0x7fffffff ;max int32
p := GetStreamedInPlayersInfo() p := GetStreamedInPlayersInfo()
if(!p) if(!p)
return -1 return -1
lpos := GetCoordinates() lpos := GetPlayerCoordinates()
if(!lpos) if(!lpos)
return -1 return -1
id := -1 id := -1
For i, o in p For i, o in p
{ {
t:=GetDist(lpos,o.POS) t:=GetDist(lpos,o.POS)
if(t<dist) if(t<dist)
{ {
dist := t dist := t
id := i id := i
} }
} }
return id return id
}}
CountOnlinePlayers() {CountOnlinePlayers() {
if(!checkHandles()) if(!checkHandles())
return -1 return -1
dwOnline := readDWORD(hGTA, dwSAMP + 0x21A0B4)
if(ErrorLevel) { dwOnline := readDWORD(hGTA, dwSAMP + 0x21A0B4)
ErrorLevel := ERROR_READ_MEMORY
return -1 if(ErrorLevel) {
} ErrorLevel := ERROR_READ_MEMORY
dwAddr := dwOnline + 0x4 return -1
OnlinePlayers := readDWORD(hGTA, dwAddr) }
if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY dwAddr := dwOnline + 0x4
return -1 OnlinePlayers := readDWORD(hGTA, dwAddr)
}
ErrorLevel := ERROR_OK if(ErrorLevel) {
return OnlinePlayers ErrorLevel := ERROR_READ_MEMORY
return -1
}
ErrorLevel := ERROR_OK
return OnlinePlayers
}}
GetPedCoordinates(dwPED) {GetPedCoordinates(dwPED) {
dwPED += 0 dwPED += 0
dwPED := Floor(dwPED) dwPED := Floor(dwPED)
if(!dwPED) if(!dwPED)
return "" return ""
if(!checkHandles()) if(!checkHandles())
return "" return ""
dwAddress := readDWORD(hGTA, dwPED + 0x14) dwAddress := readDWORD(hGTA, dwPED + 0x14)
if(ErrorLevel || dwAddress==0) { if(ErrorLevel || dwAddress==0) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return "" return ""
} }
fX := readFloat(hGTA, dwAddress + 0x30) fX := readFloat(hGTA, dwAddress + 0x30)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return "" return ""
} }
fY := readFloat(hGTA, dwAddress + 0x34) fY := readFloat(hGTA, dwAddress + 0x34)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return "" return ""
} }
fZ := readFloat(hGTA, dwAddress + 0x38) fZ := readFloat(hGTA, dwAddress + 0x38)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return "" return ""
} }
ErrorLevel := ERROR_OK ErrorLevel := ERROR_OK
return [fX, fY, fZ] return [fX, fY, fZ]
}}
GetTargetPos(dwId) {GetTargetPosById(dwId) {
dwId += 0 dwId += 0
dwId := Floor(dwId) dwId := Floor(dwId)
if(dwId < 0 || dwId >= SAMP_PLAYER_MAX) if(dwId < 0 || dwId >= SAMP_PLAYER_MAX)
return "" return ""
if(iRefreshScoreboard+iUpdateTick > A_TickCount) if(iRefreshScoreboard+iUpdateTick > A_TickCount)
{ {
if(oScoreboardData[dwId]) if(oScoreboardData[dwId])
{ {
if(oScoreboardData[dwId].HasKey("PED")) if(oScoreboardData[dwId].HasKey("PED"))
return GetPedCoordinates(oScoreboardData[dwId].PED) return GetPedCoordinates(oScoreboardData[dwId].PED)
if(oScoreboardData[dwId].HasKey("MPOS")) if(oScoreboardData[dwId].HasKey("MPOS"))
return oScoreboardData[dwId].MPOS return oScoreboardData[dwId].MPOS
} }
return "" return ""
} }
if(!updateOScoreboardData()) if(!updateOScoreboardData())
return "" return ""
if(oScoreboardData[dwId]) if(oScoreboardData[dwId])
{ {
if(oScoreboardData[dwId].HasKey("PED")) if(oScoreboardData[dwId].HasKey("PED"))
return GetPedCoordinates(oScoreboardData[dwId].PED) return GetPedCoordinates(oScoreboardData[dwId].PED)
if(oScoreboardData[dwId].HasKey("MPOS")) if(oScoreboardData[dwId].HasKey("MPOS"))
return oScoreboardData[dwId].MPOS return oScoreboardData[dwId].MPOS
} }
return "" return ""
}}
GetTargetPlayerSkinIdByPed(dwPED) {GetTargetPlayerSkinIdByPed(dwPED) {
if(!checkHandles()) if(!checkHandles())
return -1 return -1
dwAddr := dwPED + ADDR_CPED_SKINIDOFF dwAddr := dwPED + ADDR_CPED_SKINIDOFF
SkinID := readMem(hGTA, dwAddr, 2, "byte") SkinID := readMem(hGTA, dwAddr, 2, "byte")
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return -1 return -1
} }
ErrorLevel := ERROR_OK ErrorLevel := ERROR_OK
return SkinID return SkinID
}}
GetTargetPlayerSkinIdById(dwId) {GetTargetPlayerSkinIdById(dwId) {
if(!checkHandles()) if(!checkHandles())
return -1 return -1
dwPED := GetPedById(dwId) dwPED := GetPedById(dwId)
dwAddr := dwPED + ADDR_CPED_SKINIDOFF dwAddr := dwPED + ADDR_CPED_SKINIDOFF
SkinID := readMem(hGTA, dwAddr, 2, "byte") SkinID := readMem(hGTA, dwAddr, 2, "byte")
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return -1 return -1
} }
ErrorLevel := ERROR_OK ErrorLevel := ERROR_OK
return SkinID return SkinID
}}
; ##### Extra-Player-Fahrzeug-Funktionenn #####
; ##### Extra-Player-Fahrzeug-Funktionenn #####
GetVehiclePointerByPed(dwPED) {GetVehiclePointerByPed(dwPED) {
dwPED += 0 dwPED += 0
dwPED := Floor(dwPED) dwPED := Floor(dwPED)
if(!dwPED) if(!dwPED)
return 0 return 0
if(!checkHandles()) if(!checkHandles())
return 0 return 0
dwAddress := readDWORD(hGTA, dwPED + 0x58C) dwAddress := readDWORD(hGTA, dwPED + 0x58C)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return 0 return 0
} }
ErrorLevel := ERROR_OK ErrorLevel := ERROR_OK
return dwAddress return dwAddress
}}
GetVehiclePointerById(dwId) {GetVehiclePointerById(dwId) {
if(!dwId) if(!dwId)
return 0 return 0
if(!checkHandles()) if(!checkHandles())
return 0 return 0
dwPed_By_Id := GetPedById(dwId) dwPed_By_Id := GetPedById(dwId)
dwAddress := readDWORD(hGTA, dwPed_By_Id + 0x58C) dwAddress := readDWORD(hGTA, dwPed_By_Id + 0x58C)
if(ErrorLevel) { if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY ErrorLevel := ERROR_READ_MEMORY
return 0 return 0
} }
ErrorLevel := ERROR_OK ErrorLevel := ERROR_OK
return dwAddress return dwAddress
}}
IsTargetInAnyVehicleByPed(dwPED)IsTargetInAnyVehicleByPed(dwPED) {
{
if(!checkHandles()) if(!checkHandles())
return -1 return -1
dwVehiclePointer := GetVehiclePointerByPed(dwPedPointer) dwVehiclePointer := GetVehiclePointerByPed(dwPedPointer)
if(dwVehiclePointer > 0) if(dwVehiclePointer > 0)
{ {
return 1