tBKwtWS пре 4 година
комит
a3d295b0ef
100 измењених фајлова са 31703 додато и 0 уклоњено
  1. 3 0
      .gitignore
  2. 9 0
      samp03/README.md
  3. BIN
      samp03/announce
  4. BIN
      samp03/announce.exe
  5. 1509 0
      samp03/crashinfo.txt
  6. 1104 0
      samp03/dump.sql
  7. 1258 0
      samp03/filterscripts/YDBG.pwn
  8. 1354 0
      samp03/filterscripts/YDBG2.pwn
  9. BIN
      samp03/filterscripts/a51_base.amx
  10. 422 0
      samp03/filterscripts/a51_base.pwn
  11. BIN
      samp03/filterscripts/adminspec.amx
  12. 121 0
      samp03/filterscripts/adminspec.pwn
  13. BIN
      samp03/filterscripts/attachments.amx
  14. 383 0
      samp03/filterscripts/attachments.pwn
  15. BIN
      samp03/filterscripts/base.amx
  16. 151 0
      samp03/filterscripts/base.pwn
  17. BIN
      samp03/filterscripts/baseaf.amx
  18. 234 0
      samp03/filterscripts/baseaf.pwn
  19. BIN
      samp03/filterscripts/cargoship.amx
  20. 216 0
      samp03/filterscripts/cargoship.pwn
  21. BIN
      samp03/filterscripts/dillimore_gas.amx
  22. 161 0
      samp03/filterscripts/dillimore_gas.pwn
  23. BIN
      samp03/filterscripts/ferriswheel.amx
  24. 135 0
      samp03/filterscripts/ferriswheel.pwn
  25. BIN
      samp03/filterscripts/flymode.amx
  26. 265 0
      samp03/filterscripts/flymode.pwn
  27. BIN
      samp03/filterscripts/fsdebug.amx
  28. 2108 0
      samp03/filterscripts/fsdebug.pwn
  29. BIN
      samp03/filterscripts/gl_actions.amx
  30. 371 0
      samp03/filterscripts/gl_actions.pwn
  31. BIN
      samp03/filterscripts/gl_chat.amx
  32. 293 0
      samp03/filterscripts/gl_chat.pwn
  33. BIN
      samp03/filterscripts/gl_chatbubble.amx
  34. 63 0
      samp03/filterscripts/gl_chatbubble.pwn
  35. BIN
      samp03/filterscripts/gl_mapicon.amx
  36. 70 0
      samp03/filterscripts/gl_mapicon.pwn
  37. BIN
      samp03/filterscripts/gl_npcs.amx
  38. 161 0
      samp03/filterscripts/gl_npcs.pwn
  39. BIN
      samp03/filterscripts/gl_property.amx
  40. 835 0
      samp03/filterscripts/gl_property.pwn
  41. BIN
      samp03/filterscripts/gl_realtime.amx
  42. 162 0
      samp03/filterscripts/gl_realtime.pwn
  43. BIN
      samp03/filterscripts/http_test.amx
  44. 39 0
      samp03/filterscripts/http_test.pwn
  45. BIN
      samp03/filterscripts/iradio.amx
  46. 59 0
      samp03/filterscripts/iradio.pwn
  47. BIN
      samp03/filterscripts/kylies_barn.amx
  48. 138 0
      samp03/filterscripts/kylies_barn.pwn
  49. BIN
      samp03/filterscripts/ls_apartments1.amx
  50. 770 0
      samp03/filterscripts/ls_apartments1.pwn
  51. BIN
      samp03/filterscripts/ls_beachside.amx
  52. 743 0
      samp03/filterscripts/ls_beachside.pwn
  53. BIN
      samp03/filterscripts/ls_elevator.amx
  54. 509 0
      samp03/filterscripts/ls_elevator.pwn
  55. BIN
      samp03/filterscripts/ls_mall.amx
  56. 220 0
      samp03/filterscripts/ls_mall.pwn
  57. BIN
      samp03/filterscripts/ls_prisonwalls.amx
  58. 404 0
      samp03/filterscripts/ls_prisonwalls.pwn
  59. BIN
      samp03/filterscripts/ls_wellsfargo.amx
  60. 139 0
      samp03/filterscripts/ls_wellsfargo.pwn
  61. BIN
      samp03/filterscripts/maxips.amx
  62. 52 0
      samp03/filterscripts/maxips.pwn
  63. BIN
      samp03/filterscripts/menutest.amx
  64. 53 0
      samp03/filterscripts/menutest.pwn
  65. BIN
      samp03/filterscripts/modular_houses.amx
  66. 363 0
      samp03/filterscripts/modular_houses.pwn
  67. BIN
      samp03/filterscripts/modular_island.amx
  68. 194 0
      samp03/filterscripts/modular_island.pwn
  69. BIN
      samp03/filterscripts/netstats.amx
  70. 70 0
      samp03/filterscripts/netstats.pwn
  71. BIN
      samp03/filterscripts/npc_record.amx
  72. 75 0
      samp03/filterscripts/npc_record.pwn
  73. BIN
      samp03/filterscripts/ospawner.amx
  74. 416 0
      samp03/filterscripts/ospawner.pwn
  75. BIN
      samp03/filterscripts/pirateship.amx
  76. 177 0
      samp03/filterscripts/pirateship.pwn
  77. BIN
      samp03/filterscripts/pnetstats.amx
  78. 78 0
      samp03/filterscripts/pnetstats.pwn
  79. BIN
      samp03/filterscripts/pnetstats2.amx
  80. 99 0
      samp03/filterscripts/pnetstats2.pwn
  81. BIN
      samp03/filterscripts/safe_animated.amx
  82. 212 0
      samp03/filterscripts/safe_animated.pwn
  83. BIN
      samp03/filterscripts/samp_anims.amx
  84. 65 0
      samp03/filterscripts/samp_anims.pwn
  85. BIN
      samp03/filterscripts/sf_building1.amx
  86. 176 0
      samp03/filterscripts/sf_building1.pwn
  87. BIN
      samp03/filterscripts/sf_zombotech.amx
  88. 664 0
      samp03/filterscripts/sf_zombotech.pwn
  89. BIN
      samp03/filterscripts/skinchanger.amx
  90. 366 0
      samp03/filterscripts/skinchanger.pwn
  91. BIN
      samp03/filterscripts/stunt_island.amx
  92. 1092 0
      samp03/filterscripts/stunt_island.pwn
  93. BIN
      samp03/filterscripts/test_cmds.amx
  94. 1952 0
      samp03/filterscripts/test_cmds.pwn
  95. BIN
      samp03/filterscripts/vspawner.amx
  96. 387 0
      samp03/filterscripts/vspawner.pwn
  97. 10 0
      samp03/filterscripts/y_php.pwn
  98. 1169 0
      samp03/gamemodes/Interior.pwn
  99. 4114 0
      samp03/gamemodes/RPFW.0.04 Built 9.pwn
  100. 5510 0
      samp03/gamemodes/RPFW.0.0a Build 10.pwn

+ 3 - 0
.gitignore

@@ -0,0 +1,3 @@
+/samp03/logs
+/samp03/server_log.txt
+/samp03/sql_log.txt

+ 9 - 0
samp03/README.md

@@ -0,0 +1,9 @@
+# Install debian packages
+1. `su`
+1. `apt update && apt upgrade`
+1. `apt install sudo molly-guard postgresql-server`
+
+# Create user
+1. `/sbin/useradd samp -m -G ssh -s /bin/bash`
+
+#


BIN
samp03/announce.exe


+ 1509 - 0
samp03/crashinfo.txt

@@ -0,0 +1,1509 @@
+

+--------------------------

+SA-MP Server: 0.3.7-R2

+

+Exception At Address: 0x00468D34 Module: (samp-server.exe)

+

+Registers:

+EAX: 0x00000000	EBX: 0x0394D6AC	ECX: 0x00000000	EDX: 0x00000000

+ESI: 0x00000000	EDI: 0x0347C208	EBP: 0x0018FC40	ESP: 0x0018FAE0

+EFLAGS: 0x00010246

+

+Stack:

++0000: 0x00479C04   0x00000000   0x0347C208   0x0394D6AC

++0010: 0x039197C4   0x00000000   0x0000000A   0x00544A98

++0020: 0x0000000A   0x0347C208   0x005449D0   0x005449D0

++0030: 0x0048B460   0x0018FB44   0x00544A88   0x0347C208

++0040: 0x0347C208   0x039197C4   0x00000002   0x00000000

++0050: 0x00000028   0x6D007372   0x0018FB58   0x6DE20269

++0060: 0x02650000   0x00000000   0x00000020   0x0018FC30

++0070: 0x0000001F   0x0000000F   0x0018FB74   0x6DE2233B

++0080: 0x00000020   0x00000000   0x00000000   0x00000000

++0090: 0x00000000   0x0018FBB0   0x72753044   0x00000020

++00A0: 0x0018FC30   0x00000017   0x0018FBD0   0x00000000

++00B0: 0x00000000   0x00000000   0x00000000   0x00000000

++00C0: 0x0018FB80   0x00000000   0x02650000   0x026D2CB0

++00D0: 0x0018FC14   0x72752AAB   0x001B0030   0x0000002D

++00E0: 0x00000017   0x0018FC14   0x7275124D   0x026D2C98

++00F0: 0x00000001   0x026D2CA8   0x0018FBF0   0x7728E0C3

++0100: 0x0394D6A4   0x026D2CC7   0x00000065   0x026D2CA8

++0110: 0x0018FC04   0x75B314BD   0x02650000   0x00000000

++0120: 0x026D2CB0   0x0018FC18   0x6DE2016A   0x02650000

++0130: 0x00000000   0x026D2CB0   0x0018FC60   0x72751D87

+

+--------------------------

+

+Loaded Modules:

+samp-server.exe	A: 0x00400000 - 0x00519000	(D:\Software\bin\samp037_svr_R2-1-1_win32\samp-server.exe)

+ntdll.dll	A: 0x77260000 - 0x773E0000	(C:\Windows\SysWOW64\ntdll.dll)

+kernel32.dll	A: 0x75B20000 - 0x75C30000	(C:\Windows\syswow64\kernel32.dll)

+KERNELBASE.dll	A: 0x75280000 - 0x752C7000	(C:\Windows\syswow64\KERNELBASE.dll)

+SHELL32.dll	A: 0x75F30000 - 0x76B7C000	(C:\Windows\syswow64\SHELL32.dll)

+msvcrt.dll	A: 0x75190000 - 0x7523C000	(C:\Windows\syswow64\msvcrt.dll)

+SHLWAPI.dll	A: 0x756A0000 - 0x756F7000	(C:\Windows\syswow64\SHLWAPI.dll)

+GDI32.dll	A: 0x75C30000 - 0x75CC0000	(C:\Windows\syswow64\GDI32.dll)

+USER32.dll	A: 0x75050000 - 0x75150000	(C:\Windows\syswow64\USER32.dll)

+ADVAPI32.dll	A: 0x75CC0000 - 0x75D61000	(C:\Windows\syswow64\ADVAPI32.dll)

+sechost.dll	A: 0x74DC0000 - 0x74DD9000	(C:\Windows\SysWOW64\sechost.dll)

+RPCRT4.dll	A: 0x74DE0000 - 0x74ED0000	(C:\Windows\syswow64\RPCRT4.dll)

+SspiCli.dll	A: 0x74D60000 - 0x74DC0000	(C:\Windows\syswow64\SspiCli.dll)

+CRYPTBASE.dll	A: 0x74D50000 - 0x74D5C000	(C:\Windows\syswow64\CRYPTBASE.dll)

+LPK.dll	A: 0x759C0000 - 0x759CA000	(C:\Windows\syswow64\LPK.dll)

+USP10.dll	A: 0x74ED0000 - 0x74F6D000	(C:\Windows\syswow64\USP10.dll)

+WSOCK32.dll	A: 0x718E0000 - 0x718E7000	(C:\Windows\system32\WSOCK32.dll)

+WS2_32.dll	A: 0x75240000 - 0x75275000	(C:\Windows\syswow64\WS2_32.dll)

+NSI.dll	A: 0x755C0000 - 0x755C6000	(C:\Windows\syswow64\NSI.dll)

+WINMM.dll	A: 0x749D0000 - 0x74A02000	(C:\Windows\system32\WINMM.dll)

+IMM32.DLL	A: 0x75330000 - 0x75390000	(C:\Windows\system32\IMM32.DLL)

+MSCTF.dll	A: 0x755D0000 - 0x7569D000	(C:\Windows\syswow64\MSCTF.dll)

+sscanf.DLL	A: 0x10000000 - 0x1000E000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\sscanf.DLL)

+VCRUNTIME140.dll	A: 0x744C0000 - 0x744D3000	(C:\Windows\system32\VCRUNTIME140.dll)

+api-ms-win-crt-runtime-l1-1-0.dll	A: 0x744B0000 - 0x744B4000	(C:\Windows\system32\api-ms-win-crt-runtime-l1-1-0.dll)

+ucrtbase.DLL	A: 0x743C0000 - 0x744A1000	(C:\Windows\system32\ucrtbase.DLL)

+api-ms-win-core-timezone-l1-1-0.dll	A: 0x743B0000 - 0x743B3000	(C:\Windows\system32\api-ms-win-core-timezone-l1-1-0.dll)

+api-ms-win-core-file-l2-1-0.dll	A: 0x743A0000 - 0x743A3000	(C:\Windows\system32\api-ms-win-core-file-l2-1-0.dll)

+api-ms-win-core-localization-l1-2-0.dll	A: 0x74390000 - 0x74393000	(C:\Windows\system32\api-ms-win-core-localization-l1-2-0.dll)

+api-ms-win-core-synch-l1-2-0.dll	A: 0x72230000 - 0x72233000	(C:\Windows\system32\api-ms-win-core-synch-l1-2-0.dll)

+api-ms-win-core-processthreads-l1-1-1.dll	A: 0x74380000 - 0x74383000	(C:\Windows\system32\api-ms-win-core-processthreads-l1-1-1.dll)

+api-ms-win-core-file-l1-2-0.dll	A: 0x74370000 - 0x74373000	(C:\Windows\system32\api-ms-win-core-file-l1-2-0.dll)

+api-ms-win-crt-heap-l1-1-0.dll	A: 0x74360000 - 0x74363000	(C:\Windows\system32\api-ms-win-crt-heap-l1-1-0.dll)

+api-ms-win-crt-string-l1-1-0.dll	A: 0x74350000 - 0x74354000	(C:\Windows\system32\api-ms-win-crt-string-l1-1-0.dll)

+api-ms-win-crt-stdio-l1-1-0.dll	A: 0x74340000 - 0x74344000	(C:\Windows\system32\api-ms-win-crt-stdio-l1-1-0.dll)

+api-ms-win-crt-convert-l1-1-0.dll	A: 0x74330000 - 0x74334000	(C:\Windows\system32\api-ms-win-crt-convert-l1-1-0.dll)

+MSVCP100.dll	A: 0x6DED0000 - 0x6DF39000	(C:\Windows\system32\MSVCP100.dll)

+MSVCR100.dll	A: 0x6DE10000 - 0x6DECF000	(C:\Windows\system32\MSVCR100.dll)

+sql.DLL	A: 0x72760000 - 0x7276E000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\sql.DLL)

+LIBPQ.dll	A: 0x6DF80000 - 0x6DFA5000	(D:\Software\bin\samp037_svr_R2-1-1_win32\LIBPQ.dll)

+SSLEAY32.dll	A: 0x6E470000 - 0x6E4B5000	(D:\Software\bin\samp037_svr_R2-1-1_win32\SSLEAY32.dll)

+LIBEAY32.dll	A: 0x6DCF0000 - 0x6DE10000	(D:\Software\bin\samp037_svr_R2-1-1_win32\LIBEAY32.dll)

+libintl.dll	A: 0x6A300000 - 0x6A32B000	(D:\Software\bin\samp037_svr_R2-1-1_win32\libintl.dll)

+Secur32.dll	A: 0x71240000 - 0x71248000	(C:\Windows\system32\Secur32.dll)

+WLDAP32.dll	A: 0x75000000 - 0x75045000	(C:\Windows\syswow64\WLDAP32.dll)

+MSVCP110.dll	A: 0x6DC60000 - 0x6DCE5000	(C:\Windows\system32\MSVCP110.dll)

+MSVCR110.dll	A: 0x6DB80000 - 0x6DC56000	(C:\Windows\system32\MSVCR110.dll)

+streamer.DLL	A: 0x6DB10000 - 0x6DB77000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\streamer.DLL)

+MSVCP140.dll	A: 0x744E0000 - 0x7454F000	(C:\Windows\system32\MSVCP140.dll)

+api-ms-win-crt-locale-l1-1-0.dll	A: 0x74320000 - 0x74323000	(C:\Windows\system32\api-ms-win-crt-locale-l1-1-0.dll)

+api-ms-win-crt-math-l1-1-0.dll	A: 0x74310000 - 0x74315000	(C:\Windows\system32\api-ms-win-crt-math-l1-1-0.dll)

+api-ms-win-crt-filesystem-l1-1-0.dll	A: 0x74300000 - 0x74303000	(C:\Windows\system32\api-ms-win-crt-filesystem-l1-1-0.dll)

+api-ms-win-crt-time-l1-1-0.dll	A: 0x742F0000 - 0x742F3000	(C:\Windows\system32\api-ms-win-crt-time-l1-1-0.dll)

+api-ms-win-crt-environment-l1-1-0.dll	A: 0x742E0000 - 0x742E3000	(C:\Windows\system32\api-ms-win-crt-environment-l1-1-0.dll)

+api-ms-win-crt-utility-l1-1-0.dll	A: 0x742D0000 - 0x742D3000	(C:\Windows\system32\api-ms-win-crt-utility-l1-1-0.dll)

+pawnregex.DLL	A: 0x6DF40000 - 0x6DF77000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\pawnregex.DLL)

+pawncmd.DLL	A: 0x6DAD0000 - 0x6DB09000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\pawncmd.DLL)

+Whirlpool.DLL	A: 0x72730000 - 0x7273D000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\Whirlpool.DLL)

+discord-connector.DLL	A: 0x6C6A0000 - 0x6C975000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\discord-connector.DLL)

+log-core2.dll	A: 0x6CBB0000 - 0x6CC55000	(D:\Software\bin\samp037_svr_R2-1-1_win32\log-core2.dll)

+CRYPT32.dll	A: 0x75840000 - 0x75962000	(C:\Windows\syswow64\CRYPT32.dll)

+MSASN1.dll	A: 0x75180000 - 0x7518C000	(C:\Windows\syswow64\MSASN1.dll)

+CRYPTSP.dll	A: 0x722E0000 - 0x722F7000	(C:\Windows\system32\CRYPTSP.dll)

+mswsock.dll	A: 0x707F0000 - 0x7082C000	(C:\Windows\system32\mswsock.dll)

+wshtcpip.dll	A: 0x707E0000 - 0x707E5000	(C:\Windows\System32\wshtcpip.dll)

+wship6.dll	A: 0x707C0000 - 0x707C6000	(C:\Windows\System32\wship6.dll)

+DNSAPI.dll	A: 0x73600000 - 0x73644000	(C:\Windows\system32\DNSAPI.dll)

+IPHLPAPI.DLL	A: 0x70860000 - 0x7087C000	(C:\Windows\system32\IPHLPAPI.DLL)

+WINNSI.DLL	A: 0x70850000 - 0x70857000	(C:\Windows\system32\WINNSI.DLL)

+rasadhlp.dll	A: 0x72870000 - 0x72876000	(C:\Windows\system32\rasadhlp.dll)

+NLAapi.dll	A: 0x736D0000 - 0x736E0000	(C:\Windows\system32\NLAapi.dll)

+napinsp.dll	A: 0x726D0000 - 0x726E0000	(C:\Windows\system32\napinsp.dll)

+pnrpnsp.dll	A: 0x6DA30000 - 0x6DA42000	(C:\Windows\system32\pnrpnsp.dll)

+winrnr.dll	A: 0x6DA20000 - 0x6DA28000	(C:\Windows\System32\winrnr.dll)

+PROPSYS.dll	A: 0x70CD0000 - 0x70DC5000	(C:\Windows\system32\PROPSYS.dll)

+OLEAUT32.dll	A: 0x759D0000 - 0x75A61000	(C:\Windows\syswow64\OLEAUT32.dll)

+comctl32.dll	A: 0x72520000 - 0x726BE000	(C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.18837_none_41e855142bd5705d\comctl32.dll)

+apphelp.dll	A: 0x721D0000 - 0x7221C000	(C:\Windows\system32\apphelp.dll)

+CLBCatQ.DLL	A: 0x75D70000 - 0x75DF3000	(C:\Windows\syswow64\CLBCatQ.DLL)

+iertutil.dll	A: 0x753B0000 - 0x755B1000	(C:\Windows\syswow64\iertutil.dll)

+urlmon.dll	A: 0x75700000 - 0x75840000	(C:\Windows\syswow64\urlmon.dll)

+XmlLite.dll	A: 0x75970000 - 0x7599F000	(C:\Windows\syswow64\XmlLite.dll)

+WININET.dll	A: 0x75E30000 - 0x75F25000	(C:\Windows\syswow64\WININET.dll)

+SETUPAPI.dll	A: 0x76B80000 - 0x76D1D000	(C:\Windows\syswow64\SETUPAPI.dll)

+CFGMGR32.dll	A: 0x75AF0000 - 0x75B17000	(C:\Windows\syswow64\CFGMGR32.dll)

+DEVOBJ.dll	A: 0x759A0000 - 0x759B2000	(C:\Windows\syswow64\DEVOBJ.dll)

+ntmarta.dll	A: 0x71D50000 - 0x71D71000	(C:\Windows\system32\ntmarta.dll)

+profapi.dll	A: 0x72250000 - 0x7225B000	(C:\Windows\system32\profapi.dll)

+VERSION.dll	A: 0x726C0000 - 0x726C9000	(C:\Windows\system32\VERSION.dll)

+SHDOCVW.dll	A: 0x6E740000 - 0x6E76F000	(C:\Windows\system32\SHDOCVW.dll)

+WINTRUST.dll	A: 0x75150000 - 0x7517F000	(C:\Windows\syswow64\WINTRUST.dll)

+UxTheme.dll	A: 0x71860000 - 0x718E0000	(C:\Windows\system32\UxTheme.dll)

+WindowsCodecs.dll	A: 0x69590000 - 0x696C0000	(C:\Windows\system32\WindowsCodecs.dll)

+EhStorShell.dll	A: 0x69550000 - 0x69581000	(C:\Windows\system32\EhStorShell.dll)

+ntshrui.dll	A: 0x694E0000 - 0x69550000	(C:\Windows\system32\ntshrui.dll)

+srvcli.dll	A: 0x69EB0000 - 0x69EC9000	(C:\Windows\system32\srvcli.dll)

+cscapi.dll	A: 0x6D440000 - 0x6D44B000	(C:\Windows\system32\cscapi.dll)

+IconCodecService.dll	A: 0x69EA0000 - 0x69EA6000	(C:\Windows\system32\IconCodecService.dll)

+

+--------------------------

+SA-MP Server: 0.3.7-R2

+

+Exception At Address: 0x00468D34 Module: (samp-server.exe)

+

+Registers:

+EAX: 0x00000000	EBX: 0x03A14E3C	ECX: 0x00000000	EDX: 0x00000000

+ESI: 0x00000000	EDI: 0x0355C208	EBP: 0x0018FC40	ESP: 0x0018FAE0

+EFLAGS: 0x00210246

+

+Stack:

++0000: 0x00479C04   0x00000000   0x0355C208   0x03A14E3C

++0010: 0x039E0E2C   0x00000000   0x0000000A   0x00274A98

++0020: 0x0000000A   0x0355C208   0x002749D0   0x002749D0

++0030: 0x0048B460   0x0018FB44   0x00274A88   0x0355C208

++0040: 0x0355C208   0x039E0E2C   0x00000002   0x00000000

++0050: 0x00000028   0x6D007372   0x0018FB58   0x6DE20269

++0060: 0x002D0000   0x00000000   0x00000020   0x0018FC30

++0070: 0x0000001F   0x0000000F   0x0018FB74   0x6DE2233B

++0080: 0x00000020   0x00000000   0x00000000   0x00000000

++0090: 0x00000000   0x0018FBB0   0x72753044   0x00000020

++00A0: 0x0018FC30   0x00000017   0x0018FBD0   0x00000000

++00B0: 0x00000000   0x00000000   0x00000000   0x00000000

++00C0: 0x0018FB80   0x00000000   0x002D0000   0x027224F8

++00D0: 0x0018FC14   0x72752AAB   0x0020002C   0x00000033

++00E0: 0x00000017   0x0018FC14   0x7275124D   0x02722418

++00F0: 0x00000001   0x027224F0   0x0018FBF0   0x7728E0C3

++0100: 0x03A14E34   0x00000000   0x0018FC50   0x027224F0

++0110: 0x0018FC04   0x75B314BD   0x002D0000   0x00000000

++0120: 0x027224F8   0x0018FC18   0x6DE2016A   0x002D0000

++0130: 0x00000000   0x027224F8   0x0018FC60   0x72751D87

+

+--------------------------

+

+Loaded Modules:

+samp-server.exe	A: 0x00400000 - 0x00519000	(D:\Software\bin\samp037_svr_R2-1-1_win32\samp-server.exe)

+ntdll.dll	A: 0x77260000 - 0x773E0000	(C:\Windows\SysWOW64\ntdll.dll)

+kernel32.dll	A: 0x75B20000 - 0x75C30000	(C:\Windows\syswow64\kernel32.dll)

+KERNELBASE.dll	A: 0x75280000 - 0x752C7000	(C:\Windows\syswow64\KERNELBASE.dll)

+SHELL32.dll	A: 0x75F30000 - 0x76B7C000	(C:\Windows\syswow64\SHELL32.dll)

+msvcrt.dll	A: 0x75190000 - 0x7523C000	(C:\Windows\syswow64\msvcrt.dll)

+SHLWAPI.dll	A: 0x756A0000 - 0x756F7000	(C:\Windows\syswow64\SHLWAPI.dll)

+GDI32.dll	A: 0x75C30000 - 0x75CC0000	(C:\Windows\syswow64\GDI32.dll)

+USER32.dll	A: 0x75050000 - 0x75150000	(C:\Windows\syswow64\USER32.dll)

+ADVAPI32.dll	A: 0x75CC0000 - 0x75D61000	(C:\Windows\syswow64\ADVAPI32.dll)

+sechost.dll	A: 0x74DC0000 - 0x74DD9000	(C:\Windows\SysWOW64\sechost.dll)

+RPCRT4.dll	A: 0x74DE0000 - 0x74ED0000	(C:\Windows\syswow64\RPCRT4.dll)

+SspiCli.dll	A: 0x74D60000 - 0x74DC0000	(C:\Windows\syswow64\SspiCli.dll)

+CRYPTBASE.dll	A: 0x74D50000 - 0x74D5C000	(C:\Windows\syswow64\CRYPTBASE.dll)

+LPK.dll	A: 0x759C0000 - 0x759CA000	(C:\Windows\syswow64\LPK.dll)

+USP10.dll	A: 0x74ED0000 - 0x74F6D000	(C:\Windows\syswow64\USP10.dll)

+WSOCK32.dll	A: 0x718E0000 - 0x718E7000	(C:\Windows\system32\WSOCK32.dll)

+WS2_32.dll	A: 0x75240000 - 0x75275000	(C:\Windows\syswow64\WS2_32.dll)

+NSI.dll	A: 0x755C0000 - 0x755C6000	(C:\Windows\syswow64\NSI.dll)

+WINMM.dll	A: 0x749D0000 - 0x74A02000	(C:\Windows\system32\WINMM.dll)

+IMM32.DLL	A: 0x75330000 - 0x75390000	(C:\Windows\system32\IMM32.DLL)

+MSCTF.dll	A: 0x755D0000 - 0x7569D000	(C:\Windows\syswow64\MSCTF.dll)

+sscanf.DLL	A: 0x10000000 - 0x1000E000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\sscanf.DLL)

+VCRUNTIME140.dll	A: 0x744C0000 - 0x744D3000	(C:\Windows\system32\VCRUNTIME140.dll)

+api-ms-win-crt-runtime-l1-1-0.dll	A: 0x744B0000 - 0x744B4000	(C:\Windows\system32\api-ms-win-crt-runtime-l1-1-0.dll)

+ucrtbase.DLL	A: 0x743C0000 - 0x744A1000	(C:\Windows\system32\ucrtbase.DLL)

+api-ms-win-core-timezone-l1-1-0.dll	A: 0x743B0000 - 0x743B3000	(C:\Windows\system32\api-ms-win-core-timezone-l1-1-0.dll)

+api-ms-win-core-file-l2-1-0.dll	A: 0x743A0000 - 0x743A3000	(C:\Windows\system32\api-ms-win-core-file-l2-1-0.dll)

+api-ms-win-core-localization-l1-2-0.dll	A: 0x74390000 - 0x74393000	(C:\Windows\system32\api-ms-win-core-localization-l1-2-0.dll)

+api-ms-win-core-synch-l1-2-0.dll	A: 0x72230000 - 0x72233000	(C:\Windows\system32\api-ms-win-core-synch-l1-2-0.dll)

+api-ms-win-core-processthreads-l1-1-1.dll	A: 0x74380000 - 0x74383000	(C:\Windows\system32\api-ms-win-core-processthreads-l1-1-1.dll)

+api-ms-win-core-file-l1-2-0.dll	A: 0x74370000 - 0x74373000	(C:\Windows\system32\api-ms-win-core-file-l1-2-0.dll)

+api-ms-win-crt-heap-l1-1-0.dll	A: 0x74360000 - 0x74363000	(C:\Windows\system32\api-ms-win-crt-heap-l1-1-0.dll)

+api-ms-win-crt-string-l1-1-0.dll	A: 0x74350000 - 0x74354000	(C:\Windows\system32\api-ms-win-crt-string-l1-1-0.dll)

+api-ms-win-crt-stdio-l1-1-0.dll	A: 0x74340000 - 0x74344000	(C:\Windows\system32\api-ms-win-crt-stdio-l1-1-0.dll)

+api-ms-win-crt-convert-l1-1-0.dll	A: 0x74330000 - 0x74334000	(C:\Windows\system32\api-ms-win-crt-convert-l1-1-0.dll)

+MSVCP100.dll	A: 0x6DED0000 - 0x6DF39000	(C:\Windows\system32\MSVCP100.dll)

+MSVCR100.dll	A: 0x6DE10000 - 0x6DECF000	(C:\Windows\system32\MSVCR100.dll)

+sql.DLL	A: 0x72760000 - 0x7276E000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\sql.DLL)

+LIBPQ.dll	A: 0x6DF80000 - 0x6DFA5000	(D:\Software\bin\samp037_svr_R2-1-1_win32\LIBPQ.dll)

+SSLEAY32.dll	A: 0x6E470000 - 0x6E4B5000	(D:\Software\bin\samp037_svr_R2-1-1_win32\SSLEAY32.dll)

+LIBEAY32.dll	A: 0x6DCF0000 - 0x6DE10000	(D:\Software\bin\samp037_svr_R2-1-1_win32\LIBEAY32.dll)

+libintl.dll	A: 0x6A300000 - 0x6A32B000	(D:\Software\bin\samp037_svr_R2-1-1_win32\libintl.dll)

+Secur32.dll	A: 0x71240000 - 0x71248000	(C:\Windows\system32\Secur32.dll)

+WLDAP32.dll	A: 0x75000000 - 0x75045000	(C:\Windows\syswow64\WLDAP32.dll)

+MSVCP110.dll	A: 0x6DC60000 - 0x6DCE5000	(C:\Windows\system32\MSVCP110.dll)

+MSVCR110.dll	A: 0x6DB80000 - 0x6DC56000	(C:\Windows\system32\MSVCR110.dll)

+streamer.DLL	A: 0x6DB10000 - 0x6DB77000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\streamer.DLL)

+MSVCP140.dll	A: 0x744E0000 - 0x7454F000	(C:\Windows\system32\MSVCP140.dll)

+api-ms-win-crt-locale-l1-1-0.dll	A: 0x74320000 - 0x74323000	(C:\Windows\system32\api-ms-win-crt-locale-l1-1-0.dll)

+api-ms-win-crt-math-l1-1-0.dll	A: 0x74310000 - 0x74315000	(C:\Windows\system32\api-ms-win-crt-math-l1-1-0.dll)

+api-ms-win-crt-filesystem-l1-1-0.dll	A: 0x74300000 - 0x74303000	(C:\Windows\system32\api-ms-win-crt-filesystem-l1-1-0.dll)

+api-ms-win-crt-time-l1-1-0.dll	A: 0x742F0000 - 0x742F3000	(C:\Windows\system32\api-ms-win-crt-time-l1-1-0.dll)

+api-ms-win-crt-environment-l1-1-0.dll	A: 0x742E0000 - 0x742E3000	(C:\Windows\system32\api-ms-win-crt-environment-l1-1-0.dll)

+api-ms-win-crt-utility-l1-1-0.dll	A: 0x742D0000 - 0x742D3000	(C:\Windows\system32\api-ms-win-crt-utility-l1-1-0.dll)

+pawnregex.DLL	A: 0x6DF40000 - 0x6DF77000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\pawnregex.DLL)

+pawncmd.DLL	A: 0x6DAD0000 - 0x6DB09000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\pawncmd.DLL)

+Whirlpool.DLL	A: 0x72730000 - 0x7273D000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\Whirlpool.DLL)

+discord-connector.DLL	A: 0x6C2F0000 - 0x6C5C5000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\discord-connector.DLL)

+log-core2.dll	A: 0x6CBB0000 - 0x6CC55000	(D:\Software\bin\samp037_svr_R2-1-1_win32\log-core2.dll)

+CRYPT32.dll	A: 0x75840000 - 0x75962000	(C:\Windows\syswow64\CRYPT32.dll)

+MSASN1.dll	A: 0x75180000 - 0x7518C000	(C:\Windows\syswow64\MSASN1.dll)

+CRYPTSP.dll	A: 0x722E0000 - 0x722F7000	(C:\Windows\system32\CRYPTSP.dll)

+mswsock.dll	A: 0x707F0000 - 0x7082C000	(C:\Windows\system32\mswsock.dll)

+wshtcpip.dll	A: 0x707E0000 - 0x707E5000	(C:\Windows\System32\wshtcpip.dll)

+wship6.dll	A: 0x707C0000 - 0x707C6000	(C:\Windows\System32\wship6.dll)

+DNSAPI.dll	A: 0x73600000 - 0x73644000	(C:\Windows\system32\DNSAPI.dll)

+IPHLPAPI.DLL	A: 0x70860000 - 0x7087C000	(C:\Windows\system32\IPHLPAPI.DLL)

+WINNSI.DLL	A: 0x70850000 - 0x70857000	(C:\Windows\system32\WINNSI.DLL)

+rasadhlp.dll	A: 0x72870000 - 0x72876000	(C:\Windows\system32\rasadhlp.dll)

+NLAapi.dll	A: 0x736D0000 - 0x736E0000	(C:\Windows\system32\NLAapi.dll)

+napinsp.dll	A: 0x726D0000 - 0x726E0000	(C:\Windows\system32\napinsp.dll)

+pnrpnsp.dll	A: 0x6DA30000 - 0x6DA42000	(C:\Windows\system32\pnrpnsp.dll)

+winrnr.dll	A: 0x6DA20000 - 0x6DA28000	(C:\Windows\System32\winrnr.dll)

+PROPSYS.dll	A: 0x70CD0000 - 0x70DC5000	(C:\Windows\system32\PROPSYS.dll)

+OLEAUT32.dll	A: 0x759D0000 - 0x75A61000	(C:\Windows\syswow64\OLEAUT32.dll)

+comctl32.dll	A: 0x72520000 - 0x726BE000	(C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.18837_none_41e855142bd5705d\comctl32.dll)

+apphelp.dll	A: 0x721D0000 - 0x7221C000	(C:\Windows\system32\apphelp.dll)

+CLBCatQ.DLL	A: 0x75D70000 - 0x75DF3000	(C:\Windows\syswow64\CLBCatQ.DLL)

+iertutil.dll	A: 0x753B0000 - 0x755B1000	(C:\Windows\syswow64\iertutil.dll)

+urlmon.dll	A: 0x75700000 - 0x75840000	(C:\Windows\syswow64\urlmon.dll)

+XmlLite.dll	A: 0x75970000 - 0x7599F000	(C:\Windows\syswow64\XmlLite.dll)

+WININET.dll	A: 0x75E30000 - 0x75F25000	(C:\Windows\syswow64\WININET.dll)

+SETUPAPI.dll	A: 0x76B80000 - 0x76D1D000	(C:\Windows\syswow64\SETUPAPI.dll)

+CFGMGR32.dll	A: 0x75AF0000 - 0x75B17000	(C:\Windows\syswow64\CFGMGR32.dll)

+DEVOBJ.dll	A: 0x759A0000 - 0x759B2000	(C:\Windows\syswow64\DEVOBJ.dll)

+ntmarta.dll	A: 0x71D50000 - 0x71D71000	(C:\Windows\system32\ntmarta.dll)

+profapi.dll	A: 0x72250000 - 0x7225B000	(C:\Windows\system32\profapi.dll)

+VERSION.dll	A: 0x726C0000 - 0x726C9000	(C:\Windows\system32\VERSION.dll)

+

+--------------------------

+SA-MP Server: 0.3.7-R2

+

+Exception At Address: 0x00468D34 Module: (samp-server.exe)

+

+Registers:

+EAX: 0x00000000	EBX: 0x03B0DAD4	ECX: 0x00000000	EDX: 0x00000000

+ESI: 0x00000000	EDI: 0x0363C208	EBP: 0x0018FC40	ESP: 0x0018FAE0

+EFLAGS: 0x00210246

+

+Stack:

++0000: 0x00479C04   0x00000000   0x0363C208   0x03B0DAD4

++0010: 0x03AD97C4   0x00000000   0x0000000A   0x01DB4A98

++0020: 0x0000000A   0x0363C208   0x01DB49D0   0x01DB49D0

++0030: 0x0048B460   0x0018FB44   0x01DB4A88   0x0363C208

++0040: 0x0363C208   0x03AD97C4   0x00000002   0x00000000

++0050: 0x00000028   0x6D007372   0x0018FB58   0x6DE20269

++0060: 0x027D0000   0x00000000   0x00000020   0x0018FC30

++0070: 0x0000001F   0x0000000F   0x0018FB74   0x6DE2233B

++0080: 0x00000020   0x00000000   0x00000000   0x00000000

++0090: 0x00000000   0x0018FBB0   0x72753044   0x00000020

++00A0: 0x0018FC30   0x00000017   0x0018FBD0   0x00000000

++00B0: 0x00000000   0x00000000   0x00000000   0x00000000

++00C0: 0x0018FB80   0x00000000   0x027D0000   0x02702228

++00D0: 0x0018FC14   0x72752AAB   0x00070031   0x00000018

++00E0: 0x00000017   0x0018FC14   0x7275124D   0x02702210

++00F0: 0x00000001   0x02702220   0x0018FBF0   0x7728E0C3

++0100: 0x03B0DACC   0x00000000   0x0018FC50   0x02702220

++0110: 0x0018FC04   0x75B314BD   0x027D0000   0x00000000

++0120: 0x02702228   0x0018FC18   0x6DE2016A   0x027D0000

++0130: 0x00000000   0x02702228   0x0018FC60   0x72751D87

+

+--------------------------

+

+Loaded Modules:

+samp-server.exe	A: 0x00400000 - 0x00519000	(D:\Software\bin\samp037_svr_R2-1-1_win32\samp-server.exe)

+ntdll.dll	A: 0x77260000 - 0x773E0000	(C:\Windows\SysWOW64\ntdll.dll)

+kernel32.dll	A: 0x75B20000 - 0x75C30000	(C:\Windows\syswow64\kernel32.dll)

+KERNELBASE.dll	A: 0x75280000 - 0x752C7000	(C:\Windows\syswow64\KERNELBASE.dll)

+SHELL32.dll	A: 0x75F30000 - 0x76B7C000	(C:\Windows\syswow64\SHELL32.dll)

+msvcrt.dll	A: 0x75190000 - 0x7523C000	(C:\Windows\syswow64\msvcrt.dll)

+SHLWAPI.dll	A: 0x756A0000 - 0x756F7000	(C:\Windows\syswow64\SHLWAPI.dll)

+GDI32.dll	A: 0x75C30000 - 0x75CC0000	(C:\Windows\syswow64\GDI32.dll)

+USER32.dll	A: 0x75050000 - 0x75150000	(C:\Windows\syswow64\USER32.dll)

+ADVAPI32.dll	A: 0x75CC0000 - 0x75D61000	(C:\Windows\syswow64\ADVAPI32.dll)

+sechost.dll	A: 0x74DC0000 - 0x74DD9000	(C:\Windows\SysWOW64\sechost.dll)

+RPCRT4.dll	A: 0x74DE0000 - 0x74ED0000	(C:\Windows\syswow64\RPCRT4.dll)

+SspiCli.dll	A: 0x74D60000 - 0x74DC0000	(C:\Windows\syswow64\SspiCli.dll)

+CRYPTBASE.dll	A: 0x74D50000 - 0x74D5C000	(C:\Windows\syswow64\CRYPTBASE.dll)

+LPK.dll	A: 0x759C0000 - 0x759CA000	(C:\Windows\syswow64\LPK.dll)

+USP10.dll	A: 0x74ED0000 - 0x74F6D000	(C:\Windows\syswow64\USP10.dll)

+WSOCK32.dll	A: 0x718E0000 - 0x718E7000	(C:\Windows\system32\WSOCK32.dll)

+WS2_32.dll	A: 0x75240000 - 0x75275000	(C:\Windows\syswow64\WS2_32.dll)

+NSI.dll	A: 0x755C0000 - 0x755C6000	(C:\Windows\syswow64\NSI.dll)

+WINMM.dll	A: 0x749D0000 - 0x74A02000	(C:\Windows\system32\WINMM.dll)

+IMM32.DLL	A: 0x75330000 - 0x75390000	(C:\Windows\system32\IMM32.DLL)

+MSCTF.dll	A: 0x755D0000 - 0x7569D000	(C:\Windows\syswow64\MSCTF.dll)

+sscanf.DLL	A: 0x10000000 - 0x1000E000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\sscanf.DLL)

+VCRUNTIME140.dll	A: 0x744C0000 - 0x744D3000	(C:\Windows\system32\VCRUNTIME140.dll)

+api-ms-win-crt-runtime-l1-1-0.dll	A: 0x744B0000 - 0x744B4000	(C:\Windows\system32\api-ms-win-crt-runtime-l1-1-0.dll)

+ucrtbase.DLL	A: 0x743C0000 - 0x744A1000	(C:\Windows\system32\ucrtbase.DLL)

+api-ms-win-core-timezone-l1-1-0.dll	A: 0x743B0000 - 0x743B3000	(C:\Windows\system32\api-ms-win-core-timezone-l1-1-0.dll)

+api-ms-win-core-file-l2-1-0.dll	A: 0x743A0000 - 0x743A3000	(C:\Windows\system32\api-ms-win-core-file-l2-1-0.dll)

+api-ms-win-core-localization-l1-2-0.dll	A: 0x74390000 - 0x74393000	(C:\Windows\system32\api-ms-win-core-localization-l1-2-0.dll)

+api-ms-win-core-synch-l1-2-0.dll	A: 0x72230000 - 0x72233000	(C:\Windows\system32\api-ms-win-core-synch-l1-2-0.dll)

+api-ms-win-core-processthreads-l1-1-1.dll	A: 0x74380000 - 0x74383000	(C:\Windows\system32\api-ms-win-core-processthreads-l1-1-1.dll)

+api-ms-win-core-file-l1-2-0.dll	A: 0x74370000 - 0x74373000	(C:\Windows\system32\api-ms-win-core-file-l1-2-0.dll)

+api-ms-win-crt-heap-l1-1-0.dll	A: 0x74360000 - 0x74363000	(C:\Windows\system32\api-ms-win-crt-heap-l1-1-0.dll)

+api-ms-win-crt-string-l1-1-0.dll	A: 0x74350000 - 0x74354000	(C:\Windows\system32\api-ms-win-crt-string-l1-1-0.dll)

+api-ms-win-crt-stdio-l1-1-0.dll	A: 0x74340000 - 0x74344000	(C:\Windows\system32\api-ms-win-crt-stdio-l1-1-0.dll)

+api-ms-win-crt-convert-l1-1-0.dll	A: 0x74330000 - 0x74334000	(C:\Windows\system32\api-ms-win-crt-convert-l1-1-0.dll)

+MSVCP100.dll	A: 0x6DED0000 - 0x6DF39000	(C:\Windows\system32\MSVCP100.dll)

+MSVCR100.dll	A: 0x6DE10000 - 0x6DECF000	(C:\Windows\system32\MSVCR100.dll)

+sql.DLL	A: 0x72760000 - 0x7276E000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\sql.DLL)

+LIBPQ.dll	A: 0x6DF80000 - 0x6DFA5000	(D:\Software\bin\samp037_svr_R2-1-1_win32\LIBPQ.dll)

+SSLEAY32.dll	A: 0x6E470000 - 0x6E4B5000	(D:\Software\bin\samp037_svr_R2-1-1_win32\SSLEAY32.dll)

+LIBEAY32.dll	A: 0x6DCF0000 - 0x6DE10000	(D:\Software\bin\samp037_svr_R2-1-1_win32\LIBEAY32.dll)

+libintl.dll	A: 0x6A300000 - 0x6A32B000	(D:\Software\bin\samp037_svr_R2-1-1_win32\libintl.dll)

+Secur32.dll	A: 0x71240000 - 0x71248000	(C:\Windows\system32\Secur32.dll)

+WLDAP32.dll	A: 0x75000000 - 0x75045000	(C:\Windows\syswow64\WLDAP32.dll)

+MSVCP110.dll	A: 0x6DC60000 - 0x6DCE5000	(C:\Windows\system32\MSVCP110.dll)

+MSVCR110.dll	A: 0x6DB80000 - 0x6DC56000	(C:\Windows\system32\MSVCR110.dll)

+streamer.DLL	A: 0x6DB10000 - 0x6DB77000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\streamer.DLL)

+MSVCP140.dll	A: 0x744E0000 - 0x7454F000	(C:\Windows\system32\MSVCP140.dll)

+api-ms-win-crt-locale-l1-1-0.dll	A: 0x74320000 - 0x74323000	(C:\Windows\system32\api-ms-win-crt-locale-l1-1-0.dll)

+api-ms-win-crt-math-l1-1-0.dll	A: 0x74310000 - 0x74315000	(C:\Windows\system32\api-ms-win-crt-math-l1-1-0.dll)

+api-ms-win-crt-filesystem-l1-1-0.dll	A: 0x74300000 - 0x74303000	(C:\Windows\system32\api-ms-win-crt-filesystem-l1-1-0.dll)

+api-ms-win-crt-time-l1-1-0.dll	A: 0x742F0000 - 0x742F3000	(C:\Windows\system32\api-ms-win-crt-time-l1-1-0.dll)

+api-ms-win-crt-environment-l1-1-0.dll	A: 0x742E0000 - 0x742E3000	(C:\Windows\system32\api-ms-win-crt-environment-l1-1-0.dll)

+api-ms-win-crt-utility-l1-1-0.dll	A: 0x742D0000 - 0x742D3000	(C:\Windows\system32\api-ms-win-crt-utility-l1-1-0.dll)

+pawnregex.DLL	A: 0x6DF40000 - 0x6DF77000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\pawnregex.DLL)

+pawncmd.DLL	A: 0x6DAD0000 - 0x6DB09000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\pawncmd.DLL)

+Whirlpool.DLL	A: 0x72730000 - 0x7273D000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\Whirlpool.DLL)

+discord-connector.DLL	A: 0x66D20000 - 0x66FF5000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\discord-connector.DLL)

+log-core2.dll	A: 0x6CBB0000 - 0x6CC55000	(D:\Software\bin\samp037_svr_R2-1-1_win32\log-core2.dll)

+CRYPT32.dll	A: 0x75840000 - 0x75962000	(C:\Windows\syswow64\CRYPT32.dll)

+MSASN1.dll	A: 0x75180000 - 0x7518C000	(C:\Windows\syswow64\MSASN1.dll)

+CRYPTSP.dll	A: 0x722E0000 - 0x722F7000	(C:\Windows\system32\CRYPTSP.dll)

+mswsock.dll	A: 0x707F0000 - 0x7082C000	(C:\Windows\system32\mswsock.dll)

+wshtcpip.dll	A: 0x707E0000 - 0x707E5000	(C:\Windows\System32\wshtcpip.dll)

+wship6.dll	A: 0x707C0000 - 0x707C6000	(C:\Windows\System32\wship6.dll)

+DNSAPI.dll	A: 0x73600000 - 0x73644000	(C:\Windows\system32\DNSAPI.dll)

+IPHLPAPI.DLL	A: 0x70860000 - 0x7087C000	(C:\Windows\system32\IPHLPAPI.DLL)

+WINNSI.DLL	A: 0x70850000 - 0x70857000	(C:\Windows\system32\WINNSI.DLL)

+rasadhlp.dll	A: 0x72870000 - 0x72876000	(C:\Windows\system32\rasadhlp.dll)

+NLAapi.dll	A: 0x736D0000 - 0x736E0000	(C:\Windows\system32\NLAapi.dll)

+napinsp.dll	A: 0x726D0000 - 0x726E0000	(C:\Windows\system32\napinsp.dll)

+pnrpnsp.dll	A: 0x6DA30000 - 0x6DA42000	(C:\Windows\system32\pnrpnsp.dll)

+winrnr.dll	A: 0x6DA20000 - 0x6DA28000	(C:\Windows\System32\winrnr.dll)

+PROPSYS.dll	A: 0x70CD0000 - 0x70DC5000	(C:\Windows\system32\PROPSYS.dll)

+OLEAUT32.dll	A: 0x759D0000 - 0x75A61000	(C:\Windows\syswow64\OLEAUT32.dll)

+comctl32.dll	A: 0x72520000 - 0x726BE000	(C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.18837_none_41e855142bd5705d\comctl32.dll)

+apphelp.dll	A: 0x721D0000 - 0x7221C000	(C:\Windows\system32\apphelp.dll)

+CLBCatQ.DLL	A: 0x75D70000 - 0x75DF3000	(C:\Windows\syswow64\CLBCatQ.DLL)

+iertutil.dll	A: 0x753B0000 - 0x755B1000	(C:\Windows\syswow64\iertutil.dll)

+urlmon.dll	A: 0x75700000 - 0x75840000	(C:\Windows\syswow64\urlmon.dll)

+XmlLite.dll	A: 0x75970000 - 0x7599F000	(C:\Windows\syswow64\XmlLite.dll)

+WININET.dll	A: 0x75E30000 - 0x75F25000	(C:\Windows\syswow64\WININET.dll)

+SETUPAPI.dll	A: 0x76B80000 - 0x76D1D000	(C:\Windows\syswow64\SETUPAPI.dll)

+CFGMGR32.dll	A: 0x75AF0000 - 0x75B17000	(C:\Windows\syswow64\CFGMGR32.dll)

+DEVOBJ.dll	A: 0x759A0000 - 0x759B2000	(C:\Windows\syswow64\DEVOBJ.dll)

+ntmarta.dll	A: 0x71D50000 - 0x71D71000	(C:\Windows\system32\ntmarta.dll)

+profapi.dll	A: 0x72250000 - 0x7225B000	(C:\Windows\system32\profapi.dll)

+VERSION.dll	A: 0x726C0000 - 0x726C9000	(C:\Windows\system32\VERSION.dll)

+

+--------------------------

+SA-MP Server: 0.3.7-R2

+

+Exception At Address: 0x00468D34 Module: (samp-server.exe)

+

+Registers:

+EAX: 0x00000000	EBX: 0x039B6B9C	ECX: 0x00000000	EDX: 0x00000000

+ESI: 0x00000000	EDI: 0x034FC208	EBP: 0x0018FC40	ESP: 0x0018FAE0

+EFLAGS: 0x00210246

+

+Stack:

++0000: 0x00479C04   0x00000000   0x034FC208   0x039B6B9C

++0010: 0x03980E44   0x00000000   0x0000000A   0x00234A98

++0020: 0x0000000A   0x034FC208   0x002349D0   0x002349D0

++0030: 0x0048B460   0x0018FB44   0x00234A88   0x034FC208

++0040: 0x034FC208   0x03980E44   0x00000002   0x00000000

++0050: 0x00000028   0x6D007372   0x0018FB58   0x6DE20269

++0060: 0x02840000   0x00000000   0x00000020   0x0018FC30

++0070: 0x0000001F   0x0000000F   0x0018FB74   0x6DE2233B

++0080: 0x00000020   0x00000000   0x00000000   0x00000000

++0090: 0x00000000   0x0018FBB0   0x74953044   0x00000020

++00A0: 0x0018FC30   0x00000017   0x0018FBD0   0x00000000

++00B0: 0x00000000   0x00000000   0x00000000   0x00000000

++00C0: 0x0018FB80   0x00000000   0x02840000   0x027B24F8

++00D0: 0x0018FC14   0x74952AAB   0x0020002C   0x00000033

++00E0: 0x00000017   0x0018FC14   0x7495124D   0x027B2418

++00F0: 0x00000001   0x027B24F0   0x0018FBF0   0x7728E0C3

++0100: 0x039B6B94   0x00000000   0x0018FC50   0x027B24F0

++0110: 0x0018FC04   0x75B314BD   0x02840000   0x00000000

++0120: 0x027B24F8   0x0018FC18   0x6DE2016A   0x02840000

++0130: 0x00000000   0x027B24F8   0x0018FC60   0x74951D87

+

+--------------------------

+

+Loaded Modules:

+samp-server.exe	A: 0x00400000 - 0x00519000	(D:\Software\bin\samp037_svr_R2-1-1_win32\samp-server.exe)

+ntdll.dll	A: 0x77260000 - 0x773E0000	(C:\Windows\SysWOW64\ntdll.dll)

+kernel32.dll	A: 0x75B20000 - 0x75C30000	(C:\Windows\syswow64\kernel32.dll)

+KERNELBASE.dll	A: 0x75280000 - 0x752C7000	(C:\Windows\syswow64\KERNELBASE.dll)

+SHELL32.dll	A: 0x75F30000 - 0x76B7C000	(C:\Windows\syswow64\SHELL32.dll)

+msvcrt.dll	A: 0x75190000 - 0x7523C000	(C:\Windows\syswow64\msvcrt.dll)

+SHLWAPI.dll	A: 0x756A0000 - 0x756F7000	(C:\Windows\syswow64\SHLWAPI.dll)

+GDI32.dll	A: 0x75C30000 - 0x75CC0000	(C:\Windows\syswow64\GDI32.dll)

+USER32.dll	A: 0x75050000 - 0x75150000	(C:\Windows\syswow64\USER32.dll)

+ADVAPI32.dll	A: 0x75CC0000 - 0x75D61000	(C:\Windows\syswow64\ADVAPI32.dll)

+sechost.dll	A: 0x74DC0000 - 0x74DD9000	(C:\Windows\SysWOW64\sechost.dll)

+RPCRT4.dll	A: 0x74DE0000 - 0x74ED0000	(C:\Windows\syswow64\RPCRT4.dll)

+SspiCli.dll	A: 0x74D60000 - 0x74DC0000	(C:\Windows\syswow64\SspiCli.dll)

+CRYPTBASE.dll	A: 0x74D50000 - 0x74D5C000	(C:\Windows\syswow64\CRYPTBASE.dll)

+LPK.dll	A: 0x759C0000 - 0x759CA000	(C:\Windows\syswow64\LPK.dll)

+USP10.dll	A: 0x74ED0000 - 0x74F6D000	(C:\Windows\syswow64\USP10.dll)

+WSOCK32.dll	A: 0x72760000 - 0x72767000	(C:\Windows\system32\WSOCK32.dll)

+WS2_32.dll	A: 0x75240000 - 0x75275000	(C:\Windows\syswow64\WS2_32.dll)

+NSI.dll	A: 0x755C0000 - 0x755C6000	(C:\Windows\syswow64\NSI.dll)

+WINMM.dll	A: 0x749D0000 - 0x74A02000	(C:\Windows\system32\WINMM.dll)

+IMM32.DLL	A: 0x75330000 - 0x75390000	(C:\Windows\system32\IMM32.DLL)

+MSCTF.dll	A: 0x755D0000 - 0x7569D000	(C:\Windows\syswow64\MSCTF.dll)

+sscanf.DLL	A: 0x10000000 - 0x1000E000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\sscanf.DLL)

+VCRUNTIME140.dll	A: 0x744C0000 - 0x744D3000	(C:\Windows\system32\VCRUNTIME140.dll)

+api-ms-win-crt-runtime-l1-1-0.dll	A: 0x744B0000 - 0x744B4000	(C:\Windows\system32\api-ms-win-crt-runtime-l1-1-0.dll)

+ucrtbase.DLL	A: 0x743C0000 - 0x744A1000	(C:\Windows\system32\ucrtbase.DLL)

+api-ms-win-core-timezone-l1-1-0.dll	A: 0x743B0000 - 0x743B3000	(C:\Windows\system32\api-ms-win-core-timezone-l1-1-0.dll)

+api-ms-win-core-file-l2-1-0.dll	A: 0x743A0000 - 0x743A3000	(C:\Windows\system32\api-ms-win-core-file-l2-1-0.dll)

+api-ms-win-core-localization-l1-2-0.dll	A: 0x74390000 - 0x74393000	(C:\Windows\system32\api-ms-win-core-localization-l1-2-0.dll)

+api-ms-win-core-synch-l1-2-0.dll	A: 0x72230000 - 0x72233000	(C:\Windows\system32\api-ms-win-core-synch-l1-2-0.dll)

+api-ms-win-core-processthreads-l1-1-1.dll	A: 0x74380000 - 0x74383000	(C:\Windows\system32\api-ms-win-core-processthreads-l1-1-1.dll)

+api-ms-win-core-file-l1-2-0.dll	A: 0x74370000 - 0x74373000	(C:\Windows\system32\api-ms-win-core-file-l1-2-0.dll)

+api-ms-win-crt-heap-l1-1-0.dll	A: 0x74360000 - 0x74363000	(C:\Windows\system32\api-ms-win-crt-heap-l1-1-0.dll)

+api-ms-win-crt-string-l1-1-0.dll	A: 0x74350000 - 0x74354000	(C:\Windows\system32\api-ms-win-crt-string-l1-1-0.dll)

+api-ms-win-crt-stdio-l1-1-0.dll	A: 0x74340000 - 0x74344000	(C:\Windows\system32\api-ms-win-crt-stdio-l1-1-0.dll)

+api-ms-win-crt-convert-l1-1-0.dll	A: 0x74330000 - 0x74334000	(C:\Windows\system32\api-ms-win-crt-convert-l1-1-0.dll)

+MSVCP100.dll	A: 0x6DED0000 - 0x6DF39000	(C:\Windows\system32\MSVCP100.dll)

+MSVCR100.dll	A: 0x6DE10000 - 0x6DECF000	(C:\Windows\system32\MSVCR100.dll)

+sql.DLL	A: 0x72750000 - 0x7275E000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\sql.DLL)

+LIBPQ.dll	A: 0x6DF80000 - 0x6DFA5000	(D:\Software\bin\samp037_svr_R2-1-1_win32\LIBPQ.dll)

+SSLEAY32.dll	A: 0x6DDC0000 - 0x6DE05000	(D:\Software\bin\samp037_svr_R2-1-1_win32\SSLEAY32.dll)

+LIBEAY32.dll	A: 0x6DCA0000 - 0x6DDC0000	(D:\Software\bin\samp037_svr_R2-1-1_win32\LIBEAY32.dll)

+libintl.dll	A: 0x6A300000 - 0x6A32B000	(D:\Software\bin\samp037_svr_R2-1-1_win32\libintl.dll)

+Secur32.dll	A: 0x71240000 - 0x71248000	(C:\Windows\system32\Secur32.dll)

+WLDAP32.dll	A: 0x75000000 - 0x75045000	(C:\Windows\syswow64\WLDAP32.dll)

+MSVCP110.dll	A: 0x6DC10000 - 0x6DC95000	(C:\Windows\system32\MSVCP110.dll)

+MSVCR110.dll	A: 0x6DB30000 - 0x6DC06000	(C:\Windows\system32\MSVCR110.dll)

+streamer.DLL	A: 0x6DAC0000 - 0x6DB27000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\streamer.DLL)

+MSVCP140.dll	A: 0x744E0000 - 0x7454F000	(C:\Windows\system32\MSVCP140.dll)

+api-ms-win-crt-locale-l1-1-0.dll	A: 0x74320000 - 0x74323000	(C:\Windows\system32\api-ms-win-crt-locale-l1-1-0.dll)

+api-ms-win-crt-math-l1-1-0.dll	A: 0x74310000 - 0x74315000	(C:\Windows\system32\api-ms-win-crt-math-l1-1-0.dll)

+api-ms-win-crt-filesystem-l1-1-0.dll	A: 0x74300000 - 0x74303000	(C:\Windows\system32\api-ms-win-crt-filesystem-l1-1-0.dll)

+api-ms-win-crt-time-l1-1-0.dll	A: 0x742F0000 - 0x742F3000	(C:\Windows\system32\api-ms-win-crt-time-l1-1-0.dll)

+api-ms-win-crt-environment-l1-1-0.dll	A: 0x742E0000 - 0x742E3000	(C:\Windows\system32\api-ms-win-crt-environment-l1-1-0.dll)

+api-ms-win-crt-utility-l1-1-0.dll	A: 0x742D0000 - 0x742D3000	(C:\Windows\system32\api-ms-win-crt-utility-l1-1-0.dll)

+pawnregex.DLL	A: 0x6DF40000 - 0x6DF77000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\pawnregex.DLL)

+pawncmd.DLL	A: 0x6DA80000 - 0x6DAB9000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\pawncmd.DLL)

+Whirlpool.DLL	A: 0x72720000 - 0x7272D000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\Whirlpool.DLL)

+discord-connector.DLL	A: 0x6C6A0000 - 0x6C975000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\discord-connector.DLL)

+log-core2.dll	A: 0x6CBB0000 - 0x6CC55000	(D:\Software\bin\samp037_svr_R2-1-1_win32\log-core2.dll)

+CRYPT32.dll	A: 0x75840000 - 0x75962000	(C:\Windows\syswow64\CRYPT32.dll)

+MSASN1.dll	A: 0x75180000 - 0x7518C000	(C:\Windows\syswow64\MSASN1.dll)

+CRYPTSP.dll	A: 0x722E0000 - 0x722F7000	(C:\Windows\system32\CRYPTSP.dll)

+mswsock.dll	A: 0x707F0000 - 0x7082C000	(C:\Windows\system32\mswsock.dll)

+wshtcpip.dll	A: 0x707E0000 - 0x707E5000	(C:\Windows\System32\wshtcpip.dll)

+wship6.dll	A: 0x707C0000 - 0x707C6000	(C:\Windows\System32\wship6.dll)

+DNSAPI.dll	A: 0x73600000 - 0x73644000	(C:\Windows\system32\DNSAPI.dll)

+IPHLPAPI.DLL	A: 0x70860000 - 0x7087C000	(C:\Windows\system32\IPHLPAPI.DLL)

+WINNSI.DLL	A: 0x70850000 - 0x70857000	(C:\Windows\system32\WINNSI.DLL)

+rasadhlp.dll	A: 0x72870000 - 0x72876000	(C:\Windows\system32\rasadhlp.dll)

+NLAapi.dll	A: 0x736D0000 - 0x736E0000	(C:\Windows\system32\NLAapi.dll)

+napinsp.dll	A: 0x726D0000 - 0x726E0000	(C:\Windows\system32\napinsp.dll)

+pnrpnsp.dll	A: 0x6DA30000 - 0x6DA42000	(C:\Windows\system32\pnrpnsp.dll)

+winrnr.dll	A: 0x6DA20000 - 0x6DA28000	(C:\Windows\System32\winrnr.dll)

+PROPSYS.dll	A: 0x70CD0000 - 0x70DC5000	(C:\Windows\system32\PROPSYS.dll)

+OLEAUT32.dll	A: 0x759D0000 - 0x75A61000	(C:\Windows\syswow64\OLEAUT32.dll)

+comctl32.dll	A: 0x72520000 - 0x726BE000	(C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.18837_none_41e855142bd5705d\comctl32.dll)

+apphelp.dll	A: 0x721D0000 - 0x7221C000	(C:\Windows\system32\apphelp.dll)

+CLBCatQ.DLL	A: 0x75D70000 - 0x75DF3000	(C:\Windows\syswow64\CLBCatQ.DLL)

+iertutil.dll	A: 0x753B0000 - 0x755B1000	(C:\Windows\syswow64\iertutil.dll)

+urlmon.dll	A: 0x75700000 - 0x75840000	(C:\Windows\syswow64\urlmon.dll)

+XmlLite.dll	A: 0x75970000 - 0x7599F000	(C:\Windows\syswow64\XmlLite.dll)

+WININET.dll	A: 0x75E30000 - 0x75F25000	(C:\Windows\syswow64\WININET.dll)

+SETUPAPI.dll	A: 0x76B80000 - 0x76D1D000	(C:\Windows\syswow64\SETUPAPI.dll)

+CFGMGR32.dll	A: 0x75AF0000 - 0x75B17000	(C:\Windows\syswow64\CFGMGR32.dll)

+DEVOBJ.dll	A: 0x759A0000 - 0x759B2000	(C:\Windows\syswow64\DEVOBJ.dll)

+ntmarta.dll	A: 0x71D50000 - 0x71D71000	(C:\Windows\system32\ntmarta.dll)

+profapi.dll	A: 0x72250000 - 0x7225B000	(C:\Windows\system32\profapi.dll)

+VERSION.dll	A: 0x726C0000 - 0x726C9000	(C:\Windows\system32\VERSION.dll)

+

+--------------------------

+SA-MP Server: 0.3.7-R2

+

+Exception At Address: 0x00468D34 Module: (samp-server.exe)

+

+Registers:

+EAX: 0x00000000	EBX: 0x03B06BAC	ECX: 0x00000000	EDX: 0x00000000

+ESI: 0x00000000	EDI: 0x0364C208	EBP: 0x0018FC40	ESP: 0x0018FAE0

+EFLAGS: 0x00210246

+

+Stack:

++0000: 0x00479C04   0x00000000   0x0364C208   0x03B06BAC

++0010: 0x03AD0E44   0x00000000   0x0000000A   0x02184A98

++0020: 0x0000000A   0x0364C208   0x021849D0   0x021849D0

++0030: 0x0048B460   0x0018FB44   0x02184A88   0x0364C208

++0040: 0x0364C208   0x03AD0E44   0x00000002   0x00000000

++0050: 0x00000028   0x6D007372   0x0018FB58   0x6DEA0269

++0060: 0x029C0000   0x00000000   0x00000020   0x0018FC30

++0070: 0x0000001F   0x0000000F   0x0018FB74   0x6DEA233B

++0080: 0x00000020   0x00000000   0x00000000   0x00000000

++0090: 0x00000000   0x0018FBB0   0x74953044   0x00000020

++00A0: 0x0018FC30   0x00000017   0x0018FBD0   0x00000000

++00B0: 0x00000000   0x00000000   0x00000000   0x00000000

++00C0: 0x0018FB80   0x00000000   0x029C0000   0x028D22F0

++00D0: 0x0018FC14   0x74952AAB   0x0020002C   0x0000002C

++00E0: 0x00000017   0x0018FC14   0x7495124D   0x028D2210

++00F0: 0x00000001   0x028D22E8   0x0018FBF0   0x7728E0C3

++0100: 0x03B06BA4   0x00000000   0x0018FC50   0x028D22E8

++0110: 0x0018FC04   0x75B314BD   0x029C0000   0x00000000

++0120: 0x028D22F0   0x0018FC18   0x6DEA016A   0x029C0000

++0130: 0x00000000   0x028D22F0   0x0018FC60   0x74951D87

+

+--------------------------

+

+Loaded Modules:

+samp-server.exe	A: 0x00400000 - 0x00519000	(D:\Software\bin\samp037_svr_R2-1-1_win32\samp-server.exe)

+ntdll.dll	A: 0x77260000 - 0x773E0000	(C:\Windows\SysWOW64\ntdll.dll)

+kernel32.dll	A: 0x75B20000 - 0x75C30000	(C:\Windows\syswow64\kernel32.dll)

+KERNELBASE.dll	A: 0x75280000 - 0x752C7000	(C:\Windows\syswow64\KERNELBASE.dll)

+SHELL32.dll	A: 0x75F30000 - 0x76B7C000	(C:\Windows\syswow64\SHELL32.dll)

+msvcrt.dll	A: 0x75190000 - 0x7523C000	(C:\Windows\syswow64\msvcrt.dll)

+SHLWAPI.dll	A: 0x756A0000 - 0x756F7000	(C:\Windows\syswow64\SHLWAPI.dll)

+GDI32.dll	A: 0x75C30000 - 0x75CC0000	(C:\Windows\syswow64\GDI32.dll)

+USER32.dll	A: 0x75050000 - 0x75150000	(C:\Windows\syswow64\USER32.dll)

+ADVAPI32.dll	A: 0x75CC0000 - 0x75D61000	(C:\Windows\syswow64\ADVAPI32.dll)

+sechost.dll	A: 0x74DC0000 - 0x74DD9000	(C:\Windows\SysWOW64\sechost.dll)

+RPCRT4.dll	A: 0x74DE0000 - 0x74ED0000	(C:\Windows\syswow64\RPCRT4.dll)

+SspiCli.dll	A: 0x74D60000 - 0x74DC0000	(C:\Windows\syswow64\SspiCli.dll)

+CRYPTBASE.dll	A: 0x74D50000 - 0x74D5C000	(C:\Windows\syswow64\CRYPTBASE.dll)

+LPK.dll	A: 0x759C0000 - 0x759CA000	(C:\Windows\syswow64\LPK.dll)

+USP10.dll	A: 0x74ED0000 - 0x74F6D000	(C:\Windows\syswow64\USP10.dll)

+WSOCK32.dll	A: 0x72760000 - 0x72767000	(C:\Windows\system32\WSOCK32.dll)

+WS2_32.dll	A: 0x75240000 - 0x75275000	(C:\Windows\syswow64\WS2_32.dll)

+NSI.dll	A: 0x755C0000 - 0x755C6000	(C:\Windows\syswow64\NSI.dll)

+WINMM.dll	A: 0x749D0000 - 0x74A02000	(C:\Windows\system32\WINMM.dll)

+IMM32.DLL	A: 0x75330000 - 0x75390000	(C:\Windows\system32\IMM32.DLL)

+MSCTF.dll	A: 0x755D0000 - 0x7569D000	(C:\Windows\syswow64\MSCTF.dll)

+sscanf.DLL	A: 0x10000000 - 0x1000E000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\sscanf.DLL)

+VCRUNTIME140.dll	A: 0x744C0000 - 0x744D3000	(C:\Windows\system32\VCRUNTIME140.dll)

+api-ms-win-crt-runtime-l1-1-0.dll	A: 0x744B0000 - 0x744B4000	(C:\Windows\system32\api-ms-win-crt-runtime-l1-1-0.dll)

+ucrtbase.DLL	A: 0x743C0000 - 0x744A1000	(C:\Windows\system32\ucrtbase.DLL)

+api-ms-win-core-timezone-l1-1-0.dll	A: 0x743B0000 - 0x743B3000	(C:\Windows\system32\api-ms-win-core-timezone-l1-1-0.dll)

+api-ms-win-core-file-l2-1-0.dll	A: 0x743A0000 - 0x743A3000	(C:\Windows\system32\api-ms-win-core-file-l2-1-0.dll)

+api-ms-win-core-localization-l1-2-0.dll	A: 0x74390000 - 0x74393000	(C:\Windows\system32\api-ms-win-core-localization-l1-2-0.dll)

+api-ms-win-core-synch-l1-2-0.dll	A: 0x72230000 - 0x72233000	(C:\Windows\system32\api-ms-win-core-synch-l1-2-0.dll)

+api-ms-win-core-processthreads-l1-1-1.dll	A: 0x74380000 - 0x74383000	(C:\Windows\system32\api-ms-win-core-processthreads-l1-1-1.dll)

+api-ms-win-core-file-l1-2-0.dll	A: 0x74370000 - 0x74373000	(C:\Windows\system32\api-ms-win-core-file-l1-2-0.dll)

+api-ms-win-crt-heap-l1-1-0.dll	A: 0x74360000 - 0x74363000	(C:\Windows\system32\api-ms-win-crt-heap-l1-1-0.dll)

+api-ms-win-crt-string-l1-1-0.dll	A: 0x74350000 - 0x74354000	(C:\Windows\system32\api-ms-win-crt-string-l1-1-0.dll)

+api-ms-win-crt-stdio-l1-1-0.dll	A: 0x74340000 - 0x74344000	(C:\Windows\system32\api-ms-win-crt-stdio-l1-1-0.dll)

+api-ms-win-crt-convert-l1-1-0.dll	A: 0x74330000 - 0x74334000	(C:\Windows\system32\api-ms-win-crt-convert-l1-1-0.dll)

+MSVCP100.dll	A: 0x6DF50000 - 0x6DFB9000	(C:\Windows\system32\MSVCP100.dll)

+MSVCR100.dll	A: 0x6DE90000 - 0x6DF4F000	(C:\Windows\system32\MSVCR100.dll)

+sql.DLL	A: 0x72780000 - 0x7278E000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\sql.DLL)

+LIBPQ.dll	A: 0x6E000000 - 0x6E025000	(D:\Software\bin\samp037_svr_R2-1-1_win32\LIBPQ.dll)

+SSLEAY32.dll	A: 0x6DE40000 - 0x6DE85000	(D:\Software\bin\samp037_svr_R2-1-1_win32\SSLEAY32.dll)

+LIBEAY32.dll	A: 0x6DD20000 - 0x6DE40000	(D:\Software\bin\samp037_svr_R2-1-1_win32\LIBEAY32.dll)

+libintl.dll	A: 0x6A300000 - 0x6A32B000	(D:\Software\bin\samp037_svr_R2-1-1_win32\libintl.dll)

+Secur32.dll	A: 0x71240000 - 0x71248000	(C:\Windows\system32\Secur32.dll)

+WLDAP32.dll	A: 0x75000000 - 0x75045000	(C:\Windows\syswow64\WLDAP32.dll)

+MSVCP110.dll	A: 0x6DC90000 - 0x6DD15000	(C:\Windows\system32\MSVCP110.dll)

+MSVCR110.dll	A: 0x6DBB0000 - 0x6DC86000	(C:\Windows\system32\MSVCR110.dll)

+streamer.DLL	A: 0x6DB10000 - 0x6DB77000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\streamer.DLL)

+MSVCP140.dll	A: 0x744E0000 - 0x7454F000	(C:\Windows\system32\MSVCP140.dll)

+api-ms-win-crt-locale-l1-1-0.dll	A: 0x74320000 - 0x74323000	(C:\Windows\system32\api-ms-win-crt-locale-l1-1-0.dll)

+api-ms-win-crt-math-l1-1-0.dll	A: 0x74310000 - 0x74315000	(C:\Windows\system32\api-ms-win-crt-math-l1-1-0.dll)

+api-ms-win-crt-filesystem-l1-1-0.dll	A: 0x74300000 - 0x74303000	(C:\Windows\system32\api-ms-win-crt-filesystem-l1-1-0.dll)

+api-ms-win-crt-time-l1-1-0.dll	A: 0x742F0000 - 0x742F3000	(C:\Windows\system32\api-ms-win-crt-time-l1-1-0.dll)

+api-ms-win-crt-environment-l1-1-0.dll	A: 0x742E0000 - 0x742E3000	(C:\Windows\system32\api-ms-win-crt-environment-l1-1-0.dll)

+api-ms-win-crt-utility-l1-1-0.dll	A: 0x742D0000 - 0x742D3000	(C:\Windows\system32\api-ms-win-crt-utility-l1-1-0.dll)

+pawnregex.DLL	A: 0x6DFC0000 - 0x6DFF7000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\pawnregex.DLL)

+pawncmd.DLL	A: 0x6DAA0000 - 0x6DAD9000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\pawncmd.DLL)

+Whirlpool.DLL	A: 0x72750000 - 0x7275D000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\Whirlpool.DLL)

+discord-connector.DLL	A: 0x68D60000 - 0x69035000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\discord-connector.DLL)

+log-core2.dll	A: 0x6CBB0000 - 0x6CC55000	(D:\Software\bin\samp037_svr_R2-1-1_win32\log-core2.dll)

+CRYPT32.dll	A: 0x75840000 - 0x75962000	(C:\Windows\syswow64\CRYPT32.dll)

+MSASN1.dll	A: 0x75180000 - 0x7518C000	(C:\Windows\syswow64\MSASN1.dll)

+CRYPTSP.dll	A: 0x722E0000 - 0x722F7000	(C:\Windows\system32\CRYPTSP.dll)

+mswsock.dll	A: 0x707F0000 - 0x7082C000	(C:\Windows\system32\mswsock.dll)

+wshtcpip.dll	A: 0x707E0000 - 0x707E5000	(C:\Windows\System32\wshtcpip.dll)

+wship6.dll	A: 0x707C0000 - 0x707C6000	(C:\Windows\System32\wship6.dll)

+DNSAPI.dll	A: 0x73600000 - 0x73644000	(C:\Windows\system32\DNSAPI.dll)

+IPHLPAPI.DLL	A: 0x70860000 - 0x7087C000	(C:\Windows\system32\IPHLPAPI.DLL)

+WINNSI.DLL	A: 0x70850000 - 0x70857000	(C:\Windows\system32\WINNSI.DLL)

+rasadhlp.dll	A: 0x72870000 - 0x72876000	(C:\Windows\system32\rasadhlp.dll)

+NLAapi.dll	A: 0x736D0000 - 0x736E0000	(C:\Windows\system32\NLAapi.dll)

+napinsp.dll	A: 0x726D0000 - 0x726E0000	(C:\Windows\system32\napinsp.dll)

+pnrpnsp.dll	A: 0x6DA30000 - 0x6DA42000	(C:\Windows\system32\pnrpnsp.dll)

+winrnr.dll	A: 0x6DA20000 - 0x6DA28000	(C:\Windows\System32\winrnr.dll)

+PROPSYS.dll	A: 0x70CD0000 - 0x70DC5000	(C:\Windows\system32\PROPSYS.dll)

+OLEAUT32.dll	A: 0x759D0000 - 0x75A61000	(C:\Windows\syswow64\OLEAUT32.dll)

+comctl32.dll	A: 0x72520000 - 0x726BE000	(C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.18837_none_41e855142bd5705d\comctl32.dll)

+apphelp.dll	A: 0x721D0000 - 0x7221C000	(C:\Windows\system32\apphelp.dll)

+CLBCatQ.DLL	A: 0x75D70000 - 0x75DF3000	(C:\Windows\syswow64\CLBCatQ.DLL)

+iertutil.dll	A: 0x753B0000 - 0x755B1000	(C:\Windows\syswow64\iertutil.dll)

+urlmon.dll	A: 0x75700000 - 0x75840000	(C:\Windows\syswow64\urlmon.dll)

+XmlLite.dll	A: 0x75970000 - 0x7599F000	(C:\Windows\syswow64\XmlLite.dll)

+WININET.dll	A: 0x75E30000 - 0x75F25000	(C:\Windows\syswow64\WININET.dll)

+SETUPAPI.dll	A: 0x76B80000 - 0x76D1D000	(C:\Windows\syswow64\SETUPAPI.dll)

+CFGMGR32.dll	A: 0x75AF0000 - 0x75B17000	(C:\Windows\syswow64\CFGMGR32.dll)

+DEVOBJ.dll	A: 0x759A0000 - 0x759B2000	(C:\Windows\syswow64\DEVOBJ.dll)

+ntmarta.dll	A: 0x71D50000 - 0x71D71000	(C:\Windows\system32\ntmarta.dll)

+profapi.dll	A: 0x72250000 - 0x7225B000	(C:\Windows\system32\profapi.dll)

+VERSION.dll	A: 0x726C0000 - 0x726C9000	(C:\Windows\system32\VERSION.dll)

+

+--------------------------

+SA-MP Server: 0.3.7-R2

+

+Exception At Address: 0x00468D34 Module: (samp-server.exe)

+

+Registers:

+EAX: 0x00000000	EBX: 0x03A67A30	ECX: 0x00000000	EDX: 0x00000000

+ESI: 0x00000000	EDI: 0x0358C4C0	EBP: 0x0018F7F8	ESP: 0x0018F698

+EFLAGS: 0x00210246

+

+Stack:

++0000: 0x00479C04   0x00000000   0x0358C4C0   0x03A67A30

++0010: 0x03A2B5B0   0x0018F734   0x027FE760   0x028007C4

++0020: 0x0018F7D0   0x00000050   0x00470937   0x0018F6E4

++0030: 0x6B3F0269   0x028F0000   0x00000000   0x00000048

++0040: 0x0018F75C   0x00000000   0x0018F7D0   0x0000000C

++0050: 0x0018F734   0x0018F704   0x70412D23   0x0018F734

++0060: 0x0018F7D0   0x0000000C   0x00000000   0x00000000

++0070: 0x0018F6B0   0x0018F774   0x028007C4   0x0018F7D0

++0080: 0x028007C4   0x0018F780   0x70413CD0   0x00000003

++0090: 0x02800798   0x0018F7A0   0x0000000C   0x72616863

++00A0: 0x65746361   0x64695F72   0x70413A00   0x0000000C

++00B0: 0x028007C4   0x00000000   0x7041A4B5   0x0018F734

++00C0: 0x0018F773   0x028007D1   0x027FE760   0x0018F701

++00D0: 0x027FE704   0x027FE6DC   0x0018F80C   0x0018F80C

++00E0: 0x70416F48   0xFFFFFFFF   0x0018F818   0x704115A7

++00F0: 0x0358C4C0   0x0358C4C0   0x03A2B5B0   0x00000000

++0100: 0x00000002   0x00000018   0x02800790   0x00000002

++0110: 0x00000018   0x34343A32   0x0018F800   0x0018F800

++0120: 0x7261775B   0x676E696E   0x0000005D   0x00000000

++0130: 0xC1C0FA9A   0x0018F818   0x72616863   0x65746361

+

+--------------------------

+

+Loaded Modules:

+samp-server.exe	A: 0x00400000 - 0x00519000	(D:\Software\bin\samp037_svr_R2-1-1_win32\samp-server.exe)

+ntdll.dll	A: 0x77690000 - 0x77810000	(C:\Windows\SysWOW64\ntdll.dll)

+kernel32.dll	A: 0x76F70000 - 0x77080000	(C:\Windows\syswow64\kernel32.dll)

+KERNELBASE.dll	A: 0x764A0000 - 0x764E7000	(C:\Windows\syswow64\KERNELBASE.dll)

+SHELL32.dll	A: 0x75370000 - 0x75FBC000	(C:\Windows\syswow64\SHELL32.dll)

+msvcrt.dll	A: 0x763E0000 - 0x7648C000	(C:\Windows\syswow64\msvcrt.dll)

+SHLWAPI.dll	A: 0x76340000 - 0x76397000	(C:\Windows\syswow64\SHLWAPI.dll)

+GDI32.dll	A: 0x76150000 - 0x761E0000	(C:\Windows\syswow64\GDI32.dll)

+USER32.dll	A: 0x76840000 - 0x76940000	(C:\Windows\syswow64\USER32.dll)

+ADVAPI32.dll	A: 0x751F0000 - 0x75291000	(C:\Windows\syswow64\ADVAPI32.dll)

+sechost.dll	A: 0x77080000 - 0x77099000	(C:\Windows\SysWOW64\sechost.dll)

+RPCRT4.dll	A: 0x76E80000 - 0x76F70000	(C:\Windows\syswow64\RPCRT4.dll)

+SspiCli.dll	A: 0x75190000 - 0x751F0000	(C:\Windows\syswow64\SspiCli.dll)

+CRYPTBASE.dll	A: 0x75180000 - 0x7518C000	(C:\Windows\syswow64\CRYPTBASE.dll)

+LPK.dll	A: 0x76E70000 - 0x76E7A000	(C:\Windows\syswow64\LPK.dll)

+USP10.dll	A: 0x76C50000 - 0x76CED000	(C:\Windows\syswow64\USP10.dll)

+WSOCK32.dll	A: 0x729C0000 - 0x729C7000	(C:\Windows\system32\WSOCK32.dll)

+WS2_32.dll	A: 0x76500000 - 0x76535000	(C:\Windows\syswow64\WS2_32.dll)

+NSI.dll	A: 0x760C0000 - 0x760C6000	(C:\Windows\syswow64\NSI.dll)

+WINMM.dll	A: 0x74FA0000 - 0x74FD2000	(C:\Windows\system32\WINMM.dll)

+IMM32.DLL	A: 0x769D0000 - 0x76A30000	(C:\Windows\system32\IMM32.DLL)

+MSCTF.dll	A: 0x752A0000 - 0x7536D000	(C:\Windows\syswow64\MSCTF.dll)

+sscanf.DLL	A: 0x10000000 - 0x1000E000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\sscanf.DLL)

+VCRUNTIME140.dll	A: 0x6FE80000 - 0x6FE93000	(C:\Windows\system32\VCRUNTIME140.dll)

+api-ms-win-crt-runtime-l1-1-0.dll	A: 0x6FE70000 - 0x6FE74000	(C:\Windows\system32\api-ms-win-crt-runtime-l1-1-0.dll)

+ucrtbase.DLL	A: 0x6FD80000 - 0x6FE61000	(C:\Windows\system32\ucrtbase.DLL)

+api-ms-win-core-timezone-l1-1-0.dll	A: 0x6FD70000 - 0x6FD73000	(C:\Windows\system32\api-ms-win-core-timezone-l1-1-0.dll)

+api-ms-win-core-file-l2-1-0.dll	A: 0x6FD60000 - 0x6FD63000	(C:\Windows\system32\api-ms-win-core-file-l2-1-0.dll)

+api-ms-win-core-localization-l1-2-0.dll	A: 0x6FD50000 - 0x6FD53000	(C:\Windows\system32\api-ms-win-core-localization-l1-2-0.dll)

+api-ms-win-core-synch-l1-2-0.dll	A: 0x72660000 - 0x72663000	(C:\Windows\system32\api-ms-win-core-synch-l1-2-0.dll)

+api-ms-win-core-processthreads-l1-1-1.dll	A: 0x6FD40000 - 0x6FD43000	(C:\Windows\system32\api-ms-win-core-processthreads-l1-1-1.dll)

+api-ms-win-core-file-l1-2-0.dll	A: 0x6FD30000 - 0x6FD33000	(C:\Windows\system32\api-ms-win-core-file-l1-2-0.dll)

+api-ms-win-crt-heap-l1-1-0.dll	A: 0x6FD20000 - 0x6FD23000	(C:\Windows\system32\api-ms-win-crt-heap-l1-1-0.dll)

+api-ms-win-crt-string-l1-1-0.dll	A: 0x6FD10000 - 0x6FD14000	(C:\Windows\system32\api-ms-win-crt-string-l1-1-0.dll)

+api-ms-win-crt-stdio-l1-1-0.dll	A: 0x6FD00000 - 0x6FD04000	(C:\Windows\system32\api-ms-win-crt-stdio-l1-1-0.dll)

+api-ms-win-crt-convert-l1-1-0.dll	A: 0x6FCF0000 - 0x6FCF4000	(C:\Windows\system32\api-ms-win-crt-convert-l1-1-0.dll)

+MSVCP100.dll	A: 0x6B4A0000 - 0x6B509000	(C:\Windows\system32\MSVCP100.dll)

+MSVCR100.dll	A: 0x6B3E0000 - 0x6B49F000	(C:\Windows\system32\MSVCR100.dll)

+sql.DLL	A: 0x72D70000 - 0x72D7E000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\sql.DLL)

+LIBPQ.dll	A: 0x6DFC0000 - 0x6DFE5000	(D:\Software\bin\samp037_svr_R2-1-1_win32\LIBPQ.dll)

+SSLEAY32.dll	A: 0x6AB30000 - 0x6AB75000	(D:\Software\bin\samp037_svr_R2-1-1_win32\SSLEAY32.dll)

+LIBEAY32.dll	A: 0x6AA10000 - 0x6AB30000	(D:\Software\bin\samp037_svr_R2-1-1_win32\LIBEAY32.dll)

+libintl.dll	A: 0x6A300000 - 0x6A32B000	(D:\Software\bin\samp037_svr_R2-1-1_win32\libintl.dll)

+Secur32.dll	A: 0x70C00000 - 0x70C08000	(C:\Windows\system32\Secur32.dll)

+WLDAP32.dll	A: 0x76CF0000 - 0x76D35000	(C:\Windows\syswow64\WLDAP32.dll)

+MSVCP110.dll	A: 0x6A980000 - 0x6AA05000	(C:\Windows\system32\MSVCP110.dll)

+MSVCR110.dll	A: 0x6A8A0000 - 0x6A976000	(C:\Windows\system32\MSVCR110.dll)

+streamer.DLL	A: 0x69DD0000 - 0x69E37000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\streamer.DLL)

+MSVCP140.dll	A: 0x6FEA0000 - 0x6FF0F000	(C:\Windows\system32\MSVCP140.dll)

+api-ms-win-crt-locale-l1-1-0.dll	A: 0x6FCE0000 - 0x6FCE3000	(C:\Windows\system32\api-ms-win-crt-locale-l1-1-0.dll)

+api-ms-win-crt-math-l1-1-0.dll	A: 0x6FCD0000 - 0x6FCD5000	(C:\Windows\system32\api-ms-win-crt-math-l1-1-0.dll)

+api-ms-win-crt-filesystem-l1-1-0.dll	A: 0x6FCC0000 - 0x6FCC3000	(C:\Windows\system32\api-ms-win-crt-filesystem-l1-1-0.dll)

+api-ms-win-crt-time-l1-1-0.dll	A: 0x6FCB0000 - 0x6FCB3000	(C:\Windows\system32\api-ms-win-crt-time-l1-1-0.dll)

+api-ms-win-crt-environment-l1-1-0.dll	A: 0x6FCA0000 - 0x6FCA3000	(C:\Windows\system32\api-ms-win-crt-environment-l1-1-0.dll)

+api-ms-win-crt-utility-l1-1-0.dll	A: 0x6FC90000 - 0x6FC93000	(C:\Windows\system32\api-ms-win-crt-utility-l1-1-0.dll)

+pawnregex.DLL	A: 0x6DF80000 - 0x6DFB7000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\pawnregex.DLL)

+pawncmd.DLL	A: 0x6A860000 - 0x6A899000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\pawncmd.DLL)

+Whirlpool.DLL	A: 0x6E340000 - 0x6E34D000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\Whirlpool.DLL)

+discord-connector.DLL	A: 0x69AF0000 - 0x69DC5000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\discord-connector.DLL)

+log-core2.dll	A: 0x69A40000 - 0x69AE5000	(D:\Software\bin\samp037_svr_R2-1-1_win32\log-core2.dll)

+CRYPT32.dll	A: 0x76540000 - 0x76662000	(C:\Windows\syswow64\CRYPT32.dll)

+MSASN1.dll	A: 0x764F0000 - 0x764FC000	(C:\Windows\syswow64\MSASN1.dll)

+CRYPTSP.dll	A: 0x72710000 - 0x72727000	(C:\Windows\system32\CRYPTSP.dll)

+mswsock.dll	A: 0x70C20000 - 0x70C5C000	(C:\Windows\system32\mswsock.dll)

+wshtcpip.dll	A: 0x70C10000 - 0x70C15000	(C:\Windows\System32\wshtcpip.dll)

+wship6.dll	A: 0x70BF0000 - 0x70BF6000	(C:\Windows\System32\wship6.dll)

+DNSAPI.dll	A: 0x6F040000 - 0x6F084000	(C:\Windows\system32\DNSAPI.dll)

+IPHLPAPI.DLL	A: 0x70C80000 - 0x70C9C000	(C:\Windows\system32\IPHLPAPI.DLL)

+WINNSI.DLL	A: 0x72480000 - 0x72487000	(C:\Windows\system32\WINNSI.DLL)

+rasadhlp.dll	A: 0x6F030000 - 0x6F036000	(C:\Windows\system32\rasadhlp.dll)

+NLAapi.dll	A: 0x73C50000 - 0x73C60000	(C:\Windows\system32\NLAapi.dll)

+napinsp.dll	A: 0x72D10000 - 0x72D20000	(C:\Windows\system32\napinsp.dll)

+pnrpnsp.dll	A: 0x72CF0000 - 0x72D02000	(C:\Windows\system32\pnrpnsp.dll)

+winrnr.dll	A: 0x72CE0000 - 0x72CE8000	(C:\Windows\System32\winrnr.dll)

+PROPSYS.dll	A: 0x70070000 - 0x70165000	(C:\Windows\system32\PROPSYS.dll)

+OLEAUT32.dll	A: 0x76D40000 - 0x76DD1000	(C:\Windows\syswow64\OLEAUT32.dll)

+comctl32.dll	A: 0x74D80000 - 0x74F1E000	(C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.18837_none_41e855142bd5705d\comctl32.dll)

+apphelp.dll	A: 0x724B0000 - 0x724FC000	(C:\Windows\system32\apphelp.dll)

+CLBCatQ.DLL	A: 0x76BC0000 - 0x76C43000	(C:\Windows\syswow64\CLBCatQ.DLL)

+iertutil.dll	A: 0x770A0000 - 0x772A1000	(C:\Windows\syswow64\iertutil.dll)

+urlmon.dll	A: 0x76A50000 - 0x76B90000	(C:\Windows\syswow64\urlmon.dll)

+XmlLite.dll	A: 0x76E40000 - 0x76E6F000	(C:\Windows\syswow64\XmlLite.dll)

+WININET.dll	A: 0x75FC0000 - 0x760B5000	(C:\Windows\syswow64\WININET.dll)

+SETUPAPI.dll	A: 0x766A0000 - 0x7683D000	(C:\Windows\syswow64\SETUPAPI.dll)

+CFGMGR32.dll	A: 0x76B90000 - 0x76BB7000	(C:\Windows\syswow64\CFGMGR32.dll)

+DEVOBJ.dll	A: 0x76A30000 - 0x76A42000	(C:\Windows\syswow64\DEVOBJ.dll)

+ntmarta.dll	A: 0x70B00000 - 0x70B21000	(C:\Windows\system32\ntmarta.dll)

+profapi.dll	A: 0x72680000 - 0x7268B000	(C:\Windows\system32\profapi.dll)

+VERSION.dll	A: 0x74F20000 - 0x74F29000	(C:\Windows\system32\VERSION.dll)

+

+--------------------------

+SA-MP Server: 0.3.7-R2

+

+Exception At Address: 0x00468D34 Module: (samp-server.exe)

+

+Registers:

+EAX: 0x00000000	EBX: 0x03A27A30	ECX: 0x00000000	EDX: 0x00000000

+ESI: 0x00000000	EDI: 0x0354C4C0	EBP: 0x0018F7F8	ESP: 0x0018F698

+EFLAGS: 0x00210246

+

+Stack:

++0000: 0x00479C04   0x00000000   0x0354C4C0   0x03A27A30

++0010: 0x039EB5B0   0x0018F734   0x0262E760   0x02630384

++0020: 0x0018F7D0   0x00000050   0x00470937   0x0018F6E4

++0030: 0x69D90269   0x02730000   0x00000000   0x00000048

++0040: 0x0018F75C   0x00000000   0x0018F7D0   0x0000000C

++0050: 0x0018F734   0x0018F704   0x70412D23   0x0018F734

++0060: 0x0018F7D0   0x0000000C   0x00000000   0x00000000

++0070: 0x0018F6B0   0x0018F774   0x02630384   0x0018F7D0

++0080: 0x02630384   0x0018F780   0x70413CD0   0x00000003

++0090: 0x02630358   0x0018F7A0   0x0000000C   0x72616863

++00A0: 0x65746361   0x64695F72   0x70413A00   0x0000000C

++00B0: 0x02630384   0x00000000   0x7041A4B5   0x0018F734

++00C0: 0x0018F773   0x02630391   0x0262E760   0x0018F701

++00D0: 0x0262E704   0x0262E6DC   0x0018F80C   0x0018F80C

++00E0: 0x70416F48   0xFFFFFFFF   0x0018F818   0x704115A7

++00F0: 0x0354C4C0   0x0354C4C0   0x039EB5B0   0x00000000

++0100: 0x00000002   0x00000018   0x02630350   0x00000002

++0110: 0x00000018   0x31343A39   0x0018F800   0x0018F800

++0120: 0x7261775B   0x676E696E   0x0000005D   0x00000000

++0130: 0x19BD3366   0x0018F818   0x72616863   0x65746361

+

+--------------------------

+

+Loaded Modules:

+samp-server.exe	A: 0x00400000 - 0x00519000	(D:\Software\bin\samp037_svr_R2-1-1_win32\samp-server.exe)

+ntdll.dll	A: 0x77690000 - 0x77810000	(C:\Windows\SysWOW64\ntdll.dll)

+kernel32.dll	A: 0x76F70000 - 0x77080000	(C:\Windows\syswow64\kernel32.dll)

+KERNELBASE.dll	A: 0x764A0000 - 0x764E7000	(C:\Windows\syswow64\KERNELBASE.dll)

+SHELL32.dll	A: 0x75370000 - 0x75FBC000	(C:\Windows\syswow64\SHELL32.dll)

+msvcrt.dll	A: 0x763E0000 - 0x7648C000	(C:\Windows\syswow64\msvcrt.dll)

+SHLWAPI.dll	A: 0x76340000 - 0x76397000	(C:\Windows\syswow64\SHLWAPI.dll)

+GDI32.dll	A: 0x76150000 - 0x761E0000	(C:\Windows\syswow64\GDI32.dll)

+USER32.dll	A: 0x76840000 - 0x76940000	(C:\Windows\syswow64\USER32.dll)

+ADVAPI32.dll	A: 0x751F0000 - 0x75291000	(C:\Windows\syswow64\ADVAPI32.dll)

+sechost.dll	A: 0x77080000 - 0x77099000	(C:\Windows\SysWOW64\sechost.dll)

+RPCRT4.dll	A: 0x76E80000 - 0x76F70000	(C:\Windows\syswow64\RPCRT4.dll)

+SspiCli.dll	A: 0x75190000 - 0x751F0000	(C:\Windows\syswow64\SspiCli.dll)

+CRYPTBASE.dll	A: 0x75180000 - 0x7518C000	(C:\Windows\syswow64\CRYPTBASE.dll)

+LPK.dll	A: 0x76E70000 - 0x76E7A000	(C:\Windows\syswow64\LPK.dll)

+USP10.dll	A: 0x76C50000 - 0x76CED000	(C:\Windows\syswow64\USP10.dll)

+WSOCK32.dll	A: 0x729C0000 - 0x729C7000	(C:\Windows\system32\WSOCK32.dll)

+WS2_32.dll	A: 0x76500000 - 0x76535000	(C:\Windows\syswow64\WS2_32.dll)

+NSI.dll	A: 0x760C0000 - 0x760C6000	(C:\Windows\syswow64\NSI.dll)

+WINMM.dll	A: 0x74FA0000 - 0x74FD2000	(C:\Windows\system32\WINMM.dll)

+IMM32.DLL	A: 0x769D0000 - 0x76A30000	(C:\Windows\system32\IMM32.DLL)

+MSCTF.dll	A: 0x752A0000 - 0x7536D000	(C:\Windows\syswow64\MSCTF.dll)

+sscanf.DLL	A: 0x10000000 - 0x1000E000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\sscanf.DLL)

+VCRUNTIME140.dll	A: 0x6FE80000 - 0x6FE93000	(C:\Windows\system32\VCRUNTIME140.dll)

+api-ms-win-crt-runtime-l1-1-0.dll	A: 0x6FE70000 - 0x6FE74000	(C:\Windows\system32\api-ms-win-crt-runtime-l1-1-0.dll)

+ucrtbase.DLL	A: 0x6FD80000 - 0x6FE61000	(C:\Windows\system32\ucrtbase.DLL)

+api-ms-win-core-timezone-l1-1-0.dll	A: 0x6FD70000 - 0x6FD73000	(C:\Windows\system32\api-ms-win-core-timezone-l1-1-0.dll)

+api-ms-win-core-file-l2-1-0.dll	A: 0x6FD60000 - 0x6FD63000	(C:\Windows\system32\api-ms-win-core-file-l2-1-0.dll)

+api-ms-win-core-localization-l1-2-0.dll	A: 0x6FD50000 - 0x6FD53000	(C:\Windows\system32\api-ms-win-core-localization-l1-2-0.dll)

+api-ms-win-core-synch-l1-2-0.dll	A: 0x72660000 - 0x72663000	(C:\Windows\system32\api-ms-win-core-synch-l1-2-0.dll)

+api-ms-win-core-processthreads-l1-1-1.dll	A: 0x6FD40000 - 0x6FD43000	(C:\Windows\system32\api-ms-win-core-processthreads-l1-1-1.dll)

+api-ms-win-core-file-l1-2-0.dll	A: 0x6FD30000 - 0x6FD33000	(C:\Windows\system32\api-ms-win-core-file-l1-2-0.dll)

+api-ms-win-crt-heap-l1-1-0.dll	A: 0x6FD20000 - 0x6FD23000	(C:\Windows\system32\api-ms-win-crt-heap-l1-1-0.dll)

+api-ms-win-crt-string-l1-1-0.dll	A: 0x6FD10000 - 0x6FD14000	(C:\Windows\system32\api-ms-win-crt-string-l1-1-0.dll)

+api-ms-win-crt-stdio-l1-1-0.dll	A: 0x6FD00000 - 0x6FD04000	(C:\Windows\system32\api-ms-win-crt-stdio-l1-1-0.dll)

+api-ms-win-crt-convert-l1-1-0.dll	A: 0x6FCF0000 - 0x6FCF4000	(C:\Windows\system32\api-ms-win-crt-convert-l1-1-0.dll)

+MSVCP100.dll	A: 0x6B3B0000 - 0x6B419000	(C:\Windows\system32\MSVCP100.dll)

+MSVCR100.dll	A: 0x69D80000 - 0x69E3F000	(C:\Windows\system32\MSVCR100.dll)

+sql.DLL	A: 0x6E3E0000 - 0x6E3EE000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\sql.DLL)

+LIBPQ.dll	A: 0x6DFC0000 - 0x6DFE5000	(D:\Software\bin\samp037_svr_R2-1-1_win32\LIBPQ.dll)

+SSLEAY32.dll	A: 0x6AB30000 - 0x6AB75000	(D:\Software\bin\samp037_svr_R2-1-1_win32\SSLEAY32.dll)

+LIBEAY32.dll	A: 0x69C60000 - 0x69D80000	(D:\Software\bin\samp037_svr_R2-1-1_win32\LIBEAY32.dll)

+libintl.dll	A: 0x6A300000 - 0x6A32B000	(D:\Software\bin\samp037_svr_R2-1-1_win32\libintl.dll)

+Secur32.dll	A: 0x70C00000 - 0x70C08000	(C:\Windows\system32\Secur32.dll)

+WLDAP32.dll	A: 0x76CF0000 - 0x76D35000	(C:\Windows\syswow64\WLDAP32.dll)

+MSVCP110.dll	A: 0x6AAA0000 - 0x6AB25000	(C:\Windows\system32\MSVCP110.dll)

+MSVCR110.dll	A: 0x69B80000 - 0x69C56000	(C:\Windows\system32\MSVCR110.dll)

+streamer.DLL	A: 0x69B10000 - 0x69B77000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\streamer.DLL)

+MSVCP140.dll	A: 0x6FEA0000 - 0x6FF0F000	(C:\Windows\system32\MSVCP140.dll)

+api-ms-win-crt-locale-l1-1-0.dll	A: 0x6FCE0000 - 0x6FCE3000	(C:\Windows\system32\api-ms-win-crt-locale-l1-1-0.dll)

+api-ms-win-crt-math-l1-1-0.dll	A: 0x6FCD0000 - 0x6FCD5000	(C:\Windows\system32\api-ms-win-crt-math-l1-1-0.dll)

+api-ms-win-crt-filesystem-l1-1-0.dll	A: 0x6FCC0000 - 0x6FCC3000	(C:\Windows\system32\api-ms-win-crt-filesystem-l1-1-0.dll)

+api-ms-win-crt-time-l1-1-0.dll	A: 0x6FCB0000 - 0x6FCB3000	(C:\Windows\system32\api-ms-win-crt-time-l1-1-0.dll)

+api-ms-win-crt-environment-l1-1-0.dll	A: 0x6FCA0000 - 0x6FCA3000	(C:\Windows\system32\api-ms-win-crt-environment-l1-1-0.dll)

+api-ms-win-crt-utility-l1-1-0.dll	A: 0x6FC90000 - 0x6FC93000	(C:\Windows\system32\api-ms-win-crt-utility-l1-1-0.dll)

+pawnregex.DLL	A: 0x6DF80000 - 0x6DFB7000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\pawnregex.DLL)

+pawncmd.DLL	A: 0x69AD0000 - 0x69B09000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\pawncmd.DLL)

+Whirlpool.DLL	A: 0x6E340000 - 0x6E34D000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\Whirlpool.DLL)

+discord-connector.DLL	A: 0x697F0000 - 0x69AC5000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\discord-connector.DLL)

+log-core2.dll	A: 0x69740000 - 0x697E5000	(D:\Software\bin\samp037_svr_R2-1-1_win32\log-core2.dll)

+CRYPT32.dll	A: 0x76540000 - 0x76662000	(C:\Windows\syswow64\CRYPT32.dll)

+MSASN1.dll	A: 0x764F0000 - 0x764FC000	(C:\Windows\syswow64\MSASN1.dll)

+CRYPTSP.dll	A: 0x72710000 - 0x72727000	(C:\Windows\system32\CRYPTSP.dll)

+mswsock.dll	A: 0x70C20000 - 0x70C5C000	(C:\Windows\system32\mswsock.dll)

+wshtcpip.dll	A: 0x70C10000 - 0x70C15000	(C:\Windows\System32\wshtcpip.dll)

+wship6.dll	A: 0x70BF0000 - 0x70BF6000	(C:\Windows\System32\wship6.dll)

+DNSAPI.dll	A: 0x6F040000 - 0x6F084000	(C:\Windows\system32\DNSAPI.dll)

+IPHLPAPI.DLL	A: 0x70C80000 - 0x70C9C000	(C:\Windows\system32\IPHLPAPI.DLL)

+WINNSI.DLL	A: 0x72480000 - 0x72487000	(C:\Windows\system32\WINNSI.DLL)

+rasadhlp.dll	A: 0x6F030000 - 0x6F036000	(C:\Windows\system32\rasadhlp.dll)

+NLAapi.dll	A: 0x73C50000 - 0x73C60000	(C:\Windows\system32\NLAapi.dll)

+napinsp.dll	A: 0x72D10000 - 0x72D20000	(C:\Windows\system32\napinsp.dll)

+pnrpnsp.dll	A: 0x72CF0000 - 0x72D02000	(C:\Windows\system32\pnrpnsp.dll)

+winrnr.dll	A: 0x72CE0000 - 0x72CE8000	(C:\Windows\System32\winrnr.dll)

+PROPSYS.dll	A: 0x70070000 - 0x70165000	(C:\Windows\system32\PROPSYS.dll)

+OLEAUT32.dll	A: 0x76D40000 - 0x76DD1000	(C:\Windows\syswow64\OLEAUT32.dll)

+comctl32.dll	A: 0x74D80000 - 0x74F1E000	(C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.18837_none_41e855142bd5705d\comctl32.dll)

+apphelp.dll	A: 0x724B0000 - 0x724FC000	(C:\Windows\system32\apphelp.dll)

+CLBCatQ.DLL	A: 0x76BC0000 - 0x76C43000	(C:\Windows\syswow64\CLBCatQ.DLL)

+iertutil.dll	A: 0x770A0000 - 0x772A1000	(C:\Windows\syswow64\iertutil.dll)

+urlmon.dll	A: 0x76A50000 - 0x76B90000	(C:\Windows\syswow64\urlmon.dll)

+XmlLite.dll	A: 0x76E40000 - 0x76E6F000	(C:\Windows\syswow64\XmlLite.dll)

+WININET.dll	A: 0x75FC0000 - 0x760B5000	(C:\Windows\syswow64\WININET.dll)

+SETUPAPI.dll	A: 0x766A0000 - 0x7683D000	(C:\Windows\syswow64\SETUPAPI.dll)

+CFGMGR32.dll	A: 0x76B90000 - 0x76BB7000	(C:\Windows\syswow64\CFGMGR32.dll)

+DEVOBJ.dll	A: 0x76A30000 - 0x76A42000	(C:\Windows\syswow64\DEVOBJ.dll)

+ntmarta.dll	A: 0x70B00000 - 0x70B21000	(C:\Windows\system32\ntmarta.dll)

+profapi.dll	A: 0x72680000 - 0x7268B000	(C:\Windows\system32\profapi.dll)

+VERSION.dll	A: 0x74F20000 - 0x74F29000	(C:\Windows\system32\VERSION.dll)

+

+--------------------------

+SA-MP Server: 0.3.7-R2

+

+Exception At Address: 0x00468D34 Module: (samp-server.exe)

+

+Registers:

+EAX: 0x00000000	EBX: 0x03B37A78	ECX: 0x00000000	EDX: 0x00000000

+ESI: 0x00000000	EDI: 0x0365C4C0	EBP: 0x0018F7F8	ESP: 0x0018F698

+EFLAGS: 0x00210246

+

+Stack:

++0000: 0x00479C04   0x00000000   0x0365C4C0   0x03B37A78

++0010: 0x03AFB5B0   0x0018F734   0x0260E760   0x02610384

++0020: 0x0018F7D0   0x00000050   0x00470937   0x0018F6E4

++0030: 0x67420269   0x026C0000   0x00000000   0x00000048

++0040: 0x0018F75C   0x00000000   0x0018F7D0   0x0000000C

++0050: 0x0018F734   0x0018F704   0x6B3C2D23   0x0018F734

++0060: 0x0018F7D0   0x0000000C   0x00000000   0x00000000

++0070: 0x0018F6B0   0x0018F774   0x02610384   0x0018F7D0

++0080: 0x02610384   0x0018F780   0x6B3C3CD0   0x00000003

++0090: 0x02610358   0x0018F7A0   0x0000000C   0x72616863

++00A0: 0x65746361   0x64695F72   0x6B3C3A00   0x0000000C

++00B0: 0x02610384   0x00000000   0x6B3CA4B5   0x0018F734

++00C0: 0x0018F773   0x02610391   0x0260E760   0x0018F701

++00D0: 0x0260E704   0x0260E6DC   0x0018F80C   0x0018F80C

++00E0: 0x6B3C6F48   0xFFFFFFFF   0x0018F818   0x6B3C15A7

++00F0: 0x0365C4C0   0x0365C4C0   0x03AFB5B0   0x00000000

++0100: 0x00000002   0x00000018   0x02610350   0x00000002

++0110: 0x00000018   0x37303A38   0x0018F800   0x0018F800

++0120: 0x7261775B   0x676E696E   0x0000005D   0x00000000

++0130: 0xCEF7E008   0x0018F818   0x72616863   0x65746361

+

+--------------------------

+

+Loaded Modules:

+samp-server.exe	A: 0x00400000 - 0x00519000	(D:\Software\bin\samp037_svr_R2-1-1_win32\samp-server.exe)

+ntdll.dll	A: 0x77690000 - 0x77810000	(C:\Windows\SysWOW64\ntdll.dll)

+kernel32.dll	A: 0x76F70000 - 0x77080000	(C:\Windows\syswow64\kernel32.dll)

+KERNELBASE.dll	A: 0x764A0000 - 0x764E7000	(C:\Windows\syswow64\KERNELBASE.dll)

+SHELL32.dll	A: 0x75370000 - 0x75FBC000	(C:\Windows\syswow64\SHELL32.dll)

+msvcrt.dll	A: 0x763E0000 - 0x7648C000	(C:\Windows\syswow64\msvcrt.dll)

+SHLWAPI.dll	A: 0x76340000 - 0x76397000	(C:\Windows\syswow64\SHLWAPI.dll)

+GDI32.dll	A: 0x76150000 - 0x761E0000	(C:\Windows\syswow64\GDI32.dll)

+USER32.dll	A: 0x76840000 - 0x76940000	(C:\Windows\syswow64\USER32.dll)

+ADVAPI32.dll	A: 0x751F0000 - 0x75291000	(C:\Windows\syswow64\ADVAPI32.dll)

+sechost.dll	A: 0x77080000 - 0x77099000	(C:\Windows\SysWOW64\sechost.dll)

+RPCRT4.dll	A: 0x76E80000 - 0x76F70000	(C:\Windows\syswow64\RPCRT4.dll)

+SspiCli.dll	A: 0x75190000 - 0x751F0000	(C:\Windows\syswow64\SspiCli.dll)

+CRYPTBASE.dll	A: 0x75180000 - 0x7518C000	(C:\Windows\syswow64\CRYPTBASE.dll)

+LPK.dll	A: 0x76E70000 - 0x76E7A000	(C:\Windows\syswow64\LPK.dll)

+USP10.dll	A: 0x76C50000 - 0x76CED000	(C:\Windows\syswow64\USP10.dll)

+WSOCK32.dll	A: 0x729C0000 - 0x729C7000	(C:\Windows\system32\WSOCK32.dll)

+WS2_32.dll	A: 0x76500000 - 0x76535000	(C:\Windows\syswow64\WS2_32.dll)

+NSI.dll	A: 0x760C0000 - 0x760C6000	(C:\Windows\syswow64\NSI.dll)

+WINMM.dll	A: 0x74FA0000 - 0x74FD2000	(C:\Windows\system32\WINMM.dll)

+IMM32.DLL	A: 0x769D0000 - 0x76A30000	(C:\Windows\system32\IMM32.DLL)

+MSCTF.dll	A: 0x752A0000 - 0x7536D000	(C:\Windows\syswow64\MSCTF.dll)

+sscanf.DLL	A: 0x10000000 - 0x1000E000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\sscanf.DLL)

+VCRUNTIME140.dll	A: 0x6FE80000 - 0x6FE93000	(C:\Windows\system32\VCRUNTIME140.dll)

+api-ms-win-crt-runtime-l1-1-0.dll	A: 0x6FE70000 - 0x6FE74000	(C:\Windows\system32\api-ms-win-crt-runtime-l1-1-0.dll)

+ucrtbase.DLL	A: 0x6FD80000 - 0x6FE61000	(C:\Windows\system32\ucrtbase.DLL)

+api-ms-win-core-timezone-l1-1-0.dll	A: 0x6FD70000 - 0x6FD73000	(C:\Windows\system32\api-ms-win-core-timezone-l1-1-0.dll)

+api-ms-win-core-file-l2-1-0.dll	A: 0x6FD60000 - 0x6FD63000	(C:\Windows\system32\api-ms-win-core-file-l2-1-0.dll)

+api-ms-win-core-localization-l1-2-0.dll	A: 0x6FD50000 - 0x6FD53000	(C:\Windows\system32\api-ms-win-core-localization-l1-2-0.dll)

+api-ms-win-core-synch-l1-2-0.dll	A: 0x72660000 - 0x72663000	(C:\Windows\system32\api-ms-win-core-synch-l1-2-0.dll)

+api-ms-win-core-processthreads-l1-1-1.dll	A: 0x6FD40000 - 0x6FD43000	(C:\Windows\system32\api-ms-win-core-processthreads-l1-1-1.dll)

+api-ms-win-core-file-l1-2-0.dll	A: 0x6FD30000 - 0x6FD33000	(C:\Windows\system32\api-ms-win-core-file-l1-2-0.dll)

+api-ms-win-crt-heap-l1-1-0.dll	A: 0x6FD20000 - 0x6FD23000	(C:\Windows\system32\api-ms-win-crt-heap-l1-1-0.dll)

+api-ms-win-crt-string-l1-1-0.dll	A: 0x6FD10000 - 0x6FD14000	(C:\Windows\system32\api-ms-win-crt-string-l1-1-0.dll)

+api-ms-win-crt-stdio-l1-1-0.dll	A: 0x6FD00000 - 0x6FD04000	(C:\Windows\system32\api-ms-win-crt-stdio-l1-1-0.dll)

+api-ms-win-crt-convert-l1-1-0.dll	A: 0x6FCF0000 - 0x6FCF4000	(C:\Windows\system32\api-ms-win-crt-convert-l1-1-0.dll)

+MSVCP100.dll	A: 0x67AA0000 - 0x67B09000	(C:\Windows\system32\MSVCP100.dll)

+MSVCR100.dll	A: 0x67410000 - 0x674CF000	(C:\Windows\system32\MSVCR100.dll)

+sql.DLL	A: 0x6E3E0000 - 0x6E3EE000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\sql.DLL)

+LIBPQ.dll	A: 0x69740000 - 0x69765000	(D:\Software\bin\samp037_svr_R2-1-1_win32\LIBPQ.dll)

+SSLEAY32.dll	A: 0x680A0000 - 0x680E5000	(D:\Software\bin\samp037_svr_R2-1-1_win32\SSLEAY32.dll)

+LIBEAY32.dll	A: 0x651C0000 - 0x652E0000	(D:\Software\bin\samp037_svr_R2-1-1_win32\LIBEAY32.dll)

+libintl.dll	A: 0x6A300000 - 0x6A32B000	(D:\Software\bin\samp037_svr_R2-1-1_win32\libintl.dll)

+Secur32.dll	A: 0x70C00000 - 0x70C08000	(C:\Windows\system32\Secur32.dll)

+WLDAP32.dll	A: 0x76CF0000 - 0x76D35000	(C:\Windows\syswow64\WLDAP32.dll)

+MSVCP110.dll	A: 0x67500000 - 0x67585000	(C:\Windows\system32\MSVCP110.dll)

+MSVCR110.dll	A: 0x5D390000 - 0x5D466000	(C:\Windows\system32\MSVCR110.dll)

+streamer.DLL	A: 0x67B10000 - 0x67B77000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\streamer.DLL)

+MSVCP140.dll	A: 0x6FEA0000 - 0x6FF0F000	(C:\Windows\system32\MSVCP140.dll)

+api-ms-win-crt-locale-l1-1-0.dll	A: 0x6FCE0000 - 0x6FCE3000	(C:\Windows\system32\api-ms-win-crt-locale-l1-1-0.dll)

+api-ms-win-crt-math-l1-1-0.dll	A: 0x6FCD0000 - 0x6FCD5000	(C:\Windows\system32\api-ms-win-crt-math-l1-1-0.dll)

+api-ms-win-crt-filesystem-l1-1-0.dll	A: 0x6FCC0000 - 0x6FCC3000	(C:\Windows\system32\api-ms-win-crt-filesystem-l1-1-0.dll)

+api-ms-win-crt-time-l1-1-0.dll	A: 0x6FCB0000 - 0x6FCB3000	(C:\Windows\system32\api-ms-win-crt-time-l1-1-0.dll)

+api-ms-win-crt-environment-l1-1-0.dll	A: 0x6FCA0000 - 0x6FCA3000	(C:\Windows\system32\api-ms-win-crt-environment-l1-1-0.dll)

+api-ms-win-crt-utility-l1-1-0.dll	A: 0x6FC90000 - 0x6FC93000	(C:\Windows\system32\api-ms-win-crt-utility-l1-1-0.dll)

+pawnregex.DLL	A: 0x6AA90000 - 0x6AAC7000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\pawnregex.DLL)

+pawncmd.DLL	A: 0x68830000 - 0x68869000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\pawncmd.DLL)

+Whirlpool.DLL	A: 0x6A850000 - 0x6A85D000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\Whirlpool.DLL)

+discord-connector.DLL	A: 0x5D0B0000 - 0x5D385000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\discord-connector.DLL)

+log-core2.dll	A: 0x5D000000 - 0x5D0A5000	(D:\Software\bin\samp037_svr_R2-1-1_win32\log-core2.dll)

+CRYPT32.dll	A: 0x76540000 - 0x76662000	(C:\Windows\syswow64\CRYPT32.dll)

+MSASN1.dll	A: 0x764F0000 - 0x764FC000	(C:\Windows\syswow64\MSASN1.dll)

+CRYPTSP.dll	A: 0x72710000 - 0x72727000	(C:\Windows\system32\CRYPTSP.dll)

+mswsock.dll	A: 0x70C20000 - 0x70C5C000	(C:\Windows\system32\mswsock.dll)

+wshtcpip.dll	A: 0x70C10000 - 0x70C15000	(C:\Windows\System32\wshtcpip.dll)

+wship6.dll	A: 0x70BF0000 - 0x70BF6000	(C:\Windows\System32\wship6.dll)

+DNSAPI.dll	A: 0x6F040000 - 0x6F084000	(C:\Windows\system32\DNSAPI.dll)

+IPHLPAPI.DLL	A: 0x70C80000 - 0x70C9C000	(C:\Windows\system32\IPHLPAPI.DLL)

+WINNSI.DLL	A: 0x72480000 - 0x72487000	(C:\Windows\system32\WINNSI.DLL)

+rasadhlp.dll	A: 0x6F030000 - 0x6F036000	(C:\Windows\system32\rasadhlp.dll)

+NLAapi.dll	A: 0x73C50000 - 0x73C60000	(C:\Windows\system32\NLAapi.dll)

+napinsp.dll	A: 0x72D10000 - 0x72D20000	(C:\Windows\system32\napinsp.dll)

+pnrpnsp.dll	A: 0x72CF0000 - 0x72D02000	(C:\Windows\system32\pnrpnsp.dll)

+winrnr.dll	A: 0x72CE0000 - 0x72CE8000	(C:\Windows\System32\winrnr.dll)

+PROPSYS.dll	A: 0x70070000 - 0x70165000	(C:\Windows\system32\PROPSYS.dll)

+OLEAUT32.dll	A: 0x76D40000 - 0x76DD1000	(C:\Windows\syswow64\OLEAUT32.dll)

+comctl32.dll	A: 0x74D80000 - 0x74F1E000	(C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.18837_none_41e855142bd5705d\comctl32.dll)

+apphelp.dll	A: 0x724B0000 - 0x724FC000	(C:\Windows\system32\apphelp.dll)

+CLBCatQ.DLL	A: 0x76BC0000 - 0x76C43000	(C:\Windows\syswow64\CLBCatQ.DLL)

+iertutil.dll	A: 0x770A0000 - 0x772A1000	(C:\Windows\syswow64\iertutil.dll)

+urlmon.dll	A: 0x76A50000 - 0x76B90000	(C:\Windows\syswow64\urlmon.dll)

+XmlLite.dll	A: 0x76E40000 - 0x76E6F000	(C:\Windows\syswow64\XmlLite.dll)

+WININET.dll	A: 0x75FC0000 - 0x760B5000	(C:\Windows\syswow64\WININET.dll)

+SETUPAPI.dll	A: 0x766A0000 - 0x7683D000	(C:\Windows\syswow64\SETUPAPI.dll)

+CFGMGR32.dll	A: 0x76B90000 - 0x76BB7000	(C:\Windows\syswow64\CFGMGR32.dll)

+DEVOBJ.dll	A: 0x76A30000 - 0x76A42000	(C:\Windows\syswow64\DEVOBJ.dll)

+ntmarta.dll	A: 0x70B00000 - 0x70B21000	(C:\Windows\system32\ntmarta.dll)

+profapi.dll	A: 0x72680000 - 0x7268B000	(C:\Windows\system32\profapi.dll)

+VERSION.dll	A: 0x74F20000 - 0x74F29000	(C:\Windows\system32\VERSION.dll)

+

+--------------------------

+SA-MP Server: 0.3.7-R2

+

+Exception At Address: 0x00468D34 Module: (samp-server.exe)

+

+Registers:

+EAX: 0x00000000	EBX: 0x03957A20	ECX: 0x00000000	EDX: 0x00000000

+ESI: 0x00000000	EDI: 0x0347C4C0	EBP: 0x0018F7F8	ESP: 0x0018F698

+EFLAGS: 0x00210246

+

+Stack:

++0000: 0x00479C04   0x00000000   0x0347C4C0   0x03957A20

++0010: 0x0391B5B0   0x0018F734   0x0272E760   0x02730384

++0020: 0x0018F7D0   0x00000050   0x00470937   0x0018F6E4

++0030: 0x6B3F0269   0x028B0000   0x00000000   0x00000048

++0040: 0x0018F75C   0x00000000   0x0018F7D0   0x0000000C

++0050: 0x0018F734   0x0018F704   0x70412D23   0x0018F734

++0060: 0x0018F7D0   0x0000000C   0x00000000   0x00000000

++0070: 0x0018F6B0   0x0018F774   0x02730384   0x0018F7D0

++0080: 0x02730384   0x0018F780   0x70413CD0   0x00000003

++0090: 0x02730358   0x0018F7A0   0x0000000C   0x72616863

++00A0: 0x65746361   0x64695F72   0x70413A00   0x0000000C

++00B0: 0x02730384   0x00000000   0x7041A4B5   0x0018F734

++00C0: 0x0018F773   0x02730391   0x0272E760   0x0018F701

++00D0: 0x0272E704   0x0272E6DC   0x0018F80C   0x0018F80C

++00E0: 0x70416F48   0xFFFFFFFF   0x0018F818   0x704115A7

++00F0: 0x0347C4C0   0x0347C4C0   0x0391B5B0   0x00000000

++0100: 0x00000002   0x00000018   0x02730350   0x00000002

++0110: 0x00000018   0x39343A30   0x0018F800   0x0018F800

++0120: 0x7261775B   0x676E696E   0x0000005D   0x00000000

++0130: 0x0D9E73AA   0x0018F818   0x72616863   0x65746361

+

+--------------------------

+

+Loaded Modules:

+samp-server.exe	A: 0x00400000 - 0x00519000	(D:\Software\bin\samp037_svr_R2-1-1_win32\samp-server.exe)

+ntdll.dll	A: 0x77690000 - 0x77810000	(C:\Windows\SysWOW64\ntdll.dll)

+kernel32.dll	A: 0x76F70000 - 0x77080000	(C:\Windows\syswow64\kernel32.dll)

+KERNELBASE.dll	A: 0x764A0000 - 0x764E7000	(C:\Windows\syswow64\KERNELBASE.dll)

+SHELL32.dll	A: 0x75370000 - 0x75FBC000	(C:\Windows\syswow64\SHELL32.dll)

+msvcrt.dll	A: 0x763E0000 - 0x7648C000	(C:\Windows\syswow64\msvcrt.dll)

+SHLWAPI.dll	A: 0x76340000 - 0x76397000	(C:\Windows\syswow64\SHLWAPI.dll)

+GDI32.dll	A: 0x76150000 - 0x761E0000	(C:\Windows\syswow64\GDI32.dll)

+USER32.dll	A: 0x76840000 - 0x76940000	(C:\Windows\syswow64\USER32.dll)

+ADVAPI32.dll	A: 0x751F0000 - 0x75291000	(C:\Windows\syswow64\ADVAPI32.dll)

+sechost.dll	A: 0x77080000 - 0x77099000	(C:\Windows\SysWOW64\sechost.dll)

+RPCRT4.dll	A: 0x76E80000 - 0x76F70000	(C:\Windows\syswow64\RPCRT4.dll)

+SspiCli.dll	A: 0x75190000 - 0x751F0000	(C:\Windows\syswow64\SspiCli.dll)

+CRYPTBASE.dll	A: 0x75180000 - 0x7518C000	(C:\Windows\syswow64\CRYPTBASE.dll)

+LPK.dll	A: 0x76E70000 - 0x76E7A000	(C:\Windows\syswow64\LPK.dll)

+USP10.dll	A: 0x76C50000 - 0x76CED000	(C:\Windows\syswow64\USP10.dll)

+WSOCK32.dll	A: 0x729C0000 - 0x729C7000	(C:\Windows\system32\WSOCK32.dll)

+WS2_32.dll	A: 0x76500000 - 0x76535000	(C:\Windows\syswow64\WS2_32.dll)

+NSI.dll	A: 0x760C0000 - 0x760C6000	(C:\Windows\syswow64\NSI.dll)

+WINMM.dll	A: 0x74FA0000 - 0x74FD2000	(C:\Windows\system32\WINMM.dll)

+IMM32.DLL	A: 0x769D0000 - 0x76A30000	(C:\Windows\system32\IMM32.DLL)

+MSCTF.dll	A: 0x752A0000 - 0x7536D000	(C:\Windows\syswow64\MSCTF.dll)

+sscanf.DLL	A: 0x10000000 - 0x1000E000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\sscanf.DLL)

+VCRUNTIME140.dll	A: 0x6FE80000 - 0x6FE93000	(C:\Windows\system32\VCRUNTIME140.dll)

+api-ms-win-crt-runtime-l1-1-0.dll	A: 0x6FE70000 - 0x6FE74000	(C:\Windows\system32\api-ms-win-crt-runtime-l1-1-0.dll)

+ucrtbase.DLL	A: 0x6FD80000 - 0x6FE61000	(C:\Windows\system32\ucrtbase.DLL)

+api-ms-win-core-timezone-l1-1-0.dll	A: 0x6FD70000 - 0x6FD73000	(C:\Windows\system32\api-ms-win-core-timezone-l1-1-0.dll)

+api-ms-win-core-file-l2-1-0.dll	A: 0x6FD60000 - 0x6FD63000	(C:\Windows\system32\api-ms-win-core-file-l2-1-0.dll)

+api-ms-win-core-localization-l1-2-0.dll	A: 0x6FD50000 - 0x6FD53000	(C:\Windows\system32\api-ms-win-core-localization-l1-2-0.dll)

+api-ms-win-core-synch-l1-2-0.dll	A: 0x72660000 - 0x72663000	(C:\Windows\system32\api-ms-win-core-synch-l1-2-0.dll)

+api-ms-win-core-processthreads-l1-1-1.dll	A: 0x6FD40000 - 0x6FD43000	(C:\Windows\system32\api-ms-win-core-processthreads-l1-1-1.dll)

+api-ms-win-core-file-l1-2-0.dll	A: 0x6FD30000 - 0x6FD33000	(C:\Windows\system32\api-ms-win-core-file-l1-2-0.dll)

+api-ms-win-crt-heap-l1-1-0.dll	A: 0x6FD20000 - 0x6FD23000	(C:\Windows\system32\api-ms-win-crt-heap-l1-1-0.dll)

+api-ms-win-crt-string-l1-1-0.dll	A: 0x6FD10000 - 0x6FD14000	(C:\Windows\system32\api-ms-win-crt-string-l1-1-0.dll)

+api-ms-win-crt-stdio-l1-1-0.dll	A: 0x6FD00000 - 0x6FD04000	(C:\Windows\system32\api-ms-win-crt-stdio-l1-1-0.dll)

+api-ms-win-crt-convert-l1-1-0.dll	A: 0x6FCF0000 - 0x6FCF4000	(C:\Windows\system32\api-ms-win-crt-convert-l1-1-0.dll)

+MSVCP100.dll	A: 0x6B4A0000 - 0x6B509000	(C:\Windows\system32\MSVCP100.dll)

+MSVCR100.dll	A: 0x6B3E0000 - 0x6B49F000	(C:\Windows\system32\MSVCR100.dll)

+sql.DLL	A: 0x72D70000 - 0x72D7E000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\sql.DLL)

+LIBPQ.dll	A: 0x6DFC0000 - 0x6DFE5000	(D:\Software\bin\samp037_svr_R2-1-1_win32\LIBPQ.dll)

+SSLEAY32.dll	A: 0x6AB30000 - 0x6AB75000	(D:\Software\bin\samp037_svr_R2-1-1_win32\SSLEAY32.dll)

+LIBEAY32.dll	A: 0x6AA10000 - 0x6AB30000	(D:\Software\bin\samp037_svr_R2-1-1_win32\LIBEAY32.dll)

+libintl.dll	A: 0x6A300000 - 0x6A32B000	(D:\Software\bin\samp037_svr_R2-1-1_win32\libintl.dll)

+Secur32.dll	A: 0x70C00000 - 0x70C08000	(C:\Windows\system32\Secur32.dll)

+WLDAP32.dll	A: 0x76CF0000 - 0x76D35000	(C:\Windows\syswow64\WLDAP32.dll)

+MSVCP110.dll	A: 0x6A980000 - 0x6AA05000	(C:\Windows\system32\MSVCP110.dll)

+MSVCR110.dll	A: 0x6A8A0000 - 0x6A976000	(C:\Windows\system32\MSVCR110.dll)

+streamer.DLL	A: 0x69DD0000 - 0x69E37000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\streamer.DLL)

+MSVCP140.dll	A: 0x6FEA0000 - 0x6FF0F000	(C:\Windows\system32\MSVCP140.dll)

+api-ms-win-crt-locale-l1-1-0.dll	A: 0x6FCE0000 - 0x6FCE3000	(C:\Windows\system32\api-ms-win-crt-locale-l1-1-0.dll)

+api-ms-win-crt-math-l1-1-0.dll	A: 0x6FCD0000 - 0x6FCD5000	(C:\Windows\system32\api-ms-win-crt-math-l1-1-0.dll)

+api-ms-win-crt-filesystem-l1-1-0.dll	A: 0x6FCC0000 - 0x6FCC3000	(C:\Windows\system32\api-ms-win-crt-filesystem-l1-1-0.dll)

+api-ms-win-crt-time-l1-1-0.dll	A: 0x6FCB0000 - 0x6FCB3000	(C:\Windows\system32\api-ms-win-crt-time-l1-1-0.dll)

+api-ms-win-crt-environment-l1-1-0.dll	A: 0x6FCA0000 - 0x6FCA3000	(C:\Windows\system32\api-ms-win-crt-environment-l1-1-0.dll)

+api-ms-win-crt-utility-l1-1-0.dll	A: 0x6FC90000 - 0x6FC93000	(C:\Windows\system32\api-ms-win-crt-utility-l1-1-0.dll)

+pawnregex.DLL	A: 0x6DF80000 - 0x6DFB7000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\pawnregex.DLL)

+pawncmd.DLL	A: 0x6A860000 - 0x6A899000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\pawncmd.DLL)

+Whirlpool.DLL	A: 0x6E340000 - 0x6E34D000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\Whirlpool.DLL)

+discord-connector.DLL	A: 0x69AF0000 - 0x69DC5000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\discord-connector.DLL)

+log-core2.dll	A: 0x69A40000 - 0x69AE5000	(D:\Software\bin\samp037_svr_R2-1-1_win32\log-core2.dll)

+CRYPT32.dll	A: 0x76540000 - 0x76662000	(C:\Windows\syswow64\CRYPT32.dll)

+MSASN1.dll	A: 0x764F0000 - 0x764FC000	(C:\Windows\syswow64\MSASN1.dll)

+CRYPTSP.dll	A: 0x72710000 - 0x72727000	(C:\Windows\system32\CRYPTSP.dll)

+mswsock.dll	A: 0x70C20000 - 0x70C5C000	(C:\Windows\system32\mswsock.dll)

+wshtcpip.dll	A: 0x70C10000 - 0x70C15000	(C:\Windows\System32\wshtcpip.dll)

+wship6.dll	A: 0x70BF0000 - 0x70BF6000	(C:\Windows\System32\wship6.dll)

+DNSAPI.dll	A: 0x6F040000 - 0x6F084000	(C:\Windows\system32\DNSAPI.dll)

+IPHLPAPI.DLL	A: 0x70C80000 - 0x70C9C000	(C:\Windows\system32\IPHLPAPI.DLL)

+WINNSI.DLL	A: 0x72480000 - 0x72487000	(C:\Windows\system32\WINNSI.DLL)

+rasadhlp.dll	A: 0x6F030000 - 0x6F036000	(C:\Windows\system32\rasadhlp.dll)

+NLAapi.dll	A: 0x73C50000 - 0x73C60000	(C:\Windows\system32\NLAapi.dll)

+napinsp.dll	A: 0x72D10000 - 0x72D20000	(C:\Windows\system32\napinsp.dll)

+pnrpnsp.dll	A: 0x72CF0000 - 0x72D02000	(C:\Windows\system32\pnrpnsp.dll)

+winrnr.dll	A: 0x72CE0000 - 0x72CE8000	(C:\Windows\System32\winrnr.dll)

+PROPSYS.dll	A: 0x70070000 - 0x70165000	(C:\Windows\system32\PROPSYS.dll)

+OLEAUT32.dll	A: 0x76D40000 - 0x76DD1000	(C:\Windows\syswow64\OLEAUT32.dll)

+comctl32.dll	A: 0x74D80000 - 0x74F1E000	(C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.18837_none_41e855142bd5705d\comctl32.dll)

+apphelp.dll	A: 0x724B0000 - 0x724FC000	(C:\Windows\system32\apphelp.dll)

+CLBCatQ.DLL	A: 0x76BC0000 - 0x76C43000	(C:\Windows\syswow64\CLBCatQ.DLL)

+iertutil.dll	A: 0x770A0000 - 0x772A1000	(C:\Windows\syswow64\iertutil.dll)

+urlmon.dll	A: 0x76A50000 - 0x76B90000	(C:\Windows\syswow64\urlmon.dll)

+XmlLite.dll	A: 0x76E40000 - 0x76E6F000	(C:\Windows\syswow64\XmlLite.dll)

+WININET.dll	A: 0x75FC0000 - 0x760B5000	(C:\Windows\syswow64\WININET.dll)

+SETUPAPI.dll	A: 0x766A0000 - 0x7683D000	(C:\Windows\syswow64\SETUPAPI.dll)

+CFGMGR32.dll	A: 0x76B90000 - 0x76BB7000	(C:\Windows\syswow64\CFGMGR32.dll)

+DEVOBJ.dll	A: 0x76A30000 - 0x76A42000	(C:\Windows\syswow64\DEVOBJ.dll)

+ntmarta.dll	A: 0x70B00000 - 0x70B21000	(C:\Windows\system32\ntmarta.dll)

+profapi.dll	A: 0x72680000 - 0x7268B000	(C:\Windows\system32\profapi.dll)

+VERSION.dll	A: 0x74F20000 - 0x74F29000	(C:\Windows\system32\VERSION.dll)

+

+--------------------------

+SA-MP Server: 0.3.7-R2

+

+Exception At Address: 0x00468D34 Module: (samp-server.exe)

+

+Registers:

+EAX: 0x00000000	EBX: 0x03A37AD4	ECX: 0x00000000	EDX: 0x00000000

+ESI: 0x00000000	EDI: 0x0355C4C0	EBP: 0x0018F7F8	ESP: 0x0018F698

+EFLAGS: 0x00210246

+

+Stack:

++0000: 0x00479C04   0x00000000   0x0355C4C0   0x03A37AD4

++0010: 0x039FB5B0   0x0018F734   0x027DE760   0x027E0384

++0020: 0x0018F7D0   0x00000050   0x00470937   0x0018F6E4

++0030: 0x6B3F0269   0x02000000   0x00000000   0x00000048

++0040: 0x0018F75C   0x00000000   0x0018F7D0   0x0000000C

++0050: 0x0018F734   0x0018F704   0x70412D23   0x0018F734

++0060: 0x0018F7D0   0x0000000C   0x00000000   0x00000000

++0070: 0x0018F6B0   0x0018F774   0x027E0384   0x0018F7D0

++0080: 0x027E0384   0x0018F780   0x70413CD0   0x00000003

++0090: 0x027E0358   0x0018F7A0   0x0000000C   0x72616863

++00A0: 0x65746361   0x64695F72   0x70413A00   0x0000000C

++00B0: 0x027E0384   0x00000000   0x7041A4B5   0x0018F734

++00C0: 0x0018F773   0x027E0391   0x027DE760   0x0018F701

++00D0: 0x027DE704   0x027DE6DC   0x0018F80C   0x0018F80C

++00E0: 0x70416F48   0xFFFFFFFF   0x0018F818   0x704115A7

++00F0: 0x0355C4C0   0x0355C4C0   0x039FB5B0   0x00000000

++0100: 0x00000002   0x00000018   0x027E0350   0x00000002

++0110: 0x00000018   0x32333A36   0x0018F800   0x0018F800

++0120: 0x7261775B   0x676E696E   0x0000005D   0x00000000

++0130: 0x874C4105   0x0018F818   0x72616863   0x65746361

+

+--------------------------

+

+Loaded Modules:

+samp-server.exe	A: 0x00400000 - 0x00519000	(D:\Software\bin\samp037_svr_R2-1-1_win32\samp-server.exe)

+ntdll.dll	A: 0x77690000 - 0x77810000	(C:\Windows\SysWOW64\ntdll.dll)

+kernel32.dll	A: 0x76F70000 - 0x77080000	(C:\Windows\syswow64\kernel32.dll)

+KERNELBASE.dll	A: 0x764A0000 - 0x764E7000	(C:\Windows\syswow64\KERNELBASE.dll)

+SHELL32.dll	A: 0x75370000 - 0x75FBC000	(C:\Windows\syswow64\SHELL32.dll)

+msvcrt.dll	A: 0x763E0000 - 0x7648C000	(C:\Windows\syswow64\msvcrt.dll)

+SHLWAPI.dll	A: 0x76340000 - 0x76397000	(C:\Windows\syswow64\SHLWAPI.dll)

+GDI32.dll	A: 0x76150000 - 0x761E0000	(C:\Windows\syswow64\GDI32.dll)

+USER32.dll	A: 0x76840000 - 0x76940000	(C:\Windows\syswow64\USER32.dll)

+ADVAPI32.dll	A: 0x751F0000 - 0x75291000	(C:\Windows\syswow64\ADVAPI32.dll)

+sechost.dll	A: 0x77080000 - 0x77099000	(C:\Windows\SysWOW64\sechost.dll)

+RPCRT4.dll	A: 0x76E80000 - 0x76F70000	(C:\Windows\syswow64\RPCRT4.dll)

+SspiCli.dll	A: 0x75190000 - 0x751F0000	(C:\Windows\syswow64\SspiCli.dll)

+CRYPTBASE.dll	A: 0x75180000 - 0x7518C000	(C:\Windows\syswow64\CRYPTBASE.dll)

+LPK.dll	A: 0x76E70000 - 0x76E7A000	(C:\Windows\syswow64\LPK.dll)

+USP10.dll	A: 0x76C50000 - 0x76CED000	(C:\Windows\syswow64\USP10.dll)

+WSOCK32.dll	A: 0x729C0000 - 0x729C7000	(C:\Windows\system32\WSOCK32.dll)

+WS2_32.dll	A: 0x76500000 - 0x76535000	(C:\Windows\syswow64\WS2_32.dll)

+NSI.dll	A: 0x760C0000 - 0x760C6000	(C:\Windows\syswow64\NSI.dll)

+WINMM.dll	A: 0x74FA0000 - 0x74FD2000	(C:\Windows\system32\WINMM.dll)

+IMM32.DLL	A: 0x769D0000 - 0x76A30000	(C:\Windows\system32\IMM32.DLL)

+MSCTF.dll	A: 0x752A0000 - 0x7536D000	(C:\Windows\syswow64\MSCTF.dll)

+sscanf.DLL	A: 0x10000000 - 0x1000E000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\sscanf.DLL)

+VCRUNTIME140.dll	A: 0x6FE80000 - 0x6FE93000	(C:\Windows\system32\VCRUNTIME140.dll)

+api-ms-win-crt-runtime-l1-1-0.dll	A: 0x6FE70000 - 0x6FE74000	(C:\Windows\system32\api-ms-win-crt-runtime-l1-1-0.dll)

+ucrtbase.DLL	A: 0x6FD80000 - 0x6FE61000	(C:\Windows\system32\ucrtbase.DLL)

+api-ms-win-core-timezone-l1-1-0.dll	A: 0x6FD70000 - 0x6FD73000	(C:\Windows\system32\api-ms-win-core-timezone-l1-1-0.dll)

+api-ms-win-core-file-l2-1-0.dll	A: 0x6FD60000 - 0x6FD63000	(C:\Windows\system32\api-ms-win-core-file-l2-1-0.dll)

+api-ms-win-core-localization-l1-2-0.dll	A: 0x6FD50000 - 0x6FD53000	(C:\Windows\system32\api-ms-win-core-localization-l1-2-0.dll)

+api-ms-win-core-synch-l1-2-0.dll	A: 0x72660000 - 0x72663000	(C:\Windows\system32\api-ms-win-core-synch-l1-2-0.dll)

+api-ms-win-core-processthreads-l1-1-1.dll	A: 0x6FD40000 - 0x6FD43000	(C:\Windows\system32\api-ms-win-core-processthreads-l1-1-1.dll)

+api-ms-win-core-file-l1-2-0.dll	A: 0x6FD30000 - 0x6FD33000	(C:\Windows\system32\api-ms-win-core-file-l1-2-0.dll)

+api-ms-win-crt-heap-l1-1-0.dll	A: 0x6FD20000 - 0x6FD23000	(C:\Windows\system32\api-ms-win-crt-heap-l1-1-0.dll)

+api-ms-win-crt-string-l1-1-0.dll	A: 0x6FD10000 - 0x6FD14000	(C:\Windows\system32\api-ms-win-crt-string-l1-1-0.dll)

+api-ms-win-crt-stdio-l1-1-0.dll	A: 0x6FD00000 - 0x6FD04000	(C:\Windows\system32\api-ms-win-crt-stdio-l1-1-0.dll)

+api-ms-win-crt-convert-l1-1-0.dll	A: 0x6FCF0000 - 0x6FCF4000	(C:\Windows\system32\api-ms-win-crt-convert-l1-1-0.dll)

+MSVCP100.dll	A: 0x6B4A0000 - 0x6B509000	(C:\Windows\system32\MSVCP100.dll)

+MSVCR100.dll	A: 0x6B3E0000 - 0x6B49F000	(C:\Windows\system32\MSVCR100.dll)

+sql.DLL	A: 0x72D70000 - 0x72D7E000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\sql.DLL)

+LIBPQ.dll	A: 0x6DFC0000 - 0x6DFE5000	(D:\Software\bin\samp037_svr_R2-1-1_win32\LIBPQ.dll)

+SSLEAY32.dll	A: 0x6AB30000 - 0x6AB75000	(D:\Software\bin\samp037_svr_R2-1-1_win32\SSLEAY32.dll)

+LIBEAY32.dll	A: 0x6AA10000 - 0x6AB30000	(D:\Software\bin\samp037_svr_R2-1-1_win32\LIBEAY32.dll)

+libintl.dll	A: 0x6A300000 - 0x6A32B000	(D:\Software\bin\samp037_svr_R2-1-1_win32\libintl.dll)

+Secur32.dll	A: 0x70C00000 - 0x70C08000	(C:\Windows\system32\Secur32.dll)

+WLDAP32.dll	A: 0x76CF0000 - 0x76D35000	(C:\Windows\syswow64\WLDAP32.dll)

+MSVCP110.dll	A: 0x6A980000 - 0x6AA05000	(C:\Windows\system32\MSVCP110.dll)

+MSVCR110.dll	A: 0x6A8A0000 - 0x6A976000	(C:\Windows\system32\MSVCR110.dll)

+streamer.DLL	A: 0x69DD0000 - 0x69E37000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\streamer.DLL)

+MSVCP140.dll	A: 0x6FEA0000 - 0x6FF0F000	(C:\Windows\system32\MSVCP140.dll)

+api-ms-win-crt-locale-l1-1-0.dll	A: 0x6FCE0000 - 0x6FCE3000	(C:\Windows\system32\api-ms-win-crt-locale-l1-1-0.dll)

+api-ms-win-crt-math-l1-1-0.dll	A: 0x6FCD0000 - 0x6FCD5000	(C:\Windows\system32\api-ms-win-crt-math-l1-1-0.dll)

+api-ms-win-crt-filesystem-l1-1-0.dll	A: 0x6FCC0000 - 0x6FCC3000	(C:\Windows\system32\api-ms-win-crt-filesystem-l1-1-0.dll)

+api-ms-win-crt-time-l1-1-0.dll	A: 0x6FCB0000 - 0x6FCB3000	(C:\Windows\system32\api-ms-win-crt-time-l1-1-0.dll)

+api-ms-win-crt-environment-l1-1-0.dll	A: 0x6FCA0000 - 0x6FCA3000	(C:\Windows\system32\api-ms-win-crt-environment-l1-1-0.dll)

+api-ms-win-crt-utility-l1-1-0.dll	A: 0x6FC90000 - 0x6FC93000	(C:\Windows\system32\api-ms-win-crt-utility-l1-1-0.dll)

+pawnregex.DLL	A: 0x6DF80000 - 0x6DFB7000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\pawnregex.DLL)

+pawncmd.DLL	A: 0x6A860000 - 0x6A899000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\pawncmd.DLL)

+Whirlpool.DLL	A: 0x6E340000 - 0x6E34D000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\Whirlpool.DLL)

+discord-connector.DLL	A: 0x69AF0000 - 0x69DC5000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\discord-connector.DLL)

+log-core2.dll	A: 0x69A40000 - 0x69AE5000	(D:\Software\bin\samp037_svr_R2-1-1_win32\log-core2.dll)

+CRYPT32.dll	A: 0x76540000 - 0x76662000	(C:\Windows\syswow64\CRYPT32.dll)

+MSASN1.dll	A: 0x764F0000 - 0x764FC000	(C:\Windows\syswow64\MSASN1.dll)

+CRYPTSP.dll	A: 0x72710000 - 0x72727000	(C:\Windows\system32\CRYPTSP.dll)

+mswsock.dll	A: 0x70C20000 - 0x70C5C000	(C:\Windows\system32\mswsock.dll)

+wshtcpip.dll	A: 0x70C10000 - 0x70C15000	(C:\Windows\System32\wshtcpip.dll)

+wship6.dll	A: 0x70BF0000 - 0x70BF6000	(C:\Windows\System32\wship6.dll)

+DNSAPI.dll	A: 0x6F040000 - 0x6F084000	(C:\Windows\system32\DNSAPI.dll)

+IPHLPAPI.DLL	A: 0x70C80000 - 0x70C9C000	(C:\Windows\system32\IPHLPAPI.DLL)

+WINNSI.DLL	A: 0x72480000 - 0x72487000	(C:\Windows\system32\WINNSI.DLL)

+rasadhlp.dll	A: 0x6F030000 - 0x6F036000	(C:\Windows\system32\rasadhlp.dll)

+NLAapi.dll	A: 0x73C50000 - 0x73C60000	(C:\Windows\system32\NLAapi.dll)

+napinsp.dll	A: 0x72D10000 - 0x72D20000	(C:\Windows\system32\napinsp.dll)

+pnrpnsp.dll	A: 0x72CF0000 - 0x72D02000	(C:\Windows\system32\pnrpnsp.dll)

+winrnr.dll	A: 0x72CE0000 - 0x72CE8000	(C:\Windows\System32\winrnr.dll)

+PROPSYS.dll	A: 0x70070000 - 0x70165000	(C:\Windows\system32\PROPSYS.dll)

+OLEAUT32.dll	A: 0x76D40000 - 0x76DD1000	(C:\Windows\syswow64\OLEAUT32.dll)

+comctl32.dll	A: 0x74D80000 - 0x74F1E000	(C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.18837_none_41e855142bd5705d\comctl32.dll)

+apphelp.dll	A: 0x724B0000 - 0x724FC000	(C:\Windows\system32\apphelp.dll)

+CLBCatQ.DLL	A: 0x76BC0000 - 0x76C43000	(C:\Windows\syswow64\CLBCatQ.DLL)

+iertutil.dll	A: 0x770A0000 - 0x772A1000	(C:\Windows\syswow64\iertutil.dll)

+urlmon.dll	A: 0x76A50000 - 0x76B90000	(C:\Windows\syswow64\urlmon.dll)

+XmlLite.dll	A: 0x76E40000 - 0x76E6F000	(C:\Windows\syswow64\XmlLite.dll)

+WININET.dll	A: 0x75FC0000 - 0x760B5000	(C:\Windows\syswow64\WININET.dll)

+SETUPAPI.dll	A: 0x766A0000 - 0x7683D000	(C:\Windows\syswow64\SETUPAPI.dll)

+CFGMGR32.dll	A: 0x76B90000 - 0x76BB7000	(C:\Windows\syswow64\CFGMGR32.dll)

+DEVOBJ.dll	A: 0x76A30000 - 0x76A42000	(C:\Windows\syswow64\DEVOBJ.dll)

+ntmarta.dll	A: 0x70B00000 - 0x70B21000	(C:\Windows\system32\ntmarta.dll)

+profapi.dll	A: 0x72680000 - 0x7268B000	(C:\Windows\system32\profapi.dll)

+VERSION.dll	A: 0x74F20000 - 0x74F29000	(C:\Windows\system32\VERSION.dll)

+

+--------------------------

+SA-MP Server: 0.3.7-R2

+

+Exception At Address: 0x00468D34 Module: (samp-server.exe)

+

+Registers:

+EAX: 0x00000000	EBX: 0x03AC7AAC	ECX: 0x00000000	EDX: 0x00000000

+ESI: 0x00000000	EDI: 0x035EC4C0	EBP: 0x0018F7F8	ESP: 0x0018F698

+EFLAGS: 0x00210246

+

+Stack:

++0000: 0x00479C04   0x00000000   0x035EC4C0   0x03AC7AAC

++0010: 0x03A8B5B0   0x0018F734   0x027AE760   0x027B0384

++0020: 0x0018F7D0   0x00000050   0x00470937   0x0018F6E4

++0030: 0x6B3F0269   0x02730000   0x00000000   0x00000048

++0040: 0x0018F75C   0x00000000   0x0018F7D0   0x0000000C

++0050: 0x0018F734   0x0018F704   0x70412D23   0x0018F734

++0060: 0x0018F7D0   0x0000000C   0x00000000   0x00000000

++0070: 0x0018F6B0   0x0018F774   0x027B0384   0x0018F7D0

++0080: 0x027B0384   0x0018F780   0x70413CD0   0x00000003

++0090: 0x027B0358   0x0018F7A0   0x0000000C   0x72616863

++00A0: 0x65746361   0x64695F72   0x70413A00   0x0000000C

++00B0: 0x027B0384   0x00000000   0x7041A4B5   0x0018F734

++00C0: 0x0018F773   0x027B0391   0x027AE760   0x0018F701

++00D0: 0x027AE704   0x027AE6DC   0x0018F80C   0x0018F80C

++00E0: 0x70416F48   0xFFFFFFFF   0x0018F818   0x704115A7

++00F0: 0x035EC4C0   0x035EC4C0   0x03A8B5B0   0x00000000

++0100: 0x00000002   0x00000018   0x027B0350   0x00000002

++0110: 0x00000018   0x38353A31   0x0018F800   0x0018F800

++0120: 0x7261775B   0x676E696E   0x0000005D   0x00000000

++0130: 0x1D3982EA   0x0018F818   0x72616863   0x65746361

+

+--------------------------

+

+Loaded Modules:

+samp-server.exe	A: 0x00400000 - 0x00519000	(D:\Software\bin\samp037_svr_R2-1-1_win32\samp-server.exe)

+ntdll.dll	A: 0x77690000 - 0x77810000	(C:\Windows\SysWOW64\ntdll.dll)

+kernel32.dll	A: 0x76F70000 - 0x77080000	(C:\Windows\syswow64\kernel32.dll)

+KERNELBASE.dll	A: 0x764A0000 - 0x764E7000	(C:\Windows\syswow64\KERNELBASE.dll)

+SHELL32.dll	A: 0x75370000 - 0x75FBC000	(C:\Windows\syswow64\SHELL32.dll)

+msvcrt.dll	A: 0x763E0000 - 0x7648C000	(C:\Windows\syswow64\msvcrt.dll)

+SHLWAPI.dll	A: 0x76340000 - 0x76397000	(C:\Windows\syswow64\SHLWAPI.dll)

+GDI32.dll	A: 0x76150000 - 0x761E0000	(C:\Windows\syswow64\GDI32.dll)

+USER32.dll	A: 0x76840000 - 0x76940000	(C:\Windows\syswow64\USER32.dll)

+ADVAPI32.dll	A: 0x751F0000 - 0x75291000	(C:\Windows\syswow64\ADVAPI32.dll)

+sechost.dll	A: 0x77080000 - 0x77099000	(C:\Windows\SysWOW64\sechost.dll)

+RPCRT4.dll	A: 0x76E80000 - 0x76F70000	(C:\Windows\syswow64\RPCRT4.dll)

+SspiCli.dll	A: 0x75190000 - 0x751F0000	(C:\Windows\syswow64\SspiCli.dll)

+CRYPTBASE.dll	A: 0x75180000 - 0x7518C000	(C:\Windows\syswow64\CRYPTBASE.dll)

+LPK.dll	A: 0x76E70000 - 0x76E7A000	(C:\Windows\syswow64\LPK.dll)

+USP10.dll	A: 0x76C50000 - 0x76CED000	(C:\Windows\syswow64\USP10.dll)

+WSOCK32.dll	A: 0x729C0000 - 0x729C7000	(C:\Windows\system32\WSOCK32.dll)

+WS2_32.dll	A: 0x76500000 - 0x76535000	(C:\Windows\syswow64\WS2_32.dll)

+NSI.dll	A: 0x760C0000 - 0x760C6000	(C:\Windows\syswow64\NSI.dll)

+WINMM.dll	A: 0x74FA0000 - 0x74FD2000	(C:\Windows\system32\WINMM.dll)

+IMM32.DLL	A: 0x769D0000 - 0x76A30000	(C:\Windows\system32\IMM32.DLL)

+MSCTF.dll	A: 0x752A0000 - 0x7536D000	(C:\Windows\syswow64\MSCTF.dll)

+sscanf.DLL	A: 0x10000000 - 0x1000E000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\sscanf.DLL)

+VCRUNTIME140.dll	A: 0x6FE80000 - 0x6FE93000	(C:\Windows\system32\VCRUNTIME140.dll)

+api-ms-win-crt-runtime-l1-1-0.dll	A: 0x6FE70000 - 0x6FE74000	(C:\Windows\system32\api-ms-win-crt-runtime-l1-1-0.dll)

+ucrtbase.DLL	A: 0x6FD80000 - 0x6FE61000	(C:\Windows\system32\ucrtbase.DLL)

+api-ms-win-core-timezone-l1-1-0.dll	A: 0x6FD70000 - 0x6FD73000	(C:\Windows\system32\api-ms-win-core-timezone-l1-1-0.dll)

+api-ms-win-core-file-l2-1-0.dll	A: 0x6FD60000 - 0x6FD63000	(C:\Windows\system32\api-ms-win-core-file-l2-1-0.dll)

+api-ms-win-core-localization-l1-2-0.dll	A: 0x6FD50000 - 0x6FD53000	(C:\Windows\system32\api-ms-win-core-localization-l1-2-0.dll)

+api-ms-win-core-synch-l1-2-0.dll	A: 0x72660000 - 0x72663000	(C:\Windows\system32\api-ms-win-core-synch-l1-2-0.dll)

+api-ms-win-core-processthreads-l1-1-1.dll	A: 0x6FD40000 - 0x6FD43000	(C:\Windows\system32\api-ms-win-core-processthreads-l1-1-1.dll)

+api-ms-win-core-file-l1-2-0.dll	A: 0x6FD30000 - 0x6FD33000	(C:\Windows\system32\api-ms-win-core-file-l1-2-0.dll)

+api-ms-win-crt-heap-l1-1-0.dll	A: 0x6FD20000 - 0x6FD23000	(C:\Windows\system32\api-ms-win-crt-heap-l1-1-0.dll)

+api-ms-win-crt-string-l1-1-0.dll	A: 0x6FD10000 - 0x6FD14000	(C:\Windows\system32\api-ms-win-crt-string-l1-1-0.dll)

+api-ms-win-crt-stdio-l1-1-0.dll	A: 0x6FD00000 - 0x6FD04000	(C:\Windows\system32\api-ms-win-crt-stdio-l1-1-0.dll)

+api-ms-win-crt-convert-l1-1-0.dll	A: 0x6FCF0000 - 0x6FCF4000	(C:\Windows\system32\api-ms-win-crt-convert-l1-1-0.dll)

+MSVCP100.dll	A: 0x6B4A0000 - 0x6B509000	(C:\Windows\system32\MSVCP100.dll)

+MSVCR100.dll	A: 0x6B3E0000 - 0x6B49F000	(C:\Windows\system32\MSVCR100.dll)

+sql.DLL	A: 0x72D70000 - 0x72D7E000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\sql.DLL)

+LIBPQ.dll	A: 0x6DFC0000 - 0x6DFE5000	(D:\Software\bin\samp037_svr_R2-1-1_win32\LIBPQ.dll)

+SSLEAY32.dll	A: 0x6AB30000 - 0x6AB75000	(D:\Software\bin\samp037_svr_R2-1-1_win32\SSLEAY32.dll)

+LIBEAY32.dll	A: 0x6AA10000 - 0x6AB30000	(D:\Software\bin\samp037_svr_R2-1-1_win32\LIBEAY32.dll)

+libintl.dll	A: 0x6A300000 - 0x6A32B000	(D:\Software\bin\samp037_svr_R2-1-1_win32\libintl.dll)

+Secur32.dll	A: 0x70C00000 - 0x70C08000	(C:\Windows\system32\Secur32.dll)

+WLDAP32.dll	A: 0x76CF0000 - 0x76D35000	(C:\Windows\syswow64\WLDAP32.dll)

+MSVCP110.dll	A: 0x6A980000 - 0x6AA05000	(C:\Windows\system32\MSVCP110.dll)

+MSVCR110.dll	A: 0x6A8A0000 - 0x6A976000	(C:\Windows\system32\MSVCR110.dll)

+streamer.DLL	A: 0x69DD0000 - 0x69E37000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\streamer.DLL)

+MSVCP140.dll	A: 0x6FEA0000 - 0x6FF0F000	(C:\Windows\system32\MSVCP140.dll)

+api-ms-win-crt-locale-l1-1-0.dll	A: 0x6FCE0000 - 0x6FCE3000	(C:\Windows\system32\api-ms-win-crt-locale-l1-1-0.dll)

+api-ms-win-crt-math-l1-1-0.dll	A: 0x6FCD0000 - 0x6FCD5000	(C:\Windows\system32\api-ms-win-crt-math-l1-1-0.dll)

+api-ms-win-crt-filesystem-l1-1-0.dll	A: 0x6FCC0000 - 0x6FCC3000	(C:\Windows\system32\api-ms-win-crt-filesystem-l1-1-0.dll)

+api-ms-win-crt-time-l1-1-0.dll	A: 0x6FCB0000 - 0x6FCB3000	(C:\Windows\system32\api-ms-win-crt-time-l1-1-0.dll)

+api-ms-win-crt-environment-l1-1-0.dll	A: 0x6FCA0000 - 0x6FCA3000	(C:\Windows\system32\api-ms-win-crt-environment-l1-1-0.dll)

+api-ms-win-crt-utility-l1-1-0.dll	A: 0x6FC90000 - 0x6FC93000	(C:\Windows\system32\api-ms-win-crt-utility-l1-1-0.dll)

+pawnregex.DLL	A: 0x6DF80000 - 0x6DFB7000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\pawnregex.DLL)

+pawncmd.DLL	A: 0x6A860000 - 0x6A899000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\pawncmd.DLL)

+Whirlpool.DLL	A: 0x6E340000 - 0x6E34D000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\Whirlpool.DLL)

+discord-connector.DLL	A: 0x69AF0000 - 0x69DC5000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\discord-connector.DLL)

+log-core2.dll	A: 0x69A40000 - 0x69AE5000	(D:\Software\bin\samp037_svr_R2-1-1_win32\log-core2.dll)

+CRYPT32.dll	A: 0x76540000 - 0x76662000	(C:\Windows\syswow64\CRYPT32.dll)

+MSASN1.dll	A: 0x764F0000 - 0x764FC000	(C:\Windows\syswow64\MSASN1.dll)

+CRYPTSP.dll	A: 0x72710000 - 0x72727000	(C:\Windows\system32\CRYPTSP.dll)

+mswsock.dll	A: 0x70C20000 - 0x70C5C000	(C:\Windows\system32\mswsock.dll)

+wshtcpip.dll	A: 0x70C10000 - 0x70C15000	(C:\Windows\System32\wshtcpip.dll)

+wship6.dll	A: 0x70BF0000 - 0x70BF6000	(C:\Windows\System32\wship6.dll)

+DNSAPI.dll	A: 0x6F040000 - 0x6F084000	(C:\Windows\system32\DNSAPI.dll)

+IPHLPAPI.DLL	A: 0x70C80000 - 0x70C9C000	(C:\Windows\system32\IPHLPAPI.DLL)

+WINNSI.DLL	A: 0x72480000 - 0x72487000	(C:\Windows\system32\WINNSI.DLL)

+rasadhlp.dll	A: 0x6F030000 - 0x6F036000	(C:\Windows\system32\rasadhlp.dll)

+NLAapi.dll	A: 0x73C50000 - 0x73C60000	(C:\Windows\system32\NLAapi.dll)

+napinsp.dll	A: 0x72D10000 - 0x72D20000	(C:\Windows\system32\napinsp.dll)

+pnrpnsp.dll	A: 0x72CF0000 - 0x72D02000	(C:\Windows\system32\pnrpnsp.dll)

+winrnr.dll	A: 0x72CE0000 - 0x72CE8000	(C:\Windows\System32\winrnr.dll)

+PROPSYS.dll	A: 0x70070000 - 0x70165000	(C:\Windows\system32\PROPSYS.dll)

+OLEAUT32.dll	A: 0x76D40000 - 0x76DD1000	(C:\Windows\syswow64\OLEAUT32.dll)

+comctl32.dll	A: 0x74D80000 - 0x74F1E000	(C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.18837_none_41e855142bd5705d\comctl32.dll)

+apphelp.dll	A: 0x724B0000 - 0x724FC000	(C:\Windows\system32\apphelp.dll)

+CLBCatQ.DLL	A: 0x76BC0000 - 0x76C43000	(C:\Windows\syswow64\CLBCatQ.DLL)

+iertutil.dll	A: 0x770A0000 - 0x772A1000	(C:\Windows\syswow64\iertutil.dll)

+urlmon.dll	A: 0x76A50000 - 0x76B90000	(C:\Windows\syswow64\urlmon.dll)

+XmlLite.dll	A: 0x76E40000 - 0x76E6F000	(C:\Windows\syswow64\XmlLite.dll)

+WININET.dll	A: 0x75FC0000 - 0x760B5000	(C:\Windows\syswow64\WININET.dll)

+SETUPAPI.dll	A: 0x766A0000 - 0x7683D000	(C:\Windows\syswow64\SETUPAPI.dll)

+CFGMGR32.dll	A: 0x76B90000 - 0x76BB7000	(C:\Windows\syswow64\CFGMGR32.dll)

+DEVOBJ.dll	A: 0x76A30000 - 0x76A42000	(C:\Windows\syswow64\DEVOBJ.dll)

+ntmarta.dll	A: 0x70B00000 - 0x70B21000	(C:\Windows\system32\ntmarta.dll)

+profapi.dll	A: 0x72680000 - 0x7268B000	(C:\Windows\system32\profapi.dll)

+VERSION.dll	A: 0x74F20000 - 0x74F29000	(C:\Windows\system32\VERSION.dll)

+

+--------------------------

+SA-MP Server: 0.3.7-R2

+

+Exception At Address: 0x00468D34 Module: (samp-server.exe)

+

+Registers:

+EAX: 0x00000000	EBX: 0x03A07B34	ECX: 0x00000000	EDX: 0x00000000

+ESI: 0x00000000	EDI: 0x0352C4C0	EBP: 0x0018F7F8	ESP: 0x0018F698

+EFLAGS: 0x00210246

+

+Stack:

++0000: 0x00479C04   0x00000000   0x0352C4C0   0x03A07B34

++0010: 0x039CB5B0   0x0018F734   0x0273E760   0x02740384

++0020: 0x0018F7D0   0x00000050   0x00470937   0x0018F6E4

++0030: 0x6B3F0269   0x00590000   0x00000000   0x00000048

++0040: 0x0018F75C   0x00000000   0x0018F7D0   0x0000000C

++0050: 0x0018F734   0x0018F704   0x70412D23   0x0018F734

++0060: 0x0018F7D0   0x0000000C   0x00000000   0x00000000

++0070: 0x0018F6B0   0x0018F774   0x02740384   0x0018F7D0

++0080: 0x02740384   0x0018F780   0x70413CD0   0x00000003

++0090: 0x02740358   0x0018F7A0   0x0000000C   0x72616863

++00A0: 0x65746361   0x64695F72   0x70413A00   0x0000000C

++00B0: 0x02740384   0x00000000   0x7041A4B5   0x0018F734

++00C0: 0x0018F773   0x02740391   0x0273E760   0x0018F701

++00D0: 0x0273E704   0x0273E6DC   0x0018F80C   0x0018F80C

++00E0: 0x70416F48   0xFFFFFFFF   0x0018F818   0x704115A7

++00F0: 0x0352C4C0   0x0352C4C0   0x039CB5B0   0x00000000

++0100: 0x00000002   0x00000018   0x02740350   0x00000002

++0110: 0x00000018   0x30303A34   0x0018F800   0x0018F800

++0120: 0x7261775B   0x676E696E   0x0000005D   0x00000000

++0130: 0xCD39DE93   0x0018F818   0x72616863   0x65746361

+

+--------------------------

+

+Loaded Modules:

+samp-server.exe	A: 0x00400000 - 0x00519000	(D:\Software\bin\samp037_svr_R2-1-1_win32\samp-server.exe)

+ntdll.dll	A: 0x77690000 - 0x77810000	(C:\Windows\SysWOW64\ntdll.dll)

+kernel32.dll	A: 0x76F70000 - 0x77080000	(C:\Windows\syswow64\kernel32.dll)

+KERNELBASE.dll	A: 0x764A0000 - 0x764E7000	(C:\Windows\syswow64\KERNELBASE.dll)

+SHELL32.dll	A: 0x75370000 - 0x75FBC000	(C:\Windows\syswow64\SHELL32.dll)

+msvcrt.dll	A: 0x763E0000 - 0x7648C000	(C:\Windows\syswow64\msvcrt.dll)

+SHLWAPI.dll	A: 0x76340000 - 0x76397000	(C:\Windows\syswow64\SHLWAPI.dll)

+GDI32.dll	A: 0x76150000 - 0x761E0000	(C:\Windows\syswow64\GDI32.dll)

+USER32.dll	A: 0x76840000 - 0x76940000	(C:\Windows\syswow64\USER32.dll)

+ADVAPI32.dll	A: 0x751F0000 - 0x75291000	(C:\Windows\syswow64\ADVAPI32.dll)

+sechost.dll	A: 0x77080000 - 0x77099000	(C:\Windows\SysWOW64\sechost.dll)

+RPCRT4.dll	A: 0x76E80000 - 0x76F70000	(C:\Windows\syswow64\RPCRT4.dll)

+SspiCli.dll	A: 0x75190000 - 0x751F0000	(C:\Windows\syswow64\SspiCli.dll)

+CRYPTBASE.dll	A: 0x75180000 - 0x7518C000	(C:\Windows\syswow64\CRYPTBASE.dll)

+LPK.dll	A: 0x76E70000 - 0x76E7A000	(C:\Windows\syswow64\LPK.dll)

+USP10.dll	A: 0x76C50000 - 0x76CED000	(C:\Windows\syswow64\USP10.dll)

+WSOCK32.dll	A: 0x729C0000 - 0x729C7000	(C:\Windows\system32\WSOCK32.dll)

+WS2_32.dll	A: 0x76500000 - 0x76535000	(C:\Windows\syswow64\WS2_32.dll)

+NSI.dll	A: 0x760C0000 - 0x760C6000	(C:\Windows\syswow64\NSI.dll)

+WINMM.dll	A: 0x74FA0000 - 0x74FD2000	(C:\Windows\system32\WINMM.dll)

+IMM32.DLL	A: 0x769D0000 - 0x76A30000	(C:\Windows\system32\IMM32.DLL)

+MSCTF.dll	A: 0x752A0000 - 0x7536D000	(C:\Windows\syswow64\MSCTF.dll)

+sscanf.DLL	A: 0x10000000 - 0x1000E000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\sscanf.DLL)

+VCRUNTIME140.dll	A: 0x6FE80000 - 0x6FE93000	(C:\Windows\system32\VCRUNTIME140.dll)

+api-ms-win-crt-runtime-l1-1-0.dll	A: 0x6FE70000 - 0x6FE74000	(C:\Windows\system32\api-ms-win-crt-runtime-l1-1-0.dll)

+ucrtbase.DLL	A: 0x6FD80000 - 0x6FE61000	(C:\Windows\system32\ucrtbase.DLL)

+api-ms-win-core-timezone-l1-1-0.dll	A: 0x6FD70000 - 0x6FD73000	(C:\Windows\system32\api-ms-win-core-timezone-l1-1-0.dll)

+api-ms-win-core-file-l2-1-0.dll	A: 0x6FD60000 - 0x6FD63000	(C:\Windows\system32\api-ms-win-core-file-l2-1-0.dll)

+api-ms-win-core-localization-l1-2-0.dll	A: 0x6FD50000 - 0x6FD53000	(C:\Windows\system32\api-ms-win-core-localization-l1-2-0.dll)

+api-ms-win-core-synch-l1-2-0.dll	A: 0x72660000 - 0x72663000	(C:\Windows\system32\api-ms-win-core-synch-l1-2-0.dll)

+api-ms-win-core-processthreads-l1-1-1.dll	A: 0x6FD40000 - 0x6FD43000	(C:\Windows\system32\api-ms-win-core-processthreads-l1-1-1.dll)

+api-ms-win-core-file-l1-2-0.dll	A: 0x6FD30000 - 0x6FD33000	(C:\Windows\system32\api-ms-win-core-file-l1-2-0.dll)

+api-ms-win-crt-heap-l1-1-0.dll	A: 0x6FD20000 - 0x6FD23000	(C:\Windows\system32\api-ms-win-crt-heap-l1-1-0.dll)

+api-ms-win-crt-string-l1-1-0.dll	A: 0x6FD10000 - 0x6FD14000	(C:\Windows\system32\api-ms-win-crt-string-l1-1-0.dll)

+api-ms-win-crt-stdio-l1-1-0.dll	A: 0x6FD00000 - 0x6FD04000	(C:\Windows\system32\api-ms-win-crt-stdio-l1-1-0.dll)

+api-ms-win-crt-convert-l1-1-0.dll	A: 0x6FCF0000 - 0x6FCF4000	(C:\Windows\system32\api-ms-win-crt-convert-l1-1-0.dll)

+MSVCP100.dll	A: 0x6B4A0000 - 0x6B509000	(C:\Windows\system32\MSVCP100.dll)

+MSVCR100.dll	A: 0x6B3E0000 - 0x6B49F000	(C:\Windows\system32\MSVCR100.dll)

+sql.DLL	A: 0x72D70000 - 0x72D7E000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\sql.DLL)

+LIBPQ.dll	A: 0x6DFC0000 - 0x6DFE5000	(D:\Software\bin\samp037_svr_R2-1-1_win32\LIBPQ.dll)

+SSLEAY32.dll	A: 0x6AB30000 - 0x6AB75000	(D:\Software\bin\samp037_svr_R2-1-1_win32\SSLEAY32.dll)

+LIBEAY32.dll	A: 0x6AA10000 - 0x6AB30000	(D:\Software\bin\samp037_svr_R2-1-1_win32\LIBEAY32.dll)

+libintl.dll	A: 0x6A300000 - 0x6A32B000	(D:\Software\bin\samp037_svr_R2-1-1_win32\libintl.dll)

+Secur32.dll	A: 0x70C00000 - 0x70C08000	(C:\Windows\system32\Secur32.dll)

+WLDAP32.dll	A: 0x76CF0000 - 0x76D35000	(C:\Windows\syswow64\WLDAP32.dll)

+MSVCP110.dll	A: 0x6A980000 - 0x6AA05000	(C:\Windows\system32\MSVCP110.dll)

+MSVCR110.dll	A: 0x6A8A0000 - 0x6A976000	(C:\Windows\system32\MSVCR110.dll)

+streamer.DLL	A: 0x69DD0000 - 0x69E37000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\streamer.DLL)

+MSVCP140.dll	A: 0x6FEA0000 - 0x6FF0F000	(C:\Windows\system32\MSVCP140.dll)

+api-ms-win-crt-locale-l1-1-0.dll	A: 0x6FCE0000 - 0x6FCE3000	(C:\Windows\system32\api-ms-win-crt-locale-l1-1-0.dll)

+api-ms-win-crt-math-l1-1-0.dll	A: 0x6FCD0000 - 0x6FCD5000	(C:\Windows\system32\api-ms-win-crt-math-l1-1-0.dll)

+api-ms-win-crt-filesystem-l1-1-0.dll	A: 0x6FCC0000 - 0x6FCC3000	(C:\Windows\system32\api-ms-win-crt-filesystem-l1-1-0.dll)

+api-ms-win-crt-time-l1-1-0.dll	A: 0x6FCB0000 - 0x6FCB3000	(C:\Windows\system32\api-ms-win-crt-time-l1-1-0.dll)

+api-ms-win-crt-environment-l1-1-0.dll	A: 0x6FCA0000 - 0x6FCA3000	(C:\Windows\system32\api-ms-win-crt-environment-l1-1-0.dll)

+api-ms-win-crt-utility-l1-1-0.dll	A: 0x6FC90000 - 0x6FC93000	(C:\Windows\system32\api-ms-win-crt-utility-l1-1-0.dll)

+pawnregex.DLL	A: 0x6DF80000 - 0x6DFB7000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\pawnregex.DLL)

+pawncmd.DLL	A: 0x6A860000 - 0x6A899000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\pawncmd.DLL)

+Whirlpool.DLL	A: 0x6E340000 - 0x6E34D000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\Whirlpool.DLL)

+discord-connector.DLL	A: 0x69AF0000 - 0x69DC5000	(D:\Software\bin\samp037_svr_R2-1-1_win32\plugins\discord-connector.DLL)

+log-core2.dll	A: 0x69A40000 - 0x69AE5000	(D:\Software\bin\samp037_svr_R2-1-1_win32\log-core2.dll)

+CRYPT32.dll	A: 0x76540000 - 0x76662000	(C:\Windows\syswow64\CRYPT32.dll)

+MSASN1.dll	A: 0x764F0000 - 0x764FC000	(C:\Windows\syswow64\MSASN1.dll)

+CRYPTSP.dll	A: 0x72710000 - 0x72727000	(C:\Windows\system32\CRYPTSP.dll)

+mswsock.dll	A: 0x70C20000 - 0x70C5C000	(C:\Windows\system32\mswsock.dll)

+wshtcpip.dll	A: 0x70C10000 - 0x70C15000	(C:\Windows\System32\wshtcpip.dll)

+wship6.dll	A: 0x70BF0000 - 0x70BF6000	(C:\Windows\System32\wship6.dll)

+DNSAPI.dll	A: 0x6F040000 - 0x6F084000	(C:\Windows\system32\DNSAPI.dll)

+IPHLPAPI.DLL	A: 0x70C80000 - 0x70C9C000	(C:\Windows\system32\IPHLPAPI.DLL)

+WINNSI.DLL	A: 0x72480000 - 0x72487000	(C:\Windows\system32\WINNSI.DLL)

+rasadhlp.dll	A: 0x6F030000 - 0x6F036000	(C:\Windows\system32\rasadhlp.dll)

+NLAapi.dll	A: 0x73C50000 - 0x73C60000	(C:\Windows\system32\NLAapi.dll)

+napinsp.dll	A: 0x72D10000 - 0x72D20000	(C:\Windows\system32\napinsp.dll)

+pnrpnsp.dll	A: 0x72CF0000 - 0x72D02000	(C:\Windows\system32\pnrpnsp.dll)

+winrnr.dll	A: 0x72CE0000 - 0x72CE8000	(C:\Windows\System32\winrnr.dll)

+PROPSYS.dll	A: 0x70070000 - 0x70165000	(C:\Windows\system32\PROPSYS.dll)

+OLEAUT32.dll	A: 0x76D40000 - 0x76DD1000	(C:\Windows\syswow64\OLEAUT32.dll)

+comctl32.dll	A: 0x74D80000 - 0x74F1E000	(C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.18837_none_41e855142bd5705d\comctl32.dll)

+apphelp.dll	A: 0x724B0000 - 0x724FC000	(C:\Windows\system32\apphelp.dll)

+CLBCatQ.DLL	A: 0x76BC0000 - 0x76C43000	(C:\Windows\syswow64\CLBCatQ.DLL)

+iertutil.dll	A: 0x770A0000 - 0x772A1000	(C:\Windows\syswow64\iertutil.dll)

+urlmon.dll	A: 0x76A50000 - 0x76B90000	(C:\Windows\syswow64\urlmon.dll)

+XmlLite.dll	A: 0x76E40000 - 0x76E6F000	(C:\Windows\syswow64\XmlLite.dll)

+WININET.dll	A: 0x75FC0000 - 0x760B5000	(C:\Windows\syswow64\WININET.dll)

+SETUPAPI.dll	A: 0x766A0000 - 0x7683D000	(C:\Windows\syswow64\SETUPAPI.dll)

+CFGMGR32.dll	A: 0x76B90000 - 0x76BB7000	(C:\Windows\syswow64\CFGMGR32.dll)

+DEVOBJ.dll	A: 0x76A30000 - 0x76A42000	(C:\Windows\syswow64\DEVOBJ.dll)

+ntmarta.dll	A: 0x70B00000 - 0x70B21000	(C:\Windows\system32\ntmarta.dll)

+profapi.dll	A: 0x72680000 - 0x7268B000	(C:\Windows\system32\profapi.dll)

+VERSION.dll	A: 0x74F20000 - 0x74F29000	(C:\Windows\system32\VERSION.dll)


+ 1104 - 0
samp03/dump.sql

@@ -0,0 +1,1104 @@
+--
+-- PostgreSQL database dump
+--
+
+-- Dumped from database version 12.1
+-- Dumped by pg_dump version 12.1
+
+SET statement_timeout = 0;
+SET lock_timeout = 0;
+SET idle_in_transaction_session_timeout = 0;
+SET client_encoding = 'UTF8';
+SET standard_conforming_strings = on;
+SELECT pg_catalog.set_config('search_path', '', false);
+SET check_function_bodies = false;
+SET xmloption = content;
+SET client_min_messages = warning;
+SET row_security = off;
+
+SET default_tablespace = '';
+
+SET default_table_access_method = heap;
+
+--
+-- Name: character; Type: TABLE; Schema: public; Owner: rpfw-dev
+--
+
+CREATE TABLE public."character" (
+    id integer NOT NULL,
+    user_id integer NOT NULL,
+    name character varying(24) NOT NULL,
+    skin_id smallint DEFAULT 134 NOT NULL,
+    cash integer DEFAULT 0,
+    health real DEFAULT 100,
+    armour real DEFAULT 100,
+    jailed smallint DEFAULT 0,
+    pos_x real DEFAULT '-144.0328'::numeric,
+    pos_y real DEFAULT 1225.0564,
+    pos_z real DEFAULT 19.8992,
+    rotation real DEFAULT 175.5507,
+    created timestamp without time zone DEFAULT (now())::timestamp without time zone,
+    job_id smallint DEFAULT 0 NOT NULL,
+    world_id smallint DEFAULT 0 NOT NULL,
+    interior_id smallint DEFAULT 0 NOT NULL,
+    job_skin_id smallint,
+    weapon_slot_0 smallint,
+    weapon_slot_1 smallint,
+    weapon_slot_2 smallint,
+    weapon_slot_3 smallint,
+    weapon_slot_4 smallint,
+    weapon_slot_5 smallint,
+    weapon_slot_6 smallint,
+    weapon_slot_7 smallint,
+    weapon_slot_8 smallint,
+    weapon_slot_9 smallint,
+    weapon_slot_10 smallint,
+    weapon_slot_11 smallint,
+    weapon_slot_12 smallint,
+    weapon_skill_0 smallint DEFAULT 0 NOT NULL,
+    weapon_skill_1 smallint DEFAULT 0 NOT NULL,
+    weapon_skill_2 smallint DEFAULT 0 NOT NULL,
+    weapon_skill_3 smallint DEFAULT 0 NOT NULL,
+    weapon_skill_4 smallint DEFAULT 0 NOT NULL,
+    weapon_skill_5 smallint DEFAULT 0 NOT NULL,
+    weapon_skill_6 smallint DEFAULT 0 NOT NULL,
+    weapon_skill_7 smallint DEFAULT 0 NOT NULL,
+    weapon_skill_8 smallint DEFAULT 0 NOT NULL,
+    weapon_skill_9 smallint DEFAULT 0 NOT NULL,
+    weapon_skill_10 smallint DEFAULT 0 NOT NULL
+);
+ALTER TABLE ONLY public."character" ALTER COLUMN job_id SET (n_distinct=0);
+
+
+ALTER TABLE public."character" OWNER TO "rpfw-dev";
+
+--
+-- Name: TABLE "character"; Type: COMMENT; Schema: public; Owner: rpfw-dev
+--
+
+COMMENT ON TABLE public."character" IS 'A character of a user. A user can have multiple characters, limited in the game-mode by the charaterArray size, which is set to the definition MAX_CHARACTERS_PER_USER in the game-mode limits section.';
+
+
+--
+-- Name: COLUMN "character".jailed; Type: COMMENT; Schema: public; Owner: rpfw-dev
+--
+
+COMMENT ON COLUMN public."character".jailed IS 'Amount of minutes jailed.
+TODO Move to own table for criminal database';
+
+
+--
+-- Name: character_character_id_seq; Type: SEQUENCE; Schema: public; Owner: rpfw-dev
+--
+
+CREATE SEQUENCE public.character_character_id_seq
+    AS integer
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+
+ALTER TABLE public.character_character_id_seq OWNER TO "rpfw-dev";
+
+--
+-- Name: character_id_seq; Type: SEQUENCE; Schema: public; Owner: rpfw-dev
+--
+
+CREATE SEQUENCE public.character_id_seq
+    AS integer
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+
+ALTER TABLE public.character_id_seq OWNER TO "rpfw-dev";
+
+--
+-- Name: character_id_seq1; Type: SEQUENCE; Schema: public; Owner: rpfw-dev
+--
+
+CREATE SEQUENCE public.character_id_seq1
+    AS integer
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+
+ALTER TABLE public.character_id_seq1 OWNER TO "rpfw-dev";
+
+--
+-- Name: character_id_seq1; Type: SEQUENCE OWNED BY; Schema: public; Owner: rpfw-dev
+--
+
+ALTER SEQUENCE public.character_id_seq1 OWNED BY public."character".id;
+
+
+--
+-- Name: ip; Type: TABLE; Schema: public; Owner: rpfw-dev
+--
+
+CREATE TABLE public.ip (
+    id integer NOT NULL,
+    address character varying(45) NOT NULL,
+    connections integer DEFAULT 1
+);
+
+
+ALTER TABLE public.ip OWNER TO "rpfw-dev";
+
+--
+-- Name: COLUMN ip.address; Type: COMMENT; Schema: public; Owner: rpfw-dev
+--
+
+COMMENT ON COLUMN public.ip.address IS 'Even though sa-mp only seems to support IPv4.
+It''s not likely to be updated, but if so, the database is ready for the "future".';
+
+
+--
+-- Name: ip_ban; Type: TABLE; Schema: public; Owner: rpfw-dev
+--
+
+CREATE TABLE public.ip_ban (
+    id integer NOT NULL,
+    ip_id integer NOT NULL,
+    created timestamp without time zone DEFAULT (now())::timestamp without time zone,
+    expires timestamp without time zone DEFAULT ((now())::timestamp without time zone + '30 days'::interval),
+    reason character varying(121) NOT NULL,
+    banner_id integer
+);
+
+
+ALTER TABLE public.ip_ban OWNER TO "rpfw-dev";
+
+--
+-- Name: TABLE ip_ban; Type: COMMENT; Schema: public; Owner: rpfw-dev
+--
+
+COMMENT ON TABLE public.ip_ban IS 'Ban records per IP.
+Historic bans are kept for administrative purposes & active bans are checked against timestamp.';
+
+
+--
+-- Name: COLUMN ip_ban.reason; Type: COMMENT; Schema: public; Owner: rpfw-dev
+--
+
+COMMENT ON COLUMN public.ip_ban.reason IS 'Maximum sa-mp message length = 128.
+The shortest possible ban command is "/ban 0 ". (7 characters)
+128 - 7 = 121 as maximum ban reason.';
+
+
+--
+-- Name: ip_bans_id_seq; Type: SEQUENCE; Schema: public; Owner: rpfw-dev
+--
+
+CREATE SEQUENCE public.ip_bans_id_seq
+    AS integer
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+
+ALTER TABLE public.ip_bans_id_seq OWNER TO "rpfw-dev";
+
+--
+-- Name: ip_bans_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: rpfw-dev
+--
+
+ALTER SEQUENCE public.ip_bans_id_seq OWNED BY public.ip_ban.id;
+
+
+--
+-- Name: ip_id_seq; Type: SEQUENCE; Schema: public; Owner: rpfw-dev
+--
+
+CREATE SEQUENCE public.ip_id_seq
+    AS integer
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+
+ALTER TABLE public.ip_id_seq OWNER TO "rpfw-dev";
+
+--
+-- Name: ip_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: rpfw-dev
+--
+
+ALTER SEQUENCE public.ip_id_seq OWNED BY public.ip.id;
+
+
+--
+-- Name: ip_ip_id_seq; Type: SEQUENCE; Schema: public; Owner: rpfw-dev
+--
+
+CREATE SEQUENCE public.ip_ip_id_seq
+    AS integer
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+
+ALTER TABLE public.ip_ip_id_seq OWNER TO "rpfw-dev";
+
+--
+-- Name: ip_kick; Type: TABLE; Schema: public; Owner: rpfw-dev
+--
+
+CREATE TABLE public.ip_kick (
+    id integer NOT NULL,
+    ip_id integer NOT NULL,
+    created timestamp without time zone DEFAULT (now())::timestamp without time zone NOT NULL,
+    reason character varying(121) NOT NULL,
+    kicker_id integer
+);
+
+
+ALTER TABLE public.ip_kick OWNER TO "rpfw-dev";
+
+--
+-- Name: ip_kick_id_seq; Type: SEQUENCE; Schema: public; Owner: rpfw-dev
+--
+
+CREATE SEQUENCE public.ip_kick_id_seq
+    AS integer
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+
+ALTER TABLE public.ip_kick_id_seq OWNER TO "rpfw-dev";
+
+--
+-- Name: ip_kick_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: rpfw-dev
+--
+
+ALTER SEQUENCE public.ip_kick_id_seq OWNED BY public.ip_kick.id;
+
+
+--
+-- Name: pickup; Type: TABLE; Schema: public; Owner: rpfw-dev
+--
+
+CREATE TABLE public.pickup (
+    id integer NOT NULL,
+    object_id smallint NOT NULL,
+    pos_x real NOT NULL,
+    pos_y real NOT NULL,
+    pos_z real NOT NULL,
+    world_id smallint NOT NULL,
+    interior_id smallint NOT NULL,
+    type_id smallint NOT NULL,
+    pickup_id smallint,
+    angle real DEFAULT 0 NOT NULL
+);
+
+
+ALTER TABLE public.pickup OWNER TO "rpfw-dev";
+
+--
+-- Name: pickup_id_seq; Type: SEQUENCE; Schema: public; Owner: rpfw-dev
+--
+
+CREATE SEQUENCE public.pickup_id_seq
+    AS integer
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+
+ALTER TABLE public.pickup_id_seq OWNER TO "rpfw-dev";
+
+--
+-- Name: pickup_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: rpfw-dev
+--
+
+ALTER SEQUENCE public.pickup_id_seq OWNED BY public.pickup.id;
+
+
+--
+-- Name: portal; Type: TABLE; Schema: public; Owner: rpfw-dev
+--
+
+CREATE TABLE public.portal (
+    id integer NOT NULL,
+    object smallint NOT NULL,
+    pos_x real NOT NULL,
+    pos_y real NOT NULL,
+    pos_z real NOT NULL,
+    world smallint NOT NULL,
+    exit_object smallint,
+    exit_pos_x real,
+    exit_pos_y real,
+    exit_pos_z real,
+    exit_world smallint,
+    pickup_id smallint,
+    exit_pickup_id smallint,
+    interior_id smallint DEFAULT 0 NOT NULL,
+    exit_interior_id smallint,
+    angle real DEFAULT 0 NOT NULL,
+    exit_angle real
+);
+
+
+ALTER TABLE public.portal OWNER TO "rpfw-dev";
+
+--
+-- Name: portal_id_seq; Type: SEQUENCE; Schema: public; Owner: rpfw-dev
+--
+
+CREATE SEQUENCE public.portal_id_seq
+    AS integer
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+
+ALTER TABLE public.portal_id_seq OWNER TO "rpfw-dev";
+
+--
+-- Name: portal_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: rpfw-dev
+--
+
+ALTER SEQUENCE public.portal_id_seq OWNED BY public.portal.id;
+
+
+--
+-- Name: user; Type: TABLE; Schema: public; Owner: rpfw-dev
+--
+
+CREATE TABLE public."user" (
+    id integer NOT NULL,
+    name character varying(24) NOT NULL,
+    level smallint DEFAULT 1,
+    password character varying(128) NOT NULL,
+    webaccount_id integer,
+    jailed smallint DEFAULT 0,
+    created timestamp without time zone DEFAULT (now())::timestamp without time zone
+);
+
+
+ALTER TABLE public."user" OWNER TO "rpfw-dev";
+
+--
+-- Name: TABLE "user"; Type: COMMENT; Schema: public; Owner: rpfw-dev
+--
+
+COMMENT ON TABLE public."user" IS 'SA-MP player user records';
+
+
+--
+-- Name: user_ban; Type: TABLE; Schema: public; Owner: rpfw-dev
+--
+
+CREATE TABLE public.user_ban (
+    id integer NOT NULL,
+    user_id integer NOT NULL,
+    created timestamp without time zone DEFAULT (now())::timestamp without time zone,
+    expires timestamp without time zone DEFAULT ((now())::timestamp without time zone + '30 days'::interval),
+    reason character varying(121) NOT NULL,
+    banner integer,
+    ip_ban_id integer
+);
+
+
+ALTER TABLE public.user_ban OWNER TO "rpfw-dev";
+
+--
+-- Name: COLUMN user_ban.banner; Type: COMMENT; Schema: public; Owner: rpfw-dev
+--
+
+COMMENT ON COLUMN public.user_ban.banner IS 'NOT NULL as users can be banned by automation as well as ingame players.';
+
+
+--
+-- Name: COLUMN user_ban.ip_ban_id; Type: COMMENT; Schema: public; Owner: rpfw-dev
+--
+
+COMMENT ON COLUMN public.user_ban.ip_ban_id IS 'Optional, as an IP ban might get removed for another user and we want the offending user to remain banned.';
+
+
+--
+-- Name: user_bans_id_seq; Type: SEQUENCE; Schema: public; Owner: rpfw-dev
+--
+
+CREATE SEQUENCE public.user_bans_id_seq
+    AS integer
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+
+ALTER TABLE public.user_bans_id_seq OWNER TO "rpfw-dev";
+
+--
+-- Name: user_bans_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: rpfw-dev
+--
+
+ALTER SEQUENCE public.user_bans_id_seq OWNED BY public.user_ban.id;
+
+
+--
+-- Name: user_id_seq; Type: SEQUENCE; Schema: public; Owner: rpfw-dev
+--
+
+CREATE SEQUENCE public.user_id_seq
+    AS integer
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+
+ALTER TABLE public.user_id_seq OWNER TO "rpfw-dev";
+
+--
+-- Name: user_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: rpfw-dev
+--
+
+ALTER SEQUENCE public.user_id_seq OWNED BY public."user".id;
+
+
+--
+-- Name: user_ip; Type: TABLE; Schema: public; Owner: rpfw-dev
+--
+
+CREATE TABLE public.user_ip (
+    ip_id integer NOT NULL,
+    user_id integer NOT NULL,
+    updated timestamp without time zone DEFAULT (now())::timestamp without time zone NOT NULL,
+    created timestamp without time zone NOT NULL
+);
+
+
+ALTER TABLE public.user_ip OWNER TO "rpfw-dev";
+
+--
+-- Name: COLUMN user_ip.updated; Type: COMMENT; Schema: public; Owner: rpfw-dev
+--
+
+COMMENT ON COLUMN public.user_ip.updated IS 'For administration purposes it might be usefull to see when a user last used an IP.';
+
+
+--
+-- Name: COLUMN user_ip.created; Type: COMMENT; Schema: public; Owner: rpfw-dev
+--
+
+COMMENT ON COLUMN public.user_ip.created IS 'For administration purposes it might be usefull to see when a user started using an IP.';
+
+
+--
+-- Name: user_kick; Type: TABLE; Schema: public; Owner: rpfw-dev
+--
+
+CREATE TABLE public.user_kick (
+    id integer NOT NULL,
+    user_id integer NOT NULL,
+    created timestamp without time zone DEFAULT (now())::timestamp without time zone,
+    reason character varying(121) NOT NULL,
+    kicker_id integer,
+    ip_kick_id integer NOT NULL
+);
+
+
+ALTER TABLE public.user_kick OWNER TO "rpfw-dev";
+
+--
+-- Name: user_kicks_id_seq; Type: SEQUENCE; Schema: public; Owner: rpfw-dev
+--
+
+CREATE SEQUENCE public.user_kicks_id_seq
+    AS integer
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+
+ALTER TABLE public.user_kicks_id_seq OWNER TO "rpfw-dev";
+
+--
+-- Name: user_kicks_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: rpfw-dev
+--
+
+ALTER SEQUENCE public.user_kicks_id_seq OWNED BY public.user_kick.id;
+
+
+--
+-- Name: user_user_id_seq; Type: SEQUENCE; Schema: public; Owner: rpfw-dev
+--
+
+CREATE SEQUENCE public.user_user_id_seq
+    AS integer
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+
+ALTER TABLE public.user_user_id_seq OWNER TO "rpfw-dev";
+
+--
+-- Name: vehicle; Type: TABLE; Schema: public; Owner: rpfw-dev
+--
+
+CREATE TABLE public.vehicle (
+    id integer NOT NULL,
+    model_id smallint NOT NULL,
+    pos_x real NOT NULL,
+    pos_y real NOT NULL,
+    pos_z real NOT NULL,
+    angle real NOT NULL,
+    color1 smallint DEFAULT '-1'::integer NOT NULL,
+    color2 smallint DEFAULT '-1'::integer NOT NULL,
+    respawn_delay smallint DEFAULT '-1'::integer NOT NULL,
+    addsiren smallint DEFAULT '-1'::integer NOT NULL,
+    vehicle_id smallint
+);
+
+
+ALTER TABLE public.vehicle OWNER TO "rpfw-dev";
+
+--
+-- Name: vehicle_id_seq; Type: SEQUENCE; Schema: public; Owner: rpfw-dev
+--
+
+CREATE SEQUENCE public.vehicle_id_seq
+    AS integer
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+
+ALTER TABLE public.vehicle_id_seq OWNER TO "rpfw-dev";
+
+--
+-- Name: vehicle_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: rpfw-dev
+--
+
+ALTER SEQUENCE public.vehicle_id_seq OWNED BY public.vehicle.id;
+
+
+--
+-- Name: character id; Type: DEFAULT; Schema: public; Owner: rpfw-dev
+--
+
+ALTER TABLE ONLY public."character" ALTER COLUMN id SET DEFAULT nextval('public.character_id_seq1'::regclass);
+
+
+--
+-- Name: ip id; Type: DEFAULT; Schema: public; Owner: rpfw-dev
+--
+
+ALTER TABLE ONLY public.ip ALTER COLUMN id SET DEFAULT nextval('public.ip_id_seq'::regclass);
+
+
+--
+-- Name: ip_ban id; Type: DEFAULT; Schema: public; Owner: rpfw-dev
+--
+
+ALTER TABLE ONLY public.ip_ban ALTER COLUMN id SET DEFAULT nextval('public.ip_bans_id_seq'::regclass);
+
+
+--
+-- Name: ip_kick id; Type: DEFAULT; Schema: public; Owner: rpfw-dev
+--
+
+ALTER TABLE ONLY public.ip_kick ALTER COLUMN id SET DEFAULT nextval('public.ip_kick_id_seq'::regclass);
+
+
+--
+-- Name: pickup id; Type: DEFAULT; Schema: public; Owner: rpfw-dev
+--
+
+ALTER TABLE ONLY public.pickup ALTER COLUMN id SET DEFAULT nextval('public.pickup_id_seq'::regclass);
+
+
+--
+-- Name: portal id; Type: DEFAULT; Schema: public; Owner: rpfw-dev
+--
+
+ALTER TABLE ONLY public.portal ALTER COLUMN id SET DEFAULT nextval('public.portal_id_seq'::regclass);
+
+
+--
+-- Name: user id; Type: DEFAULT; Schema: public; Owner: rpfw-dev
+--
+
+ALTER TABLE ONLY public."user" ALTER COLUMN id SET DEFAULT nextval('public.user_id_seq'::regclass);
+
+
+--
+-- Name: user_ban id; Type: DEFAULT; Schema: public; Owner: rpfw-dev
+--
+
+ALTER TABLE ONLY public.user_ban ALTER COLUMN id SET DEFAULT nextval('public.user_bans_id_seq'::regclass);
+
+
+--
+-- Name: user_kick id; Type: DEFAULT; Schema: public; Owner: rpfw-dev
+--
+
+ALTER TABLE ONLY public.user_kick ALTER COLUMN id SET DEFAULT nextval('public.user_kicks_id_seq'::regclass);
+
+
+--
+-- Name: vehicle id; Type: DEFAULT; Schema: public; Owner: rpfw-dev
+--
+
+ALTER TABLE ONLY public.vehicle ALTER COLUMN id SET DEFAULT nextval('public.vehicle_id_seq'::regclass);
+
+
+--
+-- Data for Name: character; Type: TABLE DATA; Schema: public; Owner: rpfw-dev
+--
+
+COPY public."character" (id, user_id, name, skin_id, cash, health, armour, jailed, pos_x, pos_y, pos_z, rotation, created, job_id, world_id, interior_id, job_skin_id, weapon_slot_0, weapon_slot_1, weapon_slot_2, weapon_slot_3, weapon_slot_4, weapon_slot_5, weapon_slot_6, weapon_slot_7, weapon_slot_8, weapon_slot_9, weapon_slot_10, weapon_slot_11, weapon_slot_12, weapon_skill_0, weapon_skill_1, weapon_skill_2, weapon_skill_3, weapon_skill_4, weapon_skill_5, weapon_skill_6, weapon_skill_7, weapon_skill_8, weapon_skill_9, weapon_skill_10) FROM stdin;
+37	13	Jo_Bo	134	47	100	0	0	-199.62967	992.9551	19.032475	33.898186	2020-02-26 17:46:13.40483	0	0	0	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	0	0	0	0	0	0	0	0	0	0	0
+\.
+
+
+--
+-- Data for Name: ip; Type: TABLE DATA; Schema: public; Owner: rpfw-dev
+--
+
+COPY public.ip (id, address, connections) FROM stdin;
+49	127.0.0.1	235
+\.
+
+
+--
+-- Data for Name: ip_ban; Type: TABLE DATA; Schema: public; Owner: rpfw-dev
+--
+
+COPY public.ip_ban (id, ip_id, created, expires, reason, banner_id) FROM stdin;
+\.
+
+
+--
+-- Data for Name: ip_kick; Type: TABLE DATA; Schema: public; Owner: rpfw-dev
+--
+
+COPY public.ip_kick (id, ip_id, created, reason, kicker_id) FROM stdin;
+\.
+
+
+--
+-- Data for Name: pickup; Type: TABLE DATA; Schema: public; Owner: rpfw-dev
+--
+
+COPY public.pickup (id, object_id, pos_x, pos_y, pos_z, world_id, interior_id, type_id, pickup_id, angle) FROM stdin;
+31	1247	-203.16534	1012.1661	19.73446	0	0	1	3	0
+30	1247	-202	1005	19.723639	0	0	0	4	0
+\.
+
+
+--
+-- Data for Name: portal; Type: TABLE DATA; Schema: public; Owner: rpfw-dev
+--
+
+COPY public.portal (id, object, pos_x, pos_y, pos_z, world, exit_object, exit_pos_x, exit_pos_y, exit_pos_z, exit_world, pickup_id, exit_pickup_id, interior_id, exit_interior_id, angle, exit_angle) FROM stdin;
+43	19902	-197.22972	1006.7419	19.580938	-1	19607	-193.11603	1001.5561	19.775234	-1	1	2	0	0	359	1.1358372e+09
+\.
+
+
+--
+-- Data for Name: user; Type: TABLE DATA; Schema: public; Owner: rpfw-dev
+--
+
+COPY public."user" (id, name, level, password, webaccount_id, jailed, created) FROM stdin;
+13	Player	1	DF3210C97BB5895B32A09C3CD9A905248FD2F34720711152C92EE6D1828E3122B0844C565536C5214B5F2C137FF638BD86F03EBC412DDDDD4018F968819BEEC0	\N	0	2020-02-26 17:46:13.395829
+\.
+
+
+--
+-- Data for Name: user_ban; Type: TABLE DATA; Schema: public; Owner: rpfw-dev
+--
+
+COPY public.user_ban (id, user_id, created, expires, reason, banner, ip_ban_id) FROM stdin;
+\.
+
+
+--
+-- Data for Name: user_ip; Type: TABLE DATA; Schema: public; Owner: rpfw-dev
+--
+
+COPY public.user_ip (ip_id, user_id, updated, created) FROM stdin;
+\.
+
+
+--
+-- Data for Name: user_kick; Type: TABLE DATA; Schema: public; Owner: rpfw-dev
+--
+
+COPY public.user_kick (id, user_id, created, reason, kicker_id, ip_kick_id) FROM stdin;
+\.
+
+
+--
+-- Data for Name: vehicle; Type: TABLE DATA; Schema: public; Owner: rpfw-dev
+--
+
+COPY public.vehicle (id, model_id, pos_x, pos_y, pos_z, angle, color1, color2, respawn_delay, addsiren, vehicle_id) FROM stdin;
+4	411	-205.92249	950.4727	15.779951	92.88477	-1	-1	-1	-1	1
+5	411	-190.78378	977.7164	18.630545	62.595642	-1	-1	-1	-1	2
+\.
+
+
+--
+-- Name: character_character_id_seq; Type: SEQUENCE SET; Schema: public; Owner: rpfw-dev
+--
+
+SELECT pg_catalog.setval('public.character_character_id_seq', 1, false);
+
+
+--
+-- Name: character_id_seq; Type: SEQUENCE SET; Schema: public; Owner: rpfw-dev
+--
+
+SELECT pg_catalog.setval('public.character_id_seq', 1, false);
+
+
+--
+-- Name: character_id_seq1; Type: SEQUENCE SET; Schema: public; Owner: rpfw-dev
+--
+
+SELECT pg_catalog.setval('public.character_id_seq1', 39, true);
+
+
+--
+-- Name: ip_bans_id_seq; Type: SEQUENCE SET; Schema: public; Owner: rpfw-dev
+--
+
+SELECT pg_catalog.setval('public.ip_bans_id_seq', 8, true);
+
+
+--
+-- Name: ip_id_seq; Type: SEQUENCE SET; Schema: public; Owner: rpfw-dev
+--
+
+SELECT pg_catalog.setval('public.ip_id_seq', 283, true);
+
+
+--
+-- Name: ip_ip_id_seq; Type: SEQUENCE SET; Schema: public; Owner: rpfw-dev
+--
+
+SELECT pg_catalog.setval('public.ip_ip_id_seq', 133, true);
+
+
+--
+-- Name: ip_kick_id_seq; Type: SEQUENCE SET; Schema: public; Owner: rpfw-dev
+--
+
+SELECT pg_catalog.setval('public.ip_kick_id_seq', 19, true);
+
+
+--
+-- Name: pickup_id_seq; Type: SEQUENCE SET; Schema: public; Owner: rpfw-dev
+--
+
+SELECT pg_catalog.setval('public.pickup_id_seq', 31, true);
+
+
+--
+-- Name: portal_id_seq; Type: SEQUENCE SET; Schema: public; Owner: rpfw-dev
+--
+
+SELECT pg_catalog.setval('public.portal_id_seq', 43, true);
+
+
+--
+-- Name: user_bans_id_seq; Type: SEQUENCE SET; Schema: public; Owner: rpfw-dev
+--
+
+SELECT pg_catalog.setval('public.user_bans_id_seq', 5, true);
+
+
+--
+-- Name: user_id_seq; Type: SEQUENCE SET; Schema: public; Owner: rpfw-dev
+--
+
+SELECT pg_catalog.setval('public.user_id_seq', 13, true);
+
+
+--
+-- Name: user_kicks_id_seq; Type: SEQUENCE SET; Schema: public; Owner: rpfw-dev
+--
+
+SELECT pg_catalog.setval('public.user_kicks_id_seq', 10, true);
+
+
+--
+-- Name: user_user_id_seq; Type: SEQUENCE SET; Schema: public; Owner: rpfw-dev
+--
+
+SELECT pg_catalog.setval('public.user_user_id_seq', 19, true);
+
+
+--
+-- Name: vehicle_id_seq; Type: SEQUENCE SET; Schema: public; Owner: rpfw-dev
+--
+
+SELECT pg_catalog.setval('public.vehicle_id_seq', 5, true);
+
+
+--
+-- Name: character character_name_key; Type: CONSTRAINT; Schema: public; Owner: rpfw-dev
+--
+
+ALTER TABLE ONLY public."character"
+    ADD CONSTRAINT character_name_key UNIQUE (name);
+
+
+--
+-- Name: character character_pkey; Type: CONSTRAINT; Schema: public; Owner: rpfw-dev
+--
+
+ALTER TABLE ONLY public."character"
+    ADD CONSTRAINT character_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: ip ip_address_key; Type: CONSTRAINT; Schema: public; Owner: rpfw-dev
+--
+
+ALTER TABLE ONLY public.ip
+    ADD CONSTRAINT ip_address_key UNIQUE (address);
+
+
+--
+-- Name: ip_ban ip_bans_pkey; Type: CONSTRAINT; Schema: public; Owner: rpfw-dev
+--
+
+ALTER TABLE ONLY public.ip_ban
+    ADD CONSTRAINT ip_bans_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: ip_kick ip_kick_pkey; Type: CONSTRAINT; Schema: public; Owner: rpfw-dev
+--
+
+ALTER TABLE ONLY public.ip_kick
+    ADD CONSTRAINT ip_kick_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: ip ip_pkey; Type: CONSTRAINT; Schema: public; Owner: rpfw-dev
+--
+
+ALTER TABLE ONLY public.ip
+    ADD CONSTRAINT ip_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: pickup pickup_pkey; Type: CONSTRAINT; Schema: public; Owner: rpfw-dev
+--
+
+ALTER TABLE ONLY public.pickup
+    ADD CONSTRAINT pickup_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: portal portal_pkey; Type: CONSTRAINT; Schema: public; Owner: rpfw-dev
+--
+
+ALTER TABLE ONLY public.portal
+    ADD CONSTRAINT portal_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: portal unique_location; Type: CONSTRAINT; Schema: public; Owner: rpfw-dev
+--
+
+ALTER TABLE ONLY public.portal
+    ADD CONSTRAINT unique_location UNIQUE (pos_x, pos_y, pos_z, world);
+
+
+--
+-- Name: user_ban user_bans_pkey; Type: CONSTRAINT; Schema: public; Owner: rpfw-dev
+--
+
+ALTER TABLE ONLY public.user_ban
+    ADD CONSTRAINT user_bans_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: user_ip user_ip_pkey; Type: CONSTRAINT; Schema: public; Owner: rpfw-dev
+--
+
+ALTER TABLE ONLY public.user_ip
+    ADD CONSTRAINT user_ip_pkey PRIMARY KEY (ip_id, user_id);
+
+
+--
+-- Name: user_kick user_kicks_pkey; Type: CONSTRAINT; Schema: public; Owner: rpfw-dev
+--
+
+ALTER TABLE ONLY public.user_kick
+    ADD CONSTRAINT user_kicks_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: user user_name_key; Type: CONSTRAINT; Schema: public; Owner: rpfw-dev
+--
+
+ALTER TABLE ONLY public."user"
+    ADD CONSTRAINT user_name_key UNIQUE (name);
+
+
+--
+-- Name: user user_pkey; Type: CONSTRAINT; Schema: public; Owner: rpfw-dev
+--
+
+ALTER TABLE ONLY public."user"
+    ADD CONSTRAINT user_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: vehicle vehicle_pkey; Type: CONSTRAINT; Schema: public; Owner: rpfw-dev
+--
+
+ALTER TABLE ONLY public.vehicle
+    ADD CONSTRAINT vehicle_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: character character_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: rpfw-dev
+--
+
+ALTER TABLE ONLY public."character"
+    ADD CONSTRAINT character_user_id_fkey FOREIGN KEY (user_id) REFERENCES public."user"(id) ON UPDATE CASCADE ON DELETE CASCADE;
+
+
+--
+-- Name: user_ban ip_ban_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: rpfw-dev
+--
+
+ALTER TABLE ONLY public.user_ban
+    ADD CONSTRAINT ip_ban_id_fkey FOREIGN KEY (ip_ban_id) REFERENCES public.ip_ban(id) ON UPDATE CASCADE NOT VALID;
+
+
+--
+-- Name: CONSTRAINT ip_ban_id_fkey ON user_ban; Type: COMMENT; Schema: public; Owner: rpfw-dev
+--
+
+COMMENT ON CONSTRAINT ip_ban_id_fkey ON public.user_ban IS 'IP ban can be removed while character ban remains';
+
+
+--
+-- Name: ip_ban ip_bans_banner_fkey; Type: FK CONSTRAINT; Schema: public; Owner: rpfw-dev
+--
+
+ALTER TABLE ONLY public.ip_ban
+    ADD CONSTRAINT ip_bans_banner_fkey FOREIGN KEY (banner_id) REFERENCES public."user"(id) ON UPDATE CASCADE;
+
+
+--
+-- Name: ip_ban ip_bans_ip_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: rpfw-dev
+--
+
+ALTER TABLE ONLY public.ip_ban
+    ADD CONSTRAINT ip_bans_ip_id_fkey FOREIGN KEY (ip_id) REFERENCES public.ip(id) ON UPDATE CASCADE ON DELETE CASCADE;
+
+
+--
+-- Name: ip_kick ip_kick_ip_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: rpfw-dev
+--
+
+ALTER TABLE ONLY public.ip_kick
+    ADD CONSTRAINT ip_kick_ip_id_fkey FOREIGN KEY (ip_id) REFERENCES public.ip(id) ON UPDATE CASCADE ON DELETE CASCADE;
+
+
+--
+-- Name: ip_kick ip_kick_kicker_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: rpfw-dev
+--
+
+ALTER TABLE ONLY public.ip_kick
+    ADD CONSTRAINT ip_kick_kicker_id_fkey FOREIGN KEY (kicker_id) REFERENCES public."user"(id) ON UPDATE CASCADE;
+
+
+--
+-- Name: user_ban user_bans_banner_fkey; Type: FK CONSTRAINT; Schema: public; Owner: rpfw-dev
+--
+
+ALTER TABLE ONLY public.user_ban
+    ADD CONSTRAINT user_bans_banner_fkey FOREIGN KEY (banner) REFERENCES public."user"(id) ON UPDATE CASCADE;
+
+
+--
+-- Name: user_ban user_bans_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: rpfw-dev
+--
+
+ALTER TABLE ONLY public.user_ban
+    ADD CONSTRAINT user_bans_user_id_fkey FOREIGN KEY (user_id) REFERENCES public."user"(id) ON UPDATE CASCADE ON DELETE CASCADE;
+
+
+--
+-- Name: user_ip user_ip_ip_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: rpfw-dev
+--
+
+ALTER TABLE ONLY public.user_ip
+    ADD CONSTRAINT user_ip_ip_id_fkey FOREIGN KEY (ip_id) REFERENCES public.ip(id) ON UPDATE CASCADE ON DELETE CASCADE;
+
+
+--
+-- Name: user_ip user_ip_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: rpfw-dev
+--
+
+ALTER TABLE ONLY public.user_ip
+    ADD CONSTRAINT user_ip_user_id_fkey FOREIGN KEY (user_id) REFERENCES public."user"(id) ON UPDATE CASCADE ON DELETE CASCADE;
+
+
+--
+-- Name: user_kick user_kick_ip_kick_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: rpfw-dev
+--
+
+ALTER TABLE ONLY public.user_kick
+    ADD CONSTRAINT user_kick_ip_kick_id_fkey FOREIGN KEY (ip_kick_id) REFERENCES public.ip_kick(id) NOT VALID;
+
+
+--
+-- Name: user_kick user_kick_kicker_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: rpfw-dev
+--
+
+ALTER TABLE ONLY public.user_kick
+    ADD CONSTRAINT user_kick_kicker_id_fkey FOREIGN KEY (kicker_id) REFERENCES public."user"(id) ON UPDATE CASCADE;
+
+
+--
+-- Name: user_kick user_kick_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: rpfw-dev
+--
+
+ALTER TABLE ONLY public.user_kick
+    ADD CONSTRAINT user_kick_user_id_fkey FOREIGN KEY (user_id) REFERENCES public."user"(id) ON UPDATE CASCADE ON DELETE CASCADE;
+
+
+--
+-- PostgreSQL database dump complete
+--
+

+ 1258 - 0
samp03/filterscripts/YDBG.pwn

@@ -0,0 +1,1258 @@
+/*
+===================================================================
+  If you uncomment the following line YSI will be compiled with
+  filterscript options, this is VERY important if you do use it as
+  one, otherwise certain features may not work
+===================================================================
+*/
+
+#define FILTERSCRIPT
+
+/*
+===================================================================
+  If you uncomment one of the following lines YSI will not include,
+  those files in compiling.
+  So if you E.G. dont use objects in your script,
+  you could uncomment the line #define YSI_NO_OBJECTS,
+  and it would leave the Object files out.
+  
+  Note: Not every combination has been tested (there are currently
+  131072 combinations, if you find one which doesn't compile due to
+  cross-file dependencies please say.
+  
+  Also note that excluding either checkpoints or areas will exclude
+  properties instantly.  You can also exclude all unwritten new
+  libraries for future compatability using:
+
+  #define YSI_VERSION <version>
+  
+  Where version is the version you are compiling against, current
+  ids are:
+  
+  2 - YSI 0.2 or earlier
+  3 - YSI 0.3
+===================================================================
+*/
+  
+//#define YSI_NO_TEXT
+//#define YSI_NO_COMMANDS
+//#define YSI_NO_SYSTEM
+//#define YSI_NO_TRACKING
+//#define YSI_NO_CALLBACKS
+//#define YSI_NO_MASTER
+//#define YSI_NO_CLASSES
+//#define YSI_NO_PICKUPS
+//#define YSI_NO_STANDARD
+//#define YSI_NO_MODULES
+#define YSI_NO_OBJECTS
+//#define YSI_NO_RACES
+//#define YSI_NO_CHECKPOINTS
+//#define YSI_NO_AREAS
+//#define YSI_NO_GROUPS
+//#define YSI_NO_PROPERTIES
+//#define YSI_NO_ZONES
+
+#include <YSI>
+
+// State system limited to only 4,294,967,296 states
+enum YDBG_STATE
+{
+	YDBG_STATE_NONE,
+	YDBG_STATE_CREATE_AMMU[4],
+	YDBG_STATE_AMMU_PRICE[40],
+	YDBG_STATE_AMMU_AMMO[40],
+	YDBG_STATE_AMMU_TYPE,
+	YDBG_STATE_CREATE_PROP,
+	YDBG_STATE_PROP_PRICE,
+	YDBG_STATE_PROP_REWARD,
+	YDBG_STATE_PROP_DELAY,
+	YDBG_STATE_FZ_WANT,
+	YDBG_STATE_FZ_SPHERE,
+	YDBG_STATE_FZ_CIRCLE,
+	YDBG_STATE_FZ_CUBE,
+	YDBG_STATE_FZ_BOX,
+	YDBG_STATE_FZ_POLY,
+	YDBG_STATE_MA_WANT,
+	YDBG_STATE_MA_SPHERE,
+	YDBG_STATE_MA_CIRCLE,
+	YDBG_STATE_MA_CUBE,
+	YDBG_STATE_MA_BOX,
+	YDBG_STATE_MA_POLY,
+	YDBG_STATE_TELE
+}
+
+#define PLAYER_PRIVATE_WORLD(%1) \
+	((%1) + 665544)
+
+#define MAX_DEBUG_SAVE_SLOTS (5)
+
+new
+	Menu:gValueMenu,
+	Menu:gAreaMenu,
+	//gPlayerMenu[MAX_PLAYERS] = {INVALID_MENU, ...},
+	YDBG_STATE:gYDBGPlayerState[MAX_PLAYERS] = {YDBG_STATE_NONE, ...},
+	gPlayerCreateData[MAX_PLAYERS][41],
+	Text:gPlayerTextDraw[MAX_PLAYERS],
+	gEditorsGroup,
+	XML:gLoadRules;
+
+#define AddMoneyMenuData(%1,%2,%3,%4) \
+	gPlayerCreateData[playerid][(%1)] += ((gPlayerCreateData[playerid][(%1)] >>> (%2)) < ((%3) - (%4))) ? ((%4) << (%2)) : (0)
+
+#define TakeMoneyMenuData(%1,%2,%3) \
+	gPlayerCreateData[playerid][(%1)] -= ((gPlayerCreateData[playerid][(%1)] >>> (%2)) >= (%3)) ? ((%3) << (%2)) : (0)
+
+#if defined FILTERSCRIPT
+
+Script_OnFilterScriptInit()
+{
+	print("\n------------------------------------------");
+	print(" YSI Debug system by Alex \"Y_Less\" Cole");
+	print("------------------------------------------\n");
+
+	ycmd(kill);
+	ycmd("mycommand");
+	
+	// Declare the groups
+	gEditorsGroup = Group_Create("YDBG_Editors");
+	
+	// Declare the commands
+	new
+		cmd;
+	cmd = ycmd("createammu");
+	// Set them so only valid editors can use them
+	Group_SetDefaultCommandByID(cmd, 0);
+	Group_SetCommandByID(gEditorsGroup, cmd, 1);
+	
+	cmd = ycmd("createprop");
+	Group_SetDefaultCommandByID(cmd, 0);
+	Group_SetCommandByID(gEditorsGroup, cmd, 1);
+	
+	cmd = ycmd("createbank");
+	Group_SetDefaultCommandByID(cmd, 0);
+	Group_SetCommandByID(gEditorsGroup, cmd, 1);
+
+	
+	Langs_AddLanguage("EN", "English");
+	Langs_AddFile("core", "YSI");
+
+	gValueMenu = CreateMenu("Set value", 1, 260.0, 200.0, 120.0);
+	AddMenuItem(gValueMenu, 0, " +10000");
+	AddMenuItem(gValueMenu, 0, " +1000");
+	AddMenuItem(gValueMenu, 0, " +100");
+	AddMenuItem(gValueMenu, 0, " +10");
+	AddMenuItem(gValueMenu, 0, " +1");
+	AddMenuItem(gValueMenu, 0, " -1");
+	AddMenuItem(gValueMenu, 0, " -10");
+	AddMenuItem(gValueMenu, 0, " -100");
+	AddMenuItem(gValueMenu, 0, " -1000");
+	AddMenuItem(gValueMenu, 0, " -10000");
+	AddMenuItem(gValueMenu, 0, "- Done -");
+	
+	gAreaMenu = CreateMenu("Select area type", 1, 210.0, 200.0, 220.0);
+	AddMenuItem(gAreaMenu, 0, "Cube");
+	AddMenuItem(gAreaMenu, 0, "Box");
+	AddMenuItem(gAreaMenu, 0, "Circle");
+	AddMenuItem(gAreaMenu, 0, "Sphere");
+	AddMenuItem(gAreaMenu, 0, "Polygon");
+	
+	gLoadRules = XML_New();
+	XML_AddHandler(gLoadRules, "ammunation", "YDBG_Load_Ammunation");
+
+ 	return 1;
+}
+
+Script_OnFilterScriptExit()
+{
+    return 1;
+}
+
+#else
+
+main()
+{
+    print("\n--------------------------------");
+    print(" YSI Gamemode by your name here");
+    print("--------------------------------\n");
+}
+
+#endif
+
+Text_RegisterTag(tag_with_MY_KILL_HELP);
+
+forward ycmd_kill(playerid, params[], help);
+public ycmd_kill(playerid, params[], help)
+{
+    if (help) Text_Send(playerid, "MY_KILL_HELP");
+    else SetPlayerHealth(playerid, 0.0);
+    return 1;
+}
+
+Script_OnGameModeInit()
+{
+    // Don't use these lines if it's a filterscript
+    #if !defined FILTERSCRIPT
+	    SetGameModeText("Blank Script");
+	    AddStaticVehicleEx(487, 2040.0568, 1343.4222, 10.6719, 0.0, 0, 0, 20);
+	    AddStaticVehicleEx(435, 2040.0568, 1354.4222, 10.6719, 0.0, 0, 0, 20); // long trailer - 1
+	    AddStaticVehicleEx(515, 2040.0568, 1365.4222, 10.6719, 0.0, 0, 0, 20); // roadtrain
+	    Class_Add(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
+	    ycmd(kill);
+	    ycmd("mycommand");
+	    Langs_AddLanguage("EN", "English");
+	    Langs_AddFile("core", "YSI");
+    #endif
+    return 1;
+}
+
+Command_(mycommand)
+{
+    // Your code here
+    return 1;
+}
+
+Script_OnGameModeExit()
+{
+	Master_@Master();
+    return 1;
+}
+
+Script_OnPlayerRequestClass(playerid, classid)
+{
+    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
+    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
+    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
+    return 1;
+}
+
+Script_OnPlayerRequestSpawnEx(playerid, classid)
+{
+    return 1;
+}
+
+Script_OnPlayerConnect(playerid)
+{
+	new
+		Text:td = TextDrawCreate(16.0, 141.0, " ");
+	TextDrawAlignment(td, 0);
+	TextDrawBackgroundColor(td, 0x000000FF);
+	TextDrawFont(td, 1);
+	TextDrawLetterSize(td, 0.5, 0.7);
+	TextDrawColor(td, 0xFF0000AA);
+	TextDrawSetOutline(td, 1);
+	TextDrawSetProportional(td, 1);
+	TextDrawSetShadow(td, 1);
+	TextDrawShowForPlayer(playerid, td);
+	gPlayerTextDraw[playerid] = td;
+	gYDBGPlayerState[playerid] = YDBG_STATE_NONE;
+	return 1;
+}
+
+Script_OnPlayerDisconnect(playerid, reason)
+{
+	TextDrawHideForPlayer(playerid, gPlayerTextDraw[playerid]);
+	TextDrawDestroy(gPlayerTextDraw[playerid]);
+	#pragma unused reason
+    return 1;
+}
+
+Script_OnPlayerSpawn(playerid)
+{
+    return 1;
+}
+
+Script_OnPlayerDeath(playerid, killerid, reason)
+{
+    return 1;
+}
+
+Script_OnVehicleSpawn(vehicleid)
+{
+    return 1;
+}
+
+Script_OnVehicleDeath(vehicleid, killerid)
+{
+    return 1;
+}
+
+Script_OnPlayerText(playerid, text[])
+{
+	new
+		states = _:gYDBGPlayerState[playerid];
+	switch (states)
+	{
+		case (_:YDBG_STATE_AMMU_PRICE + 0) .. (_:YDBG_STATE_AMMU_PRICE + 39):
+		{
+			new
+				price = strval(text);
+			if (price < 0x00100000)
+			{
+				HideMenuForPlayerEx(playerid);
+				gPlayerCreateData[playerid][states] &= 0xFFF00000;
+				gPlayerCreateData[playerid][states] |= price;
+				ShowCreateAmmuMenu(playerid, 0);
+			}
+			return 0;
+		}
+		case (_:YDBG_STATE_AMMU_AMMO + 0) .. (_:YDBG_STATE_AMMU_AMMO + 39):
+		{
+			new
+				ammo = strval(text);
+			if (ammo < 0x00001000)
+			{
+				HideMenuForPlayerEx(playerid);
+				gPlayerCreateData[playerid][states] &= 0x000FFFFF;
+				gPlayerCreateData[playerid][states] |= ammo << 20;
+				ShowCostAmmuMenu(playerid, states - _:YDBG_STATE_AMMU_AMMO);
+			}
+			return 0;
+		}
+	}
+    return 1;
+}
+
+Script_OnPlayerPrivmsg(playerid, recieverid, text[])
+{
+    return 1;
+}
+
+Script_OnPlayerCommandText(playerid, cmdtext[])
+{
+    return 0;
+}
+
+Script_OnPlayerInfoChange(playerid)
+{
+    return 1;
+}
+
+Script_OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
+{
+    return 1;
+}
+
+Script_OnPlayerExitVehicle(playerid, vehicleid)
+{
+    return 1;
+}
+
+Script_OnPlayerStateChange(playerid, newstate, oldstate)
+{
+    return 1;
+}
+
+Script_OnPlayerEnterCheckpointEx(playerid, cpid)
+{
+    return 1;
+}
+
+Script_OnPlayerLeaveCheckpointEx(playerid, cpid)
+{
+    return 1;
+}
+
+Script_OnPlayerEnterRaceCheckpoint(playerid)
+{
+    return 1;
+}
+
+Script_OnPlayerLeaveRaceCheckpoint(playerid)
+{
+    return 1;
+}
+
+Script_OnRconCommand(cmd[])
+{
+    return 1;
+}
+
+Script_OnPlayerPickUpPickup(playerid, pickupid)
+{
+    return 1;
+}
+
+HideMenuForPlayerEx(playerid)
+{
+	new
+		Menu:menu = GetPlayerMenu(playerid);
+	HideMenuForPlayer(menu, playerid);
+	if (menu != gValueMenu) DestroyMenu(menu);
+	TogglePlayerControllable(playerid, 1);
+	TextDrawSetString(gPlayerTextDraw[playerid], " ");
+}
+
+ShowMenuForPlayerEx(Menu:menu, playerid)
+{
+	ShowMenuForPlayer(menu, playerid);
+	TogglePlayerControllable(playerid, 0);
+}
+
+Script_OnPlayerSelectedMenuRow(playerid, row)
+{
+	HideMenuForPlayerEx(playerid);
+	new
+		states = _:gYDBGPlayerState[playerid];
+	switch (states)
+	{
+		case (_:YDBG_STATE_CREATE_AMMU + 0):
+		{
+			if (row < 10) ShowAmmoAmmuMenu(playerid, row);
+			else if (row > 10) ShowTypeAmmuMenu(playerid);
+			else ShowCreateAmmuMenu(playerid, 1);
+		}
+		case (_:YDBG_STATE_CREATE_AMMU + 1):
+		{
+			if (row < 10) ShowAmmoAmmuMenu(playerid, row + 10);
+			else if (row > 10) ShowTypeAmmuMenu(playerid);
+			else ShowCreateAmmuMenu(playerid, 2);
+		}
+		case (_:YDBG_STATE_CREATE_AMMU + 2):
+		{
+			if (row < 10) ShowAmmoAmmuMenu(playerid, row + 20);
+			else if (row > 10) ShowTypeAmmuMenu(playerid);
+			else ShowCreateAmmuMenu(playerid, 3);
+		}
+		case (_:YDBG_STATE_CREATE_AMMU + 3):
+		{
+			if (row < 10) ShowAmmoAmmuMenu(playerid, row + 30);
+			else if (row > 10) ShowTypeAmmuMenu(playerid);
+			else ShowCreateAmmuMenu(playerid, 0);
+		}
+		case (_:YDBG_STATE_AMMU_PRICE + 0) .. (_:YDBG_STATE_AMMU_PRICE + 39):
+		{
+			states -= _:YDBG_STATE_AMMU_PRICE;
+			switch (row)
+			{
+				case 0: gPlayerCreateData[playerid][states] += (gPlayerCreateData[playerid][states] & 0xFFFFF < 0x0000100000 - 10000) ? (10000) : (0);
+				case 1: gPlayerCreateData[playerid][states] += (gPlayerCreateData[playerid][states] & 0xFFFFF < 0x0000100000 - 1000) ? (1000) : (0);
+				case 2: gPlayerCreateData[playerid][states] += (gPlayerCreateData[playerid][states] & 0xFFFFF < 0x0000100000 - 100) ? (100) : (0);
+				case 3: gPlayerCreateData[playerid][states] += (gPlayerCreateData[playerid][states] & 0xFFFFF < 0x0000100000 - 10) ? (10) : (0);
+				case 4: gPlayerCreateData[playerid][states] += (gPlayerCreateData[playerid][states] & 0xFFFFF < 0x0000100000 - 1) ? (1) : (0);
+				case 5: gPlayerCreateData[playerid][states] -= (gPlayerCreateData[playerid][states] & 0xFFFFF >= 1) ? (1) : (0);
+				case 6: gPlayerCreateData[playerid][states] -= (gPlayerCreateData[playerid][states] & 0xFFFFF >= 10) ? (10) : (0);
+				case 7: gPlayerCreateData[playerid][states] -= (gPlayerCreateData[playerid][states] & 0xFFFFF >= 100) ? (100) : (0);
+				case 8: gPlayerCreateData[playerid][states] -= (gPlayerCreateData[playerid][states] & 0xFFFFF >= 1000) ? (1000) : (0);
+				case 9: gPlayerCreateData[playerid][states] -= (gPlayerCreateData[playerid][states] & 0xFFFFF >= 10000) ? (10000) : (0);
+				case 10: return ShowCreateAmmuMenu(playerid, 0);
+			}
+			ShowCostAmmuMenu(playerid, states);
+		}
+		case (_:YDBG_STATE_AMMU_AMMO + 0) .. (_:YDBG_STATE_AMMU_AMMO + 39):
+		{
+			states -= _:YDBG_STATE_AMMU_AMMO;
+			switch (row)
+			{
+				case 0: AddMoneyMenuData(states, 20, 0x00001000, 10000);
+				case 1: AddMoneyMenuData(states, 20, 0x00001000, 1000);
+				case 2: AddMoneyMenuData(states, 20, 0x00001000, 100);
+				case 3: AddMoneyMenuData(states, 20, 0x00001000, 10);
+				case 4: AddMoneyMenuData(states, 20, 0x00001000, 1);
+				case 5: TakeMoneyMenuData(states, 20, 1);
+				case 6: TakeMoneyMenuData(states, 20, 10);
+				case 7: TakeMoneyMenuData(states, 20, 100);
+				case 8: TakeMoneyMenuData(states, 20, 1000);
+				case 9: TakeMoneyMenuData(states, 20, 10000);
+				case 10: return ShowCostAmmuMenu(playerid, states);
+			}
+			ShowAmmoAmmuMenu(playerid, states);
+		}
+		case (_:YDBG_STATE_AMMU_TYPE):
+		{
+			switch (row)
+			{
+				case 0: gPlayerCreateData[playerid][40] ^= 1;
+				case 1: gPlayerCreateData[playerid][40] ^= 2;
+				case 2: return CreateAmmunationFromStats(playerid);
+			}
+			ShowTypeAmmuMenu(playerid);
+		}
+		case (_:YDBG_STATE_CREATE_PROP):
+		{
+			switch (row)
+			{
+				case 0: return ShowCostPropMenu(playerid);
+				case 1: return ShowRewardPropMenu(playerid);
+				case 2: return ShowDelayPropMenu(playerid);
+				case 3: gPlayerCreateData[playerid][40] ^= 1;
+				case 4: gPlayerCreateData[playerid][40] ^= 2;
+				case 5: gPlayerCreateData[playerid][40] ^= 4;
+				case 6: gPlayerCreateData[playerid][40] ^= 8;
+				case 7: return CreatePropertyFromStats(playerid);
+			}
+			ShowCreatePropMenu(playerid);
+		}
+		case (_:YDBG_STATE_PROP_PRICE):
+		{
+			switch (row)
+			{
+				case 0: AddMoneyMenuData(37, 0, 0x04000000, 10000);
+				case 1: AddMoneyMenuData(37, 0, 0x04000000, 1000);
+				case 2: AddMoneyMenuData(37, 0, 0x04000000, 100);
+				case 3: AddMoneyMenuData(37, 0, 0x04000000, 10);
+				case 4: AddMoneyMenuData(37, 0, 0x04000000, 1);
+				case 5: TakeMoneyMenuData(37, 0, 1);
+				case 6: TakeMoneyMenuData(37, 0, 10);
+				case 7: TakeMoneyMenuData(37, 0, 100);
+				case 8: TakeMoneyMenuData(37, 0, 1000);
+				case 9: TakeMoneyMenuData(37, 0, 10000);
+				case 10: return ShowCreatePropMenu(playerid);
+			}
+			ShowCostPropMenu(playerid);
+		}
+		case (_:YDBG_STATE_PROP_REWARD):
+		{
+			switch (row)
+			{
+				case 0: AddMoneyMenuData(38, 0, 0x00040000, 10000);
+				case 1: AddMoneyMenuData(38, 0, 0x00040000, 1000);
+				case 2: AddMoneyMenuData(38, 0, 0x00040000, 100);
+				case 3: AddMoneyMenuData(38, 0, 0x00040000, 10);
+				case 4: AddMoneyMenuData(38, 0, 0x00040000, 1);
+				case 5: TakeMoneyMenuData(38, 0, 1);
+				case 6: TakeMoneyMenuData(38, 0, 10);
+				case 7: TakeMoneyMenuData(38, 0, 100);
+				case 8: TakeMoneyMenuData(38, 0, 1000);
+				case 9: TakeMoneyMenuData(38, 0, 10000);
+				case 10: return ShowCreatePropMenu(playerid);
+			}
+			ShowRewardPropMenu(playerid);
+		}
+		case (_:YDBG_STATE_PROP_DELAY):
+		{
+			switch (row)
+			{
+				case 0: AddMoneyMenuData(39, 0, 0x00100000, 10000);
+				case 1: AddMoneyMenuData(39, 0, 0x00100000, 1000);
+				case 2: AddMoneyMenuData(39, 0, 0x00100000, 100);
+				case 3: AddMoneyMenuData(39, 0, 0x00100000, 10);
+				case 4: AddMoneyMenuData(39, 0, 0x00100000, 1);
+				case 5: TakeMoneyMenuData(39, 0, 1);
+				case 6: TakeMoneyMenuData(39, 0, 10);
+				case 7: TakeMoneyMenuData(39, 0, 100);
+				case 8: TakeMoneyMenuData(39, 0, 1000);
+				case 9: TakeMoneyMenuData(39, 0, 10000);
+				case 10: return ShowCreatePropMenu(playerid);
+			}
+			ShowDelayPropMenu(playerid);
+		}
+		case (_:YDBG_STATE_MA_WANT), (_:YDBG_STATE_FZ_WANT):
+		{
+			StartPointSelection(playerid, row);
+		}
+	}
+	return 1;
+}
+
+ShowAmmoAmmuMenu(playerid, weapon)
+{
+	ShowMenuForPlayerEx(gValueMenu, playerid);
+	new
+		str[64];
+	format(str, sizeof (str), "Set ammo below or enter in text box (Current: %d)", gPlayerCreateData[playerid][weapon] >>> 20);
+	TextDrawSetString(gPlayerTextDraw[playerid], str);
+	gYDBGPlayerState[playerid] = YDBG_STATE_AMMU_AMMO + YDBG_STATE:weapon;
+	return 1;
+}
+
+ShowCostAmmuMenu(playerid, weapon)
+{
+	ShowMenuForPlayerEx(gValueMenu, playerid);
+	new
+		str[64];
+	format(str, sizeof (str), "Set cost below or enter in text box (Current: $%d)", gPlayerCreateData[playerid][weapon] & 0xFFFFF);
+	TextDrawSetString(gPlayerTextDraw[playerid], str);
+	gYDBGPlayerState[playerid] = YDBG_STATE_AMMU_PRICE + YDBG_STATE:weapon;
+	return 1;
+}
+
+ShowCostPropMenu(playerid)
+{
+	ShowMenuForPlayerEx(gValueMenu, playerid);
+	new
+		str[64];
+	format(str, sizeof (str), "Set cost below or enter in text box (Current: $%d)", gPlayerCreateData[playerid][37]);
+	TextDrawSetString(gPlayerTextDraw[playerid], str);
+	gYDBGPlayerState[playerid] = YDBG_STATE_PROP_PRICE;
+	return 1;
+}
+
+ShowRewardPropMenu(playerid)
+{
+	ShowMenuForPlayerEx(gValueMenu, playerid);
+	new
+		str[64];
+	format(str, sizeof (str), "Set payment below or enter in text box (Current: $%d)", gPlayerCreateData[playerid][38]);
+	TextDrawSetString(gPlayerTextDraw[playerid], str);
+	gYDBGPlayerState[playerid] = YDBG_STATE_PROP_REWARD;
+	return 1;
+}
+
+ShowDelayPropMenu(playerid)
+{
+	ShowMenuForPlayerEx(gValueMenu, playerid);
+	new
+		str[64];
+	format(str, sizeof (str), "Set time between rewards below or enter in text box (Current: %dms)", gPlayerCreateData[playerid][39]);
+	TextDrawSetString(gPlayerTextDraw[playerid], str);
+	gYDBGPlayerState[playerid] = YDBG_STATE_PROP_DELAY;
+	return 1;
+}
+
+CreatePropertyFromStats(playerid)
+{
+	new
+		Float:x,
+		Float:y,
+		Float:z,
+		data = gPlayerCreateData[playerid][40];
+	GetPlayerPos(playerid, x, y, z);
+	printf("make");
+	new
+		prop = CreateProperty(gPlayerCreateData[playerid], x, y, z, gPlayerCreateData[playerid][37], gPlayerCreateData[playerid][38], gPlayerCreateData[playerid][39], data & 1, data & 2, data & 4, data & 8);
+	printf("prop: %d", prop);
+
+	new
+		str[24],
+		xmlProp = XML_AddItem("property", gPlayerCreateData[playerid]);
+	if (data & 8) XML_AddParameter(xmlProp, "increase", "1");
+	if (data & 4) XML_AddParameter(xmlProp, "reduce", "1");
+	if (data & 2) XML_AddParameter(xmlProp, "multi", "1");
+	if (data & 1) XML_AddParameter(xmlProp, "sell", "1");
+	valstr(str, gPlayerCreateData[playerid][38]);
+	XML_AddParameter(xmlProp, "reward", str);
+	valstr(str, gPlayerCreateData[playerid][39]);
+	XML_AddParameter(xmlProp, "delay", str);
+	valstr(str, gPlayerCreateData[playerid][37]);
+	XML_AddParameter(xmlProp, "price", str);
+	format(str, sizeof (str), "%.2f", z);
+	XML_AddParameter(xmlProp, "z", str);
+	format(str, sizeof (str), "%.2f", y);
+	XML_AddParameter(xmlProp, "y", str);
+	format(str, sizeof (str), "%.2f", x);
+	XML_AddParameter(xmlProp, "x", str);
+	XML_WriteItem("YSI/YDBG/props.xml", xmlProp);
+
+	gPlayerCreateData[playerid] = BlankArray();
+	gYDBGPlayerState[playerid] = YDBG_STATE_NONE;
+	return 1;
+}
+
+#define AmmuWeapData(%1,%2) \
+	a[(%1)] = ((data = gPlayerCreateData[playerid][(%1)]) ? ((%2)) : (-1)), b[(%1)] = (data >>> 20), c[(%1)] = (data & 0xFFFFF)
+
+CreateAmmunationFromStats(playerid)
+{
+	new
+		Float:x,
+		Float:y,
+		Float:z,
+		data,
+		a[40],
+		b[40],
+		c[40];
+	AmmuWeapData(0,  WEAPON_BRASSKNUCKLE);
+	AmmuWeapData(1,  WEAPON_GOLFCLUB);
+	AmmuWeapData(2,  WEAPON_NITESTICK);
+	AmmuWeapData(3,  WEAPON_KNIFE);
+	AmmuWeapData(4,  WEAPON_BAT);
+	AmmuWeapData(5,  WEAPON_SHOVEL);
+	AmmuWeapData(6,  WEAPON_POOLSTICK);
+	AmmuWeapData(7,  WEAPON_KATANA);
+	AmmuWeapData(8,  WEAPON_CHAINSAW);
+	AmmuWeapData(9,  WEAPON_DILDO);
+	AmmuWeapData(10, WEAPON_DILDO2);
+	AmmuWeapData(11, WEAPON_VIBRATOR);
+	AmmuWeapData(12, WEAPON_VIBRATOR2);
+	AmmuWeapData(13, WEAPON_FLOWER);
+	AmmuWeapData(14, WEAPON_CANE);
+	AmmuWeapData(15, WEAPON_GRENADE);
+	AmmuWeapData(16, WEAPON_TEARGAS);
+	AmmuWeapData(17, WEAPON_MOLTOV);
+	AmmuWeapData(18, WEAPON_COLT45);
+	AmmuWeapData(19, WEAPON_SILENCED);
+	AmmuWeapData(20, WEAPON_DEAGLE);
+	AmmuWeapData(21, WEAPON_SHOTGUN);
+	AmmuWeapData(22, WEAPON_SAWEDOFF);
+	AmmuWeapData(23, WEAPON_SHOTGSPA);
+	AmmuWeapData(24, WEAPON_UZI);
+	AmmuWeapData(25, WEAPON_MP5);
+	AmmuWeapData(26, WEAPON_AK47);
+	AmmuWeapData(27, WEAPON_M4);
+	AmmuWeapData(28, WEAPON_TEC9);
+	AmmuWeapData(29, WEAPON_RIFLE);
+	AmmuWeapData(30, WEAPON_SNIPER);
+	AmmuWeapData(31, WEAPON_ROCKETLAUNCHER);
+	AmmuWeapData(32, WEAPON_FLAMETHROWER);
+	AmmuWeapData(33, WEAPON_MINIGUN);
+	AmmuWeapData(34, WEAPON_SATCHEL);
+	AmmuWeapData(35, WEAPON_SPRAYCAN);
+	AmmuWeapData(36, WEAPON_FIREEXTINGUISHER);
+	AmmuWeapData(37, WEAPON_CAMERA);
+	AmmuWeapData(39, WEAPON_PARACHUTE);
+	AmmuWeapData(39, WEAPON_ARMOUR);
+	GetPlayerPos(playerid, x, y, z);
+	CreateAmmunation(x, y, z, gPlayerCreateData[playerid][40] & 1, gPlayerCreateData[playerid][40] & 2,
+		a[ 0], b[ 0], c[ 0], a[ 1], b[ 1], c[ 1], a[ 2], b[ 2], c[ 2], a[ 3], b[ 3], c[ 3], a[ 4], b[ 4], c[ 4],
+		a[ 5], b[ 5], c[ 5], a[ 6], b[ 6], c[ 6], a[ 7], b[ 7], c[ 7], a[ 8], b[ 8], c[ 8], a[ 9], b[ 9], c[ 9],
+		a[10], b[10], c[10], a[11], b[11], c[11], a[12], b[12], c[12], a[13], b[13], c[13], a[14], b[14], c[14],
+		a[15], b[15], c[15], a[16], b[16], c[16], a[17], b[17], c[17], a[18], b[18], c[18], a[19], b[19], c[19],
+		a[20], b[20], c[20], a[21], b[21], c[21], a[22], b[22], c[22], a[23], b[23], c[23], a[24], b[24], c[24],
+		a[25], b[25], c[25], a[26], b[26], c[26], a[27], b[27], c[27], a[28], b[28], c[28], a[29], b[29], c[29],
+		a[30], b[30], c[30], a[31], b[31], c[31], a[32], b[32], c[32], a[33], b[33], c[33], a[34], b[34], c[34],
+		a[35], b[35], c[35], a[36], b[36], c[36], a[37], b[37], c[37], a[38], b[38], c[38], a[39], b[39], c[39]
+	);
+	
+	new
+		str[24];
+	format(str, sizeof (str), "ammu%.0f,%.0f,%.0f", x, y, z);
+	new
+		xmlWeap = XML_AddItem("ammunation", str);
+	valstr(str, gPlayerCreateData[playerid][40]);
+	XML_AddParameter(xmlWeap, "give", str);
+	for (new i = 0; i < 40; i++)
+	{
+		if (a[i] != -1)
+		{
+			new
+				xmlType = XML_AddParameter(xmlWeap, "weapon");
+			valstr(str, c[i]);
+			XML_AddParameter(xmlType, "price", str);
+			valstr(str, b[i]);
+			XML_AddParameter(xmlType, "ammo", str);
+			valstr(str, a[i]);
+			XML_AddParameter(xmlType, "type", str);
+		}
+	}
+	format(str, sizeof (str), "%.2f", z);
+	XML_AddParameter(xmlWeap, "z", str);
+	format(str, sizeof (str), "%.2f", y);
+	XML_AddParameter(xmlWeap, "y", str);
+	format(str, sizeof (str), "%.2f", x);
+	XML_AddParameter(xmlWeap, "x", str);
+	XML_WriteItem("YSI/YDBG/props.xml", xmlWeap);
+
+	gPlayerCreateData[playerid] = BlankArray();
+	gYDBGPlayerState[playerid] = YDBG_STATE_NONE;
+	return 1;
+}
+
+Script_OnPlayerExitedMenu(playerid)
+{
+	gPlayerCreateData[playerid] = BlankArray();
+	gYDBGPlayerState[playerid] = YDBG_STATE_NONE;
+    return 1;
+}
+
+BlankArray()
+{
+	static
+		empty[sizeof (gPlayerCreateData[])];
+	return empty;
+}
+
+Script_OnVehicleMod(vehicleid, componentid)
+{
+    return 1;
+}
+
+Script_OnVehiclePaintjob(vehicleid, paintjobid)
+{
+    return 1;
+}
+
+Script_OnVehicleRespray(vehicleid, color1, color2)
+{
+    return 1;
+}
+
+Script_OnPlayerLogin(playerid, yid)
+{
+    return 1;
+}
+
+Script_OnPlayerLogout(playerid, yid)
+{
+    return 1;
+}
+
+Script_OnPlayerEnterArea(playerid, areaid)
+{
+    return 1;
+}
+
+Script_OnPlayerLeaveArea(playerid, areaid)
+{
+    return 1;
+}
+
+Script_OnRaceEnd(raceid)
+{
+    return 1;
+}
+
+Script_OnPlayerExitRace(playerid, raceid)
+{
+    return 1;
+}
+
+Script_OnPlayerFinishRace(playerid, raceid, position, prize, time)
+{
+    return 1;
+}
+
+forward ycmd_createbank(playerid, params[], help);
+public ycmd_createbank(playerid, params[], help)
+{
+	if (help)
+	{
+		Text_SendFormat(playerid, "YDBG_CREATEBANK_HELP_1", "createbank");
+		Text_Send(playerid, "YDBG_CREATEBANK_HELP_2");
+	}
+	else
+	{
+		new
+			Float:x,
+			Float:y,
+			Float:z;
+		GetPlayerPos(playerid, x, y, z);
+		if (params[0] == 1) CreateBank(x, y, z);
+		else CreateBank(x, y, z, params);
+		new
+			str[24];
+		if (params[0] == 1) format(str, sizeof (str), "bank%.0f,%.0f,%.0f", x, y, z);
+		new
+			xmlBank = XML_AddItem("bank", (params[0] == 1) ? (str) : (params));
+		format(str, sizeof (str), "%.2f", z);
+		XML_AddParameter(xmlBank, "z", str);
+		format(str, sizeof (str), "%.2f", y);
+		XML_AddParameter(xmlBank, "y", str);
+		format(str, sizeof (str), "%.2f", x);
+		XML_AddParameter(xmlBank, "x", str);
+		XML_WriteItem("YSI/YDBG/props.xml", xmlBank);
+	}
+	return 1;
+}
+
+forward ycmd_createtele(playerid, params[], help);
+public ycmd_createtele(playerid, params[], help)
+{
+	if (help)
+	{
+		Text_SendFormat(playerid, "YDBG_CREATETELE_HELP_1", "createtele");
+		Text_SendFormat(playerid, "YDBG_CREATETELE_HELP_2", "set");
+		Text_Send(playerid, "YDBG_CREATETELE_HELP_3");
+	}
+	else
+	{
+		if (params[0] != 1)
+		{
+			gPlayerCreateData[playerid][37] = strval(params);
+			new
+				pos = chrfind(' ', params);
+			if (pos != -1)
+			{
+				pos = chrnfind(' ', params, pos);
+				if (pos != -1) strcpy(gPlayerCreateData[playerid], params[pos], 37);
+			}
+		}
+		GetPlayerPos(playerid, Float:gPlayerCreateData[playerid][38], Float:gPlayerCreateData[playerid][39], Float:gPlayerCreateData[playerid][40]);
+		Text_SendFormat(playerid, "YDBG_GO_SET_TELE", "set");
+		gYDBGPlayerState[playerid] = YDBG_STATE_TELE;
+	}
+	return 1;
+}
+
+forward ycmd_createma(playerid, params[], help);
+public ycmd_createma(playerid, params[], help)
+{
+	if (help)
+	{
+		Text_SendFormat(playerid, "YDBG_CREATEMA_HELP_1", "createma");
+		Text_SendFormat(playerid, "YDBG_CREATEMA_HELP_2", "set");
+		Text_Send(playerid, "YDBG_CREATEMA_HELP_3");
+	}
+	else
+	{
+		ShowMenuForPlayerEx(gAreaMenu, playerid);
+		gYDBGPlayerState[playerid] = YDBG_STATE_MA_WANT;
+	}
+	return 1;
+}
+
+forward ycmd_set(playerid, params[], help);
+public ycmd_set(playerid, params[], help)
+{
+	if (help)
+	{
+		Text_SendFormat(playerid, "YDBG_SET_HELP_1", "set");
+		Text_SendFormat(playerid, "YDBG_SET_HELP_2", "createma", "createtele", "createfz");
+		Text_Send(playerid, "YDBG_SET_HELP_3");
+	}
+	else
+	{
+		switch (gYDBGPlayerState[playerid])
+		{
+			case YDBG_STATE_MA_POLY:
+			{
+			}
+			case YDBG_STATE_TELE:
+			{
+				new
+					Float:x,
+					Float:y,
+					Float:z;
+				GetPlayerPos(playerid, x, y, z);
+				CreateTeleport(Float:gPlayerCreateData[playerid][38], Float:gPlayerCreateData[playerid][39], Float:gPlayerCreateData[playerid][40], x, y, z, gPlayerCreateData[playerid][37], gPlayerCreateData[playerid]);
+				gPlayerCreateData[playerid] = BlankArray();
+			}
+			case YDBG_STATE_FZ_POLY:
+			{
+			}
+			default: Text_Send(playerid, "YDBG_SET_NO_NEED");
+		}
+	}
+	return 1;
+}
+
+forward ycmd_createprop(playerid, params[], help);
+public ycmd_createprop(playerid, params[], help)
+{
+	if (help)
+	{
+		Text_SendFormat(playerid, "YDBG_CREATEPROP_HELP_1", "createprop");
+		Text_Send(playerid, "YDBG_CREATEPROP_HELP_2");
+		Text_Send(playerid, "YDBG_CREATEPROP_HELP_3");
+		Text_Send(playerid, "YDBG_CREATEPROP_HELP_4");
+		Text_Send(playerid, "YDBG_CREATEPROP_HELP_5");
+	}
+	else
+	{
+		if (params[0] == 1) Text_SendFormat(playerid, "YDBG_CREATEAMMU_HELP_1", "createammu");
+		else
+		{
+			gPlayerCreateData[playerid] = BlankArray();
+			strcpy(gPlayerCreateData[playerid], params, 37);
+			ShowCreatePropMenu(playerid);
+		}
+	}
+	return 1;
+}
+
+forward ycmd_createammu(playerid, params[], help);
+public ycmd_createammu(playerid, params[], help)
+{
+	if (help)
+	{
+		Text_SendFormat(playerid, "YDBG_CREATEAMMU_HELP_1", "createammu");
+		Text_Send(playerid, "YDBG_CREATEAMMU_HELP_2");
+		Text_Send(playerid, "YDBG_CREATEAMMU_HELP_3");
+		Text_Send(playerid, "YDBG_CREATEAMMU_HELP_4");
+		Text_Send(playerid, "YDBG_CREATEAMMU_HELP_5");
+	}
+	else
+	{
+		gPlayerCreateData[playerid] = BlankArray();
+		ShowCreateAmmuMenu(playerid, 0);
+	}
+	return 1;
+}
+
+Script_OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
+{
+	return 1;
+}
+
+Script_OnPlayerKeyPress(playerid, keyid)
+{
+	if (keyid == KEY_ACTION)
+	{
+		switch (gYDBGPlayerState[playerid])
+		{
+			case YDBG_STATE_FZ_CUBE:
+			{
+				new
+					Float:x1,
+					Float:y1,
+					Float:z1,
+					Float:x2 = gPlayerCreateData[playerid][0],
+					Float:y2 = gPlayerCreateData[playerid][1],
+					Float:z2 = gPlayerCreateData[playerid][2];
+				GetPlayerPos(playerid, x1, y1, z1);
+				gPlayerCreateData[playerid][40] &= 0xFF000000;
+				gPlayerCreateData[playerid][40] |= Area_AddCube((x1 > x2) ? (x2) : (x1), (y1 > y2) ? (y2) : (y1), (z1 > z2) ? (z2) : (z1), (x1 > x2) ? (x1) : (x2), (y1 > y2) ? (y1) : (y2), (z1 > z2) ? (z2) : (z1));
+			}
+			case YDBG_STATE_MA_CUBE:
+			{
+				new
+					Float:x1,
+					Float:y1,
+					Float:z1,
+					Float:x2 = gPlayerCreateData[playerid][0],
+					Float:y2 = gPlayerCreateData[playerid][1],
+					Float:z2 = gPlayerCreateData[playerid][2];
+				GetPlayerPos(playerid, x1, y1, z1);
+				gPlayerCreateData[playerid][40] &= 0xFF000000;
+				gPlayerCreateData[playerid][40] |= Area_AddCube((x1 > x2) ? (x2) : (x1), (y1 > y2) ? (y2) : (y1), (z1 > z2) ? (z2) : (z1), (x1 > x2) ? (x1) : (x2), (y1 > y2) ? (y1) : (y2), (z1 > z2) ? (z2) : (z1));
+			}
+			case YDBG_STATE_FZ_BOX:
+			{
+				new
+					Float:x1,
+					Float:y1,
+					Float:x2,
+					Float:y2 = gPlayerCreateData[playerid][1];
+				GetPlayerPos(playerid, x1, y1, x2);
+				x2 = gPlayerCreateData[playerid][0];
+				gPlayerCreateData[playerid][40] &= 0xFF000000;
+				gPlayerCreateData[playerid][40] |= Area_AddBox((x1 > x2) ? (x2) : (x1), (y1 > y2) ? (y2) : (y1), (x1 > x2) ? (x1) : (x2), (y1 > y2) ? (y1) : (y2));
+			}
+			case YDBG_STATE_MA_BOX:
+			{
+				new
+					Float:x1,
+					Float:y1,
+					Float:x2,
+					Float:y2 = gPlayerCreateData[playerid][1];
+				GetPlayerPos(playerid, x1, y1, x2);
+				x2 = gPlayerCreateData[playerid][0];
+				gPlayerCreateData[playerid][40] &= 0xFF000000;
+				gPlayerCreateData[playerid][40] |= Area_AddBox((x1 > x2) ? (x2) : (x1), (y1 > y2) ? (y2) : (y1), (x1 > x2) ? (x1) : (x2), (y1 > y2) ? (y1) : (y2));
+			}
+			case YDBG_STATE_FZ_POLY, YDBG_STATE_MA_POLY:
+			{
+				new
+					count = gPlayerCreateData[playerid][40] & 0xFFFFFF;
+				if (count < 40)
+				{
+					new
+						Float:x,
+						Float:y,
+						Float:z;
+					GetPlayerPos(playerid, x, y, z);
+					gPlayerCreateData[playerid][count++] = (floatround(x * 10.0) << 16) | (floatround(y * 10.0) & 0xFFFF);
+				}
+			}
+		}
+	}
+	return 1;
+}
+
+Script_OnPlayerKeyRelease(playerid, keyid)
+{
+	#pragma unused playerid, keyid
+	return 1;
+}
+
+ShowTypeAmmuMenu(playerid)
+{
+	new
+		Menu:ammuMenu = CreateMenu("Assignments", 2, 220.0, 200.0, 100.0, 100.0);
+	AddMenuItem(ammuMenu, 0, "Spawn");
+	AddMenuItem(ammuMenu, 1, (gPlayerCreateData[playerid][40] & 1) ? ("Yes") : ("No"));
+	AddMenuItem(ammuMenu, 0, "Instant");
+	AddMenuItem(ammuMenu, 1, (gPlayerCreateData[playerid][40] & 2) ? ("Yes") : ("No"));
+	AddMenuItem(ammuMenu, 0, "- Done -");
+	AddMenuItem(ammuMenu, 1, " ");
+	ShowMenuForPlayerEx(ammuMenu, playerid);
+	gYDBGPlayerState[playerid] = YDBG_STATE_AMMU_TYPE;
+}
+
+#define AddAmmuMenuItem(%1,%2)													\
+	AddMenuItem(ammuMenu, 0, (%2));												\
+	if ((weap = gPlayerCreateData[playerid][(%1)]))								\
+	{																			\
+		format(str, sizeof (str), "@%d, $%d", weap >>> 20, weap & 0xFFFFF);		\
+		AddMenuItem(ammuMenu, 1, str);											\
+	}																			\
+	else AddMenuItem(ammuMenu, 1, "Add...")
+
+ShowCreateAmmuMenu(playerid, page)
+{
+	if (page >= 4) page = 0;
+	new
+		Menu:ammuMenu = CreateMenu("Select Weapons", 2, 220.0, 200.0, 100.0, 100.0),
+		weap,
+		str[16];
+	switch (page)
+	{
+		case 0:
+		{
+			AddAmmuMenuItem(0, "Brassknuckle");
+			AddAmmuMenuItem(1, "Golfclub");
+			AddAmmuMenuItem(2, "Night Stick");
+			AddAmmuMenuItem(3, "Knife");
+			AddAmmuMenuItem(4, "Bat");
+			AddAmmuMenuItem(5, "Shovel");
+			AddAmmuMenuItem(6, "Poolstick");
+			AddAmmuMenuItem(7, "Katana");
+			AddAmmuMenuItem(8, "Chainsaw");
+			AddAmmuMenuItem(9, "Dildo");
+		}
+		case 1:
+		{
+			AddAmmuMenuItem(10, "Dildo 2");
+			AddAmmuMenuItem(11, "Vibrator");
+			AddAmmuMenuItem(12, "Vibrator 2");
+			AddAmmuMenuItem(13, "Flower");
+			AddAmmuMenuItem(14, "Cane");
+			AddAmmuMenuItem(15, "Grenade");
+			AddAmmuMenuItem(16, "Teargas");
+			AddAmmuMenuItem(17, "Molotov");
+			AddAmmuMenuItem(18, "Colt 45");
+			AddAmmuMenuItem(19, "Silenced Pistol");
+		}
+		case 2:
+		{
+			AddAmmuMenuItem(20, "Desert Eagle");
+			AddAmmuMenuItem(21, "Shotgun");
+			AddAmmuMenuItem(22, "Sawnoff");
+			AddAmmuMenuItem(23, "Spaz 9");
+			AddAmmuMenuItem(24, "Uzi");
+			AddAmmuMenuItem(25, "MP5");
+			AddAmmuMenuItem(26, "AK47");
+			AddAmmuMenuItem(27, "M4");
+			AddAmmuMenuItem(28, "TEC9");
+			AddAmmuMenuItem(29, "Rifle");
+		}
+		default:
+		{
+			AddAmmuMenuItem(30, "Sniper Rifle");
+			AddAmmuMenuItem(31, "Rocket Launcher");
+			AddAmmuMenuItem(32, "Flame Thrower");
+			AddAmmuMenuItem(33, "Minigun");
+			AddAmmuMenuItem(34, "Satchel Charge");
+			AddAmmuMenuItem(35, "Spraycan");
+			AddAmmuMenuItem(36, "Fire Extinguisher");
+			AddAmmuMenuItem(37, "Camera");
+			AddAmmuMenuItem(38, "Parachute");
+			AddAmmuMenuItem(39, "Armour");
+		}
+	}
+	AddMenuItem(ammuMenu, 0, "More...");
+	AddMenuItem(ammuMenu, 1, " ");
+	AddMenuItem(ammuMenu, 0, "- Done -");
+	AddMenuItem(ammuMenu, 1, " ");
+	ShowMenuForPlayerEx(ammuMenu, playerid);
+	gYDBGPlayerState[playerid] = YDBG_STATE_CREATE_AMMU + YDBG_STATE:page;
+	return 1;
+}
+
+ShowCreatePropMenu(playerid)
+{
+	new
+		Menu:propMenu = CreateMenu(gPlayerCreateData[playerid], 2, 220.0, 200.0, 100.0, 100.0),
+		str[16],
+		opt = gPlayerCreateData[playerid][40];
+	AddMenuItem(propMenu, 0, "price");
+	valstr(str, gPlayerCreateData[playerid][37]);
+	AddMenuItem(propMenu, 1, str);
+	AddMenuItem(propMenu, 0, "reward");
+	valstr(str, gPlayerCreateData[playerid][38]);
+	AddMenuItem(propMenu, 1, str);
+	AddMenuItem(propMenu, 0, "delay");
+	valstr(str, gPlayerCreateData[playerid][39]);
+	AddMenuItem(propMenu, 1, str);
+	AddMenuItem(propMenu, 0, "sell");
+	AddMenuItem(propMenu, 1, (opt & 1) ? ("yes") : ("no"));
+	AddMenuItem(propMenu, 0, "multi");
+	AddMenuItem(propMenu, 1, (opt & 2) ? ("yes") : ("no"));
+	AddMenuItem(propMenu, 0, "reduce");
+	AddMenuItem(propMenu, 1, (opt & 4) ? ("yes") : ("no"));
+	AddMenuItem(propMenu, 0, "increase");
+	AddMenuItem(propMenu, 1, (opt & 8) ? ("yes") : ("no"));
+	AddMenuItem(propMenu, 0, "- Done -");
+	AddMenuItem(propMenu, 1, " ");
+	ShowMenuForPlayerEx(propMenu, playerid);
+	gYDBGPlayerState[playerid] = YDBG_STATE_CREATE_PROP;
+	return 1;
+}
+
+StartPointSelection(playerid, type)
+{
+	gPlayerCreateData[playerid][40] = type << 24;
+	switch (type)
+	{
+		case 0:
+		{
+			TextDrawSetString(gPlayerTextDraw[playerid], "Go to the far corner and press action (usually tab)");
+			GetPlayerPos(playerid, Float:gPlayerCreateData[playerid][0], Float:gPlayerCreateData[playerid][1], Float:gPlayerCreateData[playerid][2]);
+			switch (gYDBGPlayerState[playerid])
+			{
+				case YDBG_STATE_MA_WANT: gYDBGPlayerState[playerid] = YDBG_STATE_MA_CUBE;
+				case YDBG_STATE_FZ_WANT: gYDBGPlayerState[playerid] = YDBG_STATE_FZ_CUBE;
+			}
+		}
+		case 1:
+		{
+			TextDrawSetString(gPlayerTextDraw[playerid], "Go to the far corner and press action (usually tab)");
+			new
+				Float:z;
+			GetPlayerPos(playerid, Float:gPlayerCreateData[playerid][0], Float:gPlayerCreateData[playerid][1], z);
+			switch (gYDBGPlayerState[playerid])
+			{
+				case YDBG_STATE_MA_WANT: gYDBGPlayerState[playerid] = YDBG_STATE_MA_BOX;
+				case YDBG_STATE_FZ_WANT: gYDBGPlayerState[playerid] = YDBG_STATE_FZ_BOX;
+			}
+		}
+		case 2:
+		{
+			new
+				Float:z;
+			GetPlayerPos(playerid, Float:gPlayerCreateData[playerid][0], Float:gPlayerCreateData[playerid][1], z);
+			ShowCreateCircleMenu(playerid);
+			switch (gYDBGPlayerState[playerid])
+			{
+				case YDBG_STATE_MA_WANT: gYDBGPlayerState[playerid] = YDBG_STATE_MA_CIRCLE;
+				case YDBG_STATE_FZ_WANT: gYDBGPlayerState[playerid] = YDBG_STATE_FZ_CIRCLE;
+			}
+		}
+		case 3:
+		{
+			TextDrawSetString(gPlayerTextDraw[playerid], "Enter the radius in the text box");
+			GetPlayerPos(playerid, Float:gPlayerCreateData[playerid][0], Float:gPlayerCreateData[playerid][1], Float:gPlayerCreateData[playerid][2]);
+			switch (gYDBGPlayerState[playerid])
+			{
+				case YDBG_STATE_MA_WANT: gYDBGPlayerState[playerid] = YDBG_STATE_MA_SPHERE;
+				case YDBG_STATE_FZ_WANT: gYDBGPlayerState[playerid] = YDBG_STATE_FZ_SPHERE;
+			}
+		}
+		case 4:
+		{
+			TextDrawSetString(gPlayerTextDraw[playerid], "Go to each corner and press tab~n~Type /set when done");
+			new
+				Float:x,
+				Float:y,
+				Float:z;
+			GetPlayerPos(playerid, x, y, z);
+			gPlayerCreateData[playerid][0] = (floatround(x * 10.0) << 16) | (floatround(y * 10.0) & 0xFFFF);
+			gPlayerCreateData[playerid][40]++;
+			switch (gYDBGPlayerState[playerid])
+			{
+				case YDBG_STATE_MA_WANT: gYDBGPlayerState[playerid] = YDBG_STATE_MA_POLY;
+				case YDBG_STATE_FZ_WANT: gYDBGPlayerState[playerid] = YDBG_STATE_FZ_POLY;
+			}
+		}
+	}
+}
+
+ShowCreateCircleMenu(playerid)
+{
+	new
+		Menu:circMenu = CreateMenu("Create Circle", 2, 220.0, 200.0, 100.0, 100.0),
+		str[16];
+	AddMenuItem(circMenu, 0, "Radius");
+	valstr(str, gPlayerCreateData[playerid][2]);
+	AddMenuItem(circMenu, 1, str);
+	AddMenuItem(circMenu, 0, "Height");
+	valstr(str, gPlayerCreateData[playerid][3]);
+	AddMenuItem(circMenu, 1, str);
+	AddMenuItem(circMenu, 0, "0 = infinate");
+	AddMenuItem(circMenu, 1, " ");
+	DisableMenuRow(circMenu, 2);
+	AddMenuItem(circMenu, 0, "- Done -");
+	AddMenuItem(circMenu, 1, " ");
+	ShowMenuForPlayerEx(circMenu, playerid);
+	return 1;
+}
+

+ 1354 - 0
samp03/filterscripts/YDBG2.pwn

@@ -0,0 +1,1354 @@
+/**
+*
+*       YDBG.pwn
+*       2008 (c) LexSoftware Foundation, Alexander de Jong (mrdejong)
+*       2008 (c) Alex "Y_Less" cole
+*
+*       Version 1.0.0 BETA
+*
+*       YDBG comes with two lang files English and Dutch:
+*       YDBG.en
+*       YDBG.nl
+*       YDBG_format.YSI
+*
+*       All the files can be found in:
+*       scriptfiles/YSI/
+*
+*
+*       This file need to make all the property's, ammunation's, bank's.
+*       This file can save also Area's and much more. With this file you can create your server
+*       In a minute. It works allmost automatically that means that you don't need to
+*       use much commands. No it's simple thinking, simple use thought
+*
+*       This file saves all information in to an xml file "scriptfiles/YSI/YDBG" there you can find everything you need.
+*
+*       This file loads every property's, ammunation's, bank's all what you want automatically.
+*
+*       This file also uses an administration system, thats linked to the user system of YSI.
+*       It's not really an adminisrator system, but i call him "BUILDERS" you can give people some rights
+*       and they can use only the commands they have rights to :) simple?
+*
+*
+*       I wish you all good luck with it. And keep SIMPLE THINKING if not you make it your self so dificult!
+*
+*       cya arround homi's
+*
+*       Alexander de Jong (mrdejong).
+*
+*       This file is copyrighted and protected by the GNU General Public License
+*       You can do all you want in this file, that will say if you don't like the working of something, easely edit it to your hand
+*
+*       License:
+*
+*       This program is free software: you can redistribute it and/or modify
+*	    it under the terms of the GNU General Public License as published by
+*	    the Free Software Foundation, either version 3 of the License, or
+*	    (at your option) any later version.
+*
+*	    This program is distributed in the hope that it will be useful,
+*	    but WITHOUT ANY WARRANTY; without even the implied warranty of
+*	    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*		GNU General Public License for more details.
+*
+*	    You should have received a copy of the GNU General Public License
+*	    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*
+*       Complete license: (please read them)
+*
+*       http://www.gnu.org/licenses/gpl.html
+*
+*       If you don't agree with this license please don't use IT!
+*
+*/
+
+// We are building a filterscript, that means we need to let know the system that it is a filterscript. So it is a child of the gamemode.
+#define FILTERSCRIPT
+
+#define _DEBUG 5
+
+// Setup all the defines we need:
+
+/**
+*   Options
+*/
+	// Load options
+
+// #define NO_VEHICLE_LOAD
+// #define NO_PROPERTYS_LOAD
+// #define NO_MONEYPOINT_LOAD
+// #define NO_BANK_LOAD
+
+#define MAX_XML_FILES 30
+
+#include <YSI>
+
+enum binfo
+{
+	blevel,
+	Float:spos_x,
+	Float:spos_y,
+	Float:spos_z,
+	Float:spos_a,
+	sinterior,
+}
+
+new userinfo[MAX_PLAYERS][binfo];
+new userLoged[MAX_PLAYERS] = {-1, ...};
+
+// Menu var's
+new Menu:propertyMenu;
+new Menu:vehicleSpawn;
+new Menu:saveMenu;
+new Menu:propertyOptionsMenu;
+
+new propertyOption = 0;
+new SaveOption = 0;
+new MoneyOption = 0;
+new bankOption = 0;
+
+new	popos[256];
+new	pnames[256];
+new	setup1[256];
+new	setup2[256];
+
+// vars for the command permissions
+new spos;
+new lpos;
+new mkprop;
+new giveright;
+new veh;
+new savepos;
+new c_menu;
+
+new builder;
+new superbuilder;
+
+/**
+* forwards
+*/
+forward ycmd_spos(playerid, params[], help);
+forward ycmd_lpos(playerid, params[], help);
+forward ycmd_kill(playerid, params[], help);
+forward ycmd_mkprop(playerid, params[], help);
+forward ycmd_giveright(playerid, params[], help);
+forward ycmd_gr(playerid, params[], help);
+forward ycmd_veh(playerid, params[], help);
+forward ycmd_menu(playerid, params[], help);
+forward ycmd_savepos(playerid, params[], help);
+forward ycmd_explain(playerid, params[], help);
+forward ycmd_hexplain(playerid, params[], help);
+forward ycmd_bgmx(playerid, params[], help);
+
+forward MkProp(playerid, prop1[], prop2[], prop3[], prop4[]);
+forward SpawnVehicle(playerid, vehicleid);
+forward LoadCars();
+forward LoadProp();
+forward Load_MoneyPoint();
+forward LoadBank();
+
+forward LoginDat_YDBG(playerid, identifier[], text[]);
+
+/**
+* Register tags for the lang files
+*/
+Text_RegisterTag(info);
+Text_RegisterTag(complete);
+Text_RegisterTag(error);
+
+Script_OnFilterScriptInit()
+{
+	print("\n------------------------------------");
+	print(" YDBG Ysi DeBuG tool.");
+	print(" 2008 (c) LexSoftware Foundation, Alexander de Jong");
+	print(" 2008 (c) Alex \"Y_Less\" Cole");
+	print(" Alex \"Y_Less\" Cole is also the founder of YSI");
+	print("------------------------------------\n");
+
+	// Set groups
+	builder = Group_Create("Builder");
+	superbuilder = Group_Create("Superbuilder");
+
+    load_functions();
+	
+	Langs_AddLanguage("EN", "English");
+    Langs_AddLanguage("NL", "Nederlands");
+	Langs_AddFile("core", "YSI");
+	Langs_AddFile("YDBG", "YSI");
+
+	// ** Create the menu's
+	/// Make the propertyOptionsMenu
+	propertyOptionsMenu = CreateMenu("Property options", 2, 150.0, 150.0, 170.0, 200.0);
+	AddMenuItem(propertyOptionsMenu, 0, "1. Bussinus"); // 0
+	AddMenuItem(propertyOptionsMenu, 0, "2. Bank"); // 1
+	AddMenuItem(propertyOptionsMenu, 0, "3. Ammunation"); // 2
+	AddMenuItem(propertyOptionsMenu, 0, "4. Money area"); // 3
+	AddMenuItem(propertyOptionsMenu, 0, "5. Money point"); // 4
+	AddMenuItem(propertyOptionsMenu, 0, "6. Teleport"); // 5
+	AddMenuItem(propertyOptionsMenu, 0, "7. Forbidden Area"); // 6
+	AddMenuItem(propertyOptionsMenu, 0, "8. Houses"); // 7
+	AddMenuItem(propertyOptionsMenu, 0, "9. Cancel"); // 8
+	
+	AddMenuItem(propertyOptionsMenu, 1, "CreateProperty");
+	AddMenuItem(propertyOptionsMenu, 1, "CreateBank");
+	AddMenuItem(propertyOptionsMenu, 1, "CreateAmmunation");
+	AddMenuItem(propertyOptionsMenu, 1, "CreateMoneyArea");
+	AddMenuItem(propertyOptionsMenu, 1, "CreateMoneyPoint");
+	AddMenuItem(propertyOptionsMenu, 1, "CreateTeleport");
+	AddMenuItem(propertyOptionsMenu, 1, "CreateForbiddenArea");
+	
+	/// Make property menu:
+	propertyMenu = CreateMenu("Property builder", 1, 10.0, 150.0, 225.0);
+	AddMenuItem(propertyMenu, 0, "1. Make property");
+	AddMenuItem(propertyMenu, 0, "2. Give a name");
+	AddMenuItem(propertyMenu, 0, "3. Setup 1");
+	AddMenuItem(propertyMenu, 0, "4. Setup 2");
+	AddMenuItem(propertyMenu, 0, "5. Cancel");
+	
+	// /savep menu
+	saveMenu = CreateMenu("Save options", 1, 200.0, 150.0, 200.0);
+	AddMenuItem(saveMenu, 0, "1. Save vehicles");
+	AddMenuItem(saveMenu, 0, "2. Save custom positions");
+	AddMenuItem(saveMenu, 0, "3. Save pickups");
+	AddMenuItem(saveMenu, 0, "4. Save arrea's");
+	AddMenuItem(saveMenu, 0, "5. Cancel");
+	
+	/**
+	* Make a vehicle menu;
+	* This is used if the builder doesn't have add a vulue when typing /veh
+	*/
+	vehicleSpawn = CreateMenu("Vehicle Menu", 2, 200.0, 100.0, 100.0, 125.0);
+	AddMenuItem(vehicleSpawn, 0, "521 Bike :"); // FCR-900
+	AddMenuItem(vehicleSpawn, 0, "522 Bike :"); // NRG-500
+	AddMenuItem(vehicleSpawn, 0, "463 Bike :"); // Freeway
+	AddMenuItem(vehicleSpawn, 0, "541 Car :"); // Bullet
+	AddMenuItem(vehicleSpawn, 0, "411 Car :"); // Invernus
+ 	AddMenuItem(vehicleSpawn, 0, "482 Bus :"); // Buritto
+ 	AddMenuItem(vehicleSpawn, 0, "487 Heli :"); // Maverick
+ 	
+ 	AddMenuItem(vehicleSpawn, 1, "FCR-900");
+ 	AddMenuItem(vehicleSpawn, 1, "NRG-500");
+ 	AddMenuItem(vehicleSpawn, 1, "Freeway");
+ 	AddMenuItem(vehicleSpawn, 1, "Bullet");
+ 	AddMenuItem(vehicleSpawn, 1, "Invernus");
+ 	AddMenuItem(vehicleSpawn, 1, "Buritto");
+ 	AddMenuItem(vehicleSpawn, 1, "Maverick");
+ 	
+ 	/**
+ 	* Load xml init
+ 	*/
+	load_xml_init();
+
+	return 1;
+}
+
+/**
+* This command is only for testing
+*/
+
+public ycmd_menu(playerid, params[], help)
+{
+	#pragma unused params, help
+	ShowMenu(propertyOptionsMenu, playerid);
+	
+	return 1;
+}
+
+Script_OnFilterScriptExit()
+{
+	return 1;
+}
+
+Script_OnGameModeInit()
+{
+	printf("call OGMI");
+	return 1;
+}
+
+Script_OnGameModeExit()
+{
+    Master_@Master();
+	return 1;
+}
+
+Script_OnPlayerRequestClass(playerid, classid)
+{
+	return 1;
+}
+
+Script_OnPlayerRequestSpawnEx(playerid, classid)
+{
+	return 1;
+}
+
+Script_OnPlayerConnect(playerid)
+{
+	Command_SetPlayerUseByID(spos, playerid, 0);
+	Command_SetPlayerUseByID(lpos, playerid, 0);
+	Command_SetPlayerUseByID(mkprop, playerid, 0);
+	Command_SetPlayerUseByID(giveright, playerid, 0);
+	Command_SetPlayerUseByID(veh, playerid, 0);
+	Command_SetPlayerUseByID(savepos, playerid, 0);
+	Command_SetPlayerUseByID(c_menu, playerid, 0);
+
+	return 1;
+}
+
+Script_OnPlayerDisconnect(playerid, reason)
+{
+	#pragma unused reason, playerid
+	return 1;
+}
+
+Script_OnPlayerSpawn(playerid)
+{
+	return 1;
+}
+
+Script_OnPlayerDeath(playerid, killerid, reason)
+{
+	return 1;
+}
+
+Script_OnVehicleSpawn(vehicleid)
+{
+	return 1;
+}
+
+Script_OnVehicleDeath(vehicleid, killerid)
+{
+	return 1;
+}
+
+Script_OnPlayerText(playerid, text[])
+{
+ 	if(propertyOption >= 1)
+	{
+	    new str[256]; // This is for the format lines
+
+   	    switch(propertyOption)
+	    {
+	        case 1:
+	        {
+	            if(!FindText(text, "yes", 3))
+	            {
+          		    new
+						Float:x,
+						Float:y,
+						Float:z;
+					GetPlayerPos(playerid, x, y, z);
+
+		            format(str, sizeof(str), "%f, %f, %f", x, y, z);
+		            popos = str;
+
+		            Text_Send(playerid, "YDBG_PROP_ADD_1");
+		            
+					propertyOption = 0;
+
+		            return 0;
+				}
+			}
+			case 2:
+			{
+				new name[60];
+				if(GetText(text, 60, name))
+				{
+					pnames = name;
+					
+					Text_Send(playerid, "YDBG_PROP_ADD_2");
+					
+					propertyOption = 0;
+				    
+				    return 0;
+				}
+			}
+			case 3:
+			{
+			    new opt[125];
+			    if(GetText(text, 125, opt))
+			    {
+					setup1 = opt;
+					
+					Text_Send(playerid, "YDBG_PROP_ADD_3");
+					
+					propertyOption = 0;
+					
+					return 0;
+				}
+			}
+			case 4:
+			{
+			    new opt2[125];
+			    if(GetText(text, 125, opt2))
+			    {
+					setup2 = opt2;
+					
+					Text_Send(playerid, "YDBG_PROP_ADD_4");
+					Text_Send(playerid, "YDBG_PROP_ADD_5");
+					
+					propertyOption = 522;
+
+					return 0;
+				}
+			}
+		}
+	}
+	
+	if(!FindText(text, "save", 4) && propertyOption == 522)
+	{
+	    propertyOption = 0;
+	    MkProp(playerid, popos, pnames, setup1, setup2);
+	    return 0;
+	}
+	
+	if(MoneyOption >= 1)
+	{
+	    switch(MoneyOption)
+	    {
+	        case 1:
+	        {
+	            if(!FindText(text, "yes", 4))
+	            {
+					Text_Send(playerid, "YDBG_MP_INFO_1.1");
+	                Text_Send(playerid, "YDBG_MP_INFO_1.2");
+	                Text_Send(playerid, "YDBG_MP_INFO_1.3");
+	                Text_Send(playerid, "YDBG_MP_INFO_1.4");
+	                Text_Send(playerid, "YDBG_MP_INFO_1.5");
+	                Text_Send(playerid, "YDBG_MP_INFO_1.6");
+	                Text_Send(playerid, "YDBG_MP_INFO_1.7");
+	                Text_Send(playerid, "YDBG_MP_INFO_1.8");
+	                MoneyOption = 2;
+	                return 0;
+				}
+			}
+			
+			case 2:
+			{
+			    new options[125];
+			    new str[256];
+			    GetText(text, 125, options);
+			    
+			    new xmlMpoint = XML_AddItem("moneypoint");
+			    new Float:x, Float:y, Float:z;
+			    
+			    GetPlayerPos(playerid, x, y, z);
+			    
+			    XML_AddParameter(xmlMpoint, "options", options);
+
+				format(str, sizeof(str), "%f, %f, %f", x, y, z);
+				XML_AddParameter(xmlMpoint, "position", str);
+				
+				XML_WriteItem("YSI/YDBG/moneypoint.xml", xmlMpoint);
+				
+				Text_Send(playerid, "YDBG_MP_ADD");
+				MoneyOption = 255;
+				return 0;
+			}
+		}
+	}
+	
+	if(bankOption >= 1)
+	{
+	    switch(bankOption)
+	    {
+	        case 1:
+	        {
+	            if(!FindText(text, "yes", 3))
+	            {
+	                Text_Send(playerid, "YDBG_BANK_INFO_1");
+	                Text_Send(playerid, "YDBG_BANK_INFO_2");
+	                bankOption = 2;
+	                
+	                return 0;
+				}
+			}
+			case 2:
+			{
+			    new name[125];
+			    new str[256];
+			    
+			    GetText(text, 125, name);
+			    
+			    new xmlBank = XML_AddItem("bank");
+			    
+			    new Float:x, Float:y, Float:z;
+			    GetPlayerPos(playerid, x, y, z);
+			    
+			    format(str, sizeof(str), "%f, %f, %f", x, y, z);
+			    
+			    XML_AddParameter(xmlBank, "position", str);
+			    XML_AddParameter(xmlBank, "name", name);
+			    
+			    XML_WriteItem("YSI/YDBG/bank.xml", xmlBank);
+			    
+			    Text_Send(playerid, "YDBG_BANK_ADD");
+			    
+				bankOption = 255;
+				return 0;
+			}
+		}
+	}
+
+	return 1;
+}
+
+Script_OnPlayerPrivmsg(playerid, recieverid, text[])
+{
+	return 1;
+}
+
+Script_OnPlayerCommandText(playerid, cmdtext[])
+{
+	return Command_Process(playerid, cmdtext);
+}
+
+Script_OnPlayerInfoChange(playerid)
+{
+	return 1;
+}
+
+Script_OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
+{
+	return 1;
+}
+
+Script_OnPlayerExitVehicle(playerid, vehicleid)
+{
+	return 1;
+}
+
+Script_OnPlayerStateChange(playerid, newstate, oldstate)
+{
+	return 1;
+}
+
+Script_OnPlayerEnterCheckpointEx(playerid, cpid)
+{
+	return 1;
+}
+
+Script_OnPlayerLeaveCheckpointEx(playerid, cpid)
+{
+	return 1;
+}
+
+Script_OnPlayerEnterRaceCheckpoint(playerid)
+{
+	return 1;
+}
+
+Script_OnPlayerLeaveRaceCheckpoint(playerid)
+{
+	return 1;
+}
+
+Script_OnRconCommand(cmd[])
+{
+	return 1;
+}
+
+Script_OnPlayerPickUpPickup(playerid, pickupid)
+{
+	return 1;
+}
+
+Script_OnPlayerSelectedMenuRow(playerid, row)
+{
+	new Menu:PlayerMenu = GetPlayerMenu(playerid);
+	
+	// Property Option menu
+	if(PlayerMenu == propertyOptionsMenu)
+	{
+	    switch(row)
+	    {
+	        case 0:
+	        {
+	            ShowMenu(propertyMenu, playerid);
+			}
+			case 1:
+			{
+			    Text_Send(playerid, "YDBG_BANK_INFO_3");
+			    Text_Send(playerid, "YDBG_BANK_INFO_4");
+			    bankOption = 1;
+			}
+			case 4:
+			{
+			    MoneyOption = 1;
+			    Text_Send(playerid, "YDBG_MP_INFO_2.1");
+			    Text_Send(playerid, "YDBG_MP_INFO_2.2");
+			}
+			case 7:
+			{
+			    new Float:x, Float:y, Float:z;
+			    GetPlayerPos(playerid, x, y, z);
+			    
+			    new xmlHouse = XML_AddItem("house");
+			    new str[256];
+			    format(str, sizeof(str), "%f, %f, %f", x, y, z);
+			    XML_AddParameter(xmlHouse, "position", str);
+			    
+			    XML_WriteItem("propertys/houses.xml", xmlHouse);
+			}
+			
+			default:
+			{
+			    Text_Send(playerid, "YDBG_MENU_NOT_EXIST");
+			}
+		}
+		TogglePlayerControllable(playerid, 1);
+	}
+	
+	// PorpertyMenu
+	if(PlayerMenu == propertyMenu)
+	{
+	    switch(row)
+		{
+		    case 0:
+		    {
+		        Text_Send(playerid, "YDBG_PROP_INFO_1");
+		        Text_Send(playerid, "YDBG_PROP_INFO_2");
+		        Text_Send(playerid, "YDBG_PROP_INFO_3");
+		        propertyOption = 1;
+			}
+			case 1:
+			{
+			    Text_Send(playerid, "YDBG_PROP_INFO_4");
+			    propertyOption = 2;
+			}
+			case 2:
+			{
+			    Text_Send(playerid, "YDBG_PROP_INFO_5");
+			    Text_Send(playerid, "YDBG_PROP_INFO_6");
+			    Text_Send(playerid, "YDBG_PROP_INFO_7");
+			    Text_Send(playerid, "YDBG_PROP_INFO_8");
+			    Text_Send(playerid, "YDBG_PROP_INFO_9");
+			    Text_Send(playerid, "YDBG_PROP_INFO_10");
+			    Text_Send(playerid, "YDBG_PROP_INFO_11");
+			    Text_Send(playerid, "YDBG_PROP_INFO_12");
+			    propertyOption = 3;
+			}
+			case 3:
+			{
+			    Text_Send(playerid, "YDBG_PROP_INFO_13");
+			    Text_Send(playerid, "YDBG_PROP_INFO_14");
+                Text_Send(playerid, "YDBG_PROP_INFO_15");
+                Text_Send(playerid, "YDBG_PROP_INFO_16");
+                Text_Send(playerid, "YDBG_PROP_INFO_17");
+                Text_Send(playerid, "YDBG_PROP_INFO_18");
+                Text_Send(playerid, "YDBG_PROP_INFO_19");
+                Text_Send(playerid, "YDBG_PROP_INFO_20");
+                Text_Send(playerid, "YDBG_PROP_INFO_21");
+                Text_Send(playerid, "YDBG_PROP_INFO_22");
+                propertyOption = 4;
+			}
+		}
+		TogglePlayerControllable(playerid, 1);
+	}
+
+	// Vehicle menu
+ 	if(PlayerMenu == vehicleSpawn)
+ 	{
+ 	    switch(row)
+		{
+			case 0:
+			{
+			    SpawnVehicle(playerid, 521);
+			}
+			
+			case 1:
+			{
+			    SpawnVehicle(playerid, 522);
+			}
+			
+			case 2:
+			{
+			    SpawnVehicle(playerid, 463);
+			}
+
+			case 3:
+			{
+			    SpawnVehicle(playerid, 541);
+			}
+			
+			case 4:
+			{
+			    SpawnVehicle(playerid, 411);
+			}
+			
+			case 5:
+			{
+			    SpawnVehicle(playerid, 482);
+			}
+			
+			case 6:
+			{
+			    SpawnVehicle(playerid, 487);
+			}
+		}
+		TogglePlayerControllable(playerid, 1);
+	}
+	
+	if(PlayerMenu == saveMenu)
+	{
+	    switch(row)
+	    {
+	        case 0:
+	        {
+	            SaveOption = 1;
+	            SendClientMessage(playerid, 0x00FF00AA, "Gebruik nu /savepos om de auto's op te slaan");
+			}
+			
+			case 1:
+			{
+				SaveOption = 2;
+			    SendClientMessage(playerid, 0x00FF00AA, "Costum position selected use /savepos");
+			}
+			
+			case 2:
+			{
+			    SaveOption = 3;
+			    SendClientMessage(playerid, 0x00FF00AA, "Pickups gebruik nu /savepos [pickupid]");
+			}
+			
+			case 3:
+			{
+			    SaveOption = 4;
+			    SendClientMessage(playerid, 0x00FF00AA, "DEZE OPTIE IS NOG NIET INGEBOUWD");
+			}
+			
+			case 4:
+			{
+				HideMenuForPlayer(saveMenu, playerid);
+			}
+		}
+		TogglePlayerControllable(playerid, 1);
+	}
+	return 1;
+}
+
+Script_OnPlayerExitedMenu(playerid)
+{
+	TogglePlayerControllable(playerid, 1);
+	return 1;
+}
+
+Script_OnVehicleMod(vehicleid, componentid)
+{
+	return 1;
+}
+
+Script_OnVehiclePaintjob(vehicleid, paintjobid)
+{
+	return 1;
+}
+
+Script_OnVehicleRespray(vehicleid, color1, color2)
+{
+	return 1;
+}
+
+Script_OnPlayerLogin(playerid, yid)
+{
+	userLoged[playerid] = 1;
+	return 1;
+}
+
+Script_OnPlayerLogout(playerid, yid)
+{
+	Debug_Print_1("Script_OnPlayerLogout");
+    userLoged[playerid] = 0;
+    
+    if(Group_HasPlayer(builder, playerid))
+	{
+	    Group_RemovePlayer(builder, playerid);
+	}
+
+	if(Group_HasPlayer(superbuilder, playerid))
+	{
+	    Group_RemovePlayer(superbuilder, playerid);
+	}
+
+	new playersIp[20];
+	GetPlayerIp(playerid, playersIp, 20);
+    // Write the user information
+	Player_SetTag("YDBG");
+	Player_WriteInt("blevel", userinfo[playerid][blevel]);
+	Player_WriteFloat("spos_x", userinfo[playerid][spos_x]);
+	Player_WriteFloat("spos_y", userinfo[playerid][spos_y]);
+	Player_WriteFloat("spos_z", userinfo[playerid][spos_z]);
+	Player_WriteFloat("spos_a", userinfo[playerid][spos_a]);
+	Player_WriteInt("sinterior", userinfo[playerid][sinterior]);
+
+	return 1;
+}
+
+Script_OnPlayerEnterArea(playerid, areaid)
+{
+	return 1;
+}
+
+Script_OnPlayerLeaveArea(playerid, areaid)
+{
+	return 1;
+}
+
+Script_OnRaceEnd(raceid)
+{
+	return 1;
+}
+
+Script_OnPlayerExitRace(playerid, raceid)
+{
+	return 1;
+}
+
+Script_OnPlayerFinishRace(playerid, raceid, position, prize, time)
+{
+	return 1;
+}
+
+Script_OnDynamicObjectMoved(objectid)
+{
+	return 1;
+}
+
+Script_OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
+{
+	return 1;
+}
+
+Script_OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
+{
+	return 1;
+}
+
+Script_OnPlayerKeyPress(playerid, key)
+{
+	return 1;
+}
+
+Script_OnPlayerKeyRelease(playerid, key)
+{
+	return 1;
+}
+
+Script_OnGangWarCapture(zoneid, attacker, defender)
+{
+	return 1;
+}
+
+Script_OnGangWarStart(zoneid, attacker, defender)
+{
+	return 1;
+}
+
+Script_OnGangWarDefend(zoneid, attacker, defender)
+{
+	return 1;
+}
+
+/**
+* Commands
+*/
+public ycmd_kill(playerid, params[], help)
+{
+	#pragma unused help, params
+	SetPlayerHealth(playerid, 0.0);
+	return 1;
+}
+
+public ycmd_spos(playerid, params[], help)
+{
+	#pragma unused help, params
+	new Float:x, Float:y, Float:z, Float:a;
+
+	GetPlayerPos(playerid, x, y, z);
+	GetPlayerFacingAngle(playerid, a);
+	new intid;
+	intid = GetPlayerInterior(playerid);
+
+	userinfo[playerid][spos_x] = x;
+	userinfo[playerid][spos_y] = y;
+	userinfo[playerid][spos_z] = z;
+	userinfo[playerid][spos_a] = a;
+	userinfo[playerid][sinterior] = intid;
+
+	return 1;
+}
+
+public ycmd_lpos(playerid, params[], help)
+{
+    #pragma unused help, params
+	SetPlayerPos(playerid, userinfo[playerid][spos_x], userinfo[playerid][spos_y], userinfo[playerid][spos_z]);
+	SetPlayerFacingAngle(playerid, userinfo[playerid][spos_a]);
+	SetPlayerInterior(playerid, userinfo[playerid][sinterior]);
+
+	return 1;
+}
+
+public ycmd_mkprop(playerid, params[], help)
+{
+	#pragma unused help, params
+	ShowMenu(propertyMenu, playerid);
+	return 1;
+}
+
+public ycmd_giveright(playerid, params[], help)
+{
+	#pragma unused help
+	new
+	    bblevel,
+	    giveid;
+	if(sscanf(params, "i", bblevel)) SendClientMessage(playerid, 0xff0000AA, "USAGE: /giveright [playerid] [builder] (1 = builder 2 = sbuilder)");
+	else
+	{
+		switch(bblevel)
+		{
+		    case 1:
+		    {
+		        userinfo[playerid][blevel] = 1;
+				Group_AddPlayer(builder, giveid);
+			}
+			
+			case 2:
+			{
+			    userinfo[playerid][blevel] = 2;
+			    Group_AddPlayer(superbuilder, giveid);
+			}
+		}
+	}
+	return 1;
+}
+
+public ycmd_gr(playerid, params[], help)
+{
+    #pragma unused help, params
+    if(IsPlayerAdmin(playerid))
+    {
+        userinfo[playerid][blevel] = 2;
+        Group_AddPlayer(superbuilder, playerid);
+		SendClientMessage(playerid, 0x00FF00AA, "You are now SuperBuilder");
+	}
+	return 1;
+}
+
+public ycmd_veh(playerid, params[], help)
+{
+	#pragma unused help
+	new vehicle;
+	if(sscanf(params, "i", vehicle)) ShowMenu(vehicleSpawn, playerid);
+	else
+	{
+	    SpawnVehicle(playerid, vehicle);
+	}
+
+	return 1;
+}
+
+public ycmd_savepos(playerid, params[], help)
+{
+	#pragma unused help
+	new menushoww;
+	sscanf(params, "i", menushoww);
+	if(menushoww == 522) ShowMenu(saveMenu, playerid);
+	else
+	{
+		switch(SaveOption)
+		{
+		    case 1:
+		    {
+		        new command[256];
+		        sscanf(params, "z", command);
+
+		        new vehicle = GetPlayerVehicleID(playerid);
+		        new Float:x, Float:y, Float:z, Float:a;
+
+		        GetVehiclePos(vehicle, x, y, z);
+		        GetVehicleZAngle(vehicle, a);
+
+				new str[256];
+
+				format(str, sizeof(str), "%s", command);
+				new xml_cars = XML_AddItem("vehicle", str);
+
+				format(str, sizeof(str), "%f, %f, %f, %f", x, y, z, a);
+				XML_AddParameter(xml_cars, "position", str);
+				format(str, sizeof(str), "%i", GetVehicleModel(vehicle));
+				XML_AddParameter(xml_cars, "model", str);
+
+				XML_WriteItem("YSI/YDBG/cars.xml", xml_cars);
+			}
+
+			case 2:
+			{
+			    new command[256];
+			    sscanf(params, "z", command);
+
+			    new Float:x, Float:y, Float:z, Float:a;
+
+			    GetPlayerPos(playerid, x, y, z);
+			    GetPlayerFacingAngle(playerid, a);
+			}
+
+			default:
+			{
+			    ShowMenu(saveMenu, playerid);
+			}
+		}
+	}
+	return 1;
+}
+
+new Text:showTxt;
+
+public ycmd_explain(playerid, params[], help)
+{
+	#pragma unused params, help
+	
+	showTxt = TextDrawCreate(130, 50, "Welkom,\
+	~n~~n~\
+	you want some explaining, here you GOOOO!\
+	~n~~n~\
+	this sytem....");
+	
+ 	TextDrawFont(showTxt, 1);
+	TextDrawSetShadow(showTxt, 2);
+	TextDrawUseBox(showTxt, 1);
+	TextDrawLetterSize(showTxt, 0.3, 0.3);
+	TextDrawTextSize(showTxt, 430, 350);
+	TextDrawBoxColor(showTxt, 0x00000AA);
+
+	TextDrawShowForPlayer(playerid, showTxt);
+	
+	return 1;
+}
+
+public ycmd_hexplain(playerid, params[], help)
+{
+    #pragma unused params, help
+	TextDrawHideForPlayer(playerid, showTxt);
+	return 1;
+}
+
+/**
+* Functions
+*/
+stock IsBuilder(playerid, level)
+{
+	if(userinfo[playerid][blevel] == level)
+	{
+	    return 1;
+	}
+
+	return 0;
+}
+
+stock IsBuilderEx(playerid, from, to)
+{
+	if(userinfo[playerid][blevel] >= from && userinfo[playerid][blevel] <= to)
+	{
+	    return 1;
+	}
+
+	return 0;
+}
+
+stock IsValidVehicle(carid)
+{
+	if(carid >= 400 && carid <= 611)
+	{
+	    return 1;
+	}
+	return 0;
+}
+
+public SpawnVehicle(playerid, vehicleid)
+{
+	if(IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid, 0xFF0000AA, "Get off the vehicle please ...");
+	else if(!IsValidVehicle(vehicleid)) SendClientMessage(playerid, 0xFF0000AA, "Invallid vehicle");
+	else
+	{
+		new Float:x, Float:y, Float:z, Float:a;
+		
+		GetPlayerPos(playerid, x, y, z);
+		GetPlayerFacingAngle(playerid, a);
+		
+		new spcar;
+		
+		spcar = CreateVehicle(vehicleid, x+2.0, y, z, a, -1, -1, 100000);
+		
+		PutPlayerInVehicle(playerid, spcar, 0);
+		
+		Debug_Print_1("%i is spawned", vehicleid);
+	}
+}
+
+stock ShowMenu(Menu:smenu, playerid)
+{
+	TogglePlayerControllable(playerid, 0);
+	ShowMenuForPlayer(smenu, playerid);
+	return 1;
+}
+
+public MkProp(playerid, prop1[], prop2[], prop3[], prop4[])
+{
+	new xml_prop = XML_AddItem("property", prop2);
+
+	XML_AddParameter(xml_prop, "position", prop1);
+	XML_AddParameter(xml_prop, "name", prop2);
+	XML_AddParameter(xml_prop, "options_1", prop3);
+	XML_AddParameter(xml_prop, "options_2", prop4);
+
+	XML_WriteItem("YSI/YDBG/prop.xml", xml_prop);
+
+	Text_Send(playerid, "YDBG_PROP_ADD_6");
+
+	return 1;
+}
+
+
+/**
+native YDBG_FUNCTIONS
+	native
+native FindText(text[], find[], maxlength, &output = '', outp = false);
+native GetText(text[], &output);
+*/
+
+stock FindText(text[], find[], maxlength)
+{
+	if(strlen(text) <= maxlength)
+	{
+	    if(strfind(text, find))
+		{
+			return 1;
+		}
+	}
+ 	return 0;
+}
+
+stock GetText(text[], maxlength, output[])
+{
+	if(strlen(text) <= maxlength)
+	{
+	    format(output, maxlength, "%s", text);
+	    return 1;
+	}
+	return 0;
+}
+
+/**
+* Call the builder login
+* Load data functions
+*/
+public LoginDat_YDBG(playerid, identifier[], text[])
+{
+	Debug_Print_1("LoginDat_YDBG");
+	if(!strcmp(identifier, "blevel")) userinfo[playerid][blevel] = strval(text);
+	else if(!strcmp(identifier, "spos_x")) userinfo[playerid][spos_x] = floatstr(text);
+	else if(!strcmp(identifier, "spos_y")) userinfo[playerid][spos_y] = floatstr(text);
+	else if(!strcmp(identifier, "spos_z")) userinfo[playerid][spos_z] = floatstr(text);
+	else if(!strcmp(identifier, "spos_a")) userinfo[playerid][spos_a] = floatstr(text);
+	else if(!strcmp(identifier, "sinterior")) userinfo[playerid][sinterior] = strval(text);
+	
+	if(userinfo[playerid][blevel] == 1)
+	{
+	    SetPlayerColor(playerid, 0x12bddbAA);
+     	SendClientMessage(playerid, 0x00FF00AA, "You are as builder loged in");
+     	Group_AddPlayer(builder, playerid);
+	}
+
+	if(userinfo[playerid][blevel] == 2)
+	{
+		SetPlayerColor(playerid, 0x017a8cAA);
+		SendClientMessage(playerid, 0x00FF00AA, "You are as Superbuilder loged in");
+		Group_AddPlayer(superbuilder, playerid);
+	}
+	
+	return 1;
+}
+
+public LoadCars()
+{
+    static
+		key[MAX_XML_ENTRY_NAME],
+		val[MAX_XML_ENTRY_TEXT];
+
+	new
+     	model,
+    	pos[256];
+	while (XML_GetKeyValue(key, val))
+	{
+		if(!strcmp(key, "model")) model = strval(val);
+		else if(!strcmp(key, "position")) pos = val;
+	}
+	new dest[4][256];
+	explode(pos, dest, ',');
+	// printf("Model: %i x: %f  y: %f  z: %f  a: %f", model, floatstr(dest[0]), floatstr(dest[1]), floatstr(dest[2]), floatstr(dest[3]));
+	CreateVehicle(model, floatstr(dest[0]), floatstr(dest[1]), floatstr(dest[2]), floatstr(dest[3]), -1, -1, 1000);
+}
+
+public LoadProp()
+{
+	static
+	    key[MAX_XML_ENTRY_NAME],
+	    val[MAX_XML_ENTRY_TEXT];
+
+	new
+	    options_1[256],
+	    options_2[256],
+	    name[256],
+	    pos[256];
+
+	while (XML_GetKeyValue(key, val))
+	{
+	    if(!strcmp(key, "options_2")) options_2 = val;
+	    else if(!strcmp(key, "options_1")) options_1 = val;
+	    else if(!strcmp(key, "name")) name = val;
+	    else if(!strcmp(key, "position")) pos = val;
+	}
+	
+	new opt1[3][30];
+	new opt2[5][30];
+	new dest[3][30];
+	
+	explode(options_1, opt1, ',');
+	explode(options_2, opt2, ',');
+	explode(pos, dest, ',');
+	
+	// printf("Setups: 1: %i 2: %i 3: %i 4: %i 5: %i 6: %i 7: %i 8: %i", strval(opt1[0]), strval(opt1[1]), strval(opt1[2]), strval(opt2[0]), strval(opt2[1]), strval(opt2[2]), strval(opt2[3]), strval(opt2[4]));
+ 	// printf("Name: %s Position: %f, %f, %f", name, floatstr(dest[0]), floatstr(dest[1]), floatstr(dest[2]));
+	
+	CreateProperty(name, floatstr(dest[0]), floatstr(dest[1]), floatstr(dest[2]), strval(opt1[0]), strval(opt1[1]), strval(opt1[2]), strval(opt2[0]), strval(opt2[1]), strval(opt2[2]), strval(opt2[3]), strval(opt2[4]));
+}
+
+public Load_MoneyPoint()
+{
+    static
+		key[MAX_XML_ENTRY_NAME],
+		val[MAX_XML_ENTRY_TEXT];
+
+	new
+     	pos[256],
+    	options[256];
+	while (XML_GetKeyValue(key, val))
+	{
+		if(!strcmp(key, "position")) pos = val;
+		else if(!strcmp(key, "options")) options = val;
+	}
+	
+	new posdest[3][30];
+	new optdest[2][30];
+
+	explode(pos, posdest, ',');
+	explode(options, optdest, ',');
+
+	// printf("POS: %f, %f, %f OPTIONS: %i, %i", floatstr(posdest[0]), floatstr(posdest[1]), floatstr(posdest[2]), strval(optdest[0]), strval(optdest[1]));
+	CreateMoneyPoint(floatstr(posdest[0]), floatstr(posdest[1]), floatstr(posdest[2]), 2.0, strval(optdest[0]), strval(optdest[1]));
+}
+
+public LoadBank()
+{
+    static
+		key[MAX_XML_ENTRY_NAME],
+		val[MAX_XML_ENTRY_TEXT];
+
+	new
+     	posi[256],
+    	name[256];
+	while (XML_GetKeyValue(key, val))
+	{
+		if(!strcmp(key, "name")) name = val;
+		else if(!strcmp(key, "position")) posi = val;
+	}
+	
+	new posidest[3][30];
+
+	explode(posi, posidest, ',');
+
+	printf("POS: %f, %f, %f NAME: %s", floatstr(posidest[0]), floatstr(posidest[1]), floatstr(posidest[2]), name);
+	CreateBank(floatstr(posidest[0]), floatstr(posidest[1]), floatstr(posidest[2]), name);
+}
+
+stock load_functions()
+{
+	ycmd(kill);
+	ycmd(gr);
+	ycmd(explain);
+	ycmd(hexplain);
+	c_menu = ycmd(menu);
+	spos = ycmd(spos);
+	lpos = ycmd(lpos);
+	mkprop = ycmd(mkprop);
+	giveright = ycmd(giveright);
+	veh = ycmd(veh);
+	savepos = ycmd(savepos);
+
+	Group_SetDefaultCommandByID(spos, 0);
+	Group_SetDefaultCommandByID(lpos, 0);
+	Group_SetDefaultCommandByID(mkprop, 0);
+	Group_SetDefaultCommandByID(c_menu, 0);
+	Group_SetDefaultCommandByID(giveright, 0);
+	Group_SetDefaultCommandByID(veh, 0);
+	Group_SetDefaultCommandByID(savepos, 0);
+
+	// Set the bulder commands
+	Group_SetCommandByID(builder, spos, 1);
+	Group_SetCommandByID(builder, lpos, 1);
+	Group_SetCommandByID(builder, mkprop, 1);
+	Group_SetCommandByID(builder, savepos, 1);
+
+	// Set the Superbuilder commands
+	Group_SetCommandByID(superbuilder, spos, 1);
+	Group_SetCommandByID(superbuilder, lpos, 1);
+	Group_SetCommandByID(superbuilder, mkprop, 1);
+	Group_SetCommandByID(superbuilder, giveright, 1);
+	Group_SetCommandByID(superbuilder, veh, 1);
+	Group_SetCommandByID(superbuilder, c_menu, 1);
+	Group_SetCommandByID(superbuilder, savepos, 1);
+
+	Command_SetDeniedReturn(1);
+	Command_UseDeniedMessage(1);
+	Command_SetDisconnectReturn(1);
+}
+
+stock load_xml_init()
+{
+	#if !defined NO_VEHICLE_LOAD
+	 	new
+			XML:xCars = XML_New();
+		if (xCars != NO_XML_FILE)
+		{
+			XML_AddHandler(xCars, "vehicle", "LoadCars");
+			XML_Parse(xCars, "YSI\\YDBG\\cars.xml");
+		}
+	#endif
+
+	#if !defined NO_PROPERTYS_LOAD
+	    new
+			XML:xProps = XML_New();
+		if(xProps != NO_XML_FILE)
+		{
+		    XML_AddHandler(xCars, "property", "LoadProp");
+			XML_Parse(xCars, "YSI\\YDBG\\prop.xml");
+		}
+	#endif
+
+	#if !defined NO_MONEYPOINT_LOAD
+	    new
+	        XML:xMPoint = XML_New();
+		if(xMPoint != NO_XML_FILE)
+		{
+		    XML_AddHandler(xMPoint, "moneypoint", "Load_MoneyPoint");
+		    XML_Parse(xMPoint, "YSI\\YDBG\\moneypoint.xml");
+		}
+	#endif
+
+	#if !defined NO_BANK_LOAD
+	    new
+	        XML:xBank = XML_New();
+		if(xBank != NO_XML_FILE)
+		{
+		    XML_AddHandler(xBank, "bank", "LoadBank");
+		    XML_Parse(xBank, "YSI\\YDBG\\bank.xml");
+		}
+	#endif
+}

BIN
samp03/filterscripts/a51_base.amx


+ 422 - 0
samp03/filterscripts/a51_base.pwn

@@ -0,0 +1,422 @@
+// -----------------------------------------------------------------------------
+// Example Filterscript for the Area 51 (69) Base Objects
+// ------------------------------------------------------
+// By Matite in March 2015
+//
+//
+// This script removes the existing GTASA Area 51 (69) land section, fence and
+// buildings. It then replaces the land section and buildings with the new
+// enterable versions. It also replaces the perimeter fence and adds two
+// gates that can be opened or closed.
+//
+// Warning...
+// This script uses a total of:
+// * 11 objects = 1 for the replacement land object, 7 for the replacement
+//   building objects, 1 for the outer fence and 2 for the gates
+// * Enables the /a51 command to teleport the player to the Area 51 (69) Base
+// * 2 3D Text Labels = 1 on each gate
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+
+
+// -----------------------------------------------------------------------------
+// Includes
+// --------
+
+// SA-MP include
+#include <a_samp>
+
+// For PlaySoundForPlayersInRange()
+#include "../include/gl_common.inc"
+
+
+// -----------------------------------------------------------------------------
+// Defines
+// -------
+
+// Used for messages sent to the player
+#define COLOR_MESSAGE_YELLOW        0xFFDD00AA
+
+// Used for the northern and eastern A51 (69) gates status flags
+#define GATES_CLOSED  	0
+#define GATES_CLOSING  	1
+#define GATES_OPEN    	2
+#define GATES_OPENING   3
+
+
+// -----------------------------------------------------------------------------
+// Constants
+// ---------
+
+// Gate names for the 3D text labels
+static GateNames[2][] =
+{
+	"Northern Gate",
+	"Eastern Gate"
+};
+
+// -----------------------------------------------------------------------------
+// Variables
+// ---------
+
+// Stores the created object numbers of the replacement Area 51 (69) land object,
+// buildings and fence so they can be destroyed when the filterscript is unloaded
+new A51LandObject; 		// Land object
+new A51Buildings[7]; 	// Building object
+new A51Fence;           // Fence
+new A51NorthernGate;    // Northern Gate
+new A51EasternGate;     // Eastern Gate
+
+// Stores a reference to the 3D text labels used on each set of gates so they
+// can be destroyed when the filterscript is unloaded
+new Text3D:LabelGates[2];
+
+// Stores the current status of the northern gate
+new NorthernGateStatus = GATES_CLOSED;
+
+// Stores the current status of the eastern gate
+new EasternGateStatus = GATES_CLOSED;
+
+
+// -----------------------------------------------------------------------------
+// Callbacks
+// ---------
+
+public OnPlayerCommandText(playerid, cmdtext[])
+{
+	// Check command text
+	if (strcmp("/a51", cmdtext, true, 4) == 0)
+	{
+	    // Set the interior (outside)
+		SetPlayerInterior(playerid, 0);
+
+		// Set player position and facing angle (outside the northern gate)
+		SetPlayerPos(playerid, 135.20, 1948.51, 19.74);
+		SetPlayerFacingAngle(playerid, 180);
+
+		// Fix camera position after teleporting
+		SetCameraBehindPlayer(playerid);
+
+		// Send a gametext message to the player
+		GameTextForPlayer(playerid, "~b~~h~Area 51 (69) Base!", 3000, 3);
+
+	    // Exit here
+	    return 1;
+	}
+
+	// Exit here (return 0 as the command was not handled in this filterscript)
+	return 0;
+}
+
+public OnFilterScriptInit()
+{
+    // Display information in the Server Console
+	print("\n");
+	print("  |---------------------------------------------------");
+	print("  |--- Area 51 (69) Building Objects Filterscript");
+    print("  |--  Script v1.01");
+    print("  |--  28th March 2015");
+	print("  |---------------------------------------------------");
+
+	// Create the A51 Land object
+    A51LandObject = CreateObject(11692, 199.344, 1943.79, 18.2031, 0, 0, 0);
+
+    // Display information in the Server Console
+    print("  |--  Area 51 (69) Land object created");
+    
+    // Create the A51 Fence object
+    A51Fence = CreateObject(19312, 191.141, 1870.04, 21.4766, 0, 0, 0);
+    
+    // Display information in the Server Console
+    print("  |--  Area 51 (69) Fence object created");
+    
+    // Create the A51 Building objects
+    A51Buildings[0] = CreateObject(19905, 206.798950, 1931.643432, 16.450595, 0, 0, 0);
+    A51Buildings[1] = CreateObject(19905, 188.208908, 1835.033569, 16.450595, 0, 0, 0);
+    A51Buildings[2] = CreateObject(19905, 230.378875, 1835.033569, 16.450595, 0, 0, 0);
+    A51Buildings[3] = CreateObject(19907, 142.013977, 1902.538085, 17.633581, 0, 0, 270.0);
+    A51Buildings[4] = CreateObject(19907, 146.854003, 1846.008056, 16.533580, 0, 0, 0);
+    A51Buildings[5] = CreateObject(19909, 137.900390, 1875.024291, 16.836734, 0, 0, 270.0);
+    A51Buildings[6] = CreateObject(19909, 118.170387, 1875.184326, 16.846735, 0, 0, 0);
+    
+
+    // Display information in the Server Console
+    print("  |--  Area 51 (69) Building objects created");
+
+    // Create the Northern gate object
+    A51NorthernGate = CreateObject(19313, 134.545074, 1941.527709, 21.691408, 0, 0, 180.0);
+
+    // Create the Eastern gate object
+    A51EasternGate = CreateObject(19313, 286.008666, 1822.744628, 20.010623, 0, 0, 90.0);
+
+    // Display information in the Server Console
+    print("  |--  Area 51 (69) Gate objects created");
+
+	// Create variable
+	new string[192];
+
+    // Create 3D Text Label at the prisons eastern gates
+    format(string, sizeof(string), "{CCCCCC}[%s]\n{CCCCCC}Press '{FFFFFF}~k~~CONVERSATION_YES~{CCCCCC}' to open or close the gate", GateNames[0]);
+    LabelGates[0] = Create3DTextLabel(string, 0xCCCCCCAA, 135.09, 1942.37, 19.82, 10.5, 0, 0);
+
+    // Create 3D Text Label at the prisons eastern gates
+    format(string, sizeof(string), "{CCCCCC}[%s]\n{CCCCCC}Press '{FFFFFF}~k~~CONVERSATION_YES~{CCCCCC}' to open or close the gate", GateNames[1]);
+    LabelGates[1] = Create3DTextLabel(string, 0xCCCCCCAA, 287.12, 1821.51, 18.14, 10.5, 0, 0);
+
+    // Display information in the Server Console
+	print("  |--  Area 51 (69) Gates 3D Text Labels created");
+	print("  |---------------------------------------------------");
+
+	// Loop
+    for (new i = 0; i < MAX_PLAYERS; i++)
+    {
+        // Check if the player is connected and not a NPC
+        if (IsPlayerConnected(i) && !IsPlayerNPC(i))
+        {
+            // Remove default GTASA Area 51 (69) land and buildings for the player
+			// (so any player currently ingame does not have to rejoin for them to
+			// be removed when this filterscript is loaded)
+			RemoveBuildingForPlayer(i, 16203, 199.344, 1943.79, 18.2031, 250.0); 	// Land
+			RemoveBuildingForPlayer(i, 16590, 199.344, 1943.79, 18.2031, 250.0); 	// Land LOD
+			RemoveBuildingForPlayer(i, 16323, 199.336, 1943.88, 18.2031, 250.0); 	// Buildings
+            RemoveBuildingForPlayer(i, 16619, 199.336, 1943.88, 18.2031, 250.0); 	// Buildings LOD
+            RemoveBuildingForPlayer(i, 1697, 228.797, 1835.34, 23.2344, 250.0); 	// Solar Panels (they poke through the roof inside)
+            RemoveBuildingForPlayer(i, 16094, 191.141, 1870.04, 21.4766, 250.0); 	// Outer Fence
+	    }
+    }
+
+	// Exit here
+	return 1;
+}
+
+public OnFilterScriptExit()
+{
+    // Check for valid object
+	if (IsValidObject(A51LandObject))
+	{
+		// Destroy the A51 land object
+		DestroyObject(A51LandObject);
+
+		// Display information in the Server Console
+		print("  |---------------------------------------------------");
+    	print("  |--  Area 51 (69) Land object destroyed");
+    }
+    
+    // Check for valid object
+	if (IsValidObject(A51Fence))
+	{
+		// Destroy the A51 fence object
+		DestroyObject(A51Fence);
+
+		// Display information in the Server Console
+    	print("  |--  Area 51 (69) Fence object destroyed");
+    }
+    
+    // Check for valid object
+	if (IsValidObject(A51NorthernGate))
+	{
+		// Destroy the A51 northern gate object
+		DestroyObject(A51NorthernGate);
+
+		// Display information in the Server Console
+    	print("  |--  Area 51 (69) Northern Gate object destroyed");
+    }
+    
+    // Check for valid object
+	if (IsValidObject(A51EasternGate))
+	{
+		// Destroy the A51 eastern gate object
+		DestroyObject(A51EasternGate);
+
+		// Display information in the Server Console
+    	print("  |--  Area 51 (69) Eastern Gate object destroyed");
+    }
+    
+    // Loop
+    for (new i = 0; i < sizeof(A51Buildings); i++)
+    {
+	    // Check for valid object
+		if (IsValidObject(A51Buildings[i]))
+		{
+			// Destroy the A51 building object
+			DestroyObject(A51Buildings[i]);
+
+			// Display information in the Server Console
+		   	printf("  |--  Area 51 (69) Building object %d destroyed", i + 1);
+	    }
+    }
+    
+    // Destroy 3D Text Labels on the northern and eastern gates
+    Delete3DTextLabel(LabelGates[0]);
+    Delete3DTextLabel(LabelGates[1]);
+
+    // Display information in the Server Console
+   	print("  |--  Deleted the 3D Text Labels on the Area 51 (69) Gates");
+
+   	// Display information in the Server Console
+	print("  |---------------------------------------------------");
+	print("  |--  Area 51 (69) Base Objects Filterscript Unloaded");
+	print("  |---------------------------------------------------");
+
+    // Exit here
+	return 1;
+}
+
+public OnPlayerConnect(playerid)
+{
+    // Remove default GTASA Area 51 (69) land and buildings for the player
+	RemoveBuildingForPlayer(playerid, 16203, 199.344, 1943.79, 18.2031, 250.0); 	// Land
+	RemoveBuildingForPlayer(playerid, 16590, 199.344, 1943.79, 18.2031, 250.0); 	// Land LOD
+	RemoveBuildingForPlayer(playerid, 16323, 199.336, 1943.88, 18.2031, 250.0); 	// Buildings
+    RemoveBuildingForPlayer(playerid, 16619, 199.336, 1943.88, 18.2031, 250.0); 	// Buildings LOD
+    RemoveBuildingForPlayer(playerid, 1697, 228.797, 1835.34, 23.2344, 250.0); 		// Solar Panels (they poke through the roof inside)
+    RemoveBuildingForPlayer(playerid, 16094, 191.141, 1870.04, 21.4766, 250.0); 	// Outer Fence
+
+	// Exit here (return 1 so this callback is handled in other scripts too)
+	return 1;
+}
+
+public OnObjectMoved(objectid)
+{
+    // Check if the object that moved was the northern gate
+	if (objectid == A51NorthernGate)
+	{
+	    // Check if the northern gate was closing
+	    if (NorthernGateStatus == GATES_CLOSING)
+	    {
+	        // Set status flag for northern gates
+		    NorthernGateStatus = GATES_CLOSED;
+	    }
+	    else
+	    {
+	        // Set status flag for northern gates
+		    NorthernGateStatus = GATES_OPEN;
+	    }
+	}
+	// Check if the object that moved was the eastern gate
+	else if (objectid == A51EasternGate)
+	{
+	    // Check if the eastern gate was closing
+	    if (EasternGateStatus == GATES_CLOSING)
+	    {
+	        // Set status flag for eastern gate
+		    EasternGateStatus = GATES_CLOSED;
+	    }
+	    else
+	    {
+	        // Set status flag for eastern gate
+		    EasternGateStatus = GATES_OPEN;
+	    }
+	}
+
+	// Exit here
+	return 1;
+}
+
+public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
+{
+	// Check if the player pressed the conversation yes key (normally the Y key)
+	if (newkeys & KEY_YES)
+	{
+		// Check if the player is near the eastern A51 gate
+	    if (IsPlayerInRangeOfPoint(playerid, 10.0, 287.12, 1821.51, 18.14))
+	    {
+	        // Debug
+	        //printf("-->Player ID %d within 10m of the Eastern A51 Gate", playerid);
+
+	        // Check if the eastern gate is currently opening (ie moving)
+	        if (EasternGateStatus == GATES_OPENING)
+	        {
+	            // Send chat text message and exit here
+	            SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, "* Sorry, you must wait for the eastern gate to fully open first.");
+	            return 1;
+	        }
+	        // Check if the eastern gate is currently closing (ie moving)
+	        else if (EasternGateStatus == GATES_CLOSING)
+	        {
+	            // Send chat text message and exit here
+	            SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, "* Sorry, you must wait for the eastern gate to fully close first.");
+	            return 1;
+	        }
+
+	        // Play gate opening sound
+	        PlaySoundForPlayersInRange(1035, 50.0, 287.12, 1821.51, 18.14);
+
+	        // Check if the eastern gate is currently closed
+	        if (EasternGateStatus == GATES_CLOSED)
+	        {
+	            // Send a gametext message to the player
+				GameTextForPlayer(playerid, "~b~~h~Eastern Gate Opening!", 3000, 3);
+
+		        // Animate the eastern gate opening
+		    	MoveObject(A51EasternGate, 286.008666, 1833.744628, 20.010623, 1.1, 0, 0, 90);
+
+				// Set status flag for eastern gate
+		    	EasternGateStatus = GATES_OPENING;
+	    	}
+	    	else
+	    	{
+	    	    // Send a gametext message to the player
+				GameTextForPlayer(playerid, "~b~~h~Eastern Gate Closing!", 3000, 3);
+
+		        // Animate the eastern gates closing
+		    	MoveObject(A51EasternGate, 286.008666, 1822.744628, 20.010623, 1.1, 0, 0, 90);
+
+				// Set status flag for eastern gate
+		    	EasternGateStatus = GATES_CLOSING;
+	    	}
+	    }
+	    // Check if the player is near the northern A51 gate
+	    else if (IsPlayerInRangeOfPoint(playerid, 10.0, 135.09, 1942.37, 19.82))
+	    {
+	        // Debug
+	        //printf("-->Player ID %d within 10m of the Northern A51 Gate", playerid);
+
+	        // Check if the northern gate is currently opening (ie moving)
+	        if (NorthernGateStatus == GATES_OPENING)
+	        {
+	            // Send chat text message and exit here
+	            SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, "* Sorry, you must wait for the northern gate to fully open first.");
+	            return 1;
+	        }
+	        // Check if the northern gates is currently closing (ie moving)
+	        else if (NorthernGateStatus == GATES_CLOSING)
+	        {
+	            // Send chat text message and exit here
+	            SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, "* Sorry, you must wait for the northern gate to fully close first.");
+	            return 1;
+	        }
+
+	        // Play gate opening sound
+	        PlaySoundForPlayersInRange(1035, 50.0, 135.09, 1942.37, 19.82);
+
+	        // Check if the northern gate is currently closed
+	        if (NorthernGateStatus == GATES_CLOSED)
+	        {
+	            // Send a gametext message to the player
+				GameTextForPlayer(playerid, "~b~~h~Northern Gate Opening!", 3000, 3);
+
+		        // Animate the northern gates opening
+		    	MoveObject(A51NorthernGate, 121.545074, 1941.527709, 21.691408, 1.3, 0, 0, 180);
+
+		    	// Set status flag for northern gates
+		    	NorthernGateStatus = GATES_OPENING;
+	    	}
+	    	else
+	    	{
+	    	    // Send a gametext message to the player
+				GameTextForPlayer(playerid, "~b~~h~Northern Gate Closing!", 3000, 3);
+
+		        // Animate the northern gates closing
+		    	MoveObject(A51NorthernGate, 134.545074, 1941.527709, 21.691408, 1.3, 0, 0, 180);
+
+		    	// Set status flag for northern gates
+		    	NorthernGateStatus = GATES_CLOSING;
+	    	}
+	    }
+	}
+
+	// Exit here (return 1 so this callback is handled in other scripts too)
+	return 1;
+}
+

BIN
samp03/filterscripts/adminspec.amx


+ 121 - 0
samp03/filterscripts/adminspec.pwn

@@ -0,0 +1,121 @@
+//
+//  ADMIN SPECTATE FILTER SCRIPT
+//  kye 2007
+//
+
+#pragma tabsize 0
+#include <a_samp>
+#include <core>
+#include <float>
+
+#include "../include/gl_common.inc"
+
+#define COLOR_GREY 0xAFAFAFAA
+#define COLOR_GREEN 0x33AA33AA
+#define COLOR_RED 0xAA3333AA
+#define COLOR_YELLOW 0xFFFF00AA
+#define COLOR_WHITE 0xFFFFFFFF
+
+//------------------------------------------------------------------------------------------------------
+
+#define ADMIN_SPEC_TYPE_NONE 0
+#define ADMIN_SPEC_TYPE_PLAYER 1
+#define ADMIN_SPEC_TYPE_VEHICLE 2
+
+new gSpectateID[MAX_PLAYERS];
+new gSpectateType[MAX_PLAYERS];
+
+//------------------------------------------------------------------------------------------------------
+
+public OnFilterScriptInit()
+{
+}
+
+//------------------------------------------------------------------------------------------------------
+
+public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
+{
+	// IF ANYONE IS SPECTATING THIS PLAYER, WE'LL ALSO HAVE
+	// TO CHANGE THEIR INTERIOR ID TO MATCH
+	new x = 0;
+	while(x!=MAX_PLAYERS) {
+	    if( IsPlayerConnected(x) &&	GetPlayerState(x) == PLAYER_STATE_SPECTATING &&
+			gSpectateID[x] == playerid && gSpectateType[x] == ADMIN_SPEC_TYPE_PLAYER )
+   		{
+   		    SetPlayerInterior(x,newinteriorid);
+		}
+		x++;
+	}
+}
+
+//------------------------------------------------------------------------------------------------------
+
+public OnPlayerCommandText(playerid, cmdtext[])
+{
+	new cmd[256];
+	new specplayerid, specvehicleid, idx;
+
+	// WE ONLY DEAL WITH COMMANDS FROM ADMINS IN THIS FILTERSCRIPT
+	if(!IsPlayerAdmin(playerid)) return 0;
+
+	cmd = strtok(cmdtext, idx);
+
+	// SPECTATE A PLAYER
+ 	if(strcmp(cmd, "/specplayer", true) == 0) {
+	    new tmp[256];
+		tmp = strtok(cmdtext, idx);
+
+		if(!strlen(tmp)) {
+			SendClientMessage(playerid, COLOR_WHITE, "USAGE: /specplayer [playerid]");
+			return 1;
+		}
+		specplayerid = strval(tmp);
+		
+		if(!IsPlayerConnected(specplayerid)) {
+		    SendClientMessage(playerid, COLOR_RED, "specplayer: that player isn't active.");
+			return 1;
+		}
+		
+		TogglePlayerSpectating(playerid, 1);
+		PlayerSpectatePlayer(playerid, specplayerid);
+		SetPlayerInterior(playerid,GetPlayerInterior(specplayerid));
+		gSpectateID[playerid] = specplayerid;
+		gSpectateType[playerid] = ADMIN_SPEC_TYPE_PLAYER;
+		
+ 		return 1;
+	}
+
+	// SPECTATE A VEHICLE
+ 	if(strcmp(cmd, "/specvehicle", true) == 0) {
+	    new tmp[256];
+		tmp = strtok(cmdtext, idx);
+
+		if(!strlen(tmp)) {
+			SendClientMessage(playerid, COLOR_WHITE, "USAGE: /specvehicle [vehicleid]");
+			return 1;
+		}
+		specvehicleid = strval(tmp);
+		
+		if(specvehicleid < MAX_VEHICLES) {
+			TogglePlayerSpectating(playerid, 1);
+			PlayerSpectateVehicle(playerid, specvehicleid);
+			gSpectateID[playerid] = specvehicleid;
+			gSpectateType[playerid] = ADMIN_SPEC_TYPE_VEHICLE;
+		}
+ 		return 1;
+	}
+
+	// STOP SPECTATING
+ 	if(strcmp(cmd, "/specoff", true) == 0) {
+		TogglePlayerSpectating(playerid, 0);
+		gSpectateID[playerid] = INVALID_PLAYER_ID;
+		gSpectateType[playerid] = ADMIN_SPEC_TYPE_NONE;
+		return 1;
+	}
+
+	return 0;
+}
+
+//------------------------------------------------------------------------------------------------------
+
+

BIN
samp03/filterscripts/attachments.amx


+ 383 - 0
samp03/filterscripts/attachments.pwn

@@ -0,0 +1,383 @@
+//-------------------------------------------------
+//
+// This is an example of using the EditAttachedObject functions
+// to allow the player to customize their character.
+//
+// h02 2012
+//
+// SA-MP 0.3e and above
+//
+//-------------------------------------------------
+
+#include <a_samp>
+
+#define DIALOG_ATTACH_INDEX             13500
+#define DIALOG_ATTACH_INDEX_SELECTION   DIALOG_ATTACH_INDEX+1
+#define DIALOG_ATTACH_EDITREPLACE       DIALOG_ATTACH_INDEX+2
+#define DIALOG_ATTACH_MODEL_SELECTION   DIALOG_ATTACH_INDEX+3
+#define DIALOG_ATTACH_BONE_SELECTION    DIALOG_ATTACH_INDEX+4
+
+enum AttachmentEnum
+{
+    attachmodel,
+    attachname[24]
+}
+
+new AttachmentObjects[][AttachmentEnum] = {
+{18632, "FishingRod"},
+{18633, "GTASAWrench1"},
+{18634, "GTASACrowbar1"},
+{18635, "GTASAHammer1"},
+{18636, "PoliceCap1"},
+{18637, "PoliceShield1"},
+{18638, "HardHat1"},
+{18639, "BlackHat1"},
+{18640, "Hair1"},
+{18975, "Hair2"},
+{19136, "Hair4"},
+{19274, "Hair5"},
+{18641, "Flashlight1"},
+{18642, "Taser1"},
+{18643, "LaserPointer1"},
+{19080, "LaserPointer2"},
+{19081, "LaserPointer3"},
+{19082, "LaserPointer4"},
+{19083, "LaserPointer5"},
+{19084, "LaserPointer6"},
+{18644, "Screwdriver1"},
+{18645, "MotorcycleHelmet1"},
+{18865, "MobilePhone1"},
+{18866, "MobilePhone2"},
+{18867, "MobilePhone3"},
+{18868, "MobilePhone4"},
+{18869, "MobilePhone5"},
+{18870, "MobilePhone6"},
+{18871, "MobilePhone7"},
+{18872, "MobilePhone8"},
+{18873, "MobilePhone9"},
+{18874, "MobilePhone10"},
+{18875, "Pager1"},
+{18890, "Rake1"},
+{18891, "Bandana1"},
+{18892, "Bandana2"},
+{18893, "Bandana3"},
+{18894, "Bandana4"},
+{18895, "Bandana5"},
+{18896, "Bandana6"},
+{18897, "Bandana7"},
+{18898, "Bandana8"},
+{18899, "Bandana9"},
+{18900, "Bandana10"},
+{18901, "Bandana11"},
+{18902, "Bandana12"},
+{18903, "Bandana13"},
+{18904, "Bandana14"},
+{18905, "Bandana15"},
+{18906, "Bandana16"},
+{18907, "Bandana17"},
+{18908, "Bandana18"},
+{18909, "Bandana19"},
+{18910, "Bandana20"},
+{18911, "Mask1"},
+{18912, "Mask2"},
+{18913, "Mask3"},
+{18914, "Mask4"},
+{18915, "Mask5"},
+{18916, "Mask6"},
+{18917, "Mask7"},
+{18918, "Mask8"},
+{18919, "Mask9"},
+{18920, "Mask10"},
+{18921, "Beret1"},
+{18922, "Beret2"},
+{18923, "Beret3"},
+{18924, "Beret4"},
+{18925, "Beret5"},
+{18926, "Hat1"},
+{18927, "Hat2"},
+{18928, "Hat3"},
+{18929, "Hat4"},
+{18930, "Hat5"},
+{18931, "Hat6"},
+{18932, "Hat7"},
+{18933, "Hat8"},
+{18934, "Hat9"},
+{18935, "Hat10"},
+{18936, "Helmet1"},
+{18937, "Helmet2"},
+{18938, "Helmet3"},
+{18939, "CapBack1"},
+{18940, "CapBack2"},
+{18941, "CapBack3"},
+{18942, "CapBack4"},
+{18943, "CapBack5"},
+{18944, "HatBoater1"},
+{18945, "HatBoater2"},
+{18946, "HatBoater3"},
+{18947, "HatBowler1"},
+{18948, "HatBowler2"},
+{18949, "HatBowler3"},
+{18950, "HatBowler4"},
+{18951, "HatBowler5"},
+{18952, "BoxingHelmet1"},
+{18953, "CapKnit1"},
+{18954, "CapKnit2"},
+{18955, "CapOverEye1"},
+{18956, "CapOverEye2"},
+{18957, "CapOverEye3"},
+{18958, "CapOverEye4"},
+{18959, "CapOverEye5"},
+{18960, "CapRimUp1"},
+{18961, "CapTrucker1"},
+{18962, "CowboyHat2"},
+{18963, "CJElvisHead"},
+{18964, "SkullyCap1"},
+{18965, "SkullyCap2"},
+{18966, "SkullyCap3"},
+{18967, "HatMan1"},
+{18968, "HatMan2"},
+{18969, "HatMan3"},
+{18970, "HatTiger1"},
+{18971, "HatCool1"},
+{18972, "HatCool2"},
+{18973, "HatCool3"},
+{18974, "MaskZorro1"},
+{18976, "MotorcycleHelmet2"},
+{18977, "MotorcycleHelmet3"},
+{18978, "MotorcycleHelmet4"},
+{18979, "MotorcycleHelmet5"},
+{19006, "GlassesType1"},
+{19007, "GlassesType2"},
+{19008, "GlassesType3"},
+{19009, "GlassesType4"},
+{19010, "GlassesType5"},
+{19011, "GlassesType6"},
+{19012, "GlassesType7"},
+{19013, "GlassesType8"},
+{19014, "GlassesType9"},
+{19015, "GlassesType10"},
+{19016, "GlassesType11"},
+{19017, "GlassesType12"},
+{19018, "GlassesType13"},
+{19019, "GlassesType14"},
+{19020, "GlassesType15"},
+{19021, "GlassesType16"},
+{19022, "GlassesType17"},
+{19023, "GlassesType18"},
+{19024, "GlassesType19"},
+{19025, "GlassesType20"},
+{19026, "GlassesType21"},
+{19027, "GlassesType22"},
+{19028, "GlassesType23"},
+{19029, "GlassesType24"},
+{19030, "GlassesType25"},
+{19031, "GlassesType26"},
+{19032, "GlassesType27"},
+{19033, "GlassesType28"},
+{19034, "GlassesType29"},
+{19035, "GlassesType30"},
+{19036, "HockeyMask1"},
+{19037, "HockeyMask2"},
+{19038, "HockeyMask3"},
+{19039, "WatchType1"},
+{19040, "WatchType2"},
+{19041, "WatchType3"},
+{19042, "WatchType4"},
+{19043, "WatchType5"},
+{19044, "WatchType6"},
+{19045, "WatchType7"},
+{19046, "WatchType8"},
+{19047, "WatchType9"},
+{19048, "WatchType10"},
+{19049, "WatchType11"},
+{19050, "WatchType12"},
+{19051, "WatchType13"},
+{19052, "WatchType14"},
+{19053, "WatchType15"},
+{19085, "EyePatch1"},
+{19086, "ChainsawDildo1"},
+{19090, "PomPomBlue"},
+{19091, "PomPomRed"},
+{19092, "PomPomGreen"},
+{19093, "HardHat2"},
+{19094, "BurgerShotHat1"},
+{19095, "CowboyHat1"},
+{19096, "CowboyHat3"},
+{19097, "CowboyHat4"},
+{19098, "CowboyHat5"},
+{19099, "PoliceCap2"},
+{19100, "PoliceCap3"},
+{19101, "ArmyHelmet1"},
+{19102, "ArmyHelmet2"},
+{19103, "ArmyHelmet3"},
+{19104, "ArmyHelmet4"},
+{19105, "ArmyHelmet5"},
+{19106, "ArmyHelmet6"},
+{19107, "ArmyHelmet7"},
+{19108, "ArmyHelmet8"},
+{19109, "ArmyHelmet9"},
+{19110, "ArmyHelmet10"},
+{19111, "ArmyHelmet11"},
+{19112, "ArmyHelmet12"},
+{19113, "SillyHelmet1"},
+{19114, "SillyHelmet2"},
+{19115, "SillyHelmet3"},
+{19116, "PlainHelmet1"},
+{19117, "PlainHelmet2"},
+{19118, "PlainHelmet3"},
+{19119, "PlainHelmet4"},
+{19120, "PlainHelmet5"},
+{19137, "CluckinBellHat1"},
+{19138, "PoliceGlasses1"},
+{19139, "PoliceGlasses2"},
+{19140, "PoliceGlasses3"},
+{19141, "SWATHelmet1"},
+{19142, "SWATArmour1"},
+{19160, "HardHat3"},
+{19161, "PoliceHat1"},
+{19162, "PoliceHat2"},
+{19163, "GimpMask1"},
+{19317, "bassguitar01"},
+{19318, "flyingv01"},
+{19319, "warlock01"},
+{19330, "fire_hat01"},
+{19331, "fire_hat02"},
+{19346, "hotdog01"},
+{19347, "badge01"},
+{19348, "cane01"},
+{19349, "monocle01"},
+{19350, "moustache01"},
+{19351, "moustache02"},
+{19352, "tophat01"},
+{19487, "tophat02"},
+{19488, "HatBowler6"},
+{19513, "whitephone"},
+{19578, "Banana"},
+{19418, "HandCuff"}
+};
+
+new AttachmentBones[][24] = {
+{"Spine"},
+{"Head"},
+{"Left upper arm"},
+{"Right upper arm"},
+{"Left hand"},
+{"Right hand"},
+{"Left thigh"},
+{"Right thigh"},
+{"Left foot"},
+{"Right foot"},
+{"Right calf"},
+{"Left calf"},
+{"Left forearm"},
+{"Right forearm"},
+{"Left clavicle"},
+{"Right clavicle"},
+{"Neck"},
+{"Jaw"}
+};
+
+public OnPlayerCommandText(playerid, cmdtext[])
+{
+    if(!strcmp(cmdtext, "/attachments", true))
+    {
+        new string[128];
+        for(new x;x<MAX_PLAYER_ATTACHED_OBJECTS;x++)
+        {
+            if(IsPlayerAttachedObjectSlotUsed(playerid, x)) format(string, sizeof(string), "%s%d (Used)\n", string, x);
+            else format(string, sizeof(string), "%s%d\n", string, x);
+        }
+        ShowPlayerDialog(playerid, DIALOG_ATTACH_INDEX_SELECTION, DIALOG_STYLE_LIST, \
+        "{FF0000}Attachment Modification - Index Selection", string, "Select", "Cancel");
+        return 1;
+    }
+    return 0;
+}
+
+public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
+{
+    switch(dialogid)
+    {
+        case DIALOG_ATTACH_INDEX_SELECTION:
+        {
+            if(response)
+            {
+                if(IsPlayerAttachedObjectSlotUsed(playerid, listitem))
+                {
+                    ShowPlayerDialog(playerid, DIALOG_ATTACH_EDITREPLACE, DIALOG_STYLE_MSGBOX, \
+                    "{FF0000}Attachment Modification", "Do you wish to edit the attachment in that slot, or delete it?", "Edit", "Delete");
+                }
+                else
+                {
+                    new string[4000+1];
+                    for(new x;x<sizeof(AttachmentObjects);x++)
+                    {
+                        format(string, sizeof(string), "%s%s\n", string, AttachmentObjects[x][attachname]);
+                    }
+                    ShowPlayerDialog(playerid, DIALOG_ATTACH_MODEL_SELECTION, DIALOG_STYLE_LIST, \
+                    "{FF0000}Attachment Modification - Model Selection", string, "Select", "Cancel");
+                }
+                SetPVarInt(playerid, "AttachmentIndexSel", listitem);
+            }
+            return 1;
+        }
+        case DIALOG_ATTACH_EDITREPLACE:
+        {
+            if(response) EditAttachedObject(playerid, GetPVarInt(playerid, "AttachmentIndexSel"));
+            else RemovePlayerAttachedObject(playerid, GetPVarInt(playerid, "AttachmentIndexSel"));
+            DeletePVar(playerid, "AttachmentIndexSel");
+            return 1;
+        }
+        case DIALOG_ATTACH_MODEL_SELECTION:
+        {
+            if(response)
+            {
+                if(GetPVarInt(playerid, "AttachmentUsed") == 1) EditAttachedObject(playerid, listitem);
+                else
+                {
+                    SetPVarInt(playerid, "AttachmentModelSel", AttachmentObjects[listitem][attachmodel]);
+                    new string[256+1];
+                    for(new x;x<sizeof(AttachmentBones);x++)
+                    {
+                        format(string, sizeof(string), "%s%s\n", string, AttachmentBones[x]);
+                    }
+                    ShowPlayerDialog(playerid, DIALOG_ATTACH_BONE_SELECTION, DIALOG_STYLE_LIST, \
+                    "{FF0000}Attachment Modification - Bone Selection", string, "Select", "Cancel");
+                }
+            }
+            else DeletePVar(playerid, "AttachmentIndexSel");
+            return 1;
+        }
+        case DIALOG_ATTACH_BONE_SELECTION:
+        {
+            if(response)
+            {
+                SetPlayerAttachedObject(playerid, GetPVarInt(playerid, "AttachmentIndexSel"), GetPVarInt(playerid, "AttachmentModelSel"), listitem+1);
+                EditAttachedObject(playerid, GetPVarInt(playerid, "AttachmentIndexSel"));
+                SendClientMessage(playerid, 0xFFFFFFFF, "Hint: Use {FFFF00}~k~~PED_SPRINT~{FFFFFF} to look around.");
+            }
+            DeletePVar(playerid, "AttachmentIndexSel");
+            DeletePVar(playerid, "AttachmentModelSel");
+            return 1;
+        }
+    }
+    return 0;
+}
+
+public OnPlayerEditAttachedObject( playerid, response, index, modelid, boneid,
+                                   Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ,
+                                   Float:fRotX, Float:fRotY, Float:fRotZ,
+                                   Float:fScaleX, Float:fScaleY, Float:fScaleZ )
+{
+    new debug_string[256+1];
+	format(debug_string,256,"SetPlayerAttachedObject(playerid,%d,%d,%d,%f,%f,%f,%f,%f,%f,%f,%f,%f)",
+           index,modelid,boneid,fOffsetX,fOffsetY,fOffsetZ,fRotX,fRotY,fRotZ,fScaleX,fScaleY,fScaleZ);
+
+	print(debug_string);
+    SendClientMessage(playerid, 0xFFFFFFFF, debug_string);
+    
+    SetPlayerAttachedObject(playerid,index,modelid,boneid,fOffsetX,fOffsetY,fOffsetZ,fRotX,fRotY,fRotZ,fScaleX,fScaleY,fScaleZ);
+    SendClientMessage(playerid, 0xFFFFFFFF, "You finished editing an attached object");
+    
+    return 1;
+}

BIN
samp03/filterscripts/base.amx


+ 151 - 0
samp03/filterscripts/base.pwn

@@ -0,0 +1,151 @@
+//
+// Base FS
+// Contains /pm /kick /ban commands.
+//
+
+#include <a_samp>
+#include "../include/gl_common.inc"
+
+#define ADMINFS_MESSAGE_COLOR 0xFF444499
+#define PM_INCOMING_COLOR     0xFFFF22AA
+#define PM_OUTGOING_COLOR     0xFFCC2299
+
+//------------------------------------------------
+
+public OnFilterScriptInit()
+{
+	print("\n--Base FS loaded.\n");
+	return 1;
+}
+
+//------------------------------------------------
+
+public OnPlayerCommandText(playerid, cmdtext[])
+{
+	new cmd[256];
+	new	tmp[256];
+	new Message[256];
+	new gMessage[256];
+	new pName[MAX_PLAYER_NAME+1];
+	new iName[MAX_PLAYER_NAME+1];
+	new	idx;
+	
+	cmd = strtok(cmdtext, idx);
+
+	// PM Command
+	if(strcmp("/pm", cmd, true) == 0)
+	{
+		tmp = strtok(cmdtext,idx);
+		
+		if(!strlen(tmp) || strlen(tmp) > 5) {
+			SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"Usage: /pm (id) (message)");
+			return 1;
+		}
+		
+		new id = strval(tmp);
+        gMessage = strrest(cmdtext,idx);
+        
+		if(!strlen(gMessage)) {
+			SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"Usage: /pm (id) (message)");
+			return 1;
+		}
+		
+		if(!IsPlayerConnected(id)) {
+			SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"/pm : Bad player ID");
+			return 1;
+		}
+		
+		if(playerid != id) {
+			GetPlayerName(id,iName,sizeof(iName));
+			GetPlayerName(playerid,pName,sizeof(pName));
+			format(Message,sizeof(Message),">> %s(%d): %s",iName,id,gMessage);
+			SendClientMessage(playerid,PM_OUTGOING_COLOR,Message);
+			format(Message,sizeof(Message),"** %s(%d): %s",pName,playerid,gMessage);
+			SendClientMessage(id,PM_INCOMING_COLOR,Message);
+			PlayerPlaySound(id,1085,0.0,0.0,0.0);
+			
+			printf("PM: %s",Message);
+			
+		}
+		else {
+			SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"You cannot PM yourself");
+		}
+		return 1;
+	}
+
+	//Kick Command
+	if(strcmp("/kick", cmd, true) == 0)
+	{
+	    if(IsPlayerAdmin(playerid)) {
+			tmp = strtok(cmdtext,idx);
+			if(!strlen(tmp) || strlen(tmp) > 5) {
+				return SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"Usage: /kick (id) [reason]");
+			}
+			
+			new id = strval(tmp);
+
+			if(!IsPlayerConnected(id)) {
+				SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"/kick : Bad player ID");
+				return 1;
+			}
+			
+			gMessage = strrest(cmdtext,idx);
+			
+			GetPlayerName(id,iName,sizeof(iName));
+			SendClientMessage(id,ADMINFS_MESSAGE_COLOR,"-- You have been kicked from the server.");
+
+			if(strlen(gMessage) > 0) {
+				format(Message,sizeof(Message),"Reason: %s",gMessage);
+				SendClientMessage(id,ADMINFS_MESSAGE_COLOR,Message);
+			}
+			
+			format(Message,sizeof(Message),">> %s(%d) has been kicked.",iName,id);
+			SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,Message);
+			
+			Kick(id);
+			return 1;
+		} else {
+            SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"/kick : You are not an admin");
+			return 1;
+		}
+	}
+
+	//Ban Command
+	if(strcmp("/ban", cmd, true) == 0)
+	{
+	    if(IsPlayerAdmin(playerid)) {
+			tmp = strtok(cmdtext,idx);
+			if(!strlen(tmp) || strlen(tmp) > 5) {
+				return SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"Usage: /ban (id) [reason]");
+			}
+
+			new id = strval(tmp);
+
+			if(!IsPlayerConnected(id)) {
+				SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"/ban : Bad player ID");
+				return 1;
+			}
+
+			gMessage = strrest(cmdtext,idx);
+
+			GetPlayerName(id,iName,sizeof(iName));
+			SendClientMessage(id,ADMINFS_MESSAGE_COLOR,"-- You have been banned from the server.");
+
+			if(strlen(gMessage) > 0) {
+				format(Message,sizeof(Message),"Reason: %s",gMessage);
+				SendClientMessage(id,ADMINFS_MESSAGE_COLOR,Message);
+			}
+
+			format(Message,sizeof(Message),">> %s(%d) has been banned.",iName,id);
+			SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,Message);
+
+			Ban(id);
+			return 1;
+		} else {
+            SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"/ban : You are not an admin");
+			return 1;
+		}
+	}
+	
+	return 0;
+}

BIN
samp03/filterscripts/baseaf.amx


+ 234 - 0
samp03/filterscripts/baseaf.pwn

@@ -0,0 +1,234 @@
+//
+// Base FS for Sanandreas Multiplayer 0.3
+// Contains /pm /kick /ban commands - it also features
+// a basic anti flood system, and admin chatting for rcon admins
+// using # <message>
+
+#include <a_samp>
+#include "../include/gl_common.inc"
+
+#define ADMINFS_MESSAGE_COLOR 0xFF444499
+#define PM_INCOMING_COLOR     0xFFFF22AA
+#define PM_OUTGOING_COLOR     0xFFCC2299
+
+static iPlayerChatTime[MAX_PLAYERS];
+static szPlayerChatMsg[MAX_PLAYERS][128];
+
+//------------------------------------------------
+
+stock IsPlayerFlooding(playerid)
+{
+	if(GetTickCount() - iPlayerChatTime[playerid] < 2000)
+	    return 1;
+
+	return 0;
+}
+
+//------------------------------------------------
+
+public OnFilterScriptInit()
+{
+	print("\n--Base FS loaded.\n");
+	return 1;
+}
+
+//------------------------------------------------
+
+public OnPlayerText(playerid, text[])
+{
+	// Is the player flooding?
+	if(IsPlayerFlooding(playerid) && !IsPlayerAdmin(playerid))
+	{
+	    SendClientMessage(playerid, 0xFF0000FF, "* You can only send a message once every two seconds.");
+	    return 0;
+	}
+
+	// Now we handle the admin chat, will be #<message>.
+	if( (text[0] == '#' || text[0] == '@') && strlen(text) > 1)
+	{
+		new str[128];
+		new szPlayerName[MAX_PLAYER_NAME];
+		GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
+
+		if(IsPlayerAdmin(playerid))
+		{
+		    format(str, 128, "Admin %s: %s", szPlayerName, text[1]);
+
+			for(new iPlayerID; iPlayerID < MAX_PLAYERS; iPlayerID++)
+			{
+				if(!IsPlayerConnected(iPlayerID)) continue;
+		    	if(!IsPlayerAdmin(iPlayerID)) continue;
+			    SendClientMessage(iPlayerID, PM_INCOMING_COLOR, str);
+			}
+		}
+
+		return 0;
+	}
+
+	// Okay, now it's time for anti repeating.
+	if(!IsPlayerAdmin(playerid))
+	{
+		if(strlen(text) == strlen(szPlayerChatMsg[playerid]) && !strcmp(szPlayerChatMsg[playerid], text,  false))
+		{
+			SendClientMessage(playerid, 0xFF0000FF, "* Please do not repeat yourself.");
+			format(szPlayerChatMsg[playerid], 128, "%s", text);
+		    return 0;
+		}
+	}
+
+	format(szPlayerChatMsg[playerid], 128, "%s", text);
+    iPlayerChatTime[playerid] = GetTickCount();
+    return 1;
+}
+
+//------------------------------------------------
+
+public OnPlayerDisconnect(playerid, reason)
+{
+	#pragma unused reason
+
+	iPlayerChatTime[playerid] = 0;
+	szPlayerChatMsg[playerid] = "";
+	return 1;
+}
+
+//------------------------------------------------
+
+public OnPlayerCommandText(playerid, cmdtext[])
+{
+	if(IsPlayerFlooding(playerid) && !IsPlayerAdmin(playerid))
+	{
+		SendClientMessage(playerid, 0xFF0000FF, "* You can only use commands once every two seconds.");
+	    return 1;
+	}
+
+	iPlayerChatTime[playerid] = GetTickCount();
+
+	new cmd[256];
+	new	tmp[256];
+	new Message[256];
+	new gMessage[256];
+	new pName[MAX_PLAYER_NAME+1];
+	new iName[MAX_PLAYER_NAME+1];
+	new	idx;
+
+	cmd = strtok(cmdtext, idx);
+
+	// PM Command
+	if(strcmp("/pm", cmd, true) == 0)
+	{
+		tmp = strtok(cmdtext,idx);
+
+		if(!strlen(tmp) || strlen(tmp) > 5) {
+			SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"Usage: /pm (id) (message)");
+			return 1;
+		}
+
+		new id = strval(tmp);
+        gMessage = strrest(cmdtext,idx);
+
+		if(!strlen(gMessage)) {
+			SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"Usage: /pm (id) (message)");
+			return 1;
+		}
+
+		if(!IsPlayerConnected(id)) {
+			SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"/pm : Bad player ID");
+		}
+
+		if(playerid != id) {
+			GetPlayerName(id,iName,sizeof(iName));
+			GetPlayerName(playerid,pName,sizeof(pName));
+			format(Message,sizeof(Message),">> %s(%d): %s",iName,id,gMessage);
+			SendClientMessage(playerid,PM_OUTGOING_COLOR,Message);
+			format(Message,sizeof(Message),"** %s(%d): %s",pName,playerid,gMessage);
+			SendClientMessage(id,PM_INCOMING_COLOR,Message);
+			PlayerPlaySound(id,1085,0.0,0.0,0.0);
+
+			printf("PM: %s",Message);
+
+		}
+		else {
+			SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"You cannot PM yourself");
+		}
+		return 1;
+	}
+
+	//Kick Command
+	if(strcmp("/kick", cmd, true) == 0)
+	{
+	    if(IsPlayerAdmin(playerid)) {
+			tmp = strtok(cmdtext,idx);
+			if(!strlen(tmp) || strlen(tmp) > 5) {
+				return SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"Usage: /kick (id) [reason]");
+			}
+
+			new id = strval(tmp);
+
+			if(!IsPlayerConnected(id)) {
+				SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"/kick : Bad player ID");
+				return 1;
+			}
+
+			gMessage = strrest(cmdtext,idx);
+
+			GetPlayerName(id,iName,sizeof(iName));
+			SendClientMessage(id,ADMINFS_MESSAGE_COLOR,"-- You have been kicked from the server.");
+
+			if(strlen(gMessage) > 0) {
+				format(Message,sizeof(Message),"Reason: %s",gMessage);
+				SendClientMessage(id,ADMINFS_MESSAGE_COLOR,Message);
+			}
+
+			format(Message,sizeof(Message),">> %s(%d) has been kicked.",iName,id);
+			SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,Message);
+
+			Kick(id);
+			return 1;
+		} else {
+            SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"/kick : You are not an admin");
+			return 1;
+		}
+	}
+
+	//Ban Command
+	if(strcmp("/ban", cmd, true) == 0)
+	{
+	    if(IsPlayerAdmin(playerid)) {
+			tmp = strtok(cmdtext,idx);
+			if(!strlen(tmp) || strlen(tmp) > 5) {
+				return SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"Usage: /ban (id) [reason]");
+			}
+
+			new id = strval(tmp);
+
+			if(!IsPlayerConnected(id)) {
+				SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"/ban : Bad player ID");
+				return 1;
+			}
+
+			gMessage = strrest(cmdtext,idx);
+
+			GetPlayerName(id,iName,sizeof(iName));
+			SendClientMessage(id,ADMINFS_MESSAGE_COLOR,"-- You have been banned from the server.");
+
+			if(strlen(gMessage) > 0) {
+				format(Message,sizeof(Message),"Reason: %s",gMessage);
+				SendClientMessage(id,ADMINFS_MESSAGE_COLOR,Message);
+			}
+
+			format(Message,sizeof(Message),">> %s(%d) has been banned.",iName,id);
+			SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,Message);
+
+			Ban(id);
+			return 1;
+		} else {
+            SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"/ban : You are not an admin");
+			return 1;
+		}
+	}
+
+	return 0;
+}
+
+//-----------------------------------------------

BIN
samp03/filterscripts/cargoship.amx


+ 216 - 0
samp03/filterscripts/cargoship.pwn

@@ -0,0 +1,216 @@
+//
+// Used for testing interpolated rotations with MoveObject
+// Also used to test AttachObjectToObject
+// A cargo ship goes around and visits some route points
+//
+// SA-MP 0.3d and above
+//
+// - Kye 2011
+//
+
+#include <a_samp>
+#include "../include/gl_common.inc" // for PlaySoundForPlayersInRange()
+
+#define NUM_SHIP_ROUTE_POINTS   25
+#define SHIP_HULL_ID          	9585 // massive cargo ship's hull. This is used as the main object
+#define SHIP_MOVE_SPEED         10.0
+#define SHIP_DRAW_DISTANCE      300.0
+
+#define NUM_SHIP_ATTACHMENTS 10
+
+new Float:gShipHullOrigin[3] =
+{ -2409.8438, 1544.9453, 7.0000 }; // so we can convert world space to model space for attachment positions
+
+new gShipAttachmentModelIds[NUM_SHIP_ATTACHMENTS] = {
+9586, // Ship main platform
+9761, // Ship rails
+9584, // Bridge exterior
+9698, // Bridge interior
+9821, // Bridge interior doors
+9818, // Bridge radio desk
+9819, // Captain's desk
+9822, // Captain's seat
+9820, // Bridge ducts and lights
+9590  // Cargo bay area
+};
+
+new Float:gShipAttachmentPos[NUM_SHIP_ATTACHMENTS][3] = {
+// these are world space positions used on the original cargo ship in the game
+// they will be converted to model space before attaching
+{-2412.1250, 1544.9453, 17.0469},
+{-2411.3906, 1544.9453, 27.0781},
+{-2485.0781, 1544.9453, 26.1953},
+{-2473.5859, 1543.7734, 29.0781},
+{-2474.3594, 1547.2422, 24.7500},
+{-2470.2656, 1544.9609, 33.8672},
+{-2470.4531, 1551.1172, 33.1406},
+{-2470.9375, 1550.7500, 32.9063},
+{-2474.6250, 1545.0859, 33.0625},
+{-2403.5078, 1544.9453, 8.7188}
+};
+
+// Pirate ship route points (position/rotation)
+new Float:gShipRoutePoints[NUM_SHIP_ROUTE_POINTS][6] = {
+{-1982.57, 2052.56, 0.00,   0.00, 0.00, 144.84},
+{-2178.63, 2103.67, 0.00,   0.00, 0.00, 189.24},
+{-2366.64, 2020.28, 0.00,   0.00, 0.00, 215.22},
+{-2539.06, 1892.52, 0.00,   0.00, 0.00, 215.22},
+{-2722.79, 1787.85, 0.00,   0.00, 0.00, 205.62},
+{-2918.51, 1729.60, 0.00,   0.00, 0.00, 190.50},
+{-3124.70, 1758.03, 0.00,   0.00, 0.00, 156.36},
+{-3316.51, 1850.08, 0.00,   0.00, 0.00, 153.36},
+{-3541.12, 1977.99, 0.00,   0.00, 0.00, 145.74},
+{-3772.54, 2140.70, 0.00,   0.00, 0.00, 144.96},
+{-4078.78, 2272.93, 0.00,   0.00, 0.00, 167.52},
+{-4382.22, 2222.52, 0.00,   0.36, 0.06, 206.70},
+{-4578.11, 2013.70, 0.00,   0.36, 0.54, 244.80},
+{-4603.54, 1718.89, 0.00,   1.92, -0.36, 283.26},
+{-4463.49, 1504.50, 0.00,   0.92, -0.36, 316.32},
+{-4228.00, 1380.52, 0.00,   0.92, -0.36, 342.54},
+{-3950.14, 1346.96, 0.00,   0.02, -0.06, 359.64},
+{-3646.69, 1344.57, 0.00,   0.02, -0.06, 359.64},
+{-3350.01, 1410.39, 0.00,   0.02, -0.06, 384.48},
+{-2854.63, 1651.56, 0.00,   0.02, -0.06, 378.54},
+{-2590.84, 1667.61, 0.00,   0.02, -0.06, 356.28},
+{-2345.84, 1633.19, 0.00,   0.02, -0.06, 350.28},
+{-2106.14, 1639.23, 0.00,   0.02, -0.06, 378.36},
+{-1943.63, 1743.98, 0.00,   0.02, -0.06, 411.42},
+{-1891.39, 1907.57, 0.00,   0.02, -0.06, 457.14}
+};
+
+
+new gShipCurrentPoint = 1; // current route point the ship is at. We start at route 1
+
+// SA-MP objects
+new gMainShipObjectId;
+new gShipsAttachments[NUM_SHIP_ROUTE_POINTS];
+
+forward StartMovingTimer();
+
+//-------------------------------------------------
+
+public StartMovingTimer()
+{
+	MoveObject(gMainShipObjectId,gShipRoutePoints[gShipCurrentPoint][0],
+	                           gShipRoutePoints[gShipCurrentPoint][1],
+							   gShipRoutePoints[gShipCurrentPoint][2],
+							   SHIP_MOVE_SPEED / 2.0, // slower for the first route
+							   gShipRoutePoints[gShipCurrentPoint][3],
+							   gShipRoutePoints[gShipCurrentPoint][4],
+							   gShipRoutePoints[gShipCurrentPoint][5]);
+}
+
+//-------------------------------------------------
+
+public OnFilterScriptInit()
+{
+	gMainShipObjectId = CreateObject(SHIP_HULL_ID, gShipRoutePoints[0][0], gShipRoutePoints[0][1], gShipRoutePoints[0][2],
+									gShipRoutePoints[0][3], gShipRoutePoints[0][4], gShipRoutePoints[0][5], SHIP_DRAW_DISTANCE);
+
+	new x=0;
+	while(x != NUM_SHIP_ATTACHMENTS) {
+	    gShipsAttachments[x] = CreateObject(gShipAttachmentModelIds[x], 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, SHIP_DRAW_DISTANCE);
+		AttachObjectToObject(gShipsAttachments[x], gMainShipObjectId,
+					gShipAttachmentPos[x][0] - gShipHullOrigin[0],
+					gShipAttachmentPos[x][1] - gShipHullOrigin[1],
+					gShipAttachmentPos[x][2] - gShipHullOrigin[2],
+					0.0, 0.0, 0.0);
+		x++;
+	}
+
+  	SetTimer("StartMovingTimer",30*1000,0); // pause at route 0 for 30 seconds
+
+	return 1;
+}
+
+//-------------------------------------------------
+
+public OnFilterScriptExit()
+{
+    DestroyObject(gMainShipObjectId);
+    new x=0;
+	while(x != NUM_SHIP_ATTACHMENTS) {
+	    DestroyObject(gShipsAttachments[x]);
+		x++;
+	}
+	return 1;
+}
+
+//-------------------------------------------------
+
+public OnObjectMoved(objectid)
+{
+	if(objectid != gMainShipObjectId) return 0;
+	
+	if(gShipCurrentPoint > 0 && !(gShipCurrentPoint % 5)) {
+	    // play some seagulls audio every 5 points
+		PlaySoundForPlayersInRange(6200, 200.0, gShipRoutePoints[gShipCurrentPoint][0],
+						gShipRoutePoints[gShipCurrentPoint][1],
+						gShipRoutePoints[gShipCurrentPoint][2]);
+	}
+						
+    gShipCurrentPoint++;
+    
+    if(gShipCurrentPoint == NUM_SHIP_ROUTE_POINTS) {
+		gShipCurrentPoint = 0;
+
+   		MoveObject(gMainShipObjectId,gShipRoutePoints[gShipCurrentPoint][0],
+	                           gShipRoutePoints[gShipCurrentPoint][1],
+							   gShipRoutePoints[gShipCurrentPoint][2],
+							   SHIP_MOVE_SPEED / 2.0, // slower for the last route
+							   gShipRoutePoints[gShipCurrentPoint][3],
+							   gShipRoutePoints[gShipCurrentPoint][4],
+							   gShipRoutePoints[gShipCurrentPoint][5]);
+        return 1;
+	}
+	
+	if(gShipCurrentPoint == 1) {
+	    // Before heading to the first route we should wait a bit
+	    SetTimer("StartMovingTimer",30*1000,0); // pause at route 0 for 30 seconds
+		return 1;
+	}
+
+	/*
+    new tempdebug[256+1];
+    format(tempdebug,256,"The ship is at route: %d", gShipCurrentPoint);
+    SendClientMessageToAll(0xFFFFFFFF,tempdebug);*/
+    
+    MoveObject(gMainShipObjectId,gShipRoutePoints[gShipCurrentPoint][0],
+	                           gShipRoutePoints[gShipCurrentPoint][1],
+							   gShipRoutePoints[gShipCurrentPoint][2],
+							   SHIP_MOVE_SPEED,
+							   gShipRoutePoints[gShipCurrentPoint][3],
+							   gShipRoutePoints[gShipCurrentPoint][4],
+							   gShipRoutePoints[gShipCurrentPoint][5]);
+
+ 	return 1;
+}
+
+//-------------------------------------------------
+
+public OnPlayerCommandText(playerid, cmdtext[])
+{
+    new cmd[256];
+	new idx;
+	cmd = strtok(cmdtext, idx);
+	
+	if(strcmp(cmd, "/boardship", true) == 0) {
+  	    if(gShipCurrentPoint != 1) {
+  	        SendClientMessage(playerid, 0xFFFF0000, "The ship can't be boarded right now");
+  	        return 1;
+		}
+  	    SetPlayerPos(playerid,-1937.7816,2017.7969,16.6640);
+	    return 1;
+	}
+	
+	if(strcmp(cmd, "/stopship", true) == 0) {
+        StopObject(gMainShipObjectId);
+	    return 1;
+	}
+	
+	return 0;
+}
+
+//-------------------------------------------------
+
+

BIN
samp03/filterscripts/dillimore_gas.amx


+ 161 - 0
samp03/filterscripts/dillimore_gas.pwn

@@ -0,0 +1,161 @@
+// -----------------------------------------------------------------------------
+// Example Filterscript for the Dillimore Gas Station Objects
+// ----------------------------------------------------------
+// By Matite in March 2015
+//
+//
+// This script creates the edited Dillimore Gas Station Building objects and
+// removes the existing GTASA building objects.
+//
+// Warning...
+// This script uses a total of:
+// * 2 objects = 1 for the replacement building exterior object and 1 for the
+//   the replacement building interior object
+// * Enables the /dgs command to teleport the player to the Dillimore Gas Station
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+
+
+// -----------------------------------------------------------------------------
+// Includes
+// --------
+
+// SA-MP include
+#include <a_samp>
+
+
+// -----------------------------------------------------------------------------
+// Defines
+// -------
+
+// Used for messages sent to the player
+#define COLOR_MESSAGE_YELLOW        0xFFDD00AA
+
+
+// -----------------------------------------------------------------------------
+// Variables
+// ---------
+
+// Stores the created object numbers of the replacement building objects so
+// they can be destroyed when the filterscript is unloaded
+new DillimoreGasObject1; // Building exterior object
+new DillimoreGasObject2; // Building interior object
+
+
+// -----------------------------------------------------------------------------
+// Callbacks
+// ---------
+
+public OnPlayerCommandText(playerid, cmdtext[])
+{
+	// Check command text
+	if (strcmp("/dgs", cmdtext, true, 4) == 0)
+	{
+	    // Set the interior
+		SetPlayerInterior(playerid, 0);
+
+		// Set player position and facing angle
+		SetPlayerPos(playerid, 658.37, -573.90, 16.8);
+		SetPlayerFacingAngle(playerid, 280);
+
+		// Fix camera position after teleporting
+		SetCameraBehindPlayer(playerid);
+
+		// Send a gametext message to the player
+		GameTextForPlayer(playerid, "~b~~h~Dillimore Gas Station!", 3000, 3);
+
+	    // Exit here
+	    return 1;
+	}
+
+	// Exit here (return 0 as the command was not handled in this filterscript)
+	return 0;
+}
+
+public OnFilterScriptInit()
+{
+    // Display information in the Server Console
+	print("\n");
+	print("  |---------------------------------------------------");
+	print("  |--- Dillimore Gas Station Filterscript");
+    print("  |--  Script v1.01");
+    print("  |--  3rd March 2015");
+	print("  |---------------------------------------------------");
+
+	// Create the Dillimore Gas Station exterior object
+    DillimoreGasObject1 = CreateObject(19876, 666.711, -565.133, 17.3359, 0, 0, 0);
+
+    // Display information in the Server Console
+    print("  |--  Dillimore Gas Station exterior object created");
+
+    // Create the Dillimore Gas Station interior object
+    DillimoreGasObject2 = CreateObject(19877, 666.492, -571.18, 17.3125, 0, 0, 0);
+
+    // Display information in the Server Console
+    print("  |--  Dillimore Gas Station interior object created");
+	print("  |---------------------------------------------------");
+
+	// Loop
+    for (new i = 0; i < MAX_PLAYERS; i++)
+    {
+        // Check if the player is connected and not a NPC
+        if (IsPlayerConnected(i) && !IsPlayerNPC(i))
+        {
+            // Remove default GTASA Dillimore Gas Station Building exterior, interior
+			// and LOD map objects for the player
+            // (so any player currently ingame does not have to rejoin for them
+			//  to be removed when this filterscript is loaded)
+			RemoveBuildingForPlayer(i, 12853, 666.711, -565.133, 17.3359, 250.0); 	// Building exterior
+			RemoveBuildingForPlayer(i, 12854, 666.492, -571.18, 17.3125, 250.0); 	// Building interior
+			RemoveBuildingForPlayer(i, 13245, 666.711, -565.133, 17.3359, 250.0); 	// LOD
+        }
+    }
+
+	// Exit here
+	return 1;
+}
+
+public OnFilterScriptExit()
+{
+    // Check for valid object
+	if (IsValidObject(DillimoreGasObject1))
+	{
+		// Destroy the Dillimore Gas Station exterior object
+		DestroyObject(DillimoreGasObject1);
+
+		// Display information in the Server Console
+		print("  |---------------------------------------------------");
+    	print("  |--  Dillimore Gas Station exterior object destroyed");
+    }
+    
+    // Check for valid object
+	if (IsValidObject(DillimoreGasObject2))
+	{
+		// Destroy the Dillimore Gas Station interior object
+		DestroyObject(DillimoreGasObject2);
+
+		// Display information in the Server Console
+    	print("  |--  Dillimore Gas Station interior object destroyed");
+    }
+
+   	// Display information in the Server Console
+	print("  |---------------------------------------------------");
+	print("  |--  Dillimore Gas Station Filterscript Unloaded");
+	print("  |---------------------------------------------------");
+
+    // Exit here
+	return 1;
+}
+
+public OnPlayerConnect(playerid)
+{
+    // Remove default GTASA Dillimore Gas Station Building exterior, interior
+	// and LOD map objects for the player
+	RemoveBuildingForPlayer(playerid, 12853, 666.711, -565.133, 17.3359, 250.0); 	// Building exterior
+	RemoveBuildingForPlayer(playerid, 12854, 666.492, -571.18, 17.3125, 250.0); 	// Building interior
+	RemoveBuildingForPlayer(playerid, 13245, 666.711, -565.133, 17.3359, 250.0); 	// LOD
+
+	// Exit here (return 1 so this callback is handled in other scripts too)
+	return 1;
+}
+

BIN
samp03/filterscripts/ferriswheel.amx


+ 135 - 0
samp03/filterscripts/ferriswheel.pwn

@@ -0,0 +1,135 @@
+//
+// Used for testing interpolated rotations with MoveObject
+// Also used to test AttachObjectToObject
+// The other ferris wheel (that actually spins!)
+// Located on the opposite peer at LS
+//
+// SA-MP 0.3d and above
+//
+// - Kye 2011
+//
+
+#include <a_samp>
+#include "../include/gl_common.inc" // for PlaySoundForPlayersInRange()
+
+#define NUM_FERRIS_CAGES        10
+#define FERRIS_WHEEL_ID         18877
+#define FERRIS_CAGE_ID          18879
+#define FERRIS_BASE_ID          18878
+#define FERRIS_DRAW_DISTANCE    300.0
+#define FERRIS_WHEEL_SPEED      0.01
+
+#define FERRIS_WHEEL_Z_ANGLE  	-90.0 // This is the heading the entire ferris wheel is at (beware of gimbal lock)
+
+new Float:gFerrisOrigin[3] = {832.8393, -2046.1990, 27.0900};
+
+// Cage offsets for attaching to the main wheel
+new Float:gFerrisCageOffsets[NUM_FERRIS_CAGES][3] = {
+{0.0699, 0.0600, -11.7500},
+{-6.9100, -0.0899, -9.5000},
+{11.1600, 0.0000, -3.6300},
+{-11.1600, -0.0399, 3.6499},
+{-6.9100, -0.0899, 9.4799},
+{0.0699, 0.0600, 11.7500},
+{6.9599, 0.0100, -9.5000},
+{-11.1600, -0.0399, -3.6300},
+{11.1600, 0.0000, 3.6499},
+{7.0399, -0.0200, 9.3600}
+};
+
+// SA-MP objects
+new gFerrisWheel;
+new gFerrisBase;
+new gFerrisCages[NUM_FERRIS_CAGES];
+
+forward RotateWheel();
+
+//-------------------------------------------------
+
+new Float:gCurrentTargetYAngle = 0.0; // Angle of the Y axis of the wheel to rotate to.
+new gWheelTransAlternate = 0; // Since MoveObject requires some translation target to intepolate
+						    // rotation, the world pos target is alternated by a small amount.
+						    
+UpdateWheelTarget()
+{
+    gCurrentTargetYAngle += 36.0; // There are 10 carts, so 360 / 10
+    if(gCurrentTargetYAngle >= 360.0) {
+		gCurrentTargetYAngle = 0.0;
+    }
+	if(gWheelTransAlternate) gWheelTransAlternate = 0;
+	else gWheelTransAlternate = 1;
+}
+
+//-------------------------------------------------
+
+public RotateWheel()
+{
+    UpdateWheelTarget();
+    
+    new Float:fModifyWheelZPos = 0.0;
+    if(gWheelTransAlternate) fModifyWheelZPos = 0.05;
+    
+    MoveObject( gFerrisWheel, gFerrisOrigin[0], gFerrisOrigin[1], gFerrisOrigin[2]+fModifyWheelZPos,
+				FERRIS_WHEEL_SPEED, 0.0, gCurrentTargetYAngle, FERRIS_WHEEL_Z_ANGLE );
+}
+
+//-------------------------------------------------
+
+public OnFilterScriptInit()
+{
+	gFerrisWheel = CreateObject( FERRIS_WHEEL_ID, gFerrisOrigin[0], gFerrisOrigin[1], gFerrisOrigin[2],
+	  							 0.0, 0.0, FERRIS_WHEEL_Z_ANGLE, FERRIS_DRAW_DISTANCE );
+
+    gFerrisBase = CreateObject( FERRIS_BASE_ID, gFerrisOrigin[0], gFerrisOrigin[1], gFerrisOrigin[2],
+	  							 0.0, 0.0, FERRIS_WHEEL_Z_ANGLE, FERRIS_DRAW_DISTANCE );
+	  							 
+	new x=0;
+	while(x != NUM_FERRIS_CAGES) {
+        gFerrisCages[x] = CreateObject( FERRIS_CAGE_ID, gFerrisOrigin[0], gFerrisOrigin[1], gFerrisOrigin[2],
+	  							 0.0, 0.0, FERRIS_WHEEL_Z_ANGLE, FERRIS_DRAW_DISTANCE );
+	  							 
+        AttachObjectToObject( gFerrisCages[x], gFerrisWheel,
+							  gFerrisCageOffsets[x][0],
+							  gFerrisCageOffsets[x][1],
+	  						  gFerrisCageOffsets[x][2],
+							  0.0, 0.0, FERRIS_WHEEL_Z_ANGLE, 0 );
+					
+		x++;
+	}
+	
+	SetTimer("RotateWheel",3*1000,0);
+
+	return 1;
+}
+
+//-------------------------------------------------
+
+public OnFilterScriptExit()
+{
+	new x=0;
+	
+    DestroyObject(gFerrisWheel);
+    DestroyObject(gFerrisBase);
+    
+	x=0;
+	while(x != NUM_FERRIS_CAGES) {
+	    DestroyObject(gFerrisCages[x]);
+		x++;
+	}
+
+	return 1;
+}
+
+//-------------------------------------------------
+
+public OnObjectMoved(objectid)
+{
+    if(objectid != gFerrisWheel) return 0;
+    
+    SetTimer("RotateWheel",3*1000,0);
+    return 1;
+}
+
+//-------------------------------------------------
+
+

BIN
samp03/filterscripts/flymode.amx


+ 265 - 0
samp03/filterscripts/flymode.pwn

@@ -0,0 +1,265 @@
+//-------------------------------------------------
+//
+// This is an example of using the AttachCameraToObject function
+// to create a no-clip flying camera.
+//
+// h02 2012
+//
+// SA-MP 0.3e and above
+//
+//-------------------------------------------------
+
+#include <a_samp>
+
+// Players Move Speed
+#define MOVE_SPEED              100.0
+#define ACCEL_RATE              0.03
+
+// Players Mode
+#define CAMERA_MODE_NONE    	0
+#define CAMERA_MODE_FLY     	1
+
+// Key state definitions
+#define MOVE_FORWARD    		1
+#define MOVE_BACK       		2
+#define MOVE_LEFT       		3
+#define MOVE_RIGHT      		4
+#define MOVE_FORWARD_LEFT       5
+#define MOVE_FORWARD_RIGHT      6
+#define MOVE_BACK_LEFT          7
+#define MOVE_BACK_RIGHT         8
+
+// Enumeration for storing data about the player
+enum noclipenum
+{
+	cameramode,
+	flyobject,
+	mode,
+	lrold,
+	udold,
+	lastmove,
+	Float:accelmul
+}
+new noclipdata[MAX_PLAYERS][noclipenum];
+
+//--------------------------------------------------
+
+public OnFilterScriptExit()
+{
+	// If any players are still in edit mode, boot them out before the filterscript unloads
+	for(new x; x<MAX_PLAYERS; x++)
+	{
+		if(noclipdata[x][cameramode] == CAMERA_MODE_FLY) CancelFlyMode(x);
+	}
+	return 1;
+}
+
+//--------------------------------------------------
+
+public OnPlayerConnect(playerid)
+{
+	// Reset the data belonging to this player slot
+	noclipdata[playerid][cameramode] 	= CAMERA_MODE_NONE;
+	noclipdata[playerid][lrold]	   	 	= 0;
+	noclipdata[playerid][udold]   		= 0;
+	noclipdata[playerid][mode]   		= 0;
+	noclipdata[playerid][lastmove]   	= 0;
+	noclipdata[playerid][accelmul]   	= 0.0;
+	return 1;
+}
+
+//--------------------------------------------------
+
+public OnPlayerCommandText(playerid, cmdtext[])
+{
+	if(!strcmp(cmdtext, "/flymode", true))
+	{
+	    // Place the player in and out of edit mode
+		if(GetPVarType(playerid, "FlyMode")) CancelFlyMode(playerid);
+		else FlyMode(playerid);
+		return 1;
+	}
+	return 0;
+}
+
+//--------------------------------------------------
+
+public OnPlayerUpdate(playerid)
+{
+	if(noclipdata[playerid][cameramode] == CAMERA_MODE_FLY)
+	{
+		new keys,ud,lr;
+		GetPlayerKeys(playerid,keys,ud,lr);
+
+		if(noclipdata[playerid][mode] && (GetTickCount() - noclipdata[playerid][lastmove] > 100))
+		{
+		    // If the last move was > 100ms ago, process moving the object the players camera is attached to
+		    MoveCamera(playerid);
+		}
+
+		// Is the players current key state different than their last keystate?
+		if(noclipdata[playerid][udold] != ud || noclipdata[playerid][lrold] != lr)
+		{
+			if((noclipdata[playerid][udold] != 0 || noclipdata[playerid][lrold] != 0) && ud == 0 && lr == 0)
+			{   // All keys have been released, stop the object the camera is attached to and reset the acceleration multiplier
+				StopPlayerObject(playerid, noclipdata[playerid][flyobject]);
+				noclipdata[playerid][mode]      = 0;
+				noclipdata[playerid][accelmul]  = 0.0;
+			}
+			else
+			{   // Indicates a new key has been pressed
+
+			    // Get the direction the player wants to move as indicated by the keys
+				noclipdata[playerid][mode] = GetMoveDirectionFromKeys(ud, lr);
+
+				// Process moving the object the players camera is attached to
+				MoveCamera(playerid);
+			}
+		}
+		noclipdata[playerid][udold] = ud; noclipdata[playerid][lrold] = lr; // Store current keys pressed for comparison next update
+		return 0;
+	}
+	return 1;
+}
+
+//--------------------------------------------------
+
+stock GetMoveDirectionFromKeys(ud, lr)
+{
+	new direction = 0;
+	
+    if(lr < 0)
+	{
+		if(ud < 0) 		direction = MOVE_FORWARD_LEFT; 	// Up & Left key pressed
+		else if(ud > 0) direction = MOVE_BACK_LEFT; 	// Back & Left key pressed
+		else            direction = MOVE_LEFT;          // Left key pressed
+	}
+	else if(lr > 0) 	// Right pressed
+	{
+		if(ud < 0)      direction = MOVE_FORWARD_RIGHT;  // Up & Right key pressed
+		else if(ud > 0) direction = MOVE_BACK_RIGHT;     // Back & Right key pressed
+		else			direction = MOVE_RIGHT;          // Right key pressed
+	}
+	else if(ud < 0) 	direction = MOVE_FORWARD; 	// Up key pressed
+	else if(ud > 0) 	direction = MOVE_BACK;		// Down key pressed
+	
+	return direction;
+}
+
+//--------------------------------------------------
+
+stock MoveCamera(playerid)
+{
+	new Float:FV[3], Float:CP[3];
+	GetPlayerCameraPos(playerid, CP[0], CP[1], CP[2]);          // 	Cameras position in space
+    GetPlayerCameraFrontVector(playerid, FV[0], FV[1], FV[2]);  //  Where the camera is looking at
+
+	// Increases the acceleration multiplier the longer the key is held
+	if(noclipdata[playerid][accelmul] <= 1) noclipdata[playerid][accelmul] += ACCEL_RATE;
+
+	// Determine the speed to move the camera based on the acceleration multiplier
+	new Float:speed = MOVE_SPEED * noclipdata[playerid][accelmul];
+
+	// Calculate the cameras next position based on their current position and the direction their camera is facing
+	new Float:X, Float:Y, Float:Z;
+	GetNextCameraPosition(noclipdata[playerid][mode], CP, FV, X, Y, Z);
+	MovePlayerObject(playerid, noclipdata[playerid][flyobject], X, Y, Z, speed);
+
+	// Store the last time the camera was moved as now
+	noclipdata[playerid][lastmove] = GetTickCount();
+	return 1;
+}
+
+//--------------------------------------------------
+
+stock GetNextCameraPosition(move_mode, Float:CP[3], Float:FV[3], &Float:X, &Float:Y, &Float:Z)
+{
+    // Calculate the cameras next position based on their current position and the direction their camera is facing
+    #define OFFSET_X (FV[0]*6000.0)
+	#define OFFSET_Y (FV[1]*6000.0)
+	#define OFFSET_Z (FV[2]*6000.0)
+	switch(move_mode)
+	{
+		case MOVE_FORWARD:
+		{
+			X = CP[0]+OFFSET_X;
+			Y = CP[1]+OFFSET_Y;
+			Z = CP[2]+OFFSET_Z;
+		}
+		case MOVE_BACK:
+		{
+			X = CP[0]-OFFSET_X;
+			Y = CP[1]-OFFSET_Y;
+			Z = CP[2]-OFFSET_Z;
+		}
+		case MOVE_LEFT:
+		{
+			X = CP[0]-OFFSET_Y;
+			Y = CP[1]+OFFSET_X;
+			Z = CP[2];
+		}
+		case MOVE_RIGHT:
+		{
+			X = CP[0]+OFFSET_Y;
+			Y = CP[1]-OFFSET_X;
+			Z = CP[2];
+		}
+		case MOVE_BACK_LEFT:
+		{
+			X = CP[0]+(-OFFSET_X - OFFSET_Y);
+ 			Y = CP[1]+(-OFFSET_Y + OFFSET_X);
+		 	Z = CP[2]-OFFSET_Z;
+		}
+		case MOVE_BACK_RIGHT:
+		{
+			X = CP[0]+(-OFFSET_X + OFFSET_Y);
+ 			Y = CP[1]+(-OFFSET_Y - OFFSET_X);
+		 	Z = CP[2]-OFFSET_Z;
+		}
+		case MOVE_FORWARD_LEFT:
+		{
+			X = CP[0]+(OFFSET_X  - OFFSET_Y);
+			Y = CP[1]+(OFFSET_Y  + OFFSET_X);
+			Z = CP[2]+OFFSET_Z;
+		}
+		case MOVE_FORWARD_RIGHT:
+		{
+			X = CP[0]+(OFFSET_X  + OFFSET_Y);
+			Y = CP[1]+(OFFSET_Y  - OFFSET_X);
+			Z = CP[2]+OFFSET_Z;
+		}
+	}
+}
+//--------------------------------------------------
+
+stock CancelFlyMode(playerid)
+{
+	DeletePVar(playerid, "FlyMode");
+	CancelEdit(playerid);
+	TogglePlayerSpectating(playerid, false);
+
+	DestroyPlayerObject(playerid, noclipdata[playerid][flyobject]);
+	noclipdata[playerid][cameramode] = CAMERA_MODE_NONE;
+	return 1;
+}
+
+//--------------------------------------------------
+
+stock FlyMode(playerid)
+{
+	// Create an invisible object for the players camera to be attached to
+	new Float:X, Float:Y, Float:Z;
+	GetPlayerPos(playerid, X, Y, Z);
+	noclipdata[playerid][flyobject] = CreatePlayerObject(playerid, 19300, X, Y, Z, 0.0, 0.0, 0.0);
+
+	// Place the player in spectating mode so objects will be streamed based on camera location
+	TogglePlayerSpectating(playerid, true);
+	// Attach the players camera to the created object
+	AttachCameraToPlayerObject(playerid, noclipdata[playerid][flyobject]);
+
+	SetPVarInt(playerid, "FlyMode", 1);
+	noclipdata[playerid][cameramode] = CAMERA_MODE_FLY;
+	return 1;
+}
+
+//--------------------------------------------------

BIN
samp03/filterscripts/fsdebug.amx


+ 2108 - 0
samp03/filterscripts/fsdebug.pwn

@@ -0,0 +1,2108 @@
+/* SA:MP PAWN Debug -
+ *  Debugging filterscript used
+ *  for creation of gamemode.
+ *
+ *  Simon Campbell
+ *  10/03/2007, 6:31pm
+ *
+ *  17/11/2011
+ *    Updated to 0.5d which supports SA:MP 0.3d
+*/
+
+//==============================================================================
+
+#include <a_samp>
+
+#undef KEY_UP
+#undef KEY_DOWN
+#undef KEY_LEFT
+#undef KEY_RIGHT
+
+#define KEY_UP  	65408
+#define KEY_DOWN	128
+#define KEY_LEFT    65408
+#define KEY_RIGHT   128
+
+#define DEBUG_VERSION   "0.5d"
+
+#define SKIN_SELECT   	true
+#define	VEHI_SELECT   	true
+#define WORL_SELECT     true
+#define CAME_SELECT     true
+#define OBJE_SELECT		true
+
+#define MISCEL_CMDS     true
+#define ADMINS_ONLY     false
+
+#define SKIN_SEL_STAT   1
+#define VEHI_SEL_STAT   2
+#define WORL_SEL_STAT   3
+#define CAME_SEL_STAT   4
+#define OBJE_SEL_STAT	5
+
+#define COLOR_RED   	0xFF4040FF
+#define COLOR_GREEN 	0x40FF40FF
+#define COLOR_BLUE  	0x4040FFFF
+
+#define COLOR_CYAN  	0x40FFFFFF
+#define COLOR_PINK  	0xFF40FFFF
+#define COLOR_YELLOW    0xFFFF40FF
+
+#define COLOR_WHITE		0xFFFFFFFF
+#define COLOR_BLACK		0x000000FF
+#define COLOR_NONE      0x00000000
+
+#define MIN_SKIN_ID		0
+#define MAX_SKIN_ID		299
+
+#define MIN_VEHI_ID		400
+#define MAX_VEHI_ID		611
+
+#define MIN_TIME_ID		0
+#define MAX_TIME_ID		23
+
+#define MIN_WEAT_ID     0
+#define MAX_WEAT_ID		45
+
+#define MIN_OBJE_ID		615
+#define MAX_OBJE_ID		13563
+
+#define DEFAULT_GRA     0.008
+
+#define VEHI_DIS        5.0
+#define OBJE_DIS		10.0
+
+#define CMODE_A			0
+#define CMODE_B			1
+
+#define O_MODE_SELECTOR	0
+#define O_MODE_MOVER	1
+#define O_MODE_ROTATOR	2
+
+#define PI				3.14159265
+
+#define CAMERA_TIME     40
+
+#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
+
+//==============================================================================
+
+new gPlayerStatus[MAX_PLAYERS]; // Player Status
+new gPlayerTimers[MAX_PLAYERS]; // Player TimerID's for keypresses
+new gWorldStatus[3] =  {12, 4}; // Time, Weather
+
+new curPlayerSkin[MAX_PLAYERS]				= {MIN_SKIN_ID, ...}; // Current Player Skin ID
+new curPlayerVehM[MAX_PLAYERS]				= {MIN_VEHI_ID, ...}; // Current Player Vehicle ID
+new curPlayerVehI[MAX_PLAYERS]				= {-1, ...};
+
+enum E_OBJECT
+{
+	OBJ_MOD,
+	OBJ_MDL,
+	Float:OBJ_X,
+	Float:OBJ_Y,
+	Float:OBJ_Z,
+	Float:OBJ_RX,
+	Float:OBJ_RY,
+	Float:OBJ_RZ
+}
+
+enum E_OBJ_RATE
+{
+	Float:OBJ_RATE_ROT,
+	Float:OBJ_RATE_MOVE
+}
+
+new pObjectRate[ MAX_PLAYERS ][ E_OBJ_RATE ];
+new curPlayerObjM[ MAX_PLAYERS ][ E_OBJECT ];
+new curPlayerObjI[ MAX_PLAYERS ]				= {-1, ...};
+
+enum P_CAMERA_D {
+	CMODE,
+	Float:RATE,
+	Float:CPOS_X,
+	Float:CPOS_Y,
+	Float:CPOS_Z,
+	Float:CLOO_X,
+	Float:CLOO_Y,
+	Float:CLOO_Z
+};
+
+new curPlayerCamD[MAX_PLAYERS][P_CAMERA_D];
+
+enum CURVEHICLE {
+	bool:spawn,
+	vmodel,
+	vInt
+};
+
+new curServerVehP[MAX_VEHICLES][CURVEHICLE];
+
+new aSelNames[5][] = {			// Menu selection names
+	{"SkinSelect"},
+	{"VehicleSelect"},
+	{"WeatherSelect"},
+	{"CameraSelect"},
+	{"ObjectSelect"}
+};
+
+new aWeaponNames[][32] = {
+	{"Unarmed (Fist)"}, // 0
+	{"Brass Knuckles"}, // 1
+	{"Golf Club"}, // 2
+	{"Night Stick"}, // 3
+	{"Knife"}, // 4
+	{"Baseball Bat"}, // 5
+	{"Shovel"}, // 6
+	{"Pool Cue"}, // 7
+	{"Katana"}, // 8
+	{"Chainsaw"}, // 9
+	{"Purple Dildo"}, // 10
+	{"Big White Vibrator"}, // 11
+	{"Medium White Vibrator"}, // 12
+	{"Small White Vibrator"}, // 13
+	{"Flowers"}, // 14
+	{"Cane"}, // 15
+	{"Grenade"}, // 16
+	{"Teargas"}, // 17
+	{"Molotov"}, // 18
+	{" "}, // 19
+	{" "}, // 20
+	{" "}, // 21
+	{"Colt 45"}, // 22
+	{"Colt 45 (Silenced)"}, // 23
+	{"Desert Eagle"}, // 24
+	{"Normal Shotgun"}, // 25
+	{"Sawnoff Shotgun"}, // 26
+	{"Combat Shotgun"}, // 27
+	{"Micro Uzi (Mac 10)"}, // 28
+	{"MP5"}, // 29
+	{"AK47"}, // 30
+	{"M4"}, // 31
+	{"Tec9"}, // 32
+	{"Country Rifle"}, // 33
+	{"Sniper Rifle"}, // 34
+	{"Rocket Launcher"}, // 35
+	{"Heat-Seeking Rocket Launcher"}, // 36
+	{"Flamethrower"}, // 37
+	{"Minigun"}, // 38
+	{"Satchel Charge"}, // 39
+	{"Detonator"}, // 40
+	{"Spray Can"}, // 41
+	{"Fire Extinguisher"}, // 42
+	{"Camera"}, // 43
+	{"Night Vision Goggles"}, // 44
+	{"Infrared Vision Goggles"}, // 45
+	{"Parachute"}, // 46
+	{"Fake Pistol"} // 47
+};
+
+
+new aVehicleNames[212][] = {	// Vehicle Names - Betamaster
+	{"Landstalker"},
+	{"Bravura"},
+	{"Buffalo"},
+	{"Linerunner"},
+	{"Perrenial"},
+	{"Sentinel"},
+	{"Dumper"},
+	{"Firetruck"},
+	{"Trashmaster"},
+	{"Stretch"},
+	{"Manana"},
+	{"Infernus"},
+	{"Voodoo"},
+	{"Pony"},
+	{"Mule"},
+	{"Cheetah"},
+	{"Ambulance"},
+	{"Leviathan"},
+	{"Moonbeam"},
+	{"Esperanto"},
+	{"Taxi"},
+	{"Washington"},
+	{"Bobcat"},
+	{"Mr Whoopee"},
+	{"BF Injection"},
+	{"Hunter"},
+	{"Premier"},
+	{"Enforcer"},
+	{"Securicar"},
+	{"Banshee"},
+	{"Predator"},
+	{"Bus"},
+	{"Rhino"},
+	{"Barracks"},
+	{"Hotknife"},
+	{"Trailer 1"}, //artict1
+	{"Previon"},
+	{"Coach"},
+	{"Cabbie"},
+	{"Stallion"},
+	{"Rumpo"},
+	{"RC Bandit"},
+	{"Romero"},
+	{"Packer"},
+	{"Monster"},
+	{"Admiral"},
+	{"Squalo"},
+	{"Seasparrow"},
+	{"Pizzaboy"},
+	{"Tram"},
+	{"Trailer 2"}, //artict2
+	{"Turismo"},
+	{"Speeder"},
+	{"Reefer"},
+	{"Tropic"},
+	{"Flatbed"},
+	{"Yankee"},
+	{"Caddy"},
+	{"Solair"},
+	{"Berkley's RC Van"},
+	{"Skimmer"},
+	{"PCJ-600"},
+	{"Faggio"},
+	{"Freeway"},
+	{"RC Baron"},
+	{"RC Raider"},
+	{"Glendale"},
+	{"Oceanic"},
+	{"Sanchez"},
+	{"Sparrow"},
+	{"Patriot"},
+	{"Quad"},
+	{"Coastguard"},
+	{"Dinghy"},
+	{"Hermes"},
+	{"Sabre"},
+	{"Rustler"},
+	{"ZR-350"},
+	{"Walton"},
+	{"Regina"},
+	{"Comet"},
+	{"BMX"},
+	{"Burrito"},
+	{"Camper"},
+	{"Marquis"},
+	{"Baggage"},
+	{"Dozer"},
+	{"Maverick"},
+	{"News Chopper"},
+	{"Rancher"},
+	{"FBI Rancher"},
+	{"Virgo"},
+	{"Greenwood"},
+	{"Jetmax"},
+	{"Hotring"},
+	{"Sandking"},
+	{"Blista Compact"},
+	{"Police Maverick"},
+	{"Boxville"},
+	{"Benson"},
+	{"Mesa"},
+	{"RC Goblin"},
+	{"Hotring Racer A"}, //hotrina
+	{"Hotring Racer B"}, //hotrinb
+	{"Bloodring Banger"},
+	{"Rancher"},
+	{"Super GT"},
+	{"Elegant"},
+	{"Journey"},
+	{"Bike"},
+	{"Mountain Bike"},
+	{"Beagle"},
+	{"Cropdust"},
+	{"Stunt"},
+	{"Tanker"}, //petro
+	{"Roadtrain"},
+	{"Nebula"},
+	{"Majestic"},
+	{"Buccaneer"},
+	{"Shamal"},
+	{"Hydra"},
+	{"FCR-900"},
+	{"NRG-500"},
+	{"HPV1000"},
+	{"Cement Truck"},
+	{"Tow Truck"},
+	{"Fortune"},
+	{"Cadrona"},
+	{"FBI Truck"},
+	{"Willard"},
+	{"Forklift"},
+	{"Tractor"},
+	{"Combine"},
+	{"Feltzer"},
+	{"Remington"},
+	{"Slamvan"},
+	{"Blade"},
+	{"Freight"},
+	{"Streak"},
+	{"Vortex"},
+	{"Vincent"},
+	{"Bullet"},
+	{"Clover"},
+	{"Sadler"},
+	{"Firetruck LA"}, //firela
+	{"Hustler"},
+	{"Intruder"},
+	{"Primo"},
+	{"Cargobob"},
+	{"Tampa"},
+	{"Sunrise"},
+	{"Merit"},
+	{"Utility"},
+	{"Nevada"},
+	{"Yosemite"},
+	{"Windsor"},
+	{"Monster A"}, //monstera
+	{"Monster B"}, //monsterb
+	{"Uranus"},
+	{"Jester"},
+	{"Sultan"},
+	{"Stratum"},
+	{"Elegy"},
+	{"Raindance"},
+	{"RC Tiger"},
+	{"Flash"},
+	{"Tahoma"},
+	{"Savanna"},
+	{"Bandito"},
+	{"Freight Flat"}, //freiflat
+	{"Streak Carriage"}, //streakc
+	{"Kart"},
+	{"Mower"},
+	{"Duneride"},
+	{"Sweeper"},
+	{"Broadway"},
+	{"Tornado"},
+	{"AT-400"},
+	{"DFT-30"},
+	{"Huntley"},
+	{"Stafford"},
+	{"BF-400"},
+	{"Newsvan"},
+	{"Tug"},
+	{"Trailer 3"}, //petrotr
+	{"Emperor"},
+	{"Wayfarer"},
+	{"Euros"},
+	{"Hotdog"},
+	{"Club"},
+	{"Freight Carriage"}, //freibox
+	{"Trailer 3"}, //artict3
+	{"Andromada"},
+	{"Dodo"},
+	{"RC Cam"},
+	{"Launch"},
+	{"Police Car (LSPD)"},
+	{"Police Car (SFPD)"},
+	{"Police Car (LVPD)"},
+	{"Police Ranger"},
+	{"Picador"},
+	{"S.W.A.T. Van"},
+	{"Alpha"},
+	{"Phoenix"},
+	{"Glendale"},
+	{"Sadler"},
+	{"Luggage Trailer A"}, //bagboxa
+	{"Luggage Trailer B"}, //bagboxb
+	{"Stair Trailer"}, //tugstair
+	{"Boxville"},
+	{"Farm Plow"}, //farmtr1
+	{"Utility Trailer"} //utiltr1
+};
+
+//==============================================================================
+
+forward SkinSelect(playerid);
+forward VehicleSelect(playerid);
+forward WorldSelect(playerid);
+forward CameraSelect(playerid);
+forward ObjectSelect( playerid );
+
+//==============================================================================
+
+dcmd_debug(playerid, params[]) {
+	if(strcmp(params, "help", true, 4) == 0) {
+		SendClientMessage(playerid, COLOR_BLUE, "[DEBUG]: Debug Mode 0.2 - HELP");
+		SendClientMessage(playerid, COLOR_CYAN, "[DEBUG]: Debug Mode 0.2 is a filterscript which allows scripters");
+		SendClientMessage(playerid, COLOR_CYAN, "[DEBUG]: or people who wish to explore SA:MP 0.2\'s features to have access");
+		SendClientMessage(playerid, COLOR_CYAN, "[DEBUG]: to many commands and \"menu\'s\".");
+		SendClientMessage(playerid, COLOR_YELLOW, "[DEBUG]: This filterscript was designed for SA:MP version 0.2");
+		SendClientMessage(playerid, COLOR_PINK, "[DEBUG]: For the command list type \"/debug commands\"");
+
+		return true;
+	}
+	if(strcmp(params, "commands", true, 8) == 0) {
+	    SendClientMessage(playerid, COLOR_BLUE, "[DEBUG]: Debug Mode 0.2 - COMMANDS");
+	    SendClientMessage(playerid, COLOR_CYAN, "[WORLD]: /w, /weather, /t, /time, /wsel, /g, /gravity");
+	    SendClientMessage(playerid, COLOR_CYAN, "[VEHICLES]: /v, /vehicle, /vsel");
+	    SendClientMessage(playerid, COLOR_CYAN, "[PLAYER]: /s, /skin, /ssel, /weapon, /w2");
+	    SendClientMessage(playerid, COLOR_CYAN, "[PLAYER]: /goto, /warpto, /bring, /setloc");
+	    SendClientMessage(playerid, COLOR_CYAN, "[CAMERA]: /camera, /csel");
+
+	    return true;
+	}
+
+	if(strcmp(params, "dump", true, 4) == 0) {
+	    SendClientMessage(playerid, COLOR_GREEN, "[SUCCESS]: All current server data dumped to a file.");
+	    new File:F_DUMP = fopen("DEBUG-DUMP.txt", io_append);
+	    if(F_DUMP) {
+	        new h, m, s, Y, M, D, cString[256];
+
+			getdate(Y, M, D);
+			gettime(h, m, s);
+
+	        format(cString, 256, "// %d-%d-%d @ %d:%d:%d\r\n", D, M, Y, h, m, s);
+	        fwrite(F_DUMP, cString);
+
+	    	for(new i = 0; i < MAX_VEHICLES; i++) {
+				if(curServerVehP[i][spawn] 	== true) {
+				    new Float:vx, Float:vy, Float:vz, Float:va;
+				    GetVehiclePos(i, vx, vy, vz);
+				    GetVehicleZAngle(i, va);
+					format(cString, 256, "CreateVehicle(%d, %f, %f, %f, %f, -1, -1, 5000); // Interior(%d), %s\r\n", curServerVehP[i][vmodel], vx, vy, vz, va, curServerVehP[i][vInt], aVehicleNames[curServerVehP[i][vmodel] - MIN_VEHI_ID]);
+					fwrite(F_DUMP, cString);
+	        	}
+	    	}
+	    	print("** Dumped current server information.");
+	    	fclose(F_DUMP);
+	    }
+	    else {
+			print("** Failed to create the file \"DEBUG-DUMP.txt\".\n");
+	    }
+	    return true;
+	}
+	return false;
+}
+
+#if CAME_SELECT == true
+
+dcmd_object(playerid, params[])
+{
+	new cString[ 128 ], idx;
+	cString = strtok( params, idx );
+
+	if ( !strlen( cString ) || !strlen( params[ idx + 1 ] ) )
+	{
+	    SendClientMessage( playerid, COLOR_WHITE, "[USAGE]: /object [RRATE/MRATE/CAMERA] [RATE/ID]");
+
+	    return 1;
+	}
+
+	if ( strcmp( cString, "rrate", true ) == 0 )
+	{
+	    pObjectRate[ playerid ][ OBJ_RATE_ROT ] = floatstr( params[ idx + 1 ] );
+
+	    format( cString, 128, "[SUCCESS]: Object rotation rate changed to %f.", pObjectRate[ playerid ][ OBJ_RATE_ROT ] );
+		SendClientMessage( playerid, COLOR_GREEN, cString );
+
+		return 1;
+	}
+
+	if ( strcmp( cString, "mrate", true ) == 0 )
+	{
+	    pObjectRate[ playerid ][ OBJ_RATE_MOVE ] = floatstr( params[ idx + 1 ] );
+
+	    format( cString, 128, "[SUCCESS]: Object movement rate changed to %f.", pObjectRate[ playerid ][ OBJ_RATE_MOVE ] );
+	    SendClientMessage( playerid, COLOR_GREEN, cString );
+
+	    return 1;
+	}
+
+	if ( strcmp( cString, "mode", true ) == 0 )
+	{
+	    new fuck = strval( params[ idx + 1 ] );
+
+	    if ( fuck >= O_MODE_SELECTOR || fuck <= O_MODE_ROTATOR )
+	    {
+		    curPlayerObjM[ playerid ][ OBJ_MOD ] = fuck;
+
+		    switch ( fuck )
+		    {
+		    	case O_MODE_SELECTOR: SendClientMessage( playerid, COLOR_GREEN, "[SUCCESS]: Object mode changed to Object Selection." );
+		    	case O_MODE_MOVER: SendClientMessage( playerid, COLOR_GREEN, "[SUCCESS]: Object mode changed to Object Mover." );
+		    	case O_MODE_ROTATOR: SendClientMessage( playerid, COLOR_GREEN, "[SUCCESS]: Object mode changed to Object Rotator." );
+			}
+
+			return 1;
+		}
+		else
+		{
+		    SendClientMessage( playerid, COLOR_RED, "[ERROR]: Invalid modeid." );
+
+		    return 1;
+		}
+	}
+
+	if ( strcmp( cString, "focus", true ) == 0 )
+	{
+		new objectid = strval( params[ idx + 1 ] );
+
+		if ( !IsValidObject( objectid ) )
+		{
+			SendClientMessage( playerid, COLOR_RED, "[ERROR]: Enter a valid objectid." );
+
+			return 1;
+		}
+
+		else
+		{
+			curPlayerObjI[ playerid ] = objectid;
+
+			GetObjectPos( objectid, curPlayerObjM[ playerid ][ OBJ_X ], curPlayerObjM[ playerid ][ OBJ_Y ], curPlayerObjM[ playerid ][ OBJ_Z ] );
+			GetObjectRot( objectid, curPlayerObjM[ playerid ][ OBJ_RX ], curPlayerObjM[ playerid ][ OBJ_RY ], curPlayerObjM[ playerid ][ OBJ_RZ ] );
+
+		   	curPlayerCamD[playerid][CPOS_X] = curPlayerObjM[ playerid ][ OBJ_X ] + 5.0;
+			curPlayerCamD[playerid][CPOS_Y] = curPlayerObjM[ playerid ][ OBJ_Y ] - 20.0;
+			curPlayerCamD[playerid][CPOS_Z] = curPlayerObjM[ playerid ][ OBJ_Z ] + 30.0;
+
+			curPlayerCamD[playerid][CLOO_X] = curPlayerObjM[ playerid ][ OBJ_X ];
+			curPlayerCamD[playerid][CLOO_Y] = curPlayerObjM[ playerid ][ OBJ_Y ];
+			curPlayerCamD[playerid][CLOO_Z] = curPlayerObjM[ playerid ][ OBJ_Z ];
+
+			if ( gPlayerStatus[ playerid ] == OBJE_SEL_STAT )
+			{
+				SetPlayerCameraPos( playerid, curPlayerCamD[playerid][CPOS_X], curPlayerCamD[playerid][CPOS_Y], curPlayerCamD[playerid][CPOS_Z] );
+            	SetPlayerCameraLookAt( playerid, curPlayerObjM[ playerid ][ OBJ_X ], curPlayerObjM[ playerid ][ OBJ_Y ], curPlayerObjM[ playerid ][ OBJ_Z ] );
+			}
+
+			return 1;
+		}
+	}
+
+	if ( strcmp( cString, "camera", true ) == 0 )
+	{
+	    new cameraid = strval( params[ idx + 1 ] );
+
+		if ( cameraid >= 0 && cameraid < 4 )
+		{
+		    switch ( cameraid )
+		    {
+		        case 0:
+		        {
+		            curPlayerCamD[playerid][CPOS_X] = curPlayerObjM[ playerid ][ OBJ_X ] + 7.0;
+					curPlayerCamD[playerid][CPOS_Y] = curPlayerObjM[ playerid ][ OBJ_Y ] - 20.0;
+					curPlayerCamD[playerid][CPOS_Z] = curPlayerObjM[ playerid ][ OBJ_Z ] + 30.0;
+		        }
+
+		        case 1:
+		        {
+		            curPlayerCamD[playerid][CPOS_X] = curPlayerObjM[ playerid ][ OBJ_X ] + 7.0;
+					curPlayerCamD[playerid][CPOS_Y] = curPlayerObjM[ playerid ][ OBJ_Y ] + 15.0;
+					curPlayerCamD[playerid][CPOS_Z] = curPlayerObjM[ playerid ][ OBJ_X ] + 15.0;
+		        }
+
+		        case 2:
+		        {
+		            curPlayerCamD[playerid][CPOS_X] = curPlayerObjM[ playerid ][ OBJ_X ] - 20.0;
+					curPlayerCamD[playerid][CPOS_Y] = curPlayerObjM[ playerid ][ OBJ_Y ] + 20.0;
+					curPlayerCamD[playerid][CPOS_Z] = curPlayerObjM[ playerid ][ OBJ_X ] + 20.0;
+		        }
+
+		        case 3:
+		        {
+		            curPlayerCamD[playerid][CPOS_X] = curPlayerObjM[ playerid ][ OBJ_X ] - 10.0;
+					curPlayerCamD[playerid][CPOS_Y] = curPlayerObjM[ playerid ][ OBJ_Y ] + 25.0;
+					curPlayerCamD[playerid][CPOS_Z] = curPlayerObjM[ playerid ][ OBJ_X ] + 15.0;
+		        }
+		    }
+
+		    SetPlayerCameraPos( playerid, curPlayerCamD[playerid][CPOS_X], curPlayerCamD[playerid][CPOS_Y], curPlayerCamD[playerid][CPOS_Z] );
+            SetPlayerCameraLookAt( playerid, curPlayerObjM[ playerid ][ OBJ_X ], curPlayerObjM[ playerid ][ OBJ_Y ], curPlayerObjM[ playerid ][ OBJ_Z ] );
+
+			return 1;
+		}
+		else
+		{
+		    SendClientMessage( playerid, COLOR_RED, "[ERROR]: Invalid object camera id.");
+
+		    return 1;
+		}
+	}
+	return 0;
+}
+
+dcmd_osel(playerid, params[])
+{
+	#pragma unused params
+
+	new cString[ 128 ];
+
+	if ( gPlayerStatus[ playerid ] != 0 )
+	{
+		format( cString, 128, "[ERROR]: You are already using \"%s\".", aSelNames[ gPlayerStatus[ playerid ] - 1 ] );
+		SendClientMessage(playerid, COLOR_RED, cString);
+
+		return 1;
+	}
+
+	new Float:a;
+
+	gPlayerStatus[playerid] = OBJE_SEL_STAT;
+
+	GetPlayerPos(playerid, curPlayerCamD[playerid][CPOS_X], curPlayerCamD[playerid][CPOS_Y], curPlayerCamD[playerid][CPOS_Z]);
+	curPlayerCamD[playerid][CPOS_Z] += 5.0;
+	SetPlayerCameraPos(playerid, curPlayerCamD[playerid][CPOS_X], curPlayerCamD[playerid][CPOS_Y], curPlayerCamD[playerid][CPOS_Z]);
+
+	GetXYInFrontOfPlayer(playerid, curPlayerCamD[playerid][CLOO_X], curPlayerCamD[playerid][CLOO_Y], OBJE_DIS);
+
+	curPlayerCamD[playerid][CLOO_Z] = curPlayerCamD[playerid][CPOS_Z] - 5.0;
+
+	SetPlayerCameraLookAt(playerid, curPlayerCamD[playerid][CLOO_X], curPlayerCamD[playerid][CLOO_Y], curPlayerCamD[playerid][CLOO_Z]);
+
+	TogglePlayerControllable(playerid, 0);
+
+	GetPlayerFacingAngle(playerid, a);
+
+	curPlayerObjM[ playerid ][ OBJ_X ] = curPlayerCamD[playerid][CLOO_X];
+	curPlayerObjM[ playerid ][ OBJ_Y ] = curPlayerCamD[playerid][CLOO_Y];
+	curPlayerObjM[ playerid ][ OBJ_Z ] = curPlayerCamD[playerid][CLOO_Z];
+	curPlayerObjM[ playerid ][ OBJ_RX ] = 0.0;
+	curPlayerObjM[ playerid ][ OBJ_RY ] = 0.0;
+	curPlayerObjM[ playerid ][ OBJ_RZ ] = 0.0;
+
+	curPlayerObjI[ playerid ] = CreateObject( curPlayerObjM[ playerid ][ OBJ_MDL ], curPlayerObjM[ playerid ][ OBJ_X ],
+		curPlayerObjM[ playerid ][ OBJ_Y ], curPlayerObjM[ playerid ][ OBJ_Z ],
+		curPlayerObjM[ playerid ][ OBJ_RX ], curPlayerObjM[ playerid ][ OBJ_RY ], curPlayerObjM[ playerid ][ OBJ_RZ ]
+	);
+
+	gPlayerTimers[ playerid ] = SetTimerEx("ObjectSelect", 200, 1, "i", playerid);
+
+	return 1;
+}
+
+dcmd_camera(playerid, params[]) {
+	new idx; new cString[128];
+
+	cString = strtok(params, idx);
+
+	if (!strlen(cString)) {
+	    SendClientMessage(playerid, COLOR_RED, "[USAGE]: /camera [RATE/MODE] [RATE/MODEID]");
+
+	    return true;
+	}
+
+	if (strcmp(cString, "rate", true, 4) == 0) {
+	    curPlayerCamD[playerid][RATE] = floatstr(params[idx+1]);
+
+	    return true;
+	}
+
+	if (strcmp(cString, "mode", true, 4) == 0) {
+	    curPlayerCamD[playerid][CMODE] = strval(params[idx+1]);
+
+	    return true;
+	}
+
+	return true;
+}
+
+dcmd_csel(playerid, params[]) {
+	#pragma unused params
+
+	new cString[128];
+
+	if (gPlayerStatus[playerid] != 0) {
+		format(cString, 128, "[ERROR]: You are already using \"%s\".", aSelNames[gPlayerStatus[playerid] - 1]);
+		SendClientMessage(playerid, COLOR_RED, cString);
+
+		return true;
+	}
+
+	gPlayerStatus[playerid] = CAME_SEL_STAT;
+
+    TogglePlayerControllable(playerid, 0);
+
+	GetPlayerPos(playerid, curPlayerCamD[playerid][CPOS_X], curPlayerCamD[playerid][CPOS_Y], curPlayerCamD[playerid][CPOS_Z]);
+	GetXYInFrontOfPlayer(playerid, curPlayerCamD[playerid][CLOO_X], curPlayerCamD[playerid][CLOO_Y], 5.0);
+
+	curPlayerCamD[playerid][CLOO_Z] = curPlayerCamD[playerid][CPOS_Z];
+
+	gPlayerTimers[playerid] = SetTimerEx("CameraSelect", 200, 1, "i", playerid);
+
+	return true;
+}
+
+#endif
+
+#if WORL_SELECT == true
+dcmd_g(playerid, params[]) {
+	new cString[128];
+
+	if (!strlen(params[0]))
+	{
+	    SendClientMessage(playerid, COLOR_RED, "[USAGE]: /g GRAVITY or /gravity GRAVITY");
+	    return true;
+	}
+
+	new Float:grav = floatstr(params[0]);
+
+	SetGravity(grav);
+
+	format(cString, 128, "[SUCCESS]: World gravity changed to %f", grav);
+	SendClientMessage(playerid, COLOR_GREEN, cString);
+
+	return true;
+}
+
+dcmd_gravity(playerid, params[])
+	return dcmd_g(playerid, params);
+
+dcmd_w(playerid, params[]) {
+	new idx, iString[128];
+	iString = strtok(params, idx);
+
+	if (!strlen(iString)) {
+	    SendClientMessage(playerid, COLOR_RED, "[USAGE]: /w WEATHERID or /weather WEATHERID");
+	    return true;
+	}
+
+	idx = strval(iString);
+
+	if (idx < MIN_WEAT_ID || idx > MAX_WEAT_ID) {
+	    SendClientMessage(playerid, COLOR_RED, "[ERROR]: Invalid WEATHERID");
+	    return true;
+	}
+
+	gWorldStatus[1] = idx;
+
+	SetWeather(idx);
+
+	format(iString, 128, "[SUCCESS]: Weather has changed to WEATHERID %d", idx);
+	SendClientMessage(playerid, COLOR_GREEN, iString);
+
+	return true;
+}
+
+dcmd_weather(playerid, params[])
+	return dcmd_w(playerid, params);
+
+dcmd_t(playerid, params[]) {
+	new idx, iString[128];
+	iString = strtok(params, idx);
+
+	if (!strlen(iString)) {
+	    SendClientMessage(playerid, COLOR_RED, "[USAGE]: /t HOUR or /time HOUR");
+	    return true;
+	}
+
+	idx = strval(iString);
+
+	if (idx < MIN_TIME_ID || idx > MAX_TIME_ID) {
+	    SendClientMessage(playerid, COLOR_RED, "[ERROR]: Invalid HOUR");
+	    return true;
+	}
+
+	gWorldStatus[0] = idx;
+
+	SetWorldTime(idx);
+
+	format(iString, 128, "[SUCCESS]: Time has changed to HOUR %d", idx);
+	SendClientMessage(playerid, COLOR_GREEN, iString);
+
+	return true;
+}
+
+dcmd_time(playerid, params[])
+	return dcmd_t(playerid, params);
+
+dcmd_wsel(playerid, params[]) {
+	#pragma unused params
+
+	new cString[128];
+
+	if (gPlayerStatus[playerid] != 0) {
+		format(cString, 128, "[ERROR]: You are already using \"%s\".", aSelNames[gPlayerStatus[playerid] - 1]);
+		SendClientMessage(playerid, COLOR_RED, cString);
+		return true;
+	}
+
+	new Float:x, Float:y, Float:z;
+
+	gPlayerStatus[playerid] = WORL_SEL_STAT;
+
+	GetPlayerPos(playerid, x, y, z);
+	SetPlayerCameraPos(playerid, x, y, z + 40.0);
+
+	GetXYInFrontOfPlayer(playerid, x, y, 100.0);
+
+	SetPlayerCameraLookAt(playerid, x, y, z + 5.0);
+
+	TogglePlayerControllable(playerid, 0);
+
+	gPlayerTimers[playerid] = SetTimerEx("WorldSelect", 200, 1, "i", playerid);
+
+	GameTextForPlayer(playerid, "WorldSelect", 1500, 3);
+
+	return true;
+}
+#endif
+
+#if VEHI_SELECT == true
+
+dcmd_v(playerid, params[])
+{
+	new
+		idx,
+		iString[ 128 ];
+
+	if ( gPlayerStatus[ playerid ] != 0 )
+	{
+		format				( iString, 128, "[ERROR]: You are already using \"%s\".", aSelNames[ gPlayerStatus[ playerid ] - 1 ] );
+		SendClientMessage	( playerid, COLOR_RED, iString );
+
+		return true;
+	}
+
+	if ( params[ 0 ] == '\0' )	// Same effect as a !strlen check.
+		return SendClientMessage( playerid, COLOR_RED, "[USAGE]: /v MODELID/NAME or /vehicle MODELID/NAME" );
+
+	//***************
+	// Fix by Mike! *
+	//***************
+
+	idx = GetVehicleModelIDFromName( params );
+
+	if( idx == -1 )
+	{
+		idx = strval(iString);
+
+		if ( idx < MIN_VEHI_ID || idx > MAX_VEHI_ID )
+			return SendClientMessage(playerid, COLOR_RED, "[ERROR]: Invalid MODELID/NAME");
+	}
+
+	new
+		Float:x,
+		Float:y,
+		Float:z,
+		Float:a;
+
+	GetPlayerPos(playerid, x, y, z);
+	GetXYInFrontOfPlayer(playerid, x, y, VEHI_DIS);
+	GetPlayerFacingAngle(playerid, a);
+
+	curPlayerVehM[playerid] = idx;
+
+	curPlayerVehI[playerid] = CreateVehicle(idx, x, y, z + 2.0, a + 90.0, -1, -1, 5000);
+	LinkVehicleToInterior(curPlayerVehI[playerid], GetPlayerInterior(playerid));
+
+ 	curServerVehP[curPlayerVehI[playerid]][spawn] 	= true;
+	curServerVehP[curPlayerVehI[playerid]][vmodel]	= idx;
+	curServerVehP[curPlayerVehI[playerid]][vInt]    = GetPlayerInterior(playerid);
+
+	format(iString, 128, "[SUCCESS]: Spawned a \"%s\" (MODELID: %d, VEHICLEID: %d)", aVehicleNames[idx - MIN_VEHI_ID], idx, curPlayerVehI[playerid]);
+
+	SendClientMessage(playerid, COLOR_GREEN, iString);
+
+	return true;
+}
+
+dcmd_vehicle(playerid, params[])
+	return dcmd_v(playerid, params);
+
+dcmd_vsel(playerid, params[])
+{
+	// /vsel allows players to select a vehicle using playerkeys.
+	#pragma unused params
+
+	new cString[128];
+
+	if (gPlayerStatus[playerid] != 0) {
+		format(cString, 128, "[ERROR]: You are already using \"%s\".", aSelNames[gPlayerStatus[playerid] - 1]);
+		SendClientMessage(playerid, COLOR_RED, cString);
+		return true;
+	}
+
+	new Float:x, Float:y, Float:z, Float:a;
+
+	gPlayerStatus[playerid] = VEHI_SEL_STAT;
+
+	GetPlayerPos(playerid, x, y, z);
+	SetPlayerCameraPos(playerid, x, y, z + 3.0);
+
+	GetXYInFrontOfPlayer(playerid, x, y, VEHI_DIS);
+	SetPlayerCameraLookAt(playerid, x, y, z);
+
+	TogglePlayerControllable(playerid, 0);
+
+	GetPlayerFacingAngle(playerid, a);
+
+	curPlayerVehI[playerid] = CreateVehicle(curPlayerVehM[playerid], x, y, z + 2.0, a + 90.0, -1, -1, 5000);
+	printf( "vsel vehicle start id = %d", curPlayerVehI[playerid] );
+
+	LinkVehicleToInterior(curPlayerVehI[playerid], GetPlayerInterior(playerid));
+
+ 	curServerVehP[curPlayerVehI[playerid]][spawn] 	= true;
+	curServerVehP[curPlayerVehI[playerid]][vmodel]	= curPlayerVehM[playerid];
+	curServerVehP[curPlayerVehI[playerid]][vInt]    = GetPlayerInterior(playerid);
+
+	gPlayerTimers[playerid] = SetTimerEx("VehicleSelect", 200, 1, "i", playerid);
+
+	return true;
+}
+
+#endif
+
+#if SKIN_SELECT == true
+
+dcmd_ssel(playerid, params[])
+{
+	// /ssel allows players to select a skin using playerkeys.
+	#pragma unused params
+
+	new cString[128];
+
+	if (gPlayerStatus[playerid] != 0) {
+		format(cString, 128, "[ERROR]: You are already using \"%s\".", aSelNames[gPlayerStatus[playerid] - 1]);
+		SendClientMessage(playerid, COLOR_RED, cString);
+		return true;
+	}
+
+	new Float:x, Float:y, Float:z;
+
+	gPlayerStatus[playerid] = SKIN_SEL_STAT;
+
+	GetPlayerPos(playerid, x, y, z);
+	SetPlayerCameraLookAt(playerid, x, y, z);
+
+	GetXYInFrontOfPlayer(playerid, x, y, 3.5);
+	SetPlayerCameraPos(playerid, x, y, z);
+
+	TogglePlayerControllable(playerid, 0);
+
+	gPlayerTimers[playerid] = SetTimerEx("SkinSelect", 200, 1, "i", playerid);
+
+	return true;
+}
+
+dcmd_s(playerid, params[])
+{
+    // /s SKINID allows players to directly select a skin using it's ID.
+	new idx, iString[128];
+	iString = strtok(params, idx);
+
+	if (!strlen(iString)) {
+	    SendClientMessage(playerid, COLOR_RED, "[USAGE]: /s SKINID");
+	    return true;
+	}
+
+	idx = strval(iString);
+
+	if (IsInvalidSkin(idx) || idx < MIN_SKIN_ID || idx > MAX_SKIN_ID) {
+	    SendClientMessage(playerid, COLOR_RED, "[ERROR]: Invalid SKINID");
+	    return true;
+	}
+
+	SetPlayerSkin(playerid, idx);
+	curPlayerSkin[playerid] = idx;
+	format(iString, 128, "[SUCCESS]: Changed skin to SKINID %d", idx);
+
+	SendClientMessage(playerid, COLOR_GREEN, iString);
+
+	return true;
+}
+
+dcmd_skin(playerid, params[])
+{
+	dcmd_s(playerid, params);
+
+	return true;
+}
+
+#endif
+
+#if MISCEL_CMDS == true
+dcmd_goto(playerid, params[])
+{
+	new idx, iString[128];
+	iString = strtok(params, idx);
+
+	if (!strlen(iString)) {
+	    SendClientMessage(playerid, COLOR_RED, "[USAGE]: /goto PLAYERID (X_OFFSET Y_OFFSET Z_OFFSET)");
+	    return true;
+	}
+
+	new ID = strval(iString);
+
+	if (!IsPlayerConnected(ID)) {
+	    SendClientMessage(playerid, COLOR_RED, "[ERROR]: Not connected PLAYERID.");
+	    return true;
+	}
+
+	new Float:X, Float:Y, Float:Z;
+	new Interior = GetPlayerInterior(ID);
+
+	GetPlayerPos(ID, X, Y, Z);
+
+	iString = strtok(params, idx);
+
+	if (!strlen(iString)) {
+	    GetXYInFrontOfPlayer(ID, X, Y, 1.5);
+	    SetPlayerInterior(playerid, Interior);
+		SetPlayerPos(playerid, X, Y, Z);
+
+		GetPlayerName(ID, iString, 128);
+		format(iString, 128, "[SUCCESS]: You have warped to %s (ID: %d).", iString, ID);
+		SendClientMessage(playerid, COLOR_GREEN, iString);
+
+	    return true;
+	}
+
+	X += floatstr(iString);
+	iString = strtok(params, idx);
+
+	if (!strlen(iString)) {
+	    goto fwarpto;
+	}
+
+	Y += floatstr(iString);
+	iString = strtok(params, idx);
+
+	if (!strlen(iString)) {
+	    goto fwarpto;
+	}
+
+	Z += floatstr(iString);
+
+	fwarpto:
+
+	new pVID = GetPlayerVehicleID( playerid );
+
+	if ( pVID )
+	{
+	    SetVehiclePos( pVID, X, Y, Z );
+	    LinkVehicleToInterior( pVID, Interior );
+	}
+	else
+	{
+		SetPlayerPos( playerid, X, Y, Z);
+	}
+
+	SetPlayerInterior( playerid, Interior);
+
+	GetPlayerName(ID, iString, 128);
+	format(iString, 128, "[SUCCESS]: You have warped to %s (ID: %d).", iString, ID);
+	SendClientMessage(playerid, COLOR_GREEN, iString);
+
+	return true;
+}
+
+dcmd_warpto(playerid, params[])
+{
+	dcmd_goto(playerid, params);
+
+	return true;
+}
+
+dcmd_setloc(playerid, params[])
+{
+	new idx, iString[128];
+	iString = strtok(params, idx);
+
+	if (!strlen(iString)) {
+	    SendClientMessage(playerid, COLOR_RED, "[USAGE]: /setloc X Y Z INTERIOR");
+	    return true;
+	}
+
+	new Float:X, Float:Y, Float:Z;
+	new Interior;
+
+	X = floatstr(iString);
+	Y = floatstr(strtok(params,idx));
+	Z = floatstr(strtok(params,idx));
+	Interior = strval(strtok(params,idx));
+
+    new pVID = GetPlayerVehicleID( playerid );
+
+	if ( pVID )
+	{
+	    SetVehiclePos( pVID, X, Y, Z );
+	    LinkVehicleToInterior( pVID, Interior );
+	}
+	else
+	{
+		SetPlayerPos( playerid, X, Y, Z );
+	}
+
+	SetPlayerInterior(playerid, Interior);
+
+	return true;
+
+
+}
+
+dcmd_bring(playerid, params[])
+{
+	new idx, iString[128];
+	iString = strtok(params, idx);
+
+	if (!strlen(iString)) {
+	    SendClientMessage(playerid, COLOR_RED, "[USAGE]: /bring PLAYERID (X_OFFSET Y_OFFSET Z_OFFSET)");
+	    return true;
+	}
+
+	new ID = strval(iString);
+
+	if (!IsPlayerConnected(ID)) {
+	    SendClientMessage(playerid, COLOR_RED, "[ERROR]: Not connected PLAYERID.");
+	    return true;
+	}
+
+	new Float:X, Float:Y, Float:Z;
+	new Interior = GetPlayerInterior(playerid);
+
+	GetPlayerPos(playerid, X, Y, Z);
+
+	iString = strtok(params, idx);
+
+	if (!strlen(iString)) {
+	    GetXYInFrontOfPlayer(playerid, X, Y, 1.5);
+	    SetPlayerInterior(ID, Interior);
+		SetPlayerPos(ID, X, Y, Z);
+
+		GetPlayerName(ID, iString, 128);
+		format(iString, 128, "[SUCCESS]: You have brought %s (ID: %d) to you.", iString, ID);
+		SendClientMessage(playerid, COLOR_GREEN, iString);
+
+	    return true;
+	}
+
+	X += floatstr(iString);
+	iString = strtok(params, idx);
+
+	if (!strlen(iString)) {
+	    goto fbring;
+	}
+
+	Y += floatstr(iString);
+	iString = strtok(params, idx);
+
+	if (!strlen(iString)) {
+	    goto fbring;
+	}
+
+	Z += floatstr(iString);
+
+	fbring:
+
+	new pVID = GetPlayerVehicleID( ID );
+
+	if ( pVID )
+	{
+	    SetVehiclePos( pVID, X, Y, Z );
+	    LinkVehicleToInterior( pVID, Interior );
+	}
+	else
+	{
+		SetPlayerPos( ID, X, Y, Z );
+	}
+
+	SetPlayerInterior(ID, Interior);
+
+	GetPlayerName(ID, iString, 128);
+	format(iString, 128, "[SUCCESS]: You have brought %s (ID: %d) to you.", iString, ID);
+	SendClientMessage(playerid, COLOR_GREEN, iString);
+
+	return true;
+}
+
+dcmd_weapon(playerid, params[])
+{
+	dcmd_w2(playerid, params);
+
+	return true;
+}
+
+dcmd_w2(playerid, params[])
+{
+	new idx, iString[128];
+	iString = strtok(params, idx);
+
+	if (!strlen(iString)) {
+	    SendClientMessage(playerid, COLOR_RED, "[USAGE]: /w2 WEAPONID/NAME (AMMO) or /weapon WEAPONID/NAME (AMMO)");
+	    return true;
+	}
+
+	new weaponid = GetWeaponModelIDFromName(iString);
+
+	if (weaponid == -1) {
+		weaponid = strval(iString);
+		if (weaponid < 0 || weaponid > 47) {
+	    	SendClientMessage(playerid, COLOR_RED, "[ERROR]: Invalid WEAPONID/NAME");
+	    	return true;
+		}
+	}
+
+	if (!strlen(params[idx+1])) {
+	    GivePlayerWeapon(playerid, weaponid, 500);
+
+	    format(iString, 128, "[SUCCESS]: You were given weapon %s (ID: %d) with 500 ammo.", aWeaponNames[weaponid], weaponid);
+	    SendClientMessage(playerid, COLOR_GREEN, iString);
+
+	    return true;
+	}
+
+	idx = strval(params[idx+1]);
+
+    GivePlayerWeapon(playerid, weaponid, idx);
+
+    format(iString, 128, "[SUCCESS]: You were given weapon %s (ID: %d) with %d ammo.", aWeaponNames[weaponid], weaponid, idx);
+    SendClientMessage(playerid, COLOR_GREEN, iString);
+
+	return true;
+}
+#endif
+
+public OnFilterScriptInit()
+{
+	print("\n  *********************\n  * SA:MP DEBUG 0.2   *");
+	print("  * By Simon Campbell *\n  *********************");
+	printf("  * Version: %s      *\n  *********************", DEBUG_VERSION);
+	print("  * -- LOADED         *\n  *********************\n");
+
+	for ( new i = 0; i < MAX_PLAYERS; i++ )
+	{
+		curPlayerObjM[ i ][ OBJ_MDL ] = MIN_OBJE_ID;
+		pObjectRate[ i ][ OBJ_RATE_ROT ] = 1.0;
+		pObjectRate[ i ][ OBJ_RATE_MOVE ] = 1.0;
+	}
+
+}
+
+public OnFilterScriptExit()
+{
+	print("\n  *********************\n  * SA:MP DEBUG 0.2   *");
+	print("  * -- SHUTDOWN       *\n  *********************\n");
+}
+
+public OnPlayerCommandText(playerid, cmdtext[])
+{
+	#if ADMINS_ONLY == true
+	if(IsPlayerAdmin(playerid)) {
+	#endif
+
+	#if SKIN_SELECT == true
+	dcmd(s, 1, cmdtext);
+	dcmd(ssel, 4, cmdtext);
+	dcmd(skin, 4, cmdtext);
+	#endif
+
+	#if VEHI_SELECT == true
+	dcmd(v, 1, cmdtext);
+	dcmd(vsel, 4, cmdtext);
+	dcmd(vehicle, 7, cmdtext);
+	#endif
+
+	#if WORL_SELECT == true
+	dcmd(w, 1, cmdtext);
+	dcmd(t, 1, cmdtext);
+	dcmd(g, 1, cmdtext);
+	dcmd(wsel, 4, cmdtext);
+	dcmd(time, 4, cmdtext);
+	dcmd(weather, 7, cmdtext);
+	dcmd(gravity, 7, cmdtext);
+	#endif
+
+	#if MISCEL_CMDS == true
+	dcmd(w2, 2, cmdtext);
+	dcmd(goto, 4, cmdtext);
+	dcmd(bring, 5, cmdtext);
+	dcmd(warpto, 6, cmdtext);
+	dcmd(weapon, 6, cmdtext);
+	dcmd(setloc, 6, cmdtext);
+	#endif
+
+	#if CAME_SELECT == true
+	dcmd(csel, 4, cmdtext);
+	dcmd(camera, 6, cmdtext);
+	#endif
+
+	dcmd(osel, 4, cmdtext);
+	dcmd(object, 6, cmdtext);
+	dcmd(debug, 5, cmdtext);
+
+	#if ADMINS_ONLY == true
+	}
+	#endif
+
+	return 0;
+}
+
+public OnPlayerDisconnect(playerid,reason)
+{
+	KillTimer(gPlayerTimers[playerid]);
+
+	gPlayerStatus[playerid] = 0;
+	gPlayerTimers[playerid] = 0;
+
+	curPlayerSkin[playerid] = MIN_SKIN_ID; // Current Player Skin ID
+	curPlayerVehM[playerid] = MIN_VEHI_ID; // Current Player Vehicle ID
+	curPlayerVehI[playerid] = -1;
+
+	return 0;
+}
+
+public OnPlayerConnect(playerid)
+{
+    curPlayerCamD[playerid][CMODE] = CMODE_A;
+    curPlayerCamD[playerid][RATE]  = 2.0;
+
+	return 0;
+}
+
+public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ) {
+	#if ADMINS_ONLY == true
+	if (IsPlayerAdmin(playerid)) {
+	#endif
+	SetPlayerPosFindZ(playerid, fX, fY, fZ);
+	#if ADMINS_ONLY == true
+	}
+	#endif
+}
+
+
+//==============================================================================
+
+#if WORL_SELECT == true
+public WorldSelect(playerid)
+{   // Created by Simon
+	/*
+	// Make sure the player is not in world selection before continuing
+	if (gPlayerStatus[playerid] != WORL_SEL_STAT) {
+		KillTimer(skinTimerID[playerid]);
+        return;
+	}
+	*/
+
+	new keys, updown, leftright;
+
+    GetPlayerKeys(playerid, keys, updown, leftright);
+
+	new cString[128];
+
+	// Right key increases World Time
+	if (leftright == KEY_RIGHT) {
+		if(gWorldStatus[0] == MAX_TIME_ID) {
+			gWorldStatus[0] = MIN_TIME_ID;
+		}
+		else {
+			gWorldStatus[0]++;
+		}
+		format(cString, 128, "World Time: %d~n~Weather ID: %d", gWorldStatus[0], gWorldStatus[1]);
+    	GameTextForPlayer(playerid, cString, 1500, 3);
+		SetWorldTime(gWorldStatus[0]);
+	}
+
+	// Left key decreases World Time
+	if (leftright == KEY_LEFT) {
+	    if(gWorldStatus[0] == MIN_TIME_ID) {
+	        gWorldStatus[0] = MAX_TIME_ID;
+	    }
+	    else {
+	        gWorldStatus[0]--;
+	    }
+		format(cString, 128, "World Time: %d~n~Weather ID: %d", gWorldStatus[0], gWorldStatus[1]);
+    	GameTextForPlayer(playerid, cString, 1500, 3);
+		SetWorldTime(gWorldStatus[0]);
+	}
+
+	// Up key increases Weather ID
+	if(updown == KEY_UP) {
+		if(gWorldStatus[1] == MAX_WEAT_ID) {
+			gWorldStatus[1] = MIN_WEAT_ID;
+		}
+		else {
+		        gWorldStatus[1]++;
+		}
+		format(cString, 128, "World Time: %d~n~Weather ID: %d", gWorldStatus[0], gWorldStatus[1]);
+    	GameTextForPlayer(playerid, cString, 1500, 3);
+		SetWeather(gWorldStatus[1]);
+	}
+
+	// Down key decreases Weather ID
+	if(updown == KEY_DOWN) {
+		if(gWorldStatus[1] == MIN_WEAT_ID) {
+			gWorldStatus[1] = MAX_WEAT_ID;
+		}
+		else {
+		        gWorldStatus[1]--;
+		}
+		format(cString, 128, "World Time: %d~n~Weather ID: %d", gWorldStatus[0], gWorldStatus[1]);
+    	GameTextForPlayer(playerid, cString, 1500, 3);
+		SetWeather(gWorldStatus[1]);
+	}
+
+	// Action key exits WorldSelection
+	if(keys & KEY_ACTION) {
+		SetCameraBehindPlayer(playerid);
+		TogglePlayerControllable(playerid, 1);
+
+		format(cString, 128, "[SUCCESS]: Time changed to %d hours and weather changed to WEATHERID %d", gWorldStatus[0], gWorldStatus[1]);
+		SendClientMessage(playerid, COLOR_GREEN, cString);
+
+		new File:F_WORLD = fopen("TIME-WEATHER.txt", io_append);
+
+		if(F_WORLD) {
+		    new h, m, s, Y, M, D;
+
+			getdate(Y, M, D);
+			gettime(h, m, s);
+
+			format(cString, 128, "// %d-%d-%d @ %d:%d:%d\r\nSetWeather(%d);\r\nSetWorldTime(%d);\r\n", D, M, Y, h, m, s);
+
+			fwrite(F_WORLD, cString);
+			fclose(F_WORLD);
+			printf("\n%s\n",cString);
+		}
+		else {
+			print("Failed to create the file \"TIME-WEATHER.txt\".\n");
+		}
+
+		gPlayerStatus[playerid] = 0;
+		KillTimer(gPlayerTimers[playerid]);
+
+		return;
+	}
+}
+
+#endif
+
+#if SKIN_SELECT == true
+public SkinSelect(playerid)
+{   // Created by Simon
+	/*
+	// Make sure the player is not in skin selection before continuing
+	if (gPlayerStatus[playerid] != SKIN_SEL_STAT) {
+		KillTimer(skinTimerID[playerid]);
+        return;
+	}
+	*/
+
+	new keys, updown, leftright;
+
+    GetPlayerKeys(playerid, keys, updown, leftright);
+
+	new cString[128];
+
+	// Right key increases Skin ID
+	if (leftright == KEY_RIGHT) {
+		if(curPlayerSkin[playerid] == MAX_SKIN_ID) {
+			curPlayerSkin[playerid] = MIN_SKIN_ID;
+		}
+		else {
+  			curPlayerSkin[playerid]++;
+	    }
+		while(IsInvalidSkin(curPlayerSkin[playerid])) {
+			curPlayerSkin[playerid]++;
+		}
+
+  		format(cString, 128, "Skin ID: %d", curPlayerSkin[playerid]);
+    	GameTextForPlayer(playerid, cString, 1500, 3);
+	    SetPlayerSkin(playerid, curPlayerSkin[playerid]);
+	}
+
+	// Left key decreases Skin ID
+	if(leftright == KEY_LEFT) {
+ 		if(curPlayerSkin[playerid] == MIN_SKIN_ID) {
+			curPlayerSkin[playerid] = MAX_SKIN_ID;
+		}
+		else {
+			curPlayerSkin[playerid]--;
+		}
+		while(IsInvalidSkin(curPlayerSkin[playerid])) {
+			curPlayerSkin[playerid]--;
+		}
+
+		format(cString, 128, "Skin ID: %d", curPlayerSkin[playerid]);
+  		GameTextForPlayer(playerid, cString, 1500, 3);
+  		SetPlayerSkin(playerid, curPlayerSkin[playerid]);
+	}
+
+	// Action key exits skin selection
+	if(keys & KEY_ACTION)
+	{
+		SetCameraBehindPlayer(playerid);
+		TogglePlayerControllable(playerid, 1);
+
+		format(cString, 128, "[SUCCESS]: You have changed to SKINID %d", curPlayerSkin[playerid]);
+		SendClientMessage(playerid, COLOR_GREEN, cString);
+
+		gPlayerStatus[playerid] = 0;
+		KillTimer(gPlayerTimers[playerid]);
+	}
+}
+#endif
+
+#if CAME_SELECT == true
+public CameraSelect(playerid)
+{
+	// CMODE_A 0	Up/Down = IncreaseZ/DecreaseZ; Left/Right = IncreaseX/DecreaseX; Num4/Num6 = IncreaseY/DecreaseY
+	// CMODE_B 1	Up/Down = Rotate Up/Down; Left/Right = Rotate Left/Right; Num4/Num6 = Move Left/Right
+
+	new keys, updown, leftright;
+
+	GetPlayerKeys(playerid, keys, updown, leftright);
+
+	printf("Player (%d) keys = %d, updown = %d, leftright = %d", playerid, keys, updown, leftright);
+
+	if (curPlayerCamD[playerid][CMODE] == CMODE_A)
+	{
+	    if (leftright == KEY_RIGHT) {
+	        curPlayerCamD[playerid][CPOS_X] += curPlayerCamD[playerid][RATE];
+	        curPlayerCamD[playerid][CLOO_X] += curPlayerCamD[playerid][RATE];
+
+	        SetPlayerPos(playerid, curPlayerCamD[playerid][CPOS_X], curPlayerCamD[playerid][CPOS_Y], curPlayerCamD[playerid][CPOS_Z]);
+
+	        SetPlayerCameraPos(playerid, curPlayerCamD[playerid][CPOS_X], curPlayerCamD[playerid][CPOS_Y], curPlayerCamD[playerid][CPOS_Z]);
+	        SetPlayerCameraLookAt(playerid, curPlayerCamD[playerid][CLOO_X], curPlayerCamD[playerid][CLOO_Y], curPlayerCamD[playerid][CLOO_Z]);
+	 	}
+
+		if (leftright == KEY_LEFT) {
+	        curPlayerCamD[playerid][CPOS_X] -= curPlayerCamD[playerid][RATE];
+	        curPlayerCamD[playerid][CLOO_X] -= curPlayerCamD[playerid][RATE];
+
+	        SetPlayerPos(playerid, curPlayerCamD[playerid][CPOS_X], curPlayerCamD[playerid][CPOS_Y], curPlayerCamD[playerid][CPOS_Z]);
+
+	        SetPlayerCameraPos(playerid, curPlayerCamD[playerid][CPOS_X], curPlayerCamD[playerid][CPOS_Y], curPlayerCamD[playerid][CPOS_Z]);
+	        SetPlayerCameraLookAt(playerid, curPlayerCamD[playerid][CLOO_X], curPlayerCamD[playerid][CLOO_Y], curPlayerCamD[playerid][CLOO_Z]);
+		}
+
+		if (updown == KEY_UP) {
+			curPlayerCamD[playerid][CPOS_Z] += curPlayerCamD[playerid][RATE];
+	        curPlayerCamD[playerid][CLOO_Z] += curPlayerCamD[playerid][RATE];
+
+	        SetPlayerPos(playerid, curPlayerCamD[playerid][CPOS_X], curPlayerCamD[playerid][CPOS_Y], curPlayerCamD[playerid][CPOS_Z]);
+
+	        SetPlayerCameraPos(playerid, curPlayerCamD[playerid][CPOS_X], curPlayerCamD[playerid][CPOS_Y], curPlayerCamD[playerid][CPOS_Z]);
+	        SetPlayerCameraLookAt(playerid, curPlayerCamD[playerid][CLOO_X], curPlayerCamD[playerid][CLOO_Y], curPlayerCamD[playerid][CLOO_Z]);
+		}
+
+		if (updown == KEY_DOWN) {
+  			curPlayerCamD[playerid][CPOS_Z] -= curPlayerCamD[playerid][RATE];
+	        curPlayerCamD[playerid][CLOO_Z] -= curPlayerCamD[playerid][RATE];
+
+	        SetPlayerPos(playerid, curPlayerCamD[playerid][CPOS_X], curPlayerCamD[playerid][CPOS_Y], curPlayerCamD[playerid][CPOS_Z]);
+
+	        SetPlayerCameraPos(playerid, curPlayerCamD[playerid][CPOS_X], curPlayerCamD[playerid][CPOS_Y], curPlayerCamD[playerid][CPOS_Z]);
+	        SetPlayerCameraLookAt(playerid, curPlayerCamD[playerid][CLOO_X], curPlayerCamD[playerid][CLOO_Y], curPlayerCamD[playerid][CLOO_Z]);
+		}
+
+		if (keys & KEY_ANALOG_RIGHT) {
+		    curPlayerCamD[playerid][CPOS_Y] += curPlayerCamD[playerid][RATE];
+	        curPlayerCamD[playerid][CLOO_Y] += curPlayerCamD[playerid][RATE];
+
+	        SetPlayerPos(playerid, curPlayerCamD[playerid][CPOS_X], curPlayerCamD[playerid][CPOS_Y], curPlayerCamD[playerid][CPOS_Z]);
+
+	        SetPlayerCameraPos(playerid, curPlayerCamD[playerid][CPOS_X], curPlayerCamD[playerid][CPOS_Y], curPlayerCamD[playerid][CPOS_Z]);
+	        SetPlayerCameraLookAt(playerid, curPlayerCamD[playerid][CLOO_X], curPlayerCamD[playerid][CLOO_Y], curPlayerCamD[playerid][CLOO_Z]);
+		}
+
+
+		if (keys & KEY_ANALOG_LEFT) {
+		    curPlayerCamD[playerid][CPOS_Y] -= curPlayerCamD[playerid][RATE];
+	        curPlayerCamD[playerid][CLOO_Y] -= curPlayerCamD[playerid][RATE];
+
+	        SetPlayerPos(playerid, curPlayerCamD[playerid][CPOS_X], curPlayerCamD[playerid][CPOS_Y], curPlayerCamD[playerid][CPOS_Z]);
+
+	        SetPlayerCameraPos(playerid, curPlayerCamD[playerid][CPOS_X], curPlayerCamD[playerid][CPOS_Y], curPlayerCamD[playerid][CPOS_Z]);
+	        SetPlayerCameraLookAt(playerid, curPlayerCamD[playerid][CLOO_X], curPlayerCamD[playerid][CLOO_Y], curPlayerCamD[playerid][CLOO_Z]);
+		}
+	}
+
+
+	if(curPlayerCamD[playerid][CMODE] == CMODE_B)
+	{
+	    if (leftright == KEY_RIGHT) {
+	        // Rotate Y +
+   		}
+
+   		if (leftright == KEY_LEFT) {
+   		    // Rotate Y -
+   		}
+
+   		if (updown == KEY_UP) {
+   		    // Rotate X +
+   		}
+
+   		if (updown == KEY_DOWN) {
+   		    // Rotate X -
+   		}
+
+   		if (keys & KEY_ANALOG_RIGHT) {
+   		    // Rotate Z +
+   		}
+
+   		if (keys & KEY_ANALOG_LEFT) {
+   		    // Rotate Z -
+   		}
+	}
+
+	if (keys & KEY_ACTION)
+	{
+	    SetCameraBehindPlayer(playerid);
+
+        new
+			File:F_CAMERA = fopen("CAMERA.txt", io_append);
+
+		if( F_CAMERA )
+		{
+ 			new
+				cString[512], h, m, s, Y, M, D;
+
+			getdate(Y, M, D);
+			gettime(h, m, s);
+
+			format(cString, sizeof( cString ), "// %d-%d-%d @ %d:%d:%d\r\nSetPlayerCameraPos(playerid, %f, %f, %f);\r\nSetPlayerCameraLookAt(playerid, %f, %f, %f);\r\n", D, M, Y, h, m, s,curPlayerCamD[playerid][CPOS_X],curPlayerCamD[playerid][CPOS_Y],curPlayerCamD[playerid][CPOS_Z],curPlayerCamD[playerid][CLOO_X],curPlayerCamD[playerid][CLOO_Y],curPlayerCamD[playerid][CLOO_Z]);
+
+			fwrite(F_CAMERA, cString);
+			fclose(F_CAMERA);
+
+			printf("\n%s\n",cString);
+
+			SendClientMessage( playerid, COLOR_GREEN, "Current camera data saved to 'CAMERA.txt'" );
+		}
+		else
+			print("Failed to create the file \"CAMERA.txt\".\n");
+
+		TogglePlayerControllable(playerid, 1);
+
+		KillTimer(gPlayerTimers[playerid]);
+
+		gPlayerStatus[playerid] = 0;
+	}
+}
+
+#endif
+
+#if VEHI_SELECT == true
+public VehicleSelect(playerid)
+{
+	/*
+	// Make sure the player is not in skin selection before continuing
+	if (gPlayerStatus[playerid] != VEHI_SEL_STAT) {
+		KillTimer(skinTimerID[playerid]);
+        return;
+	}
+	*/
+
+	new keys, updown, leftright;
+
+    GetPlayerKeys(playerid, keys, updown, leftright);
+
+	new cString[128];
+
+	// Right key increases Vehicle MODELID
+	if (leftright == KEY_RIGHT) {
+		if(curPlayerVehM[playerid] == MAX_VEHI_ID) {
+			curPlayerVehM[playerid] = MIN_VEHI_ID;
+		}
+		else {
+  			curPlayerVehM[playerid]++;
+	    }
+
+		format(cString, 128, "Model ID: %d~n~Vehicle Name: %s", curPlayerVehM, aVehicleNames[curPlayerVehM[playerid] - MIN_VEHI_ID]);
+    	GameTextForPlayer(playerid, cString, 1500, 3);
+
+    	new Float:x, Float:y, Float:z, Float:a;
+
+		GetPlayerPos(playerid, x, y, z);
+		GetXYInFrontOfPlayer(playerid, x, y, VEHI_DIS);
+		GetPlayerFacingAngle(playerid, a);
+
+		DestroyVehicle(curPlayerVehI[playerid]);
+		curServerVehP[curPlayerVehI[playerid]][spawn] 	= false;
+
+		curPlayerVehI[playerid] = CreateVehicle(curPlayerVehM[playerid], x, y, z + 2.0, a + 90.0, -1, -1, 5000);
+		printf( "vsel vehicle select id = %d", curPlayerVehI[playerid] );
+
+        LinkVehicleToInterior(curPlayerVehI[playerid], GetPlayerInterior(playerid));
+
+        curServerVehP[curPlayerVehI[playerid]][spawn] 	= true;
+		curServerVehP[curPlayerVehI[playerid]][vmodel]	= curPlayerVehM[playerid];
+		curServerVehP[curPlayerVehI[playerid]][vInt]    = GetPlayerInterior(playerid);
+	}
+
+	// Left key decreases Vehicle MODELID
+	if(leftright == KEY_LEFT) {
+ 		if(curPlayerVehM[playerid] == MIN_VEHI_ID) {
+			curPlayerVehM[playerid] = MAX_VEHI_ID;
+		}
+		else {
+			curPlayerVehM[playerid]--;
+		}
+
+		format(cString, 128, "Model ID: %d~n~Vehicle Name: %s", curPlayerVehM, aVehicleNames[curPlayerVehM[playerid] - MIN_VEHI_ID]);
+  		GameTextForPlayer(playerid, cString, 1500, 3);
+
+   		new Float:x, Float:y, Float:z, Float:a;
+
+		GetPlayerPos(playerid, x, y, z);
+		GetXYInFrontOfPlayer(playerid, x, y, VEHI_DIS);
+		GetPlayerFacingAngle(playerid, a);
+
+		DestroyVehicle(curPlayerVehI[playerid]);
+		curServerVehP[curPlayerVehI[playerid]][spawn] 	= false;
+
+		curPlayerVehI[playerid] = CreateVehicle(curPlayerVehM[playerid], x, y, z + 2.0, a + 90.0, -1, -1, 5000);
+		printf( "vsel vehicle select id = %d", curPlayerVehI[playerid] );
+
+		LinkVehicleToInterior(curPlayerVehI[playerid], GetPlayerInterior(playerid));
+
+ 		curServerVehP[curPlayerVehI[playerid]][spawn] 	= true;
+		curServerVehP[curPlayerVehI[playerid]][vmodel]	= curPlayerVehM[playerid];
+		curServerVehP[curPlayerVehI[playerid]][vInt]    = GetPlayerInterior(playerid);
+	}
+
+	// Action key exits vehicle selection
+	if(keys & KEY_ACTION)
+	{
+		SetCameraBehindPlayer(playerid);
+		TogglePlayerControllable(playerid, 1);
+
+		format(cString, 128, "[SUCCESS]: Spawned a \"%s\" (MODELID: %d, VEHICLEID: %d)", aVehicleNames[curPlayerVehM[playerid] - MIN_VEHI_ID], curPlayerVehM[playerid], curPlayerVehI[playerid]);
+		SendClientMessage(playerid, COLOR_GREEN, cString);
+
+		gPlayerStatus[playerid] = 0;
+		KillTimer(gPlayerTimers[playerid]);
+	}
+}
+#endif
+
+#if OBJE_SELECT == true
+public ObjectSelect( playerid )
+{
+	new keys, updown, leftright;
+
+    GetPlayerKeys( playerid, keys, updown, leftright );
+
+	new cString[ 128 ];
+
+	switch ( curPlayerObjM[ playerid ][ OBJ_MOD ] )
+	{
+		case O_MODE_SELECTOR:
+		{
+			if ( updown == KEY_UP)
+			{
+				curPlayerObjM[ playerid ][ OBJ_MDL ] += 10;
+
+				if ( curPlayerObjM[ playerid ][ OBJ_MDL ] >= MAX_OBJE_ID )
+				{
+					curPlayerObjM[ playerid ][ OBJ_MDL ] = MIN_OBJE_ID;
+				}
+
+				while ( !IsValidModel( curPlayerObjM[ playerid ][ OBJ_MDL ] ) )
+				{
+					curPlayerObjM[ playerid ][ OBJ_MDL ]++;
+				}
+
+				DestroyObject( curPlayerObjI[ playerid ] );
+				curPlayerObjI[ playerid ] = CreateObject( curPlayerObjM[ playerid ][ OBJ_MDL ], curPlayerObjM[ playerid ][ OBJ_X ],
+					curPlayerObjM[ playerid ][ OBJ_Y ], curPlayerObjM[ playerid ][ OBJ_Z ],
+					curPlayerObjM[ playerid ][ OBJ_RX ], curPlayerObjM[ playerid ][ OBJ_RY ], curPlayerObjM[ playerid ][ OBJ_RZ ]
+				);
+
+				format( cString, 128, "Model ID: %d", curPlayerObjM[ playerid ][ OBJ_MDL ] );
+  				GameTextForPlayer(playerid, cString, 1500, 3);
+			}
+
+			if ( updown == KEY_DOWN)
+			{
+				curPlayerObjM[ playerid ][ OBJ_MDL ] -= 10;
+
+				if ( curPlayerObjM[ playerid ][ OBJ_MDL ] <= MIN_OBJE_ID )
+				{
+					curPlayerObjM[ playerid ][ OBJ_MDL ] = MAX_OBJE_ID;
+				}
+
+				while ( !IsValidModel( curPlayerObjM[ playerid ][ OBJ_MDL ] ) )
+				{
+					curPlayerObjM[ playerid ][ OBJ_MDL ]--;
+				}
+
+				DestroyObject( curPlayerObjI[ playerid ] );
+				curPlayerObjI[ playerid ] = CreateObject( curPlayerObjM[ playerid ][ OBJ_MDL ], curPlayerObjM[ playerid ][ OBJ_X ],
+					curPlayerObjM[ playerid ][ OBJ_Y ], curPlayerObjM[ playerid ][ OBJ_Z ],
+					curPlayerObjM[ playerid ][ OBJ_RX ], curPlayerObjM[ playerid ][ OBJ_RY ], curPlayerObjM[ playerid ][ OBJ_RZ ]
+				);
+
+				format( cString, 128, "Model ID: %d", curPlayerObjM[ playerid ][ OBJ_MDL ] );
+  				GameTextForPlayer(playerid, cString, 1500, 3);
+			}
+
+			if ( leftright == KEY_LEFT)
+			{
+				curPlayerObjM[ playerid ][ OBJ_MDL ]--;
+
+				if ( curPlayerObjM[ playerid ][ OBJ_MDL ] <= MIN_OBJE_ID )
+				{
+					curPlayerObjM[ playerid ][ OBJ_MDL ] = MAX_OBJE_ID;
+				}
+
+				while ( !IsValidModel( curPlayerObjM[ playerid ][ OBJ_MDL ] ) )
+				{
+					curPlayerObjM[ playerid ][ OBJ_MDL ]--;
+				}
+
+				DestroyObject( curPlayerObjI[ playerid ] );
+				curPlayerObjI[ playerid ] = CreateObject( curPlayerObjM[ playerid ][ OBJ_MDL ], curPlayerObjM[ playerid ][ OBJ_X ],
+					curPlayerObjM[ playerid ][ OBJ_Y ], curPlayerObjM[ playerid ][ OBJ_Z ],
+					curPlayerObjM[ playerid ][ OBJ_RX ], curPlayerObjM[ playerid ][ OBJ_RY ], curPlayerObjM[ playerid ][ OBJ_RZ ]
+				);
+
+				format( cString, 128, "Model ID: %d", curPlayerObjM[ playerid ][ OBJ_MDL ] );
+  				GameTextForPlayer(playerid, cString, 1500, 3);
+			}
+
+			if ( leftright == KEY_RIGHT)
+			{
+				curPlayerObjM[ playerid ][ OBJ_MDL ]++;
+
+				if ( curPlayerObjM[ playerid ][ OBJ_MDL ] >= MAX_OBJE_ID )
+				{
+					curPlayerObjM[ playerid ][ OBJ_MDL ] = MIN_OBJE_ID;
+				}
+
+				while ( !IsValidModel( curPlayerObjM[ playerid ][ OBJ_MDL ] ) )
+				{
+					curPlayerObjM[ playerid ][ OBJ_MDL ]++;
+				}
+
+				DestroyObject( curPlayerObjI[ playerid ] );
+				curPlayerObjI[ playerid ] = CreateObject( curPlayerObjM[ playerid ][ OBJ_MDL ], curPlayerObjM[ playerid ][ OBJ_X ],
+					curPlayerObjM[ playerid ][ OBJ_Y ], curPlayerObjM[ playerid ][ OBJ_Z ],
+					curPlayerObjM[ playerid ][ OBJ_RX ], curPlayerObjM[ playerid ][ OBJ_RY ], curPlayerObjM[ playerid ][ OBJ_RZ ]
+				);
+
+				format( cString, 128, "Model ID: %d", curPlayerObjM[ playerid ][ OBJ_MDL ] );
+  				GameTextForPlayer(playerid, cString, 1500, 3);
+			}
+		}
+
+		case O_MODE_MOVER:
+		{
+			if ( updown == KEY_UP)
+			{
+				curPlayerObjM[ playerid ][ OBJ_Z ] += pObjectRate[ playerid ][ OBJ_RATE_MOVE ];
+				curPlayerCamD[ playerid ][ CPOS_Z ] += pObjectRate[ playerid ][ OBJ_RATE_MOVE ];
+	        	curPlayerCamD[ playerid ][ CLOO_Z ] += pObjectRate[ playerid ][ OBJ_RATE_MOVE ];
+			}
+
+			if ( updown == KEY_DOWN)
+			{
+				curPlayerObjM[ playerid ][ OBJ_Z ] -= pObjectRate[ playerid ][ OBJ_RATE_MOVE ];
+				curPlayerCamD[ playerid ][ CPOS_Z ] -= pObjectRate[ playerid ][ OBJ_RATE_MOVE ];
+	        	curPlayerCamD[ playerid ][ CLOO_Z ] -= pObjectRate[ playerid ][ OBJ_RATE_MOVE ];
+			}
+
+			if ( leftright == KEY_LEFT)
+			{
+				curPlayerObjM[ playerid ][ OBJ_Y ] -= pObjectRate[ playerid ][ OBJ_RATE_MOVE ];
+				curPlayerCamD[ playerid ][ CPOS_Y ] -= pObjectRate[ playerid ][ OBJ_RATE_MOVE ];
+	        	curPlayerCamD[ playerid ][ CLOO_Y ] -= pObjectRate[ playerid ][ OBJ_RATE_MOVE ];
+			}
+
+			if ( leftright == KEY_RIGHT)
+			{
+				curPlayerObjM[ playerid ][ OBJ_Y ] += pObjectRate[ playerid ][ OBJ_RATE_MOVE ];
+				curPlayerCamD[ playerid ][ CPOS_Y ] += pObjectRate[ playerid ][ OBJ_RATE_MOVE ];
+	        	curPlayerCamD[ playerid ][ CLOO_Y ] += pObjectRate[ playerid ][ OBJ_RATE_MOVE ];
+			}
+
+			if ( keys & KEY_ANALOG_LEFT )
+			{
+				curPlayerObjM[ playerid ][ OBJ_Y ] -= pObjectRate[ playerid ][ OBJ_RATE_MOVE ];
+				curPlayerCamD[ playerid ][ CPOS_Y ] -= pObjectRate[ playerid ][ OBJ_RATE_MOVE ];
+	        	curPlayerCamD[ playerid ][ CLOO_Y ] -= pObjectRate[ playerid ][ OBJ_RATE_MOVE ];
+			}
+
+			if ( keys & KEY_ANALOG_LEFT )
+			{
+				curPlayerObjM[ playerid ][ OBJ_X ] += pObjectRate[ playerid ][ OBJ_RATE_MOVE ];
+				curPlayerCamD[ playerid ][ CPOS_X ] += pObjectRate[ playerid ][ OBJ_RATE_MOVE ];
+	        	curPlayerCamD[ playerid ][ CLOO_X ] += pObjectRate[ playerid ][ OBJ_RATE_MOVE ];
+			}
+
+			SetPlayerPos( playerid, curPlayerCamD[playerid][CPOS_X], curPlayerCamD[playerid][CPOS_Y], curPlayerCamD[playerid][CPOS_Z] );
+			SetObjectPos( curPlayerObjI[ playerid ], curPlayerObjM[ playerid ][ OBJ_X ], curPlayerObjM[ playerid ][ OBJ_Y ], curPlayerObjM[ playerid ][ OBJ_Z ] );
+			SetPlayerCameraPos(playerid, curPlayerCamD[playerid][CPOS_X], curPlayerCamD[playerid][CPOS_Y], curPlayerCamD[playerid][CPOS_Z]);
+	        SetPlayerCameraLookAt(playerid, curPlayerCamD[playerid][CLOO_X], curPlayerCamD[playerid][CLOO_Y], curPlayerCamD[playerid][CLOO_Z]);
+		}
+
+		case O_MODE_ROTATOR:
+		{
+			if ( updown == KEY_UP)
+			{
+				curPlayerObjM[ playerid ][ OBJ_RZ ] += pObjectRate[ playerid ][ OBJ_RATE_ROT ];
+			}
+
+			if ( updown == KEY_DOWN)
+			{
+				curPlayerObjM[ playerid ][ OBJ_RZ ] -= pObjectRate[ playerid ][ OBJ_RATE_ROT ];
+
+			}
+
+			if ( leftright == KEY_LEFT)
+			{
+				curPlayerObjM[ playerid ][ OBJ_RY ] -= pObjectRate[ playerid ][ OBJ_RATE_ROT ];
+			}
+
+			if ( leftright == KEY_RIGHT)
+			{
+				curPlayerObjM[ playerid ][ OBJ_RY ] += pObjectRate[ playerid ][ OBJ_RATE_ROT ];
+			}
+
+			if ( keys & KEY_ANALOG_LEFT )
+			{
+				curPlayerObjM[ playerid ][ OBJ_RY ] -= pObjectRate[ playerid ][ OBJ_RATE_ROT ];
+			}
+
+			if ( keys & KEY_ANALOG_LEFT )
+			{
+				curPlayerObjM[ playerid ][ OBJ_RX ] += pObjectRate[ playerid ][ OBJ_RATE_ROT ];
+			}
+
+			SetObjectRot( curPlayerObjI[ playerid ], curPlayerObjM[ playerid ][ OBJ_RX ], curPlayerObjM[ playerid ][ OBJ_RY ], curPlayerObjM[ playerid ][ OBJ_RZ ] );
+		}
+	}
+
+	if ( keys & KEY_ACTION )
+	{
+		gPlayerStatus[ playerid ] = 0;
+		TogglePlayerControllable( playerid, 1 );
+		SetCameraBehindPlayer( playerid );
+		KillTimer( gPlayerTimers[playerid] );
+	}
+
+}
+#endif
+
+IsInvalidSkin(skinid)
+{   // Created by Simon
+	// Checks whether the skinid parsed is crashable or not.
+
+	#define	MAX_BAD_SKINS   14
+
+	new badSkins[MAX_BAD_SKINS] = {
+		3, 4, 5, 6, 8, 42, 65, 74, 86,
+		119, 149, 208, 273, 289
+	};
+
+	for (new i = 0; i < MAX_BAD_SKINS; i++) {
+	    if (skinid == badSkins[i]) return true;
+	}
+
+	return false;
+}
+
+GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
+{	// Created by Y_Less
+
+	new Float:a;
+
+	GetPlayerPos(playerid, x, y, a);
+	GetPlayerFacingAngle(playerid, a);
+
+	if (GetPlayerVehicleID(playerid)) {
+	    GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
+	}
+
+	x += (distance * floatsin(-a, degrees));
+	y += (distance * floatcos(-a, degrees));
+}
+
+strtok(const string[], &index)
+{   // Created by Compuphase
+
+	new length = strlen(string);
+	while ((index < length) && (string[index] <= ' '))
+	{
+		index++;
+	}
+
+	new offset = index;
+	new result[20];
+	while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
+	{
+		result[index - offset] = string[index];
+		index++;
+	}
+	result[index - offset] = EOS;
+	return result;
+}
+
+GetVehicleModelIDFromName(vname[])
+{
+	for(new i = 0; i < 211; i++)
+	{
+		if ( strfind(aVehicleNames[i], vname, true) != -1 )
+			return i + MIN_VEHI_ID;
+	}
+	return -1;
+}
+
+GetWeaponModelIDFromName(wname[])
+{
+    for(new i = 0; i < 48; i++) {
+        if (i == 19 || i == 20 || i == 21) continue;
+		if (strfind(aWeaponNames[i], wname, true) != -1) {
+			return i;
+		}
+	}
+	return -1;
+}
+
+IsValidModel(modelid)
+{
+	// Created by Y_Less.
+
+	static modeldat[] =
+	{
+		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -128,
+		-515899393, -134217729, -1, -1, 33554431, -1, -1, -1, -14337, -1, -33,
+		127, 0, 0, 0, 0, 0, -8388608, -1, -1, -1, -16385, -1, -1, -1, -1, -1,
+		-1, -1, -33, -1, -771751937, -1, -9, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+		-1, -1, -1, -1, -1, -1, -1, -1, 33554431, -25, -1, -1, -1, -1, -1, -1,
+		-1073676289, -2147483648, 34079999, 2113536, -4825600, -5, -1, -3145729,
+		-1, -16777217, -63, -1, -1, -1, -1, -201326593, -1, -1, -1, -1, -1,
+		-257, -1, 1073741823, -133122, -1, -1, -65, -1, -1, -1, -1, -1, -1,
+		-2146435073, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1073741823, -64, -1,
+		-1, -1, -1, -2635777, 134086663, 0, -64, -1, -1, -1, -1, -1, -1, -1,
+		-536870927, -131069, -1, -1, -1, -1, -1, -1, -1, -1, -16384, -1,
+		-33554433, -1, -1, -1, -1, -1, -1610612737, 524285, -128, -1,
+		2080309247, -1, -1, -1114113, -1, -1, -1, 66977343, -524288, -1, -1, -1,
+		-1, -2031617, -1, 114687, -256, -1, -4097, -1, -4097, -1, -1,
+		1010827263, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -32768, -1, -1, -1, -1, -1,
+		2147483647, -33554434, -1, -1, -49153, -1148191169, 2147483647,
+		-100781080, -262145, -57, 134217727, -8388608, -1, -1, -1, -1, -1, -1,
+		-1, -1, -1, -1, -1, -1, -1, -1, -1048577, -1, -449, -1017, -1, -1, -1,
+		-1, -1, -1, -1, -1, -1, -1, -1, -1835009, -2049, -1, -1, -1, -1, -1, -1,
+		-8193, -1, -536870913, -1, -1, -1, -1, -1, -87041, -1, -1, -1, -1, -1,
+		-1, -209860, -1023, -8388609, -2096897, -1, -1048577, -1, -1, -1, -1,
+		-1, -1, -897, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1610612737,
+		-3073, -28673, -1, -1, -1, -1537, -1, -1, -13, -1, -1, -1, -1, -1985,
+		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1056964609, -1, -1, -1,
+		-1, -1, -1, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+		-236716037, -1, -1, -1, -1, -1, -1, -1, -536870913, 3, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+		-1, -1, -1, -1, -1, -2097153, -2109441, -1, 201326591, -4194304, -1, -1,
+		-241, -1, -1, -1, -1, -1, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, -32768, -1, -1, -1, -2, -671096835, -1, -8388609, -66323585, -13,
+		-1793, -32257, -247809, -1, -1, -513, 16252911, 0, 0, 0, -131072,
+		33554383, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8356095, 0, 0, 0, 0, 0,
+		0, -256, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+		-268435449, -1, -1, -2049, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+		92274627, -65536, -2097153, -268435457, 591191935, 1, 0, -16777216, -1,
+		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 127
+	};
+	if ((modelid >= 0) && ((modelid / 32) < sizeof (modeldat)) && (modeldat[modelid / 32] & (1 << (modelid % 32))))
+	{
+	    return 1;
+	}
+	return 0;
+}

BIN
samp03/filterscripts/gl_actions.amx


+ 371 - 0
samp03/filterscripts/gl_actions.pwn

@@ -0,0 +1,371 @@
+//-------------------------------------------------
+//
+// Generic Special Actions And Anims
+// kyeman 2007
+//
+//-------------------------------------------------
+
+#include <a_samp>
+#include <core>
+#include <float>
+#pragma tabsize 0
+
+#include "../include/gl_common.inc"
+
+new gPlayerUsingLoopingAnim[MAX_PLAYERS];
+new gPlayerAnimLibsPreloaded[MAX_PLAYERS];
+
+new Text:txtAnimHelper;
+
+//-------------------------------------------------
+
+OnePlayAnim(playerid,animlib[],animname[], Float:Speed, looping, lockx, locky, lockz, lp)
+{
+	ApplyAnimation(playerid, animlib, animname, Speed, looping, lockx, locky, lockz, lp);
+}
+
+//-------------------------------------------------
+
+LoopingAnim(playerid,animlib[],animname[], Float:Speed, looping, lockx, locky, lockz, lp)
+{
+    gPlayerUsingLoopingAnim[playerid] = 1;
+    ApplyAnimation(playerid, animlib, animname, Speed, looping, lockx, locky, lockz, lp);
+    TextDrawShowForPlayer(playerid,txtAnimHelper);
+}
+
+//-------------------------------------------------
+
+StopLoopingAnim(playerid)
+{
+	gPlayerUsingLoopingAnim[playerid] = 0;
+    ApplyAnimation(playerid, "CARRY", "crry_prtial", 4.0, 0, 0, 0, 0, 0);
+}
+
+//-------------------------------------------------
+
+PreloadAnimLib(playerid, animlib[])
+{
+	ApplyAnimation(playerid,animlib,"null",0.0,0,0,0,0,0);
+}
+
+//-------------------------------------------------
+
+// ********** CALLBACKS **********
+
+public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
+{
+	if(!gPlayerUsingLoopingAnim[playerid]) return;
+
+	if(IsKeyJustDown(KEY_SPRINT,newkeys,oldkeys)) {
+	    StopLoopingAnim(playerid);
+        TextDrawHideForPlayer(playerid,txtAnimHelper);
+    }
+}
+
+//------------------------------------------------
+
+public OnPlayerDeath(playerid, killerid, reason)
+{
+	// if they die whilst performing a looping anim, we should reset the state
+	if(gPlayerUsingLoopingAnim[playerid]) {
+        gPlayerUsingLoopingAnim[playerid] = 0;
+        TextDrawHideForPlayer(playerid,txtAnimHelper);
+	}
+
+ 	return 1;
+}
+
+//-------------------------------------------------
+
+public OnPlayerSpawn(playerid)
+{
+	if(!gPlayerAnimLibsPreloaded[playerid]) {
+   		PreloadAnimLib(playerid,"BOMBER");
+   		PreloadAnimLib(playerid,"RAPPING");
+    	PreloadAnimLib(playerid,"SHOP");
+   		PreloadAnimLib(playerid,"BEACH");
+   		PreloadAnimLib(playerid,"SMOKING");
+    	PreloadAnimLib(playerid,"FOOD");
+    	PreloadAnimLib(playerid,"ON_LOOKERS");
+    	PreloadAnimLib(playerid,"DEALER");
+		PreloadAnimLib(playerid,"CRACK");
+		PreloadAnimLib(playerid,"CARRY");
+		PreloadAnimLib(playerid,"COP_AMBIENT");
+		PreloadAnimLib(playerid,"PARK");
+		PreloadAnimLib(playerid,"INT_HOUSE");
+		PreloadAnimLib(playerid,"FOOD");
+		gPlayerAnimLibsPreloaded[playerid] = 1;
+	}
+	return 1;
+}
+
+//-------------------------------------------------
+
+public OnPlayerConnect(playerid)
+{
+    gPlayerUsingLoopingAnim[playerid] = 0;
+	gPlayerAnimLibsPreloaded[playerid] = 0;
+	
+	return 1;
+}
+
+//-------------------------------------------------
+
+public OnFilterScriptInit()
+{
+	// Init our text display
+	txtAnimHelper = TextDrawCreate(610.0, 400.0,
+	"~r~~k~~PED_SPRINT~ ~w~to stop the animation");
+	TextDrawUseBox(txtAnimHelper, 0);
+	TextDrawFont(txtAnimHelper, 2);
+	TextDrawSetShadow(txtAnimHelper,0); // no shadow
+    TextDrawSetOutline(txtAnimHelper,1); // thickness 1
+    TextDrawBackgroundColor(txtAnimHelper,0x000000FF);
+    TextDrawColor(txtAnimHelper,0xFFFFFFFF);
+    TextDrawAlignment(txtAnimHelper,3); // align right
+}
+
+//-------------------------------------------------
+
+public OnPlayerCommandText(playerid, cmdtext[])
+{
+	new cmd[256];
+	new idx;
+	new dancestyle;
+	cmd = strtok(cmdtext, idx);
+
+	if(strcmp(cmd,"/animlist",true)==0)
+	{
+		SendClientMessage(playerid,0xAFAFAFAA,"Available Animations:");
+	    SendClientMessage(playerid,0xAFAFAFAA,"/handsup /drunk /bomb /getarrested /laugh /lookout /robman");
+        SendClientMessage(playerid,0xAFAFAFAA,"/crossarms /lay /hide /vomit /eat /wave /taichi");
+        SendClientMessage(playerid,0xAFAFAFAA,"/deal /crack /smokem /smokef /groundsit /chat /dance /f**ku");
+	}
+
+    if(strcmp(cmd, "/amcuffed", true) == 0) {
+		  // note: the cuffs have not been scaled for all player models
+    	 SetPlayerAttachedObject(playerid,8,19418,6,-0.031999,0.024000,-0.024000,-7.900000,-32.000011,-72.299987,1.115998,1.322000,1.406000);
+    	 SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CUFFED);
+         return 1;
+	}
+
+	 if(strcmp(cmd, "/uncuffme", true) == 0) {
+		 if(IsPlayerAttachedObjectSlotUsed(playerid, 8)) {
+			RemovePlayerAttachedObject(playerid, 8);
+		 }
+         SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
+         return 1;
+	}
+	
+	// We don't handle anything else after this that can be used in vehicles
+	if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) {
+        return 0;
+	}
+
+	// HANDSUP
+ 	if(strcmp(cmd, "/handsup", true) == 0) {
+		SetPlayerSpecialAction(playerid,SPECIAL_ACTION_HANDSUP);
+        return 1;
+    }
+    
+    // CELLPHONE IN
+ 	if(strcmp(cmd, "/cellin", true) == 0) {
+		SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USECELLPHONE);
+        return 1;
+    }
+    
+    // CELLPHONE OUT
+ 	if(strcmp(cmd, "/cellout", true) == 0) {
+		SetPlayerSpecialAction(playerid,SPECIAL_ACTION_STOPUSECELLPHONE);
+        return 1;
+    }
+
+    // Drunk
+    if(strcmp(cmd, "/drunk", true) == 0) {
+		LoopingAnim(playerid,"PED","WALK_DRUNK",4.0,1,1,1,1,0);
+		return 1;
+    }
+    
+	// Place a Bomb
+    if (strcmp("/bomb", cmdtext, true) == 0) {
+		ClearAnimations(playerid);
+		OnePlayAnim(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0); // Place Bomb
+		return 1;
+	}
+	// Police Arrest
+    if (strcmp("/getarrested", cmdtext, true, 7) == 0) {
+	      LoopingAnim(playerid,"ped", "ARRESTgun", 4.0, 0, 1, 1, 1, -1); // Gun Arrest
+		  return 1;
+    }
+	// Laugh
+    if (strcmp("/laugh", cmdtext, true) == 0) {
+          OnePlayAnim(playerid, "RAPPING", "Laugh_01", 4.0, 0, 0, 0, 0, 0); // Laugh
+		  return 1;
+	}
+	// Rob Lookout
+    if (strcmp("/lookout", cmdtext, true) == 0) {
+          OnePlayAnim(playerid, "SHOP", "ROB_Shifty", 4.0, 0, 0, 0, 0, 0); // Rob Lookout
+		  return 1;
+	}
+	// Rob Threat
+    if (strcmp("/robman", cmdtext, true) == 0) {
+          LoopingAnim(playerid, "SHOP", "ROB_Loop_Threat", 4.0, 1, 0, 0, 0, 0); // Rob
+		  return 1;
+	}
+	// Arms crossed
+    if (strcmp("/crossarms", cmdtext, true) == 0) {
+          LoopingAnim(playerid, "COP_AMBIENT", "Coplook_loop", 4.0, 0, 1, 1, 1, -1); // Arms crossed
+		  return 1;
+	}
+	// Lay Down
+    if (strcmp("/lay", cmdtext, true, 6) == 0) {
+          LoopingAnim(playerid,"BEACH", "bather", 4.0, 1, 0, 0, 0, 0); // Lay down
+		  return 1;
+    }
+	// Take Cover
+    if (strcmp("/hide", cmdtext, true, 3) == 0) {
+          LoopingAnim(playerid, "ped", "cower", 3.0, 1, 0, 0, 0, 0); // Taking Cover
+		  return 1;
+	}
+	// Vomit
+    if (strcmp("/vomit", cmdtext, true) == 0) {
+	      OnePlayAnim(playerid, "FOOD", "EAT_Vomit_P", 3.0, 0, 0, 0, 0, 0); // Vomit BAH!
+		  return 1;
+	}
+	// Eat Burger
+    if (strcmp("/eat", cmdtext, true) == 0) {
+	      OnePlayAnim(playerid, "FOOD", "EAT_Burger", 3.0, 0, 0, 0, 0, 0); // Eat Burger
+		  return 1;
+	}
+	// Wave
+    if (strcmp("/wave", cmdtext, true) == 0) {
+	      LoopingAnim(playerid, "ON_LOOKERS", "wave_loop", 4.0, 1, 0, 0, 0, 0); // Wave
+		  return 1;
+	}
+	// Slap Ass
+    if (strcmp("/slapass", cmdtext, true) == 0) {
+         OnePlayAnim(playerid, "SWEET", "sweet_ass_slap", 4.0, 0, 0, 0, 0, 0); // Ass Slapping
+		  return 1;
+	}
+	// Dealer
+    if (strcmp("/deal", cmdtext, true) == 0) {
+          OnePlayAnim(playerid, "DEALER", "DEALER_DEAL", 4.0, 0, 0, 0, 0, 0); // Deal Drugs
+		  return 1;
+	}
+	// Crack Dieing
+    if (strcmp("/crack", cmdtext, true, 6) == 0) {
+          LoopingAnim(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0); // Dieing of Crack
+		  return 1;
+	}
+	// Male Smoking
+    if (strcmp("/smokem", cmdtext, true, 4) == 0) {
+          LoopingAnim(playerid,"SMOKING", "M_smklean_loop", 4.0, 1, 0, 0, 0, 0); // Smoke
+		  return 1;
+	}
+	// Female Smoking
+    if (strcmp("/smokef", cmdtext, true) == 0) {
+          LoopingAnim(playerid, "SMOKING", "F_smklean_loop", 4.0, 1, 0, 0, 0, 0); // Female Smoking
+		  return 1;
+	}
+	// Sit
+    if (strcmp("/groundsit", cmdtext, true, 4) == 0) {
+          LoopingAnim(playerid,"BEACH", "ParkSit_M_loop", 4.0, 1, 0, 0, 0, 0); // Sit
+		  return 1;
+    }
+    // Idle Chat
+    if(strcmp(cmd, "/chat", true) == 0) {
+		 OnePlayAnim(playerid,"PED","IDLE_CHAT",4.0,0,0,0,0,0);
+         return 1;
+    }
+    // Fucku
+    if(strcmp(cmd, "/fucku", true) == 0) {
+		 OnePlayAnim(playerid,"PED","fucku",4.0,0,0,0,0,0);
+         return 1;
+    }
+    // TaiChi
+    if(strcmp(cmd, "/taichi", true) == 0) {
+		 LoopingAnim(playerid,"PARK","Tai_Chi_Loop",4.0,1,0,0,0,0);
+         return 1;
+    }
+    
+    // ChairSit
+    if(strcmp(cmd, "/chairsit", true) == 0) {
+		 LoopingAnim(playerid,"BAR","dnk_stndF_loop",4.0,1,0,0,0,0);
+         return 1;
+    }
+    
+    // Collapse
+    if(strcmp(cmd, "/collapse", true) == 0) {
+		 LoopingAnim(playerid,"PED","FALL_COLLAPSE",4.0,1,0,0,0,0);
+         return 1;
+    }
+    
+     // fall
+    if(strcmp(cmd, "/fallover", true) == 0) {
+		 LoopingAnim(playerid,"PED","FALL_FALL",4.0,1,0,0,0,0);
+         return 1;
+    }
+
+    // ko
+    if(strcmp(cmd, "/ko1", true) == 0) {
+		 LoopingAnim(playerid,"PED","KO_SHOT_STOM",200.0, 0, 1, 1, 1, -1);
+         return 1;
+    }
+    
+    // ko
+    if(strcmp(cmd, "/ko2", true) == 0) {
+		 LoopingAnim(playerid,"PED","KO_SHOT_FACE",4.0, 0, 1, 1, 1, -1);
+         return 1;
+    }
+    
+    if(strcmp(cmd, "/floorhit", true) == 0) {
+         ApplyAnimation(playerid,"PED", "FLOOR_hit_f", 4.1, 0, 0, 0, 1, 0);
+         return 1;
+    }
+
+    /* Would allow people to troll... but would be cool as a script
+	   controlled function
+    // Bed Sleep R
+    if(strcmp(cmd, "/inbedright", true) == 0) {
+		 LoopingAnim(playerid,"INT_HOUSE","BED_Loop_R",4.0,1,0,0,0,0);
+         return 1;
+    }
+    // Bed Sleep L
+    if(strcmp(cmd, "/inbedleft", true) == 0) {
+		 LoopingAnim(playerid,"INT_HOUSE","BED_Loop_L",4.0,1,0,0,0,0);
+         return 1;
+    }*/
+
+	// START DANCING
+ 	if(strcmp(cmd, "/dance", true) == 0) {
+		    new tmp[256];
+
+			// Get the dance style param
+      		tmp = strtok(cmdtext, idx);
+			if(!strlen(tmp) || strlen(tmp) > 2) {
+				SendClientMessage(playerid,0xFF0000FF,"USAGE: /dance [style 1-4]");
+				return 1;
+			}
+			
+			dancestyle = strval(tmp);
+			if(dancestyle < 1 || dancestyle > 4) {
+			    SendClientMessage(playerid,0xFF0000FF,"USAGE: /dance [style 1-4]");
+			    return 1;
+			}
+			
+			if(dancestyle == 1) {
+			    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE1);
+			} else if(dancestyle == 2) {
+			    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE2);
+			} else if(dancestyle == 3) {
+			    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE3);
+			} else if(dancestyle == 4) {
+			    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE4);
+			}
+ 	  		return 1;
+	}
+
+	return 0;
+}
+//-------------------------------------------------
+// EOF

BIN
samp03/filterscripts/gl_chat.amx


+ 293 - 0
samp03/filterscripts/gl_chat.pwn

@@ -0,0 +1,293 @@
+//
+//
+//  SA-MP Roleplay style chat module for Grand Larceny
+//  (c) 2012 SA-MP Team
+//   All rights reserved
+//
+
+#include <a_samp>
+#include "../include/gl_common.inc"
+#include "../include/gl_messages.inc" // <- contains all the main text/messaging functions
+
+//---------------------------------------------
+
+stock ProcessChatText(playerid, text[])
+{
+	new useindex=1;
+
+    // Handle shouting prefix (!)
+	if(text[0] == '!' && strlen(text) > 1) {
+	    if(text[1] == ' ') useindex++;
+     	TalkMessage(SHOUT_DISTANCE, playerid, "*shouts*", text[useindex]);
+     	return;
+	}
+
+	// Handle quiet prefix (#)
+	if(text[0] == '#' && strlen(text) > 1) {
+	    if(text[1] == ' ') useindex++;
+     	TalkMessage(LOW_DISTANCE, playerid, "*quietly*", text[useindex]);
+     	return;
+	}
+
+	// Send to other players in range and fade
+	TalkMessage(TALK_DISTANCE, playerid, "", text);
+}
+
+//---------------------------------------------
+
+stock ProcessActionText(playerid, message[], actiontype)
+{
+    new ActionText[256+1];
+    new ActionBubble[MAX_CHATBUBBLE_LENGTH+1];
+    new PlayerName[MAX_PLAYER_NAME+1];
+
+    GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
+
+	if(actiontype == ACTION_DO) {
+		format(ActionText, 256, "* %s ((%s))", message, PlayerName);
+		format(ActionBubble, MAX_CHATBUBBLE_LENGTH, "* (( %s ))", message);
+	} else {
+	    format(ActionText, 256, "* %s %s", PlayerName, message);
+	    format(ActionBubble, MAX_CHATBUBBLE_LENGTH, "* %s", message);
+	}
+	
+    LocalMessage(ACTION_DISTANCE, playerid, ACTION_COLOR, ActionText);
+   	SetPlayerChatBubble(playerid, ActionBubble, ACTION_COLOR, ACTION_DISTANCE, CHAT_BUBBLE_TIME);
+}
+
+//---------------------------------------------
+
+new gOOCDisabled = false;
+
+stock GlobalOOCMessage(playerid, message[])
+{
+	new msg[256+1];
+	new PlayerName[MAX_PLAYER_NAME+1];
+
+	if(gOOCDisabled) {
+		CmdErrorMessage(playerid, "The OOC channel is not enabled right now");
+		return;
+	}
+
+	GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
+	format(msg, 256, "(( %s: %s ))", PlayerName, message);
+
+	for(new i = 0; i < MAX_PLAYERS; i++) { // for every player
+		if(IsPlayerConnected(i)) { // Todo: check if player accepts occ
+		    PlayerMessage(i, OOC_COLOR, msg);
+		}
+	}
+}
+
+//---------------------------------------------
+
+stock ToggleOOC(playerid)
+{
+	if(IsPlayerAdmin(playerid)) {
+	    // toggle it
+	    if(gOOCDisabled) gOOCDisabled = false;
+		else gOOCDisabled = true;
+		
+	    if(!gOOCDisabled) {
+	        GlobalMessage(GENERAL_COLOR, "{D0D0D0}[ooc] channel is {80CC80}enabled");
+		} else {
+		    GlobalMessage(GENERAL_COLOR, "{D0D0D0}[ooc] channel is {CC8080}disabled");
+		}
+	} else {
+	    CmdErrorMessage(playerid, "Your admin level isn't high enough to change this");
+	}
+}
+
+//---------------------------------------------
+
+stock ProcessLocalOOC(playerid, message[])
+{
+	new new_message[256+1];
+	new PlayerName[MAX_PLAYER_NAME+1];
+	GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
+	format(new_message, 256, "%s (( %s ))", PlayerName, message);
+	LocalMessage(TALK_DISTANCE, playerid, LOCAL_TALK_COLOR, new_message);
+}
+
+//---------------------------------------------
+
+stock ProcessMegaphone(playerid, message[])
+{
+	// Todo: add permissions on megaphone usage
+   	new new_message[256+1];
+	new PlayerName[MAX_PLAYER_NAME+1];
+	GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
+	format(new_message, 256, "(megaphone) %s >> %s", PlayerName, message);
+	LocalMessage(MEGAPHONE_DISTANCE, playerid, MEGAPHONE_COLOR, new_message, 1);
+}
+
+//---------------------------------------------
+
+stock ProcessWhisper(playerid, toplayerid, message[])
+{
+	new PlayerName[MAX_PLAYER_NAME+1];
+	new ToPlayerName[MAX_PLAYER_NAME+1];
+	new PmMessage[256+1];
+	GetPlayerName(playerid,PlayerName,sizeof(PlayerName));
+	GetPlayerName(toplayerid,ToPlayerName,sizeof(ToPlayerName));
+	format(PmMessage, sizeof(PmMessage), ">> %s(%d): %s", ToPlayerName, toplayerid, message);
+	PlayerMessage(playerid, WHISPER_COLOR, PmMessage);
+	format(PmMessage, sizeof(PmMessage), "** %s(%d): %s", PlayerName, playerid, message);
+	PlayerMessage(toplayerid, WHISPER_COLOR, PmMessage);
+	PlayerPlaySound(toplayerid, 1085, 0.0, 0.0, 0.0);
+}
+
+//---------------------------------------------
+
+stock ProcessChatCommands(playerid, cmdtext[])
+{
+    new cmd[256+1];
+	new message[256+1];
+	new	tmp[256+1];
+	new	idx;
+
+	cmd = strtok(cmdtext, idx);
+
+    // Action commands
+	if(!strcmp("/me", cmd, true))
+	{
+  	    message = strrest(cmdtext,idx);
+  	    if(!strlen(message)) {
+			CmdUsageMessage(playerid, "/me [action]");
+			return 1;
+		}
+		ProcessActionText(playerid, message, ACTION_ME);
+		return 1;
+	}
+	if(!strcmp("/do", cmd, true))
+	{
+  	    message = strrest(cmdtext,idx);
+  	    if(!strlen(message)) {
+			CmdUsageMessage(playerid, "/do [action]");
+			return 1;
+		}
+		ProcessActionText(playerid, message, ACTION_DO);
+		return 1;
+	}
+	// Talk commands
+
+	// /low
+	if(!strcmp("/l", cmd, true) || !strcmp("/low", cmd, true))
+	{
+  	    message = strrest(cmdtext,idx);
+  	    if(!strlen(message)) {
+			CmdUsageMessage(playerid, "(/l)ow [text]");
+			return 1;
+		}
+		TalkMessage(LOW_DISTANCE, playerid, "*quietly*", message);
+		return 1;
+	}
+	// /shout
+	if(!strcmp("/s", cmd, true) || !strcmp("/shout", cmd, true))
+	{
+  	    message = strrest(cmdtext,idx);
+  	    if(!strlen(message)) {
+			CmdUsageMessage(playerid, "(/s)hout [text]");
+			return 1;
+		}
+		TalkMessage(SHOUT_DISTANCE, playerid, "*shouts*", message);
+		return 1;
+	}
+	// /b (local ooc)
+	if(!strcmp("/b", cmd, true))
+	{
+  	    message = strrest(cmdtext,idx);
+  	    if(!strlen(message)) {
+			CmdUsageMessage(playerid, "/b [text]");
+			return 1;
+		}
+	    ProcessLocalOOC(playerid, message);
+		return 1;
+	}
+	// /megaphone
+	if(!strcmp("/m", cmd, true) || !strcmp("/megaphone", cmd, true))
+	{
+  	    message = strrest(cmdtext,idx);
+  	    if(!strlen(message)) {
+			CmdUsageMessage(playerid, "(/m)egaphone [text]");
+			return 1;
+		}
+		ProcessMegaphone(playerid, message);
+		return 1;
+	}
+	// Global OOC /o and /ooc
+	if(!strcmp("/o", cmd, true) || !strcmp("/ooc", cmd, true))
+	{
+  	    message = strrest(cmdtext,idx);
+  	    if(!strlen(message)) {
+			CmdUsageMessage(playerid, "(/o)oc [text]");
+			return 1;
+		}
+		GlobalOOCMessage(playerid, message);
+		return 1;
+	}
+	// Toggle the OOC channel /togooc
+	if(!strcmp("/togooc", cmd, true))
+	{
+  	   	ToggleOOC(playerid);
+		return 1;
+	}
+ 	// /whisper /pm
+	if(!strcmp("/w", cmd, true) || !strcmp("/wisper", cmd, true) || !strcmp("/pm", cmd, true))
+	{
+		tmp = strtok(cmdtext,idx);
+
+		if(!strlen(tmp)) {
+			CmdUsageMessage(playerid, "(/w)isper [playerid/PartOfName] [whisper text]");
+			return 1;
+		}
+		
+		new toplayerid = ReturnUser(tmp);
+
+	    if(toplayerid == RETURN_USER_MULTIPLE) {
+			CmdErrorMessage(playerid, "Multiple matches found for [name]. Please narrow the search.");
+			return 1;
+		}
+		if(toplayerid == RETURN_USER_FAILURE || !IsPlayerConnected(toplayerid)) {
+		    CmdErrorMessage(playerid, "That player isn't connected right now.");
+			return 1;
+		}
+		
+		message = strrest(cmdtext,idx);
+			     
+		if(!strlen(message)) {
+			CmdUsageMessage(playerid, "(/w)isper [playerid/PartOfName] [whisper text]");
+			return 1;
+		}
+
+		if(IsPlayerConnected(toplayerid)) {
+		     ProcessWhisper(playerid, toplayerid, message);
+		}
+		
+		return 1;
+	}
+
+
+	return 0;
+}
+
+//---------------------------------------------
+
+public OnPlayerText(playerid, text[])
+{
+	ProcessChatText(playerid, text);
+	return 0;
+}
+
+//------------------------------------------------
+
+public OnPlayerCommandText(playerid, cmdtext[])
+{
+	if(ProcessChatCommands(playerid,cmdtext)) {
+	    return 1;
+	}
+	return 0;
+}
+
+//---------------------------------------------
+

BIN
samp03/filterscripts/gl_chatbubble.amx


+ 63 - 0
samp03/filterscripts/gl_chatbubble.pwn

@@ -0,0 +1,63 @@
+//
+// Example use of chat above player's head
+//
+
+#include <a_samp>
+#include "../include/gl_common.inc"
+
+#define MESSAGE_COLOR 		  0xEEEEEEFF
+#define ECHO_COLOR 		  	  0xEEEEEEFF
+#define ACTION_COLOR     	  0xEE66EEFF
+
+//------------------------------------------------
+
+public OnFilterScriptInit()
+{
+	print("\n--Speech bubble example loaded.\n");
+	return 1;
+}
+
+//------------------------------------------------
+
+public OnPlayerText(playerid, text[])
+{
+	 if(strlen(text) > 128) return 0;
+	 
+	 new to_others[MAX_CHATBUBBLE_LENGTH+1];
+	 new to_me[MAX_CHATBUBBLE_LENGTH+1];
+	 
+	 format(to_others,MAX_CHATBUBBLE_LENGTH,"Says: %s",text);
+	 format(to_me,MAX_CHATBUBBLE_LENGTH,">> %s",text);
+	 
+     SetPlayerChatBubble(playerid,to_others,MESSAGE_COLOR,35.0,10000);
+     SendClientMessage(playerid,ECHO_COLOR,to_me);
+     
+     return 0; // can't do normal chat with this loaded
+}
+
+//------------------------------------------------
+
+public OnPlayerCommandText(playerid, cmdtext[])
+{
+	new cmd[256];
+	new Message[256];
+	new	idx;
+	new actiontext[MAX_CHATBUBBLE_LENGTH+1];
+
+	cmd = strtok(cmdtext, idx);
+
+	// Action command
+	if(strcmp("/me", cmd, true) == 0)
+	{
+	    Message = strrest(cmdtext,idx);
+	    format(actiontext,MAX_CHATBUBBLE_LENGTH,"* %s",Message);
+       	SetPlayerChatBubble(playerid,actiontext,ACTION_COLOR,30.0,10000);
+    	SendClientMessage(playerid,ACTION_COLOR,actiontext);
+		return 1;
+	}
+	
+	return 0; // not handled by this script
+}
+
+//------------------------------------------------
+

BIN
samp03/filterscripts/gl_mapicon.amx


+ 70 - 0
samp03/filterscripts/gl_mapicon.pwn

@@ -0,0 +1,70 @@
+//-------------------------------------------------
+//
+// These are the default map icons from San Andreas
+// Cluckin Bell, Ammu, Burgershot etc
+//
+// Kye 2010
+//
+//-------------------------------------------------
+
+#pragma tabsize 0
+
+#include <a_samp>
+#include <core>
+#include <float>
+
+public OnPlayerConnect(playerid)
+{
+	SetPlayerMapIcon(playerid,49,822.6,-1590.3,13.5,7,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,50,-2570.1,245.4,10.3,7,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,51,2726.6,-2026.4,17.5,7,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,52,2080.3,2119.0,10.8,7,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,53,675.7,-496.6,16.8,7,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,54,-1805.7,943.2,24.8,29,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,55,2750.9,2470.9,11.0,29,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,56,2351.8,2529.0,10.8,29,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,57,2635.5,1847.4,11.0,29,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,58,2083.4,2221.0,11.0,29,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,59,-1719.1,1359.4,8.6,29,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,60,2330.2,75.2,31.0,29,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,61,203.2,-200.4,6.5,29,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,62,812.9,-1616.1,13.6,10,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,63,1199.1,-924.0,43.3,10,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,64,2362.2,2069.9,10.8,10,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,65,2469.5,2033.8,10.8,10,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,66,2172.9,2795.7,10.8,10,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,67,1875.3,2072.0,10.8,10,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,68,1161.5,2072.0,10.8,10,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,69,-2356.0,1009.0,49.0,10,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,70,-1913.3,826.2,36.9,10,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,71,-2335.6,-165.6,39.5,10,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,72,2397.8,-1895.6,13.7,14,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,73,2421.6,-1509.6,24.1,14,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,74,-2671.6,257.4,4.6,14,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,75,2392.4,2046.5,10.8,14,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,76,2844.5,2401.1,11.0,14,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,77,2635.5,1674.3,11.0,14,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,78,2105.7,2228.7,11.0,14,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,79,-2154.0,-2461.2,30.8,14,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,80,-1816.2,620.8,37.5,14,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,81,-1216.0,1831.4,45.3,14,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,82,172.73,1176.76,13.7,14,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,83,932.0,-1353.0,14.0,14,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,84,1971.7,-2036.6,13.5,39,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,85,2071.6,-1779.9,13.5,39,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,86,2094.6,2119.0,10.8,39,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,87,-2490.5,-40.1,39.3,39,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,88,1372.9,-1278.8,12.5,6,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,89,2400.5,-1978.4,13.5,6,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,90,-2626.6,209.4,4.9,6,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,91,2535.9,2083.5,10.8,6,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,92,2156.5,943.2,10.8,6,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,93,779.7,1874.3,4.9,6,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,94,-2092.7,-2463.8,30.6,6,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,95,240.0,-178.2,2.0,6,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,96,-1509.4,2611.8,58.5,6,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,97,-315.67,829.87,13.43,6,0,MAPICON_LOCAL);
+	SetPlayerMapIcon(playerid,98,2332.9,63.6,31.0,6,0,MAPICON_LOCAL);
+	
+	return 1;
+}

BIN
samp03/filterscripts/gl_npcs.amx


+ 161 - 0
samp03/filterscripts/gl_npcs.pwn

@@ -0,0 +1,161 @@
+//-------------------------------------------------
+//
+//  NPC initialisation for Grand Larceny
+//
+//-------------------------------------------------
+
+#pragma tabsize 0
+#include <a_samp>
+
+//-------------------------------------------------
+
+public OnFilterScriptInit()
+{
+	ConnectNPC("TrainDriverLV","train_lv");
+	ConnectNPC("TrainDriverLS","train_ls");
+	ConnectNPC("TrainDriverSF","train_sf");
+	ConnectNPC("PilotLV","at400_lv");
+	ConnectNPC("PilotSF","at400_sf");
+	ConnectNPC("PilotLS","at400_ls");
+	
+	// Testing
+	//ConnectNPC("OnfootTest","onfoot_test");
+	//ConnectNPC("DriverTest","mat_test2");
+	//ConnectNPC("DriverTest2","driver_test2");
+
+	return 1;
+}
+
+//-------------------------------------------------
+// IMPORTANT: This restricts NPCs connecting from
+// an IP address outside this server. If you need
+// to connect NPCs externally you will need to modify
+// the code in this callback.
+
+public OnPlayerConnect(playerid)
+{
+	if(IsPlayerNPC(playerid)) {
+	    new ip_addr_npc[64+1];
+	    new ip_addr_server[64+1];
+	    GetServerVarAsString("bind",ip_addr_server,64);
+	    GetPlayerIp(playerid,ip_addr_npc,64);
+	    
+		if(!strlen(ip_addr_server)) {
+		    ip_addr_server = "127.0.0.1";
+		}
+		
+		if(strcmp(ip_addr_npc,ip_addr_server,true) != 0) {
+		    // this bot is remote connecting
+		    printf("NPC: Got a remote NPC connecting from %s and I'm kicking it.",ip_addr_npc);
+		    Kick(playerid);
+		    return 0;
+		}
+        printf("NPC: Connection from %s is allowed.",ip_addr_npc);
+	}
+	
+	return 1;
+}
+
+//-------------------------------------------------
+
+public OnPlayerRequestClass(playerid, classid)
+{
+	if(!IsPlayerNPC(playerid)) return 0; // We only deal with NPC players in this script
+	
+	new playername[64];
+	GetPlayerName(playerid,playername,64);
+
+ 	if(!strcmp(playername,"TrainDriverLV",true)) {
+        SetSpawnInfo(playerid,69,255,1462.0745,2630.8787,10.8203,0.0,-1,-1,-1,-1,-1,-1);
+	}
+	else if(!strcmp(playername,"TrainDriverSF",true)) {
+	    SetSpawnInfo(playerid,69,255,-1942.7950,168.4164,27.0006,0.0,-1,-1,-1,-1,-1,-1);
+	}
+	else if(!strcmp(playername,"TrainDriverLS",true)) {
+	    SetSpawnInfo(playerid,69,255,1700.7551,-1953.6531,14.8756,0.0,-1,-1,-1,-1,-1,-1);
+	}
+	else if(!strcmp(playername,"PilotLV",true)) {
+	    SetSpawnInfo(playerid,69,61,0.0,0.0,0.0,0.0,-1,-1,-1,-1,-1,-1);
+	}
+	else if(!strcmp(playername,"PilotSF",true)) {
+	    SetSpawnInfo(playerid,69,61,0.0,0.0,0.0,0.0,-1,-1,-1,-1,-1,-1);
+	}
+	else if(!strcmp(playername,"PilotLS",true)) {
+	    SetSpawnInfo(playerid,69,61,0.0,0.0,0.0,0.0,-1,-1,-1,-1,-1,-1);
+	}
+	else if(!strcmp(playername,"OnfootTest",true)) {
+	    SetSpawnInfo(playerid,69,61,2388.1003,-1279.8933,25.1291,94.3321,-1,-1,-1,-1,-1,-1);
+	}
+	else if(!strcmp(playername,"DriverTest",true)) {
+	    SetSpawnInfo(playerid,69,61,2388.1003,-1279.8933,25.1291,94.3321,-1,-1,-1,-1,-1,-1);
+	}
+	else if(!strcmp(playername,"DriverTest2",true)) {
+	    SetSpawnInfo(playerid,69,61,2388.1003,-1279.8933,25.1291,94.3321,-1,-1,-1,-1,-1,-1);
+	}
+
+	return 0;
+}
+
+//-------------------------------------------------
+
+stock SetVehicleTireStatus(vehicleid, tirestatus)
+{
+    new panels, doors, lights, tires;
+    GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
+    UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, tirestatus);
+}
+
+//-------------------------------------------------
+
+public OnPlayerSpawn(playerid)
+{
+	if(!IsPlayerNPC(playerid)) return 1; // We only deal with NPC players in this script
+
+	new playername[64];
+	GetPlayerName(playerid,playername,64);
+
+	if(!strcmp(playername,"TrainDriverLV",true)) {
+        PutPlayerInVehicle(playerid,1,0);
+        SetPlayerColor(playerid,0xFFFFFFFF);
+ 	}
+	else if(!strcmp(playername,"TrainDriverSF",true)) {
+	    PutPlayerInVehicle(playerid,5,0);
+	    SetPlayerColor(playerid,0xFFFFFFFF);
+	}
+	else if(!strcmp(playername,"TrainDriverLS",true)) {
+	    PutPlayerInVehicle(playerid,9,0);
+	    SetPlayerColor(playerid,0xFFFFFFFF);
+	}
+	else if(!strcmp(playername,"PilotLV",true)) {
+	    PutPlayerInVehicle(playerid,13,0);
+	    SetPlayerColor(playerid,0xFFFFFFFF);
+	}
+	else if(!strcmp(playername,"PilotSF",true)) {
+	    PutPlayerInVehicle(playerid,14,0);
+	    SetPlayerColor(playerid,0xFFFFFFFF);
+	}
+	else if(!strcmp(playername,"PilotLS",true)) {
+	    PutPlayerInVehicle(playerid,15,0);
+	    SetPlayerColor(playerid,0xFFFFFFFF);
+	}
+	else if(!strcmp(playername,"OnfootTest",true)) {
+	    //PutPlayerInVehicle(playerid,876,0);
+	    SetPlayerColor(playerid,0xFFFFFFFF);
+	}
+	else if(!strcmp(playername,"DriverTest",true)) {
+	    PutPlayerInVehicle(playerid,376,0);
+	    SetPlayerColor(playerid,0xFFFFFFFF);
+	}
+	else if(!strcmp(playername,"DriverTest2",true)) {
+		//SetVehicleTireStatus(876,0xFF);
+	    PutPlayerInVehicle(playerid,875,0);
+	    SetPlayerColor(playerid,0xFFFFFFFF);
+	}
+
+	return 1;
+}
+
+//-------------------------------------------------
+// EOF
+
+

BIN
samp03/filterscripts/gl_property.amx


+ 835 - 0
samp03/filterscripts/gl_property.pwn

@@ -0,0 +1,835 @@
+//-------------------------------------------------------
+//
+// GRAND LARCENY Property creation and management script
+//
+// by damospiderman 2008
+//
+//-------------------------------------------------------
+
+#include <a_samp>
+#include "../include/gl_common.inc"
+
+#define FILTERSCRIPT
+//#define USE_SQLITE
+
+#define PROP_VW    		(10000)
+#define MAX_INTERIORS	(146)
+#define MAX_PROPERTIES  (1000)
+
+#define PROPERTY_FOLDER	"properties" // Location of properties file
+#define PROPERTY_UNIQID_FILE    "properties/uniqId.txt" // Location of Uniq Interior Info
+#define DB_PROPERTIES   "properties/dbProperties.db" // Location of the properties Database
+
+#define MAX_TYPES       (5)
+#define TYPE_EMPTY      (0)
+#define TYPE_HOUSE 		(1)
+#define TYPE_BUSINESS	(2)
+#define TYPE_BANK   	(3)
+#define TYPE_COP        (4)
+
+enum // Property Type Enum
+	E_P_TYPES {
+		tIcon,
+		tName[32]
+	}
+
+enum // Uniq Interiors Enum
+	E_INTERIORS {
+		inIntID,
+		Float:inExitX,
+		Float:inExitY,
+		Float:inExitZ,
+		Float:inExitA,
+		inName[64]
+	};
+
+enum // Properties Enum
+	E_PROPERTIES {
+		eInterior,
+		eType,
+		Float:eEntX,
+		Float:eEntY,
+		Float:eEntZ,
+		Float:eEntA,
+		eUniqIntId,
+		eOwner,
+		ePrice,
+		ePname[64]
+	};
+
+//  [ uniq property id ]
+new	unid;
+
+//	[ Array of all the property interior info ]
+new interiorInfo[MAX_INTERIORS][E_INTERIORS];
+
+//	[ Pickup array with property id assigned via array slot ( pickupid ) ]
+new propPickups[MAX_PROPERTIES] = {-1};
+
+//	[ Handles for 3D text displayed at property entrances ]
+new Text3D:propTextInfo[MAX_PROPERTIES];
+
+// 	[ Mass array of all the properties and info about them ]
+new properties[MAX_PROPERTIES][E_PROPERTIES];
+
+//	[ The last pickup the player went through so they can do /enter command ]
+new lastPickup[MAX_PLAYERS] = {-1};
+
+//	[ Current property Unique Interior the player is in.. defaults to -1 when not in any property ]
+new currentInt[MAX_PLAYERS] = {-1};
+
+//	[ Player Position array to store the last place the player was before /view command so they can be teleported back ]
+new Float:plPos[MAX_PLAYERS][3];
+
+//	[ Players actual interior id used for /view /return command ]
+new plInt[MAX_PLAYERS];
+
+//  [ Array of property type iconid's and strings for property type ]
+new propIcons[MAX_TYPES][E_P_TYPES] =	{
+											{ 0, "" }, 					// TYPE_EMPTY ( not used )
+											{ 1273, "House" }, 			// TYPE_HOUSE green house icon
+											{ 1272, "Business" }, 		// TYPE_BUSINESS blue house icon
+											{ 1274, "Bank" }, 			// TYPE_BANK dollar sign icon
+											{ 1247, "Police Station" }	// TYPE_COP Bribe Star 1247
+										};
+										
+new	propFile[MAX_TYPES][64] =   {
+									{ "blank" },
+		                            { "properties/houses.txt" },
+		                            { "properties/businesses.txt" },
+		                            { "properties/banks.txt" },
+		                            { "properties/police.txt" }
+							 	};
+							 	
+//  Keep track of what properties we've sent an /enter notification for
+new gLastPropertyEnterNotification[MAX_PLAYERS];
+
+
+/********************************
+*   Interior Info Functions     *
+********************************/
+stock Float:GetInteriorExit( id, &Float:x, &Float:y, &Float:z ){
+	if( id > MAX_INTERIORS ) return 0.0;
+	else {
+	    x = interiorInfo[id][inExitX];
+	    y = interiorInfo[id][inExitY];
+	    z = interiorInfo[id][inExitZ];
+		return interiorInfo[id][inExitA];
+	}
+}
+
+// Gets interior exit info from uniq Interior Id. Returns InteriorId or -1 if interior doesn't exist
+stock GetInteriorExitInfo( uniqIntId, &Float:exitX, &Float:exitY, &Float:exitZ, &Float:exitA ){
+	if( uniqIntId < MAX_INTERIORS ){
+	    exitX = interiorInfo[uniqIntId][inExitX];
+	    exitY = interiorInfo[uniqIntId][inExitY];
+	    exitZ = interiorInfo[uniqIntId][inExitZ];
+	    exitA = interiorInfo[uniqIntId][inExitA];
+		return interiorInfo[uniqIntId][inIntID];
+	}
+	return -1;
+}
+
+
+stock GetInteriorIntID( id ){ // Gets the interior id of a uniq Interior Id :S
+	if( id > MAX_INTERIORS ) return -1;
+	else return interiorInfo[id][inIntID];
+}
+
+stock GetInteriorName( id )
+{
+	new tmp[64];
+	if( id > MAX_PROPERTIES ) return tmp;
+
+	else {
+  		format( tmp, 64, "%s", interiorInfo[id][inName] );
+		return tmp;
+	}
+}
+
+/********************************************************
+********************************************************/
+
+
+/********************************
+*  	 Property Functions  		*
+********************************/
+
+stock Float:GetPropertyEntrance( id, &Float:x, &Float:y, &Float:z ){
+	if( id > MAX_PROPERTIES ) return 0.0;
+	x = properties[id][eEntX];
+	y = properties[id][eEntY];
+	z = properties[id][eEntZ];
+	return properties[id][eEntA];
+}
+
+stock Float:GetPropertyExit( id, &Float:x, &Float:y, &Float:z ){
+	if( id > MAX_PROPERTIES ) return 0.0;
+	return GetInteriorExit( properties[id][eUniqIntId], x, y, z );
+}
+
+stock GetPropertyInteriorFileId( id ){
+	if( id > MAX_PROPERTIES ) return 0;
+	else return properties[id][eUniqIntId];
+}
+
+stock GetPropertyInteriorId( id ){
+	if( id > MAX_PROPERTIES ) return 0;
+	else return GetInteriorIntID( properties[id][eUniqIntId] );
+}
+
+stock GetPropertyType( id ){
+	if( id > MAX_PROPERTIES ) return 0;
+	else return properties[id][eType];
+}
+
+stock GetPropertyOwner( id ){
+	if( id > MAX_PROPERTIES ) return -1;
+	else return properties[id][eOwner];
+}
+
+stock GetPropertyPrice( id ){
+	if( id > MAX_PROPERTIES ) return -1;
+	else return properties[id][ePrice];
+}
+
+stock GetPropertyName( id ){
+	new tmp[64];
+	if( id > MAX_PROPERTIES ) return tmp;
+	else {
+  		format( tmp, 64, "%s", properties[id][ePname] );
+		return tmp;
+	}
+}
+
+/********************************************************
+********************************************************/
+
+/********************************
+*   	Database Functions	    *
+********************************/
+
+stock Float:dbGetPropertyEntrance( database[], uniqId, &Float:x, &Float:y, &Float:z ){
+	new
+	    DB:prop,
+	    DBResult:query_result,
+	    query[128],
+		num;
+
+	prop = db_open( database );
+	format( query, 128,"SELECT entX, entY, enZ, entA FROM properties WHERE id = %d LIMIT 1", uniqId );
+
+	query_result = db_query( prop, query );
+	num = db_num_rows(query_result);
+	if(!num) return -1.0;
+
+	else {
+		db_get_field_assoc( query_result, "entX", query, 128 );
+		x = floatstr( query );
+		db_get_field_assoc( query_result, "entY", query, 128 );
+		y = floatstr( query );
+		db_get_field_assoc( query_result, "entZ", query, 128 );
+		z = floatstr( query );
+		db_get_field_assoc( query_result, "entA", query, 128 );
+		return floatstr( query );
+	}
+}
+
+stock dbSetPropertyOwner( database[], uniqId, ownerId ){
+}
+
+stock dbSetPropertyPrice( database[], uniqId, price ){
+}
+
+stock dbDeleteProperty( database[], uniqId ){
+}
+
+stock dbCreateProperty( database[], uniqId, Float:entX, Float:entY, Float:entZ, Float:entA ){ // remember to add rest of params
+}
+
+stock dbLoadProperties( database[] )
+{
+	new
+		    DB:prop,
+		    DBResult:query_result,
+		    query[128],
+			num,
+			i;
+
+	prop = db_open( database );
+	format( query, 128,"SELECT * FROM properties", uniqId );
+
+	query_result = db_query( prop, query );
+	num = db_num_rows(query_result);
+	if(!num) return 0;
+	else {
+		while( i < num ){
+		    db_get_field_assoc( query_result, "entX", query, 128 );
+			x = floatstr( query );
+			db_get_field_assoc( query_result, "entX", query, 128 );
+			x = floatstr( query );
+			db_get_field_assoc( query_result, "entY", query, 128 );
+			y = floatstr( query );
+			db_get_field_assoc( query_result, "entZ", query, 128 );
+			z = floatstr( query );
+			db_get_field_assoc( query_result, "entA", query, 128 );
+			i++;
+		}
+	}
+
+}
+/********************************************************
+********************************************************/
+
+/*********************************
+*   Property System Functions    *
+*********************************/
+
+ReadInteriorInfo( fileName[] )
+{
+	new
+	    File:file_ptr,
+	    buf[256],
+	    tmp[64],
+	    idx,
+		uniqId;
+
+
+	file_ptr = fopen( fileName, io_read );
+	if( file_ptr ){
+		while( fread( file_ptr, buf, 256 ) > 0){
+		    idx = 0;
+
+     		idx = token_by_delim( buf, tmp, ' ', idx );
+			if(idx == (-1)) continue;
+			uniqId = strval( tmp );
+
+			if( uniqId >= MAX_INTERIORS ) return 0;
+
+			idx = token_by_delim( buf, tmp, ' ', idx+1 );
+		    if(idx == (-1)) continue;
+		 	interiorInfo[uniqId][inIntID] = strval( tmp );
+
+			idx = token_by_delim( buf, tmp, ' ', idx+1 );
+		    if(idx == (-1)) continue;
+			interiorInfo[uniqId][inExitX] = floatstr( tmp );
+
+			idx = token_by_delim( buf, tmp, ' ', idx+1 );
+		    if(idx == (-1)) continue;
+			interiorInfo[uniqId][inExitY] = floatstr( tmp );
+
+			idx = token_by_delim( buf, tmp, ' ', idx+1);
+		    if(idx == (-1)) continue;
+			interiorInfo[uniqId][inExitZ] = floatstr( tmp );
+
+			idx = token_by_delim( buf, tmp, ' ', idx+1 );
+		    if(idx == (-1)) continue;
+			interiorInfo[uniqId][inExitA] = floatstr( tmp );
+
+			idx = token_by_delim( buf, interiorInfo[uniqId][inName], ';', idx+1 );
+		    if(idx == (-1)) continue;
+
+			/*
+			printf( "ReadInteriorInfo(%d, %d, %f, %f, %f, %f ( %s ))",
+					uniqId,
+					interiorInfo[uniqId][inIntID],
+					interiorInfo[uniqId][inExitX],
+					interiorInfo[uniqId][inExitY],
+					interiorInfo[uniqId][inExitZ],
+					interiorInfo[uniqId][inExitA],
+					interiorInfo[uniqId][inName] );*/
+
+		}
+		//printf( "Interiors File read successfully" );
+		fclose( file_ptr );
+		return 1;
+	}
+	printf( "Could Not Read Interiors file ( %s )", fileName );
+	return 0;
+}
+
+ReadPropertyFile( fileName[] )
+{
+	new  File:file_ptr,
+	    tmp[128],
+		buf[256],
+		idx,
+		Float:enX,
+		Float:enY,
+		Float:enZ,
+		Float:enA,
+		uniqIntId,
+		p_type,
+		pIcon;
+
+	printf("Reading File: %s",fileName);
+
+	file_ptr = fopen( fileName, io_read );
+
+	if(!file_ptr )return 0;
+
+ 	while( fread( file_ptr, buf, 256 ) > 0){
+ 	    idx = 0;
+
+ 	    idx = token_by_delim( buf, tmp, ',', idx );
+		if(idx == (-1)) continue;
+		pIcon = strval( tmp );
+
+ 	    idx = token_by_delim( buf, tmp, ',', idx+1 );
+		if(idx == (-1)) continue;
+		enX = floatstr( tmp );
+
+  		idx = token_by_delim( buf, tmp, ',', idx+1 );
+		if(idx == (-1)) continue;
+		enY = floatstr( tmp );
+
+		idx = token_by_delim( buf, tmp, ',', idx+1 );
+		if(idx == (-1)) continue;
+		enZ = floatstr( tmp );
+
+ 		idx = token_by_delim( buf, tmp, ',', idx+1 );
+		if(idx == (-1)) continue;
+		enA = floatstr( tmp );
+
+		idx = token_by_delim( buf, tmp, ',', idx+1 );
+		if(idx == (-1)) continue;
+		uniqIntId = strval( tmp );
+
+		idx = token_by_delim( buf, tmp, ';', idx+1 );
+		if(idx == (-1)) continue;
+		p_type = strval( tmp );
+
+		CreateProperty( uniqIntId, pIcon, enX, enY, enZ, enA, p_type  );
+	}
+	fclose( file_ptr );
+	return 1;
+}
+
+PutPlayerInProperty( playerid, propId, propVW = 0 )
+{
+	new Float:x, Float:y, Float:z, Float:a;
+	new intFileId;
+	
+    a = GetPropertyExit( propId, x, y, z );
+	SetPlayerPos( playerid, x, y, z );
+	SetPlayerFacingAngle( playerid, a );
+	SetPlayerInterior( playerid, GetPropertyInteriorId( propId ));
+	SetPlayerVirtualWorld( playerid, (propVW==0)? propId+PROP_VW:propVW );
+	intFileId = GetPropertyInteriorFileId(propId);
+	currentInt[playerid] = propId;
+	
+	//new dbgstring[128];
+	//format(dbgstring,sizeof(dbgstring),"PutPlayerInProperty(%d): FileInt=%d",propId,intFileId);
+	//SendClientMessage(playerid,0xFFFFFFFF,dbgstring);
+	
+	// the following will make the client shop scripts run if we tell it
+	// the name of the shop.
+	if(intFileId == 22) {
+	    SetPlayerShopName(playerid,"FDPIZA");
+	}
+	else if(intFileId == 47) {
+		SetPlayerShopName(playerid,"FDBURG");
+	}
+	else if(intFileId == 130) {
+	    SetPlayerShopName(playerid,"FDCHICK");
+	}
+	else if(intFileId == 32) {
+	    SetPlayerShopName(playerid,"AMMUN1");
+	}
+	else if(intFileId == 96) {
+	    SetPlayerShopName(playerid,"AMMUN2");
+	}
+	else if(intFileId == 122) {
+	    SetPlayerShopName(playerid,"AMMUN3");
+	}
+	else if(intFileId == 123) {
+	    SetPlayerShopName(playerid,"AMMUN5");
+	}
+	
+}
+
+// Adds new property to property file
+AddProperty( uniqIntId, Float:entX, Float:entY, Float:entZ, Float:entA, p_type, comment[]="" )
+{
+	new
+	    Float:exitX,
+	    Float:exitY,
+	    Float:exitZ,
+	    Float:exitA,
+		interiorId,
+		File:file_ptr,
+		tmp[128];
+
+	interiorId = GetInteriorExitInfo( uniqIntId, exitX, exitY, exitZ, exitA );
+
+	if( interiorId != -1 ){
+	    file_ptr = fopen( propFile[p_type], io_append );
+	    if(file_ptr){
+			format( tmp, 128, "%d, %f, %f, %f, %f, %d, %d ; //%s\r\n", propIcons[p_type][tIcon],entX, entY, entZ, entA, uniqIntId, p_type, comment );
+
+			fwrite( file_ptr, tmp );
+			fclose( file_ptr );
+			printf( "PropDB - %s", tmp );
+			return CreateProperty( uniqIntId, propIcons[p_type][tIcon], entX, entY, entZ, entA,  p_type );
+		}
+	}
+	return -1;
+}
+
+CreateProperty( uniqIntId, iconId,  Float:entX, Float:entY, Float:entZ, Float:entA, p_type, name[64]="", owner=-1, price=0 )
+{
+	if( (unid+1) < MAX_PROPERTIES ){
+		new Id = CreatePickup( iconId ,23, entX, entY, entZ, 0 );
+		//printf( "CreateProperty(%d, %d, %f, %f, %f, %f, %d)", uniqIntId, iconId, entX, entY, entZ, entA, p_type );
+		propPickups[Id] = unid;
+		properties[unid][eEntX] 	= entX;
+		properties[unid][eEntY] 	= entY;
+		properties[unid][eEntZ] 	= entZ;
+		properties[unid][eEntA] 	= entA;
+		properties[unid][eUniqIntId] = uniqIntId;
+		properties[unid][eOwner] 	= owner;
+		properties[unid][ePrice] 	= price;
+		properties[unid][eType] 	= p_type;
+		format( properties[unid][ePname], 64, "%s", name );
+		
+		new text_info[256];
+		
+		propTextInfo[unid] = Text3D:INVALID_3DTEXT_ID;
+		
+		if(p_type == TYPE_HOUSE) {
+		    format(text_info,256,"{FFFFFF}[{88EE88}House{FFFFFF}]");
+		    propTextInfo[unid] = Create3DTextLabel(text_info,0x88EE88FF,entX,entY,entZ+0.75,20.0,0,1);
+		}
+		else if(p_type == TYPE_BUSINESS) {
+		    format(text_info,256,"{FFFFFF}[{AAAAFF}Business{FFFFFF}]");
+		    propTextInfo[unid] = Create3DTextLabel(text_info,0xAAAAFFFF,entX,entY,entZ+0.75,20.0,0,1);
+		}
+		else if(p_type == TYPE_BANK) {
+		    format(text_info,256,"{FFFFFF}[{EEEE88}Bank{FFFFFF}]");
+		    propTextInfo[unid] = Create3DTextLabel(text_info,0xEEEE88FF,entX,entY,entZ+0.75,20.0,0,1);
+		}
+		else if(p_type == TYPE_COP) {
+		    format(text_info,256,"{FFFFFF}[{EEEE88}Police Station{FFFFFF}]");
+		    propTextInfo[unid] = Create3DTextLabel(text_info,0xEEEE88FF,entX,entY,entZ+0.75,20.0,0,1);
+		}
+
+		return unid++;
+	}
+	else print( "Property Limit Reached" );
+	return -1;
+}
+
+PropertyCommand( playerid, cmd[],cmdtext[],idx, p_type )
+{
+	new
+	        Float:x,
+	        Float:y,
+	        Float:z,
+	        Float:a,
+	        tmp[256],
+	        string[128],
+			uniqId,
+			id;
+
+	if( GetPlayerInterior(playerid) != 0 || GetPlayerVirtualWorld(playerid)!= 0 ){
+	    SendClientMessage(playerid, 0x550000FF, "You can only create properties in Interior 0 and VW 0" );
+	    return 1;
+	}
+
+	GetPlayerPos( playerid, x, y, z );
+	GetPlayerFacingAngle( playerid, a );
+
+	tmp = strtok( cmdtext, idx );
+	if(!strlen(tmp)){
+	    format( string, 128, "Usage: %s [uniqInteriorId] [optional-comment]", cmd );
+	    SendClientMessage( playerid, 0xFF00CC, string );
+	    return 1;
+	}
+	if(!isNumeric(tmp)){
+	    SendClientMessage(playerid, 0x550000, "Uniq Interior Id must be a number" );
+	    return 1;
+	}
+	uniqId = strval( tmp );
+
+	if( uniqId > MAX_INTERIORS || uniqId < 0 ){
+		SendClientMessage( playerid, 0xFFFFCC, "Invalid Uniq Interior Id" );
+		return 1;
+	}
+
+    idx = token_by_delim( cmdtext, tmp, '\0', idx );
+ 	if(idx){
+ 	    id = AddProperty( uniqId, x, y, z, a, p_type, tmp );
+	}
+
+	else {
+		id = AddProperty( uniqId, x, y, z, a, p_type );
+	}
+
+	if( id != -1 ){
+		format( tmp, 256, "Property Type ( %d ) Added Successfully: UniqId: %d Interior: %d IntName: %s",p_type, id, interiorInfo[uniqId][inIntID], interiorInfo[uniqId][inName] );
+	    SendClientMessage( playerid, 0xCC7700, tmp );
+	}else{
+	    SendClientMessage( playerid, 0x00FF55, "Error: Something went wrong/Property Limit Reached" );
+	}
+	return 1;
+}
+
+LoadProperties()
+{
+	if( properties[0][eType] != TYPE_EMPTY ){
+	    UnloadProperties();
+	}
+	unid = 0;
+   	for( new i = 0; i < MAX_PROPERTIES; i++ ){
+   	    properties[i][eType] = TYPE_EMPTY;
+	}
+
+	ReadInteriorInfo( "properties/interiors.txt" );
+
+	for( new i = 0; i < MAX_TYPES; i++ ){
+   		ReadPropertyFile( propFile[i] );
+	}
+	return 1;
+}
+
+UnloadProperties()
+{
+	new
+	    p;
+	for( new i = 0; i < MAX_PROPERTIES; i++ ){
+		if( propPickups[i] != -1 ){
+			DestroyPickup( i );
+			p = propPickups[i];
+			propPickups[i] = -1;
+			properties[p][eInterior] = -1;
+			properties[p][eType] = TYPE_EMPTY;
+			properties[p][eOwner] = -1;
+			properties[p][ePrice] = 0;
+			properties[p][ePname][0] = '\0';
+		}
+	}
+}
+
+/********************************************************
+********************************************************/
+
+
+/************************************
+*   		Callbacks			    *
+************************************/
+
+
+public OnFilterScriptInit()
+{
+	print("\n-----------------------------------");
+	print("Grand Larceny Property Filterscript		");
+	print("-----------------------------------\n");
+	return 1;
+}
+
+public OnFilterScriptExit()
+{
+	UnloadProperties();
+	return 1;
+}
+
+public OnGameModeInit()
+{
+	LoadProperties();
+	return 1;
+}
+
+public OnGameModeExit()
+{
+	UnloadProperties();
+	return 1;
+}
+
+public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
+{
+	if( newinteriorid == 0 ){
+		currentInt[playerid] = -1;
+		SetPlayerVirtualWorld( playerid, 0 );
+	}
+	return 1;
+}
+
+public OnPlayerSpawn( playerid )
+{
+	gLastPropertyEnterNotification[playerid] = -1;
+	return 1;
+}
+
+public OnPlayerPickUpPickup(playerid, pickupid)
+{
+	//printf( "DEBUG: Player %d pickedup Pickup %d Prop Id %d", playerid, pickupid );
+	lastPickup[playerid] = pickupid;
+	new id = propPickups[pickupid];
+	new pmsg[256];
+
+	if( properties[id][eType] > 0 ){
+	
+	    if(gLastPropertyEnterNotification[playerid] != id){
+	        gLastPropertyEnterNotification[playerid] = id;
+          	switch( properties[id][eType] ){
+		    	case TYPE_HOUSE:{
+		        	format(pmsg,256,"* House: type /enter to enter");
+		        	SendClientMessage( playerid, 0xFF55BBFF, pmsg );
+		        	return 1;
+				}
+
+				case TYPE_BUSINESS:{
+			   		format(pmsg,256,"* Business: type /enter to enter");
+		        	SendClientMessage( playerid, 0xFF55BBFF, pmsg );
+		        	return 1;
+				}
+
+				case TYPE_BANK:{
+					format(pmsg,256,"* Bank: type /enter to enter");
+		        	SendClientMessage( playerid, 0xFF55BBFF, pmsg );
+		        	return 1;
+				}
+
+				case TYPE_COP:{
+					format(pmsg,256,"* Police Station: type /enter to enter");
+		        	SendClientMessage( playerid, 0xFF55BBFF, pmsg );
+		        	return 1;
+				}
+		 	}
+		}
+	}
+	else SendClientMessage( playerid, 0xFF9900FF, "This property doesn't exist :S" );
+
+	return 1;
+}
+
+public OnPlayerCommandText(playerid, cmdtext[])
+{
+	new idx;
+	new cmd[256];
+
+	cmd = strtok(cmdtext, idx);
+	
+	// Public commands.
+	if(strcmp("/enter", cmd, true) == 0) // enter property
+	{
+		if( lastPickup[playerid] != -1 || properties[lastPickup[playerid]][eType] > 0 ){
+		    new
+		        id = propPickups[lastPickup[playerid]],
+		        Float:x,
+		        Float:y,
+		        Float:z;
+
+			GetPropertyEntrance( id, x, y, z );
+	    	if( IsPlayerInRangeOfPoint( playerid, 3.0, x, y, z )){
+	    	    PutPlayerInProperty( playerid, id );
+	    	    SendClientMessage( playerid, 0x55AADDFF, "* You have entered a property.. type /exit to leave" );
+	    	    return 1;
+			}
+		}
+		return 1;
+	}
+	else if(strcmp("/exit", cmd, true) == 0) // exit property
+	{
+	    if( currentInt[playerid] > -1 && GetPlayerInterior(playerid) == GetPropertyInteriorId( currentInt[playerid] )){
+
+	        new id = currentInt[playerid];
+	        new Float:x;
+			new	Float:y;
+			new	Float:z;
+			new	Float:a;
+
+			// make sure they're near the exit before allowing them to exit.
+			GetPropertyExit( id, x, y, z );
+			if(!IsPlayerInRangeOfPoint(playerid,4.5,x,y,z)) {
+			    SendClientMessage(playerid,0xDDAA55FF,"* You must be near the property exit to /exit");
+			    return 1;
+			}
+
+			a = GetPropertyEntrance( id, x, y, z );
+			SetPlayerPos( playerid, x, y, z );
+			SetPlayerFacingAngle( playerid, a );
+			SetPlayerInterior( playerid, 0 );
+			SetPlayerVirtualWorld( playerid, 0 );
+		}
+		currentInt[playerid] = -1;
+		return 1;
+	}
+	
+	// The rest of the commands here are for
+	// property creation which is admin only.
+	
+	if(!IsPlayerAdmin(playerid)) return 0;
+
+	if(strcmp("/chouse", cmd, true) == 0) // creates a house type property
+	{
+		PropertyCommand( playerid, cmd, cmdtext,idx, TYPE_HOUSE );
+		return 1;
+	}
+	else if(strcmp("/cbus", cmd, true) == 0) // creates a business type property
+	{
+ 	    PropertyCommand( playerid, cmd, cmdtext,idx, TYPE_BUSINESS );
+ 	    return 1;
+	}
+	else if(strcmp("/ccop", cmd, true) == 0) // creates a police station property
+	{
+		PropertyCommand( playerid, cmd, cmdtext,idx, TYPE_COP );
+		return 1;
+	}
+	else if(strcmp("/cbank", cmd, true) == 0) // creates a bank type property
+	{
+		PropertyCommand( playerid, cmd, cmdtext,idx, TYPE_BANK );
+		return 1;
+	}
+	else if(strcmp("/view", cmd, true) == 0) //Basically lets you view an interior from the interiors.txt file by id
+	{
+
+	    new
+			tmp[256],
+			string[128],
+			uniqId,
+			Float:x,
+			Float:y,
+			Float:z,
+			Float:a;
+		tmp = strtok( cmdtext, idx );
+		if(!strlen(tmp)){
+		    format( string, 128, "Usage: %s [uniqInteriorId]", cmd );
+		    SendClientMessage( playerid, 0xFF00CC, string );
+
+		    return 1;
+		}
+		if(!isNumeric(tmp)){
+		    SendClientMessage(playerid, 0x550000, "Uniq Interior Id must be a number" );
+		    return 1;
+		}
+		uniqId = strval( tmp );
+
+		if( uniqId > MAX_INTERIORS || uniqId < 0 ){
+			SendClientMessage( playerid, 0xFFFFCC, "Invalid Uniq Interior Id" );
+			return 1;
+		}
+		if( GetPlayerInterior( playerid ) == 0 ){
+			GetPlayerPos( playerid, plPos[playerid][0], plPos[playerid][1], plPos[playerid][2] );
+			plInt[playerid] = GetPlayerInterior( playerid );
+		}
+		a = GetInteriorExit( uniqId, x, y, z );
+		SetPlayerInterior( playerid, GetInteriorIntID( uniqId ) );
+		SetPlayerPos( playerid, x, y, z );
+		SetPlayerFacingAngle( playerid, a );
+		format( string, 128, "UniqId: %d InteriorId: %d Name: %s | Use /return to go to last position", uniqId,GetInteriorIntID( uniqId ), GetInteriorName( uniqId ));
+		SendClientMessage( playerid, 0x556600FF, string );
+		return 1;
+	}
+	else if( strcmp( "/return", cmd, true ) == 0 ) // return from /view command to last position
+	{
+	    SetPlayerPos( playerid, plPos[playerid][0], plPos[playerid][1], plPos[playerid][2] );
+	    SetPlayerInterior( playerid, plInt[playerid] );
+		return 1;
+	}
+
+	return 0;
+}
+
+/***********************************************************************
+***********************************************************************/

BIN
samp03/filterscripts/gl_realtime.amx


+ 162 - 0
samp03/filterscripts/gl_realtime.pwn

@@ -0,0 +1,162 @@
+//
+// Keeps the in game time synced to the server's time and
+// draws the current time on the player's hud using a textdraw/
+// (1 minute = 1 minute real world time)
+//
+//  (c) 2009-2014 SA-MP Team
+
+#include <a_samp>
+#pragma tabsize 0
+
+#include "../include/gl_common.inc"
+
+//--------------------------------------------------
+
+// Used to override the time in this script
+new worldtime_override = 0;
+new worldtime_overridehour = 0;
+new worldtime_overridemin  = 0;
+
+new Text:txtTimeDisp;
+new hour, minute;
+new timestr[32];
+
+forward UpdateTimeAndWeather();
+
+//--------------------------------------------------
+
+new fine_weather_ids[] = {1,2,3,4,5,6,7,12,13,14,15,17,18,24,25,26,27,28,29,30,40};
+new foggy_weather_ids[] = {9,19,20,31,32};
+new wet_weather_ids[] = {8};
+
+stock UpdateWorldWeather()
+{
+	new next_weather_prob = random(100);
+	if(next_weather_prob < 70) 		SetWeather(fine_weather_ids[random(sizeof(fine_weather_ids))]);
+	else if(next_weather_prob < 95) SetWeather(foggy_weather_ids[random(sizeof(foggy_weather_ids))]);
+	else							SetWeather(wet_weather_ids[random(sizeof(wet_weather_ids))]);
+}
+
+//--------------------------------------------------
+
+//new last_weather_update=0;
+
+public UpdateTimeAndWeather()
+{
+	// Update time
+	if(!worldtime_override) {
+    	gettime(hour, minute);
+	} else {
+		hour = worldtime_overridehour;
+		minute = worldtime_overridemin;
+	}
+
+   	format(timestr,32,"%02d:%02d",hour,minute);
+   	TextDrawSetString(txtTimeDisp,timestr);
+   	SetWorldTime(hour);
+   	
+	new x=0;
+	while(x!=MAX_PLAYERS) {
+	    if(IsPlayerConnected(x) && GetPlayerState(x) != PLAYER_STATE_NONE) {
+	        SetPlayerTime(x,hour,minute);
+		 }
+		 x++;
+	}
+
+	/* Update weather every hour
+	if(last_weather_update == 0) {
+	    UpdateWorldWeather();
+	}
+	last_weather_update++;
+	if(last_weather_update == 60) {
+	    last_weather_update = 0;
+	}*/
+}
+
+//--------------------------------------------------
+
+public OnGameModeInit()
+{
+	// Init our text display
+	txtTimeDisp = TextDrawCreate(605.0,25.0,"00:00");
+	TextDrawUseBox(txtTimeDisp, 0);
+	TextDrawFont(txtTimeDisp, 3);
+	TextDrawSetShadow(txtTimeDisp,0); // no shadow
+    TextDrawSetOutline(txtTimeDisp,2); // thickness 1
+    TextDrawBackgroundColor(txtTimeDisp,0x000000FF);
+    TextDrawColor(txtTimeDisp,0xFFFFFFFF);
+    TextDrawAlignment(txtTimeDisp,3);
+	TextDrawLetterSize(txtTimeDisp,0.5,1.5);
+	
+	UpdateTimeAndWeather();
+	SetTimer("UpdateTimeAndWeather",1000 * 60,1);
+
+	return 1;
+}
+
+//--------------------------------------------------
+
+public OnPlayerSpawn(playerid)
+{
+	TextDrawShowForPlayer(playerid,txtTimeDisp);
+	
+	// Update time
+	if(!worldtime_override) {
+    	gettime(hour, minute);
+	} else {
+		hour = worldtime_overridehour;
+		minute = worldtime_overridemin;
+	}
+	
+	SetPlayerTime(playerid,hour,minute);
+	
+	return 1;
+}
+
+//--------------------------------------------------
+
+public OnPlayerDeath(playerid, killerid, reason)
+{
+    TextDrawHideForPlayer(playerid,txtTimeDisp);
+ 	return 1;
+}
+
+//--------------------------------------------------
+
+public OnPlayerConnect(playerid)
+{
+    gettime(hour, minute);
+    SetPlayerTime(playerid,hour,minute);
+    return 1;
+}
+
+//--------------------------------------------------
+
+public OnPlayerCommandText(playerid, cmdtext[])
+{
+	new cmd[256+1];
+	new idx;
+	cmd = strtok(cmdtext, idx);
+	
+	if(!IsPlayerAdmin(playerid)) return 0; // this is an admin only script
+
+	if(strcmp(cmd, "/sethour", true) == 0) {
+	    new tmp[256+1];
+		tmp = strtok(cmdtext,idx);
+        worldtime_override = 1;
+        worldtime_overridehour = strval(tmp);
+        UpdateTimeAndWeather();
+		return 1;
+	}
+	
+	if(strcmp(cmd, "/setminute", true) == 0) {
+	    new tmp[256+1];
+		tmp = strtok(cmdtext,idx);
+        worldtime_override = 1;
+        worldtime_overridemin = strval(tmp);
+        UpdateTimeAndWeather();
+		return 1;
+	}
+	
+	return 0;
+}

BIN
samp03/filterscripts/http_test.amx


+ 39 - 0
samp03/filterscripts/http_test.pwn

@@ -0,0 +1,39 @@
+//------------------------------------------------
+
+#include <a_samp>
+#include <a_http>
+
+forward MyHttpResponse(index, response_code, data[]);
+
+//------------------------------------------------
+
+public OnFilterScriptInit()
+{
+	print("\n--HTTP Test Loaded.\n");
+	return 1;
+}
+
+//------------------------------------------------
+
+public MyHttpResponse(index, response_code, data[])
+{
+	new showdata[256+1];
+	format(showdata, 256, "Index: %d ResponseCode: %d Data: %s", index, response_code, data);
+	SendClientMessage(index, 0xFFFFFFFF, showdata);
+}
+
+//------------------------------------------------
+
+public OnPlayerCommandText(playerid, cmdtext[])
+{
+	new cmd[256+1];
+
+	if(strcmp("/httptest", cmd, true) == 0)
+	{
+	    HTTP(playerid, HTTP_GET, "sa-mp.com/return.txt", "", "MyHttpResponse");
+	    return 1;
+	}
+	
+	return 0;
+}
+//------------------------------------------------

BIN
samp03/filterscripts/iradio.amx


+ 59 - 0
samp03/filterscripts/iradio.pwn

@@ -0,0 +1,59 @@
+//-------------------------------------------------
+// Internet radio example
+// (c) 2011 SA-MP Team
+//-------------------------------------------------
+
+#pragma tabsize 0
+#include <a_samp>
+
+//-------------------------------------------------
+
+public OnFilterScriptInit()
+{
+	return 1;
+}
+
+//-------------------------------------------------
+
+public OnPlayerStateChange(playerid, newstate, oldstate)
+{
+	// play an internet radio stream when they are in a vehicle
+	if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
+	{
+		PlayAudioStreamForPlayer(playerid, "http://somafm.com/tags.pls");
+	}
+	// stop the internet stream
+	else if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
+	{
+	    StopAudioStreamForPlayer(playerid);
+	}
+	return 0;
+}
+
+//-------------------------------------------------
+
+public OnPlayerUpdate(playerid)
+{
+	if(!IsPlayerConnected(playerid)) return 0;
+	if(IsPlayerNPC(playerid)) return 1;
+	
+	// Handle playing SomaFM at the alhambra
+	if(GetPlayerInterior(playerid) == 17) {
+	    if(IsPlayerInRangeOfPoint(playerid,70.0,489.5824,-14.7563,1000.6797)) { // alhambra middle
+	    	if(!GetPVarInt(playerid,"alhambra")) {
+	    	    SetPVarInt(playerid,"alhambra",1);
+	    	    PlayAudioStreamForPlayer(playerid, "http://somafm.com/tags.pls",480.9575,-3.5402,1002.0781,40.0,true);
+			}
+		}
+	}
+	else {
+		if(GetPVarInt(playerid,"alhambra")) {
+	  		DeletePVar(playerid,"alhambra");
+	   		StopAudioStreamForPlayer(playerid);
+		}
+	}
+	
+	return 1;
+}
+
+//-------------------------------------------------

BIN
samp03/filterscripts/kylies_barn.amx


+ 138 - 0
samp03/filterscripts/kylies_barn.pwn

@@ -0,0 +1,138 @@
+// -----------------------------------------------------------------------------
+// Example Filterscript for Kylie's Barn Object
+// --------------------------------------------
+// By Matite in March 2015
+//
+//
+// This script creates the repaired Kylie's Barn Building object and removes
+// the existing GTASA barn object (normally this object has some collision
+// bugs that prevent the player from moving about inside it).
+//
+// Warning...
+// This script uses a total of:
+// * 1 object = 1 for the replacement barn object
+// * Enables the /kb command to teleport the player to Kylie's Barn
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+
+
+// -----------------------------------------------------------------------------
+// Includes
+// --------
+
+// SA-MP include
+#include <a_samp>
+
+
+// -----------------------------------------------------------------------------
+// Defines
+// -------
+
+// Used for messages sent to the player
+#define COLOR_MESSAGE_YELLOW        0xFFDD00AA
+
+
+// -----------------------------------------------------------------------------
+// Variables
+// ---------
+
+// Stores the created object number of the replacement barn object so
+// it can be destroyed when the filterscript is unloaded
+new KyliesBarnObject1; // Barn object
+
+
+// -----------------------------------------------------------------------------
+// Callbacks
+// ---------
+
+public OnPlayerCommandText(playerid, cmdtext[])
+{
+	// Check command text
+	if (strcmp("/kb", cmdtext, true, 3) == 0)
+	{
+	    // Set the interior
+		SetPlayerInterior(playerid, 3);
+
+		// Set player position and facing angle
+		SetPlayerPos(playerid, 292.03, 309.82, 999.55);
+		SetPlayerFacingAngle(playerid, 88);
+
+		// Fix camera position after teleporting
+		SetCameraBehindPlayer(playerid);
+
+		// Send a gametext message to the player
+		GameTextForPlayer(playerid, "~b~~h~Kylie's Barn!", 3000, 3);
+
+	    // Exit here
+	    return 1;
+	}
+
+	// Exit here (return 0 as the command was not handled in this filterscript)
+	return 0;
+}
+
+public OnFilterScriptInit()
+{
+    // Display information in the Server Console
+	print("\n");
+	print("  |---------------------------------------------------");
+	print("  |--- Kylie's Barn Filterscript");
+    print("  |--  Script v1.01");
+    print("  |--  6th March 2015");
+	print("  |---------------------------------------------------");
+
+	// Create Kylie's Barn repaired object
+    KyliesBarnObject1 = CreateObject(19881, 286.188, 307.609, 1002.01, 0, 0, 0);
+
+    // Display information in the Server Console
+    print("  |--  Kylie's Barn object created");
+	print("  |---------------------------------------------------");
+
+	// Loop
+    for (new i = 0; i < MAX_PLAYERS; i++)
+    {
+        // Check if the player is connected and not a NPC
+        if (IsPlayerConnected(i) && !IsPlayerNPC(i))
+        {
+            // Remove default GTASA Kylie's Barn object for the player (so any
+            // player currently ingame does not have to rejoin for them to be
+			// removed when this filterscript is loaded)
+			RemoveBuildingForPlayer(i, 14871, 286.188, 307.609, 1002.01, 250.0); 	// Barn
+	    }
+    }
+
+	// Exit here
+	return 1;
+}
+
+public OnFilterScriptExit()
+{
+    // Check for valid object
+	if (IsValidObject(KyliesBarnObject1))
+	{
+		// Destroy the Kylie's Barn object
+		DestroyObject(KyliesBarnObject1);
+
+		// Display information in the Server Console
+		print("  |---------------------------------------------------");
+    	print("  |--  Kylie's Barn object destroyed");
+    }
+
+   	// Display information in the Server Console
+	print("  |---------------------------------------------------");
+	print("  |--  Kylie's Barn Filterscript Unloaded");
+	print("  |---------------------------------------------------");
+
+    // Exit here
+	return 1;
+}
+
+public OnPlayerConnect(playerid)
+{
+    // Remove default GTASA Kylie's Barn object for the player
+	RemoveBuildingForPlayer(playerid, 14871, 286.188, 307.609, 1002.01, 250.0); 	// Barn
+
+	// Exit here (return 1 so this callback is handled in other scripts too)
+	return 1;
+}
+

BIN
samp03/filterscripts/ls_apartments1.amx


+ 770 - 0
samp03/filterscripts/ls_apartments1.pwn

@@ -0,0 +1,770 @@
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+// Example Filterscript for the new LS Apartments 1 Building with Elevator
+// -----------------------------------------------------------------------
+// Original elevator code by Zamaroht in 2010
+//
+// Updated by Kye in 2011
+// * Added a sound effect for the elevator starting/stopping
+//
+// Edited by Matite in January 2015
+// * Added code to remove the existing building, add the new building and
+//   edited the elevator code so it works in this new building
+//
+// Updated to v1.02 by Matite in February 2015
+// * Added code for the new car park object and edited the elevator to
+//   include the car park
+//
+// This script creates the new LS Apartments 1 building object, removes the
+// existing GTASA building object, adds the new car park object and creates
+// an elevator that can be used to travel between all levels.
+//
+// You can un-comment the OnPlayerCommandText callback below to enable a simple
+// teleport command (/lsa) that teleports you to the LS Apartments 1 building.
+//
+// Warning...
+// This script uses a total of:
+// * 27 objects = 1 for the elevator, 2 for the elevator doors, 22 for the
+//   elevator floor doors, 1 for the replacement LS Apartments 1 building
+//   and 1 for the car park
+// * 12 3D Text Labels = 11 on the floors and 1 in the elevator
+// * 1 dialog (for the elevator - dialog ID 876)
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+
+
+// -----------------------------------------------------------------------------
+// Includes
+// --------
+
+// SA-MP include
+#include <a_samp>
+
+// For PlaySoundForPlayersInRange()
+#include "../include/gl_common.inc"
+
+// -----------------------------------------------------------------------------
+// Defines
+// -------
+
+// Movement speed of the elevator
+#define ELEVATOR_SPEED      (5.0)
+
+// Movement speed of the doors
+#define DOORS_SPEED         (5.0)
+
+// Time in ms that the elevator will wait in each floor before continuing with the queue...
+// be sure to give enough time for doors to open
+#define ELEVATOR_WAIT_TIME  (5000)  
+
+// Dialog ID for the LS Apartments building elevator dialog
+#define DIALOG_ID           (876)
+
+// Position defines
+#define Y_DOOR_CLOSED       (-1180.535917)
+#define Y_DOOR_R_OPENED     Y_DOOR_CLOSED - 1.6
+#define Y_DOOR_L_OPENED     Y_DOOR_CLOSED + 1.6
+
+#define GROUND_Z_COORD      (20.879316)
+
+#define ELEVATOR_OFFSET     (0.059523)
+
+#define X_ELEVATOR_POS      (1181.622924)
+#define Y_ELEVATOR_POS      (-1180.554687)
+
+// Elevator state defines
+#define ELEVATOR_STATE_IDLE     (0)
+#define ELEVATOR_STATE_WAITING  (1)
+#define ELEVATOR_STATE_MOVING   (2)
+
+// Invalid floor define
+#define INVALID_FLOOR           (-1)
+
+// Used for chat text messages
+#define COLOR_MESSAGE_YELLOW        0xFFDD00AA
+
+// -----------------------------------------------------------------------------
+// Constants
+// ---------
+
+// Elevator floor names for the 3D text labels
+static FloorNames[11][] =
+{
+	"Car Park",
+	"Ground Floor",
+	"First Floor",
+	"Second Floor",
+	"Third Floor",
+	"Fourth Floor",
+	"Fifth Floor",
+	"Sixth Floor",
+	"Seventh Floor",
+	"Eighth Floor",
+	"Ninth Floor"
+};
+
+// Elevator floor Z heights
+static Float:FloorZOffsets[11] =
+{
+    0.0, 		// Car Park
+    13.604544,	// Ground Floor
+    18.808519,	// First Floor = 13.604544 + 5.203975
+    24.012494,  // Second Floor = 18.808519 + 5.203975
+    29.216469,  // Third Floor = 24.012494 + 5.203975
+    34.420444,  // Fourth Floor = 29.216469 + 5.203975
+    39.624419,  // Fifth Floor = 34.420444 + 5.203975
+    44.828394,  // Sixth Floor = 39.624419 + 5.203975
+    50.032369,  // Seventh Floor = 44.828394 + 5.203975
+    55.236344,  // Eighth Floor = 50.032369 + 5.203975
+    60.440319   // Ninth Floor = 55.236344 + 5.203975
+};
+
+// ------------------------------------------------------------------------------
+// Variables
+// ---------
+
+// Stores the created object number of the replacement building so it can be
+// destroyed when the filterscript is unloaded
+new LSApartments1Object;
+
+// Stores the created object number of the new cark park so it can be
+// destroyed when the filterscript is unloaded
+new LSApartments1CPObject;
+
+// Stores the created object numbers of the elevator, the elevator doors and
+// the elevator floor doors so they can be destroyed when the filterscript
+// is unloaded
+new Obj_Elevator, Obj_ElevatorDoors[2], Obj_FloorDoors[11][2];
+	
+// Stores a reference to the 3D text labels used on each floor and inside the
+// elevator itself so they can be detroyed when the filterscript is unloaded
+new Text3D:Label_Elevator, Text3D:Label_Floors[11];
+
+// Stores the current state of the elevator (ie ELEVATOR_STATE_IDLE,
+// ELEVATOR_STATE_WAITING or ELEVATOR_STATE_MOVING)
+new ElevatorState;
+
+// Stores the current floor the elevator is on or heading to... if the value is
+// ELEVATOR_STATE_IDLE or ELEVATOR_STATE_WAITING this is the current floor. If
+// the value is ELEVATOR_STATE_MOVING then it is the floor it's moving to
+new	ElevatorFloor;  
+
+// Stores the elevator queue for each floor
+new ElevatorQueue[11];
+
+// Stores who requested the floor for the elevator queue...
+// FloorRequestedBy[floor_id] = playerid;  (stores who requested which floor)
+new	FloorRequestedBy[11];
+
+// Used for a timer that makes the elevator move faster after players start
+// surfing the object
+new ElevatorBoostTimer;
+
+// ------------------------------------------------------------------------------
+// Function Forwards
+// -----------------
+
+// Public:
+forward CallElevator(playerid, floorid);    // You can use INVALID_PLAYER_ID too.
+forward ShowElevatorDialog(playerid);
+
+// Private:
+forward Elevator_Initialize();
+forward Elevator_Destroy();
+
+forward Elevator_OpenDoors();
+forward Elevator_CloseDoors();
+forward Floor_OpenDoors(floorid);
+forward Floor_CloseDoors(floorid);
+
+forward Elevator_MoveToFloor(floorid);
+forward Elevator_Boost(floorid);        	// Increases the elevator speed until it reaches 'floorid'.
+forward Elevator_TurnToIdle();
+
+forward ReadNextFloorInQueue();
+forward RemoveFirstQueueFloor();
+forward AddFloorToQueue(floorid);
+forward IsFloorInQueue(floorid);
+forward ResetElevatorQueue();
+
+forward DidPlayerRequestElevator(playerid);
+
+forward Float:GetElevatorZCoordForFloor(floorid);
+forward Float:GetDoorsZCoordForFloor(floorid);
+
+// ------------------------------------------------------------------------------
+// Callbacks
+// ---------
+
+
+// Uncomment the OnPlayerCommandText callback below (remove the "/*" and the "*/")
+// to enable a simple teleport command (/lsa) which teleports the player to
+// outside the LS Apartments 1 building.
+
+/*
+public OnPlayerCommandText(playerid, cmdtext[])
+{
+	// Check command text
+	if (strcmp("/lsa", cmdtext, true, 4) == 0)
+	{
+	    // Set the interior
+		SetPlayerInterior(playerid, 0);
+
+		// Set player position and facing angle
+		SetPlayerPos(playerid, 1131.07 + random(3), -1180.72 + random(2), 33.32);
+		SetPlayerFacingAngle(playerid, 270);
+
+		// Fix camera position after teleporting
+		SetCameraBehindPlayer(playerid);
+
+		// Send a gametext message to the player
+		GameTextForPlayer(playerid, "~b~~h~LS Apartments 1!", 3000, 3);
+	
+	    // Exit here
+	    return 1;
+	}
+	
+	// Exit here (return 0 as the command was not handled in this filterscript)
+	return 0;
+}
+*/
+
+public OnFilterScriptInit()
+{
+    // Display information in the Server Console
+	print("\n");
+	print("  |---------------------------------------------------");
+	print("  |--- LS Apartments 1 Filterscript");
+    print("  |--  Script v1.02");
+    print("  |--  5th February 2015");
+	print("  |---------------------------------------------------");
+
+	// Create the LS Apartments 1 Building object
+    LSApartments1Object = CreateObject(19595, 1160.96, -1180.58, 70.4141, 0, 0, 0);
+
+    // Display information in the Server Console
+    print("  |--  LS Apartments 1 Building object created");
+    
+    // Create the LS Apartments 1 Car Park object
+    LSApartments1CPObject = CreateObject(19798, 1160.96, -1180.58, 20.4141, 0, 0, 0);
+
+    // Display information in the Server Console
+    print("  |--  LS Apartments 1 Car Park object created");
+
+    // Reset the elevator queue
+	ResetElevatorQueue();
+
+	// Create the elevator object, the elevator doors and the floor doors
+	Elevator_Initialize();
+
+	// Display information in the Server Console
+    print("  |--  LS Apartments 1 Elevator created");
+    print("  |---------------------------------------------------");
+    
+    // Loop
+    for (new i = 0; i < MAX_PLAYERS; i++)
+    {
+        // Check if the player is connected and not a NPC
+        if (IsPlayerConnected(i) && !IsPlayerNPC(i))
+        {
+            // Remove default GTASA building map object, LOD and awning shadows
+            // (so any player currently ingame does not have to rejoin for them
+			//  to be removed when this filterscript is loaded)
+			RemoveBuildingForPlayer(i, 5766, 1160.96, -1180.58, 70.4141, 250.0); // Awning shadows
+			RemoveBuildingForPlayer(i, 5767, 1160.96, -1180.58, 70.4141, 250.0); // Building
+			RemoveBuildingForPlayer(i, 5964, 1160.96, -1180.58, 70.4141, 250.0); // LOD
+        }
+    }
+
+	// Exit here
+	return 1;
+}
+
+public OnFilterScriptExit()
+{
+    // Check for valid object
+	if (IsValidObject(LSApartments1Object))
+	{
+		// Destroy the LS Apartments 1 Building object
+		DestroyObject(LSApartments1Object);
+
+		// Display information in the Server Console
+		print("  |---------------------------------------------------");
+    	print("  |--  LS Apartments 1 Building object destroyed");
+    }
+    
+    // Check for valid object
+	if (IsValidObject(LSApartments1CPObject))
+	{
+		// Destroy the LS Apartments 1 Car Park object
+		DestroyObject(LSApartments1CPObject);
+
+		// Display information in the Server Console
+    	print("  |--  LS Apartments 1 Car Park object destroyed");
+    }
+
+    // Destroy the elevator, the elevator doors and the elevator floor doors
+	Elevator_Destroy();
+
+	// Display information in the Server Console
+    print("  |--  LS Apartments 1 Elevator destroyed");
+    print("  |---------------------------------------------------");
+
+    // Exit here
+	return 1;
+}
+
+public OnPlayerConnect(playerid)
+{
+    // Remove default GTASA building map object, LOD and awning shadows
+	RemoveBuildingForPlayer(playerid, 5766, 1160.96, -1180.58, 70.4141, 250.0); // Awning shadows
+	RemoveBuildingForPlayer(playerid, 5767, 1160.96, -1180.58, 70.4141, 250.0); // Building
+	RemoveBuildingForPlayer(playerid, 5964, 1160.96, -1180.58, 70.4141, 250.0); // LOD
+
+	// Exit here
+	return 1;
+}
+
+public OnObjectMoved(objectid)
+{
+	// Create variables
+    new Float:x, Float:y, Float:z;
+    
+    // Loop
+	for(new i; i < sizeof(Obj_FloorDoors); i ++)
+	{
+	    // Check if the object that moved was one of the elevator floor doors
+		if(objectid == Obj_FloorDoors[i][0])
+		{
+		    GetObjectPos(Obj_FloorDoors[i][0], x, y, z);
+
+            // Some floor doors have shut, move the elevator to next floor in queue:
+            if (y < Y_DOOR_L_OPENED - 0.5)
+		    {
+				Elevator_MoveToFloor(ElevatorQueue[0]);
+				RemoveFirstQueueFloor();
+			}
+		}
+	}
+
+	if(objectid == Obj_Elevator)   // The elevator reached the specified floor.
+	{
+	    KillTimer(ElevatorBoostTimer);  // Kills the timer, in case the elevator reached the floor before boost.
+
+	    FloorRequestedBy[ElevatorFloor] = INVALID_PLAYER_ID;
+
+	    Elevator_OpenDoors();
+	    Floor_OpenDoors(ElevatorFloor);
+
+	    GetObjectPos(Obj_Elevator, x, y, z);
+	    Label_Elevator	= Create3DTextLabel("{CCCCCC}Press '{FFFFFF}~k~~CONVERSATION_YES~{CCCCCC}' to use elevator", 0xCCCCCCAA, X_ELEVATOR_POS - 1.7, Y_ELEVATOR_POS - 1.75, z - 0.4, 4.0, 0, 1);
+
+	    ElevatorState 	= ELEVATOR_STATE_WAITING;
+	    SetTimer("Elevator_TurnToIdle", ELEVATOR_WAIT_TIME, 0);
+	}
+
+	return 1;
+}
+
+public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
+{
+    if(dialogid == DIALOG_ID)
+    {
+        if(!response)
+            return 0;
+
+        if(FloorRequestedBy[listitem] != INVALID_PLAYER_ID || IsFloorInQueue(listitem))
+            GameTextForPlayer(playerid, "~r~The floor is already in the queue", 3500, 4);
+		else if(DidPlayerRequestElevator(playerid))
+		    GameTextForPlayer(playerid, "~r~You already requested the elevator", 3500, 4);
+		else
+	        CallElevator(playerid, listitem);
+
+		return 1;
+    }
+
+	return 0;
+}
+
+public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
+{
+    // Check if the player is not in a vehicle and pressed the conversation yes key (Y by default)
+	if (!IsPlayerInAnyVehicle(playerid) && (newkeys & KEY_YES))
+	{
+	    // Create variables and get the players current position
+	    new Float:pos[3];
+	    GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
+	    
+	    // For debug
+	    //printf("X = %0.2f | Y = %0.2f | Z = %0.2f", pos[0], pos[1], pos[2]);
+
+        // Check if the player is using the button inside the elevator
+	    if (pos[1] > (Y_ELEVATOR_POS - 1.8) && pos[1] < (Y_ELEVATOR_POS + 1.8) && pos[0] < (X_ELEVATOR_POS + 1.8) && pos[0] > (X_ELEVATOR_POS - 1.8))
+	    {
+	        // The player is using the button inside the elevator
+	        // --------------------------------------------------
+	        
+	        // Show the elevator dialog to the player
+	        ShowElevatorDialog(playerid);
+	    }
+		else
+		{
+		    // Check if the player is using the button on one of the floors
+		    if(pos[1] < (Y_ELEVATOR_POS - 1.81) && pos[1] > (Y_ELEVATOR_POS - 3.8) && pos[0] > (X_ELEVATOR_POS - 3.8) && pos[0] < (X_ELEVATOR_POS - 1.81))
+		    {
+		        // The player is most likely using an elevator floor button... check which floor
+		        // -----------------------------------------------------------------------------
+		        
+		        // Create variable with the number of floors to check (total floors minus 1)
+				new i = 10;
+
+				// Loop
+				while(pos[2] < GetDoorsZCoordForFloor(i) + 3.5 && i > 0)
+				    i --;
+
+				if(i == 0 && pos[2] < GetDoorsZCoordForFloor(0) + 2.0)
+				    i = -1;
+
+				if (i <= 9)
+				{
+				    // Check if the elevator is not moving (idle or waiting)
+				    if (ElevatorState != ELEVATOR_STATE_MOVING)
+				    {
+				        // Check if the elevator is already on the floor it was called from
+				        if (ElevatorFloor == i + 1)
+				        {
+				            // Display gametext message to the player
+							GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~y~~h~LS Apartments 1 Elevator Is~n~~y~~h~Already On This Floor...~n~~w~Walk Inside It~n~~w~And Press '~k~~CONVERSATION_YES~'", 3500, 3);
+
+							// Display chat text message to the player
+	                        SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, "* The LS Apartments 1 elevator is already on this floor... walk inside it and press '{FFFFFF}~k~~CONVERSATION_YES~{CCCCCC}'");
+
+                            // Exit here (return 1 so this callback is processed in other scripts)
+	                        return 1;
+				        }
+				    }
+
+				    // Call function to call the elevator to the floor
+					CallElevator(playerid, i + 1);
+
+					// Display gametext message to the player
+					GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~g~~h~LS Apartments 1 Elevator~n~~g~~h~Has Been Called...~n~~w~Please Wait", 3000, 3);
+
+					// Create variable for formatted message
+					new strTempString[100];
+					
+					// Check if the elevator is moving
+					if (ElevatorState == ELEVATOR_STATE_MOVING)
+					{
+					    // Format chat text message
+						format(strTempString, sizeof(strTempString), "* The LS Apartments 1 elevator has been called... it is currently moving towards the %s.", FloorNames[ElevatorFloor]);
+					}
+					else
+					{
+					    // Check if the floor is the car park
+					    if (ElevatorFloor == 0)
+					    {
+					    	// Format chat text message
+							format(strTempString, sizeof(strTempString), "* The LS Apartments 1 elevator has been called... it is currently at the %s.", FloorNames[ElevatorFloor]);
+						}
+						else
+						{
+					    	// Format chat text message
+							format(strTempString, sizeof(strTempString), "* The LS Apartments 1 elevator has been called... it is currently on the %s.", FloorNames[ElevatorFloor]);
+						}
+					}
+					
+					// Display formatted chat text message to the player
+					SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, strTempString);
+
+					// Exit here (return 1 so this callback is processed in other scripts)
+					return 1;
+				}
+		    }
+		}
+	}
+
+    // Exit here (return 1 so this callback is processed in other scripts)
+	return 1;
+}
+
+// ------------------------ Functions ------------------------
+stock Elevator_Initialize()
+{
+	// Create the elevator and elevator door objects
+	Obj_Elevator 			= CreateObject(18755, X_ELEVATOR_POS, Y_ELEVATOR_POS, GROUND_Z_COORD + ELEVATOR_OFFSET, 0.000000, 0.000000, 0.000000);
+	Obj_ElevatorDoors[0] 	= CreateObject(18757, X_ELEVATOR_POS, Y_ELEVATOR_POS, GROUND_Z_COORD + ELEVATOR_OFFSET, 0.000000, 0.000000, 0.000000);
+	Obj_ElevatorDoors[1] 	= CreateObject(18756, X_ELEVATOR_POS, Y_ELEVATOR_POS, GROUND_Z_COORD + ELEVATOR_OFFSET, 0.000000, 0.000000, 0.000000);
+
+    // Create the 3D text label for inside the elevator
+	Label_Elevator = Create3DTextLabel("{CCCCCC}Press '{FFFFFF}~k~~CONVERSATION_YES~{CCCCCC}' to use elevator", 0xCCCCCCAA, X_ELEVATOR_POS - 1.7, Y_ELEVATOR_POS - 1.75, GROUND_Z_COORD - 0.4, 4.0, 0, 1);
+
+	// Create variables
+	new string[128], Float:z;
+
+	// Loop
+	for (new i; i < sizeof(Obj_FloorDoors); i ++)
+	{
+	    // Create elevator floor door objects
+	    Obj_FloorDoors[i][0] 	= CreateObject(18757, X_ELEVATOR_POS - 0.245, Y_ELEVATOR_POS, GetDoorsZCoordForFloor(i), 0.000000, 0.000000, 0.000000);
+		Obj_FloorDoors[i][1] 	= CreateObject(18756, X_ELEVATOR_POS - 0.245, Y_ELEVATOR_POS, GetDoorsZCoordForFloor(i), 0.000000, 0.000000, 0.000000);
+
+		// Format string for the floor 3D text label
+		format(string, sizeof(string), "{CCCCCC}[%s]\n{CCCCCC}Press '{FFFFFF}~k~~CONVERSATION_YES~{CCCCCC}' to call", FloorNames[i]);
+
+		// Get label Z position
+		z = GetDoorsZCoordForFloor(i);
+
+		// Create floor label
+		Label_Floors[i] = Create3DTextLabel(string, 0xCCCCCCAA, X_ELEVATOR_POS - 2.5, Y_ELEVATOR_POS - 2.5, z - 0.2, 10.5, 0, 1);
+	}
+
+	// Open the car park floor doors and the elevator doors
+	Floor_OpenDoors(0);
+	Elevator_OpenDoors();
+
+    // Exit here
+	return 1;
+}
+
+stock Elevator_Destroy()
+{
+	// Destroys the elevator.
+
+	DestroyObject(Obj_Elevator);
+	DestroyObject(Obj_ElevatorDoors[0]);
+	DestroyObject(Obj_ElevatorDoors[1]);
+	Delete3DTextLabel(Label_Elevator);
+
+	for(new i; i < sizeof(Obj_FloorDoors); i ++)
+	{
+	    DestroyObject(Obj_FloorDoors[i][0]);
+		DestroyObject(Obj_FloorDoors[i][1]);
+		Delete3DTextLabel(Label_Floors[i]);
+	}
+
+	return 1;
+}
+
+stock Elevator_OpenDoors()
+{
+	// Opens the elevator's doors.
+
+	new Float:x, Float:y, Float:z;
+
+	GetObjectPos(Obj_ElevatorDoors[0], x, y, z);
+	MoveObject(Obj_ElevatorDoors[0], x, Y_DOOR_L_OPENED, z, DOORS_SPEED);
+	MoveObject(Obj_ElevatorDoors[1], x, Y_DOOR_R_OPENED, z, DOORS_SPEED);
+
+	return 1;
+}
+
+stock Elevator_CloseDoors()
+{
+    // Closes the elevator's doors.
+
+    if(ElevatorState == ELEVATOR_STATE_MOVING)
+	    return 0;
+
+    new Float:x, Float:y, Float:z;
+
+	GetObjectPos(Obj_ElevatorDoors[0], x, y, z);
+	MoveObject(Obj_ElevatorDoors[0], x, Y_DOOR_CLOSED, z, DOORS_SPEED);
+	MoveObject(Obj_ElevatorDoors[1], x, Y_DOOR_CLOSED, z, DOORS_SPEED);
+
+	return 1;
+}
+
+stock Floor_OpenDoors(floorid)
+{
+    // Opens the doors at the specified floor.
+
+    MoveObject(Obj_FloorDoors[floorid][0], X_ELEVATOR_POS - 0.245, Y_DOOR_L_OPENED, GetDoorsZCoordForFloor(floorid), DOORS_SPEED);
+	MoveObject(Obj_FloorDoors[floorid][1], X_ELEVATOR_POS - 0.245, Y_DOOR_R_OPENED, GetDoorsZCoordForFloor(floorid), DOORS_SPEED);
+	
+	PlaySoundForPlayersInRange(6401, 50.0, X_ELEVATOR_POS, Y_ELEVATOR_POS, GetDoorsZCoordForFloor(floorid) + 5.0);
+
+	return 1;
+}
+
+stock Floor_CloseDoors(floorid)
+{
+    // Closes the doors at the specified floor.
+
+    MoveObject(Obj_FloorDoors[floorid][0], X_ELEVATOR_POS - 0.245, Y_ELEVATOR_POS, GetDoorsZCoordForFloor(floorid), DOORS_SPEED);
+	MoveObject(Obj_FloorDoors[floorid][1], X_ELEVATOR_POS - 0.245, Y_ELEVATOR_POS, GetDoorsZCoordForFloor(floorid), DOORS_SPEED);
+	
+	PlaySoundForPlayersInRange(6401, 50.0, X_ELEVATOR_POS, Y_ELEVATOR_POS, GetDoorsZCoordForFloor(floorid) + 5.0);
+
+	return 1;
+}
+
+stock Elevator_MoveToFloor(floorid)
+{
+	// Moves the elevator to specified floor (doors are meant to be already closed).
+
+	ElevatorState = ELEVATOR_STATE_MOVING;
+	ElevatorFloor = floorid;
+
+	// Move the elevator slowly, to give time to clients to sync the object surfing. Then, boost it up:
+	MoveObject(Obj_Elevator, X_ELEVATOR_POS, Y_ELEVATOR_POS, GetElevatorZCoordForFloor(floorid), 0.25);
+    MoveObject(Obj_ElevatorDoors[0], X_ELEVATOR_POS, Y_ELEVATOR_POS, GetDoorsZCoordForFloor(floorid), 0.25);
+    MoveObject(Obj_ElevatorDoors[1], X_ELEVATOR_POS, Y_ELEVATOR_POS, GetDoorsZCoordForFloor(floorid), 0.25);
+    Delete3DTextLabel(Label_Elevator);
+
+	ElevatorBoostTimer = SetTimerEx("Elevator_Boost", 2000, 0, "i", floorid);
+
+	return 1;
+}
+
+public Elevator_Boost(floorid)
+{
+	// Increases the elevator's speed until it reaches 'floorid'
+	StopObject(Obj_Elevator);
+	StopObject(Obj_ElevatorDoors[0]);
+	StopObject(Obj_ElevatorDoors[1]);
+	
+	MoveObject(Obj_Elevator, X_ELEVATOR_POS, Y_ELEVATOR_POS, GetElevatorZCoordForFloor(floorid), ELEVATOR_SPEED);
+    MoveObject(Obj_ElevatorDoors[0], X_ELEVATOR_POS, Y_ELEVATOR_POS, GetDoorsZCoordForFloor(floorid), ELEVATOR_SPEED);
+    MoveObject(Obj_ElevatorDoors[1], X_ELEVATOR_POS, Y_ELEVATOR_POS, GetDoorsZCoordForFloor(floorid), ELEVATOR_SPEED);
+
+	return 1;
+}
+
+public Elevator_TurnToIdle()
+{
+	ElevatorState = ELEVATOR_STATE_IDLE;
+	ReadNextFloorInQueue();
+
+	return 1;
+}
+
+stock RemoveFirstQueueFloor()
+{
+	// Removes the data in ElevatorQueue[0], and reorders the queue accordingly.
+
+	for(new i; i < sizeof(ElevatorQueue) - 1; i ++)
+	    ElevatorQueue[i] = ElevatorQueue[i + 1];
+
+	ElevatorQueue[sizeof(ElevatorQueue) - 1] = INVALID_FLOOR;
+
+	return 1;
+}
+
+stock AddFloorToQueue(floorid)
+{
+ 	// Adds 'floorid' at the end of the queue.
+
+	// Scan for the first empty space:
+	new slot = -1;
+	for(new i; i < sizeof(ElevatorQueue); i ++)
+	{
+	    if(ElevatorQueue[i] == INVALID_FLOOR)
+	    {
+	        slot = i;
+	        break;
+	    }
+	}
+
+	if(slot != -1)
+	{
+	    ElevatorQueue[slot] = floorid;
+
+     	// If needed, move the elevator.
+	    if(ElevatorState == ELEVATOR_STATE_IDLE)
+	        ReadNextFloorInQueue();
+
+	    return 1;
+	}
+
+	return 0;
+}
+
+stock ResetElevatorQueue()
+{
+	// Resets the queue.
+
+	for(new i; i < sizeof(ElevatorQueue); i ++)
+	{
+	    ElevatorQueue[i] 	= INVALID_FLOOR;
+	    FloorRequestedBy[i] = INVALID_PLAYER_ID;
+	}
+
+	return 1;
+}
+
+stock IsFloorInQueue(floorid)
+{
+	// Checks if the specified floor is currently part of the queue.
+
+	for(new i; i < sizeof(ElevatorQueue); i ++)
+	    if(ElevatorQueue[i] == floorid)
+	        return 1;
+
+	return 0;
+}
+
+stock ReadNextFloorInQueue()
+{
+	// Reads the next floor in the queue, closes doors, and goes to it.
+
+	if(ElevatorState != ELEVATOR_STATE_IDLE || ElevatorQueue[0] == INVALID_FLOOR)
+	    return 0;
+
+	Elevator_CloseDoors();
+	Floor_CloseDoors(ElevatorFloor);
+
+	return 1;
+}
+
+stock DidPlayerRequestElevator(playerid)
+{
+	for(new i; i < sizeof(FloorRequestedBy); i ++)
+	    if(FloorRequestedBy[i] == playerid)
+	        return 1;
+
+	return 0;
+}
+
+stock ShowElevatorDialog(playerid)
+{
+	new string[512];
+	for(new i; i < sizeof(ElevatorQueue); i ++)
+	{
+	    if(FloorRequestedBy[i] != INVALID_PLAYER_ID)
+	        strcat(string, "{FF0000}");
+
+	    strcat(string, FloorNames[i]);
+	    strcat(string, "\n");
+	}
+
+	ShowPlayerDialog(playerid, DIALOG_ID, DIALOG_STYLE_LIST, "LS Apartments 1 Elevator...", string, "Accept", "Cancel");
+
+	return 1;
+}
+
+stock CallElevator(playerid, floorid)
+{
+	// Calls the elevator (also used with the elevator dialog).
+
+	if(FloorRequestedBy[floorid] != INVALID_PLAYER_ID || IsFloorInQueue(floorid))
+	    return 0;
+
+	FloorRequestedBy[floorid] = playerid;
+	AddFloorToQueue(floorid);
+
+	return 1;
+}
+
+stock Float:GetElevatorZCoordForFloor(floorid)
+{
+    // Return Z height value plus a small offset
+    return (GROUND_Z_COORD + FloorZOffsets[floorid] + ELEVATOR_OFFSET);
+}
+
+stock Float:GetDoorsZCoordForFloor(floorid)
+{
+	// Return Z height value plus a small offset
+	return (GROUND_Z_COORD + FloorZOffsets[floorid] + ELEVATOR_OFFSET);
+}
+

BIN
samp03/filterscripts/ls_beachside.amx


+ 743 - 0
samp03/filterscripts/ls_beachside.pwn

@@ -0,0 +1,743 @@
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+// Example Filterscript for the new LS BeachSide Building with Elevator
+// --------------------------------------------------------------------
+// Original elevator code by Zamaroht in 2010
+//
+// Updated by Kye in 2011
+// * Added a sound effect for the elevator starting/stopping
+//
+// Edited by Matite in January 2015
+// * Adapted the elevator code so it works in this new building and removed the
+//   light pole at the underground car park entrance
+//
+// Updated to v1.03 by Matite in April 2015
+// * Removed the code that removes the existing building map object and the lines
+//   that create the new objects as the original building is now replaced with
+//   the new one by SAMP instead (same as the LS Office building)
+//
+// Updated to v1.02 by Matite in February 2015
+// * Added code for the new car park object and edited the elevator to
+//   include the car park
+//
+// This script creates the new LS BeachSide building object, removes the
+// existing GTASA building object, adds the new car park object and creates
+// an elevator that can be used to travel between all levels.
+//
+// You can un-comment the OnPlayerCommandText callback below to enable a simple
+// teleport command (/lsb) that teleports you to the LS BeachSide building.
+//
+// Warning...
+// This script uses a total of:
+// * 31 objects = 1 for the elevator, 2 for the elevator doors and 28 for the
+//   elevator floor doors
+// * 15 3D Text Labels = 14 on the floors and 1 in the elevator
+// * 1 dialog (for the elevator - dialog ID 877)
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+
+
+// -----------------------------------------------------------------------------
+// Includes
+// --------
+
+// SA-MP include
+#include <a_samp>
+
+// For PlaySoundForPlayersInRange()
+#include "../include/gl_common.inc"
+
+// -----------------------------------------------------------------------------
+// Defines
+// -------
+
+// Movement speed of the elevator
+#define ELEVATOR_SPEED      (5.0)
+
+// Movement speed of the doors
+#define DOORS_SPEED         (5.0)
+
+// Time in ms that the elevator will wait in each floor before continuing with the queue...
+// be sure to give enough time for doors to open
+#define ELEVATOR_WAIT_TIME  (5000)  
+
+// Dialog ID for the LS BeachSide elevator dialog
+#define DIALOG_ID           (877)
+
+// Position defines
+#define X_DOOR_R_OPENED     (289.542419)
+#define X_DOOR_L_OPENED     (286.342407)
+#define Y_DOOR_R_OPENED     (-1609.640991)
+#define Y_DOOR_L_OPENED     (-1609.076049)
+
+#define X_FDOOR_R_OPENED    (289.492431)
+#define X_FDOOR_L_OPENED    (286.292419)
+#define Y_FDOOR_R_OPENED    (-1609.870971)
+#define Y_FDOOR_L_OPENED    (-1609.306030)
+
+#define GROUND_Z_COORD      (18.755348)     // (33.825077)
+#define X_ELEVATOR_POS      (287.942413)
+#define Y_ELEVATOR_POS      (-1609.341064)
+
+// Elevator state defines
+#define ELEVATOR_STATE_IDLE     (0)
+#define ELEVATOR_STATE_WAITING  (1)
+#define ELEVATOR_STATE_MOVING   (2)
+
+// Invalid floor define
+#define INVALID_FLOOR           (-1)
+
+// Used for chat text messages
+#define COLOR_MESSAGE_YELLOW        0xFFDD00AA
+
+// -----------------------------------------------------------------------------
+// Constants
+// ---------
+
+// Elevator floor names for the 3D text labels
+static FloorNames[14][] =
+{
+	"Car Park",
+	"Ground Floor",
+	"First Floor",
+	"Second Floor",
+	"Third Floor",
+	"Fourth Floor",
+	"Fifth Floor",
+	"Sixth Floor",
+	"Seventh Floor",
+	"Eighth Floor",
+	"Ninth Floor",
+	"Tenth Floor",
+	"Eleventh Floor",
+	"Twelfth Floor"
+};
+
+// Elevator floor Z heights
+static Float:FloorZOffsets[14] =
+{
+    0.0, 		// Car Park
+    15.069729,  // Ground Floor
+    29.130733,	// First Floor
+    33.630733,  // Second Floor = 29.130733 + 4.5
+    38.130733,  // Third Floor = 33.630733 + 4.5
+    42.630733,  // Fourth Floor = 38.130733 + 4.5
+    47.130733,  // Fifth Floor = 42.630733 + 4.5
+    51.630733,  // Sixth Floor = 47.130733 + 4.5
+    56.130733,  // Seventh Floor = 51.630733 + 4.5
+    60.630733,  // Eighth Floor = 56.130733 + 4.5
+    65.130733,  // Ninth Floor = 60.630733 + 4.5
+    69.630733,  // Tenth Floor = 65.130733 + 4.5
+    74.130733,  // Eleventh Floor = 69.630733 + 4.5
+    78.630733,  // Twelfth Floor = 74.130733 + 4.5
+};
+
+// -----------------------------------------------------------------------------
+// Variables
+// ---------
+
+// Stores the created object numbers of the elevator, the elevator doors and
+// the elevator floor doors so they can be destroyed when the filterscript
+// is unloaded
+new Obj_Elevator, Obj_ElevatorDoors[2], Obj_FloorDoors[14][2];
+	
+// Stores a reference to the 3D text labels used on each floor and inside the
+// elevator itself so they can be detroyed when the filterscript is unloaded
+new Text3D:Label_Elevator, Text3D:Label_Floors[14];
+
+// Stores the current state of the elevator (ie ELEVATOR_STATE_IDLE,
+// ELEVATOR_STATE_WAITING or ELEVATOR_STATE_MOVING)
+new ElevatorState;
+
+// Stores the current floor the elevator is on or heading to... if the value is
+// ELEVATOR_STATE_IDLE or ELEVATOR_STATE_WAITING this is the current floor. If
+// the value is ELEVATOR_STATE_MOVING then it is the floor it's moving to
+new	ElevatorFloor;  
+
+// Stores the elevator queue for each floor
+new ElevatorQueue[14];
+
+// Stores who requested the floor for the elevator queue...
+// FloorRequestedBy[floor_id] = playerid;  (stores who requested which floor)
+new	FloorRequestedBy[14];
+
+// Used for a timer that makes the elevator move faster after players start
+// surfing the object
+new ElevatorBoostTimer;
+
+// -----------------------------------------------------------------------------
+// Function Forwards
+// -----------------
+
+// Public:
+forward CallElevator(playerid, floorid);    // You can use INVALID_PLAYER_ID too.
+forward ShowElevatorDialog(playerid);
+
+// Private:
+forward Elevator_Initialize();
+forward Elevator_Destroy();
+
+forward Elevator_OpenDoors();
+forward Elevator_CloseDoors();
+forward Floor_OpenDoors(floorid);
+forward Floor_CloseDoors(floorid);
+
+forward Elevator_MoveToFloor(floorid);
+forward Elevator_Boost(floorid);        	// Increases the elevator speed until it reaches 'floorid'.
+forward Elevator_TurnToIdle();
+
+forward ReadNextFloorInQueue();
+forward RemoveFirstQueueFloor();
+forward AddFloorToQueue(floorid);
+forward IsFloorInQueue(floorid);
+forward ResetElevatorQueue();
+
+forward DidPlayerRequestElevator(playerid);
+
+forward Float:GetElevatorZCoordForFloor(floorid);
+forward Float:GetDoorsZCoordForFloor(floorid);
+
+// -----------------------------------------------------------------------------
+// Callbacks
+// ---------
+
+// Un-comment the OnPlayerCommandText callback below (remove the "/*" and the "*/")
+// to enable a simple teleport command (/lsb) which teleports the player to
+// outside the LS BeachSide building.
+
+/*
+public OnPlayerCommandText(playerid, cmdtext[])
+{
+	// Check command text
+	if (strcmp("/lsb", cmdtext, true, 4) == 0)
+	{
+	    // Set the interior
+		SetPlayerInterior(playerid, 0);
+
+		// Set player position and facing angle
+		SetPlayerPos(playerid, 289.81 + random(2), -1630.65 + random(2), 34.32);
+		SetPlayerFacingAngle(playerid, 10);
+
+		// Fix camera position after teleporting
+		SetCameraBehindPlayer(playerid);
+
+		// Send a gametext message to the player
+		GameTextForPlayer(playerid, "~b~~h~LS BeachSide!", 3000, 3);
+
+	    // Exit here
+	    return 1;
+	}
+
+	// Exit here (return 0 as the command was not handled in this filterscript)
+	return 0;
+}
+*/
+
+public OnFilterScriptInit()
+{
+    // Display information in the Server Console
+	print("\n");
+	print("  |---------------------------------------------------");
+	print("  |--- LS BeachSide Filterscript");
+    print("  |--  Script v1.03");
+    print("  |--  19th April 2015");
+	print("  |---------------------------------------------------");
+
+    // Reset the elevator queue
+	ResetElevatorQueue();
+
+	// Create the elevator object, the elevator doors and the floor doors
+	Elevator_Initialize();
+
+	// Display information in the Server Console
+    print("  |--  LS BeachSide Building Elevator created");
+    print("  |---------------------------------------------------");
+    
+    // Loop
+    for (new i = 0; i < MAX_PLAYERS; i++)
+    {
+        // Check if the player is connected and not a NPC
+        if (IsPlayerConnected(i) && !IsPlayerNPC(i))
+        {
+            // Remove the lamp post at the underground car park entrance
+            RemoveBuildingForPlayer(i, 1226, 265.481, -1581.1, 32.9311, 5.0);
+            
+            // Remove the night lights object (must be removed to also remove any
+		    // occulsion zones inside the building)
+		    RemoveBuildingForPlayer(i, 6518, 280.297, -1606.2, 72.3984, 250.0);
+        }
+    }
+
+	// Exit here
+	return 1;
+}
+
+public OnFilterScriptExit()
+{
+    // Destroy the elevator, the elevator doors and the elevator floor doors
+	Elevator_Destroy();
+
+	// Display information in the Server Console
+    print("  |--  LS BeachSide Building Elevator destroyed");
+    print("  |---------------------------------------------------");
+
+    // Exit here
+	return 1;
+}
+
+public OnPlayerConnect(playerid)
+{
+    // Remove the lamp post at the underground car park entrance
+    RemoveBuildingForPlayer(playerid, 1226, 265.481, -1581.1, 32.9311, 5.0);
+    
+    // Remove the night lights object (must be removed to also remove any
+    // occulsion zones inside the building)
+    RemoveBuildingForPlayer(playerid, 6518, 280.297, -1606.2, 72.3984, 250.0);
+
+	// Exit here (return 1 so this callback is processed in other scripts)
+	return 1;
+}
+
+public OnObjectMoved(objectid)
+{
+	// Create variables
+    new Float:x, Float:y, Float:z;
+    
+    // Loop
+	for(new i; i < sizeof(Obj_FloorDoors); i ++)
+	{
+	    // Check if the object that moved was one of the elevator floor doors
+		if(objectid == Obj_FloorDoors[i][0])
+		{
+		    GetObjectPos(Obj_FloorDoors[i][0], x, y, z);
+
+            // Some floor doors have shut, move the elevator to next floor in queue:
+            if (y < Y_DOOR_L_OPENED - 0.5)
+		    {
+				Elevator_MoveToFloor(ElevatorQueue[0]);
+				RemoveFirstQueueFloor();
+			}
+		}
+	}
+
+	if(objectid == Obj_Elevator)   // The elevator reached the specified floor.
+	{
+	    KillTimer(ElevatorBoostTimer);  // Kills the timer, in case the elevator reached the floor before boost.
+
+	    FloorRequestedBy[ElevatorFloor] = INVALID_PLAYER_ID;
+
+	    Elevator_OpenDoors();
+	    Floor_OpenDoors(ElevatorFloor);
+
+	    GetObjectPos(Obj_Elevator, x, y, z);
+	    Label_Elevator	= Create3DTextLabel("{CCCCCC}Press '{FFFFFF}~k~~CONVERSATION_YES~{CCCCCC}' to use elevator", 0xCCCCCCAA, X_ELEVATOR_POS + 1.6, Y_ELEVATOR_POS - 1.85, z - 0.4, 4.0, 0, 1);
+
+	    ElevatorState 	= ELEVATOR_STATE_WAITING;
+	    SetTimer("Elevator_TurnToIdle", ELEVATOR_WAIT_TIME, 0);
+	}
+
+	return 1;
+}
+
+public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
+{
+    if(dialogid == DIALOG_ID)
+    {
+        if(!response)
+            return 0;
+
+        if(FloorRequestedBy[listitem] != INVALID_PLAYER_ID || IsFloorInQueue(listitem))
+            GameTextForPlayer(playerid, "~r~The floor is already in the queue", 3500, 4);
+		else if(DidPlayerRequestElevator(playerid))
+		    GameTextForPlayer(playerid, "~r~You already requested the elevator", 3500, 4);
+		else
+	        CallElevator(playerid, listitem);
+
+		return 1;
+    }
+
+	return 0;
+}
+
+public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
+{
+	// Check if the player is not in a vehicle and pressed the conversation yes key (Y by default)
+	if (!IsPlayerInAnyVehicle(playerid) && (newkeys & KEY_YES))
+	{
+	    // Create variables and get the players current position
+	    new Float:pos[3];
+	    GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
+	    
+	    // For debug
+	    //printf("X = %0.2f | Y = %0.2f | Z = %0.2f", pos[0], pos[1], pos[2]);
+
+        // Check if the player is using the button inside the elevator
+	    if (pos[1] > (Y_ELEVATOR_POS - 1.8) && pos[1] < (Y_ELEVATOR_POS + 1.8) && pos[0] < (X_ELEVATOR_POS + 1.8) && pos[0] > (X_ELEVATOR_POS - 1.8))
+	    {
+	        // The player is using the button inside the elevator
+	        // --------------------------------------------------
+	        
+	        // Show the elevator dialog to the player
+	        ShowElevatorDialog(playerid);
+	    }
+		else
+		{
+		    // Check if the player is using the button on one of the floors
+		    if(pos[1] < (Y_ELEVATOR_POS - 1.81) && pos[1] > (Y_ELEVATOR_POS - 3.8) && pos[0] > (X_ELEVATOR_POS + 1.21) && pos[0] < (X_ELEVATOR_POS + 3.8))
+		    {
+		        // The player is most likely using an elevator floor button... check which floor
+		        // -----------------------------------------------------------------------------
+		        
+		        // Create variable with the number of floors to check (total floors minus 1)
+				new i = 13;
+
+				// Loop
+				while(pos[2] < GetDoorsZCoordForFloor(i) + 3.5 && i > 0)
+				    i --;
+
+				if(i == 0 && pos[2] < GetDoorsZCoordForFloor(0) + 2.0)
+				    i = -1;
+
+				if (i <= 12)
+				{
+				    // Check if the elevator is not moving (idle or waiting)
+				    if (ElevatorState != ELEVATOR_STATE_MOVING)
+				    {
+				        // Check if the elevator is already on the floor it was called from
+				        if (ElevatorFloor == i + 1)
+				        {
+				            // Display gametext message to the player
+							GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~y~~h~LS BeachSide Elevator Is~n~~y~~h~Already On This Floor...~n~~w~Walk Inside It~n~~w~And Press '~k~~CONVERSATION_YES~'", 3500, 3);
+
+							// Display chat text message to the player
+	                        SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, "* The LS BeachSide elevator is already on this floor... walk inside it and press '{FFFFFF}~k~~CONVERSATION_YES~{CCCCCC}'");
+	                        
+	                        // Exit here (return 1 so this callback is processed in other scripts)
+	                        return 1;
+				        }
+				    }
+
+				    // Call function to call the elevator to the floor
+					CallElevator(playerid, i + 1);
+
+					// Display gametext message to the player
+					GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~g~~h~LS BeachSide Elevator~n~~g~~h~Has Been Called...~n~~w~Please Wait", 3000, 3);
+
+					// Create variable for formatted message
+					new strTempString[100];
+					
+					// Check if the elevator is moving
+					if (ElevatorState == ELEVATOR_STATE_MOVING)
+					{
+					    // Format chat text message
+						format(strTempString, sizeof(strTempString), "* The LS BeachSide elevator has been called... it is currently moving towards the %s.", FloorNames[ElevatorFloor]);
+					}
+					else
+					{
+					    // Check if the floor is the car park
+					    if (ElevatorFloor == 0)
+					    {
+					    	// Format chat text message
+							format(strTempString, sizeof(strTempString), "* The LS BeachSide elevator has been called... it is currently at the %s.", FloorNames[ElevatorFloor]);
+						}
+						else
+						{
+					    	// Format chat text message
+							format(strTempString, sizeof(strTempString), "* The LS BeachSide elevator has been called... it is currently on the %s.", FloorNames[ElevatorFloor]);
+						}
+					}
+					
+					// Display formatted chat text message to the player
+					SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, strTempString);
+
+					// Exit here (return 1 so this callback is processed in other scripts)
+					return 1;
+				}
+		    }
+		}
+	}
+
+    // Exit here (return 1 so this callback is processed in other scripts)
+	return 1;
+}
+
+// ------------------------ Functions ------------------------
+stock Elevator_Initialize()
+{
+	// Create the elevator and elevator door objects
+	Obj_Elevator 			= CreateObject(18755, X_ELEVATOR_POS, Y_ELEVATOR_POS, GROUND_Z_COORD, 0.000000, 0.000000, 80.000000);
+	Obj_ElevatorDoors[0] 	= CreateObject(18757, X_ELEVATOR_POS, Y_ELEVATOR_POS, GROUND_Z_COORD, 0.000000, 0.000000, 80.000000);
+	Obj_ElevatorDoors[1] 	= CreateObject(18756, X_ELEVATOR_POS, Y_ELEVATOR_POS, GROUND_Z_COORD, 0.000000, 0.000000, 80.000000);
+
+	// Create the 3D text label for inside the elevator
+	Label_Elevator = Create3DTextLabel("{CCCCCC}Press '{FFFFFF}~k~~CONVERSATION_YES~{CCCCCC}' to use elevator", 0xCCCCCCAA, X_ELEVATOR_POS + 1.6, Y_ELEVATOR_POS - 1.85, GROUND_Z_COORD - 0.4, 4.0, 0, 1);
+
+	// Create variables
+	new string[128], Float:z;
+
+	// Loop
+	for (new i; i < sizeof(Obj_FloorDoors); i ++)
+	{
+	    // Create elevator floor door objects
+	    Obj_FloorDoors[i][0] 	= CreateObject(18757, X_ELEVATOR_POS, Y_ELEVATOR_POS - 0.245, GetDoorsZCoordForFloor(i) + 0.05, 0.000000, 0.000000, 80.000000);
+		Obj_FloorDoors[i][1] 	= CreateObject(18756, X_ELEVATOR_POS, Y_ELEVATOR_POS - 0.245, GetDoorsZCoordForFloor(i) + 0.05, 0.000000, 0.000000, 80.000000);
+
+        // Format string for the floor 3D text label
+		format(string, sizeof(string), "{CCCCCC}[%s]\n{CCCCCC}Press '{FFFFFF}~k~~CONVERSATION_YES~{CCCCCC}' to call", FloorNames[i]);
+
+		// Get label Z position
+		z = GetDoorsZCoordForFloor(i);
+
+		// Create floor label
+		Label_Floors[i] = Create3DTextLabel(string, 0xCCCCCCAA, X_ELEVATOR_POS + 2, Y_ELEVATOR_POS -3, z - 0.2, 10.5, 0, 1);
+	}
+
+	// Open the car park floor doors and the elevator doors
+	Floor_OpenDoors(0);
+	Elevator_OpenDoors();
+
+	// Exit here
+	return 1;
+}
+
+stock Elevator_Destroy()
+{
+	// Destroys the elevator.
+
+	DestroyObject(Obj_Elevator);
+	DestroyObject(Obj_ElevatorDoors[0]);
+	DestroyObject(Obj_ElevatorDoors[1]);
+	Delete3DTextLabel(Label_Elevator);
+
+	for(new i; i < sizeof(Obj_FloorDoors); i ++)
+	{
+	    DestroyObject(Obj_FloorDoors[i][0]);
+		DestroyObject(Obj_FloorDoors[i][1]);
+		Delete3DTextLabel(Label_Floors[i]);
+	}
+
+	return 1;
+}
+
+stock Elevator_OpenDoors()
+{
+	// Opens the elevator's doors.
+
+	new Float:x, Float:y, Float:z;
+
+	GetObjectPos(Obj_ElevatorDoors[0], x, y, z);
+	MoveObject(Obj_ElevatorDoors[0], X_DOOR_L_OPENED, Y_DOOR_L_OPENED, z, DOORS_SPEED);
+	MoveObject(Obj_ElevatorDoors[1], X_DOOR_R_OPENED, Y_DOOR_R_OPENED, z, DOORS_SPEED);
+
+	return 1;
+}
+
+stock Elevator_CloseDoors()
+{
+    // Closes the elevator's doors.
+
+    if(ElevatorState == ELEVATOR_STATE_MOVING)
+	    return 0;
+
+    new Float:x, Float:y, Float:z;
+
+	GetObjectPos(Obj_ElevatorDoors[0], x, y, z);
+	MoveObject(Obj_ElevatorDoors[0], X_ELEVATOR_POS, Y_ELEVATOR_POS, z, DOORS_SPEED);
+	MoveObject(Obj_ElevatorDoors[1], X_ELEVATOR_POS, Y_ELEVATOR_POS, z, DOORS_SPEED);
+
+	return 1;
+}
+
+stock Floor_OpenDoors(floorid)
+{
+    // Opens the doors at the specified floor.
+
+    MoveObject(Obj_FloorDoors[floorid][0], X_FDOOR_L_OPENED, Y_FDOOR_L_OPENED, GetDoorsZCoordForFloor(floorid) + 0.05, DOORS_SPEED);
+	MoveObject(Obj_FloorDoors[floorid][1], X_FDOOR_R_OPENED, Y_FDOOR_R_OPENED, GetDoorsZCoordForFloor(floorid) + 0.05, DOORS_SPEED);
+	
+	PlaySoundForPlayersInRange(6401, 50.0, X_ELEVATOR_POS, Y_ELEVATOR_POS, GetDoorsZCoordForFloor(floorid) + 5.0);
+
+	return 1;
+}
+
+stock Floor_CloseDoors(floorid)
+{
+    // Closes the doors at the specified floor.
+
+    MoveObject(Obj_FloorDoors[floorid][0], X_ELEVATOR_POS, Y_ELEVATOR_POS - 0.245, GetDoorsZCoordForFloor(floorid) + 0.05, DOORS_SPEED);
+	MoveObject(Obj_FloorDoors[floorid][1], X_ELEVATOR_POS, Y_ELEVATOR_POS - 0.245, GetDoorsZCoordForFloor(floorid) + 0.05, DOORS_SPEED);
+	
+	PlaySoundForPlayersInRange(6401, 50.0, X_ELEVATOR_POS, Y_ELEVATOR_POS, GetDoorsZCoordForFloor(floorid) + 5.0);
+
+	return 1;
+}
+
+stock Elevator_MoveToFloor(floorid)
+{
+	// Moves the elevator to specified floor (doors are meant to be already closed).
+
+	ElevatorState = ELEVATOR_STATE_MOVING;
+	ElevatorFloor = floorid;
+
+	// Move the elevator slowly, to give time to clients to sync the object surfing. Then, boost it up:
+	MoveObject(Obj_Elevator, X_ELEVATOR_POS, Y_ELEVATOR_POS, GetElevatorZCoordForFloor(floorid), 0.25);
+    MoveObject(Obj_ElevatorDoors[0], X_ELEVATOR_POS, Y_ELEVATOR_POS, GetDoorsZCoordForFloor(floorid), 0.25);
+    MoveObject(Obj_ElevatorDoors[1], X_ELEVATOR_POS, Y_ELEVATOR_POS, GetDoorsZCoordForFloor(floorid), 0.25);
+    Delete3DTextLabel(Label_Elevator);
+
+	ElevatorBoostTimer = SetTimerEx("Elevator_Boost", 2000, 0, "i", floorid);
+
+	return 1;
+}
+
+public Elevator_Boost(floorid)
+{
+	// Increases the elevator's speed until it reaches 'floorid'
+	StopObject(Obj_Elevator);
+	StopObject(Obj_ElevatorDoors[0]);
+	StopObject(Obj_ElevatorDoors[1]);
+	
+	MoveObject(Obj_Elevator, X_ELEVATOR_POS, Y_ELEVATOR_POS, GetElevatorZCoordForFloor(floorid), ELEVATOR_SPEED);
+    MoveObject(Obj_ElevatorDoors[0], X_ELEVATOR_POS, Y_ELEVATOR_POS, GetDoorsZCoordForFloor(floorid), ELEVATOR_SPEED);
+    MoveObject(Obj_ElevatorDoors[1], X_ELEVATOR_POS, Y_ELEVATOR_POS, GetDoorsZCoordForFloor(floorid), ELEVATOR_SPEED);
+
+	return 1;
+}
+
+public Elevator_TurnToIdle()
+{
+	ElevatorState = ELEVATOR_STATE_IDLE;
+	ReadNextFloorInQueue();
+
+	return 1;
+}
+
+stock RemoveFirstQueueFloor()
+{
+	// Removes the data in ElevatorQueue[0], and reorders the queue accordingly.
+
+	for(new i; i < sizeof(ElevatorQueue) - 1; i ++)
+	    ElevatorQueue[i] = ElevatorQueue[i + 1];
+
+	ElevatorQueue[sizeof(ElevatorQueue) - 1] = INVALID_FLOOR;
+
+	return 1;
+}
+
+stock AddFloorToQueue(floorid)
+{
+ 	// Adds 'floorid' at the end of the queue.
+
+	// Scan for the first empty space:
+	new slot = -1;
+	for(new i; i < sizeof(ElevatorQueue); i ++)
+	{
+	    if(ElevatorQueue[i] == INVALID_FLOOR)
+	    {
+	        slot = i;
+	        break;
+	    }
+	}
+
+	if(slot != -1)
+	{
+	    ElevatorQueue[slot] = floorid;
+
+     	// If needed, move the elevator.
+	    if(ElevatorState == ELEVATOR_STATE_IDLE)
+	        ReadNextFloorInQueue();
+
+	    return 1;
+	}
+
+	return 0;
+}
+
+stock ResetElevatorQueue()
+{
+	// Resets the queue.
+
+	for(new i; i < sizeof(ElevatorQueue); i ++)
+	{
+	    ElevatorQueue[i] 	= INVALID_FLOOR;
+	    FloorRequestedBy[i] = INVALID_PLAYER_ID;
+	}
+
+	return 1;
+}
+
+stock IsFloorInQueue(floorid)
+{
+	// Checks if the specified floor is currently part of the queue.
+
+	for(new i; i < sizeof(ElevatorQueue); i ++)
+	    if(ElevatorQueue[i] == floorid)
+	        return 1;
+
+	return 0;
+}
+
+stock ReadNextFloorInQueue()
+{
+	// Reads the next floor in the queue, closes doors, and goes to it.
+
+	if(ElevatorState != ELEVATOR_STATE_IDLE || ElevatorQueue[0] == INVALID_FLOOR)
+	    return 0;
+
+	Elevator_CloseDoors();
+	Floor_CloseDoors(ElevatorFloor);
+
+	return 1;
+}
+
+stock DidPlayerRequestElevator(playerid)
+{
+	for(new i; i < sizeof(FloorRequestedBy); i ++)
+	    if(FloorRequestedBy[i] == playerid)
+	        return 1;
+
+	return 0;
+}
+
+stock ShowElevatorDialog(playerid)
+{
+	new string[512];
+	for(new i; i < sizeof(ElevatorQueue); i ++)
+	{
+	    if(FloorRequestedBy[i] != INVALID_PLAYER_ID)
+	        strcat(string, "{FF0000}");
+
+	    strcat(string, FloorNames[i]);
+	    strcat(string, "\n");
+	}
+
+	ShowPlayerDialog(playerid, DIALOG_ID, DIALOG_STYLE_LIST, "LS BeachSide Elevator...", string, "Accept", "Cancel");
+
+	return 1;
+}
+
+stock CallElevator(playerid, floorid)
+{
+	// Calls the elevator (also used with the elevator dialog).
+
+	if(FloorRequestedBy[floorid] != INVALID_PLAYER_ID || IsFloorInQueue(floorid))
+	    return 0;
+
+	FloorRequestedBy[floorid] = playerid;
+	AddFloorToQueue(floorid);
+
+	return 1;
+}
+
+stock Float:GetElevatorZCoordForFloor(floorid)
+{
+	// Return Z height value
+    return (GROUND_Z_COORD + FloorZOffsets[floorid]);
+}
+
+stock Float:GetDoorsZCoordForFloor(floorid)
+{
+    // Return Z height value
+	return (GROUND_Z_COORD + FloorZOffsets[floorid]);
+}
+

BIN
samp03/filterscripts/ls_elevator.amx


+ 509 - 0
samp03/filterscripts/ls_elevator.pwn

@@ -0,0 +1,509 @@
+/*
+*   Example elevator system for the new LS building.
+*
+*	Zamaroht 2010
+*
+*   26/08/2011: Kye: added a sound effect for the elevator starting/stopping.
+*/
+
+// Warning: This script uses a total of 45 objects, 22 3D Text Labels and 1 dialog.
+
+#include <a_samp>
+#include "../include/gl_common.inc" // for PlaySoundForPlayersInRange()
+
+#define ELEVATOR_SPEED      (5.0)   // Movement speed of the elevator.
+#define DOORS_SPEED         (5.0)   // Movement speed of the doors.
+#define ELEVATOR_WAIT_TIME  (5000)  // Time in ms that the elevator will wait in each floor before continuing with the queue.
+									// Be sure to give enough time for doors to open.
+
+#define DIALOG_ID           (874)
+
+// Private:
+#define X_DOOR_CLOSED       (1786.627685)
+#define X_DOOR_R_OPENED     (1785.027685)
+#define X_DOOR_L_OPENED     (1788.227685)
+#define GROUND_Z_COORD      (14.511476)
+#define ELEVATOR_OFFSET     (0.059523)
+
+/* ------------------
+// Constants:
+-------------------*/
+static FloorNames[21][] =
+{
+	"Ground Floor",
+	"First Floor",
+	"Second Floor",
+	"Third Floor",
+	"Fourth Floor",
+	"Fifth Floor",
+	"Sixth Floor",
+	"Seventh Floor",
+	"Eighth Floor",
+	"Ninth Floor",
+	"Tenth Floor",
+	"Eleventh Floor",
+	"Twelfth Floor",
+	"Thirteenth Floor",
+	"Fourteenth Floor",
+	"Fifteenth Floor",
+	"Sixteenth Floor",
+	"Seventeenth Floor",
+	"Eighteenth Floor",
+	"Nineteenth Floor",
+	"Penthouse"
+};
+
+static Float:FloorZOffsets[21] =
+{
+    0.0,		// 0.0,
+    8.5479,		// 8.5479,
+    13.99945,   // 8.5479 + (5.45155 * 1.0),
+    19.45100,   // 8.5479 + (5.45155 * 2.0),
+    24.90255,   // 8.5479 + (5.45155 * 3.0),
+    30.35410,   // 8.5479 + (5.45155 * 4.0),
+    35.80565,   // 8.5479 + (5.45155 * 5.0),
+    41.25720,   // 8.5479 + (5.45155 * 6.0),
+    46.70875,   // 8.5479 + (5.45155 * 7.0),
+    52.16030,   // 8.5479 + (5.45155 * 8.0),
+    57.61185,   // 8.5479 + (5.45155 * 9.0),
+    63.06340,   // 8.5479 + (5.45155 * 10.0),
+    68.51495,   // 8.5479 + (5.45155 * 11.0),
+    73.96650,   // 8.5479 + (5.45155 * 12.0),
+    79.41805,   // 8.5479 + (5.45155 * 13.0),
+    84.86960,   // 8.5479 + (5.45155 * 14.0),
+    90.32115,   // 8.5479 + (5.45155 * 15.0),
+    95.77270,   // 8.5479 + (5.45155 * 16.0),
+    101.22425,  // 8.5479 + (5.45155 * 17.0),
+    106.67580,	// 8.5479 + (5.45155 * 18.0),
+    112.12735	// 8.5479 + (5.45155 * 19.0)
+};
+
+/* ------------------
+// Variables:
+-------------------*/
+new Obj_Elevator, Obj_ElevatorDoors[2],
+	Obj_FloorDoors[21][2];
+
+new Text3D:Label_Elevator, Text3D:Label_Floors[21];
+
+#define ELEVATOR_STATE_IDLE     (0)
+#define ELEVATOR_STATE_WAITING  (1)
+#define ELEVATOR_STATE_MOVING   (2)
+
+new ElevatorState,
+	ElevatorFloor;  // If Idle or Waiting, this is the current floor. If Moving, the floor it's moving to.
+
+#define INVALID_FLOOR           (-1)
+
+new ElevatorQueue[21],  	// Floors in queue.
+	FloorRequestedBy[21];   // FloorRequestedBy[floor_id] = playerid; - Points out who requested which floor.
+
+new ElevatorBoostTimer;     // Timer that makes the elevator move faster after players start surfing the object.
+
+/* ------------------
+*  Function forwards:
+-------------------*/
+// Public:
+forward CallElevator(playerid, floorid);    // You can use INVALID_PLAYER_ID too.
+forward ShowElevatorDialog(playerid);
+
+// Private:
+forward Elevator_Initialize();
+forward Elevator_Destroy();
+
+forward Elevator_OpenDoors();
+forward Elevator_CloseDoors();
+forward Floor_OpenDoors(floorid);
+forward Floor_CloseDoors(floorid);
+
+forward Elevator_MoveToFloor(floorid);
+forward Elevator_Boost(floorid);        	// Increases the elevator speed until it reaches 'floorid'.
+forward Elevator_TurnToIdle();
+
+forward ReadNextFloorInQueue();
+forward RemoveFirstQueueFloor();
+forward AddFloorToQueue(floorid);
+forward IsFloorInQueue(floorid);
+forward ResetElevatorQueue();
+
+forward DidPlayerRequestElevator(playerid);
+
+forward Float:GetElevatorZCoordForFloor(floorid);
+forward Float:GetDoorsZCoordForFloor(floorid);
+
+// ------------------------ Callbacks ------------------------
+
+public OnFilterScriptInit()
+{
+	ResetElevatorQueue();
+	Elevator_Initialize();
+
+	return 1;
+}
+
+public OnFilterScriptExit()
+{
+	Elevator_Destroy();
+
+	return 1;
+}
+
+public OnObjectMoved(objectid)
+{
+    new Float:x, Float:y, Float:z;
+	for(new i; i < sizeof(Obj_FloorDoors); i ++)
+	{
+		if(objectid == Obj_FloorDoors[i][0])
+		{
+		    GetObjectPos(Obj_FloorDoors[i][0], x, y, z);
+
+		    if(x < X_DOOR_L_OPENED - 0.5)   // Some floor doors have shut, move the elevator to next floor in queue:
+		    {
+				Elevator_MoveToFloor(ElevatorQueue[0]);
+				RemoveFirstQueueFloor();
+			}
+		}
+	}
+
+	if(objectid == Obj_Elevator)   // The elevator reached the specified floor.
+	{
+	    KillTimer(ElevatorBoostTimer);  // Kills the timer, in case the elevator reached the floor before boost.
+
+	    FloorRequestedBy[ElevatorFloor] = INVALID_PLAYER_ID;
+
+	    Elevator_OpenDoors();
+	    Floor_OpenDoors(ElevatorFloor);
+
+	    GetObjectPos(Obj_Elevator, x, y, z);
+	    Label_Elevator	= Create3DTextLabel("{CCCCCC}Press '{FFFFFF}~k~~CONVERSATION_YES~{CCCCCC}' to use elevator", 0xCCCCCCAA, 1784.9822, -1302.0426, z - 0.9, 4.0, 0, 1);
+
+	    ElevatorState 	= ELEVATOR_STATE_WAITING;
+	    SetTimer("Elevator_TurnToIdle", ELEVATOR_WAIT_TIME, 0);
+	}
+
+	return 1;
+}
+
+public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
+{
+    if(dialogid == DIALOG_ID)
+    {
+        if(!response)
+            return 0;
+
+        if(FloorRequestedBy[listitem] != INVALID_PLAYER_ID || IsFloorInQueue(listitem))
+            GameTextForPlayer(playerid, "~r~The floor is already in the queue", 3500, 4);
+		else if(DidPlayerRequestElevator(playerid))
+		    GameTextForPlayer(playerid, "~r~You already requested the elevator", 3500, 4);
+		else
+	        CallElevator(playerid, listitem);
+
+		return 1;
+    }
+
+	return 0;
+}
+
+public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
+{
+	if(!IsPlayerInAnyVehicle(playerid) && (newkeys & KEY_YES))
+	{
+	    new Float:pos[3];
+	    GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
+	    if(pos[1] < -1301.4 && pos[1] > -1303.2417 && pos[0] < 1786.2131 && pos[0] > 1784.1555)    // He is using the elevator button
+	        ShowElevatorDialog(playerid);
+		else    // Is he in a floor button?
+		{
+		    if(pos[1] > -1301.4 && pos[1] < -1299.1447 && pos[0] < 1785.6147 && pos[0] > 1781.9902)
+		    {
+		        // He is most likely using it, check floor:
+				new i=20;
+				while(pos[2] < GetDoorsZCoordForFloor(i) + 3.5 && i > 0)
+				    i --;
+
+				if(i == 0 && pos[2] < GetDoorsZCoordForFloor(0) + 2.0)
+				    i = -1;
+
+				if(i <= 19)
+				{
+					CallElevator(playerid, i + 1);
+					GameTextForPlayer(playerid, "~r~Elevator called", 3500, 4);
+				}
+		    }
+		}
+	}
+
+	return 1;
+}
+
+// ------------------------ Functions ------------------------
+stock Elevator_Initialize()
+{
+	// Initializes the elevator.
+
+	Obj_Elevator 			= CreateObject(18755, 1786.678100, -1303.459472, GROUND_Z_COORD + ELEVATOR_OFFSET, 0.000000, 0.000000, 270.000000);
+	Obj_ElevatorDoors[0] 	= CreateObject(18757, X_DOOR_CLOSED, -1303.459472, GROUND_Z_COORD, 0.000000, 0.000000, 270.000000);
+	Obj_ElevatorDoors[1] 	= CreateObject(18756, X_DOOR_CLOSED, -1303.459472, GROUND_Z_COORD, 0.000000, 0.000000, 270.000000);
+
+	Label_Elevator          = Create3DTextLabel("{CCCCCC}Press '{FFFFFF}~k~~CONVERSATION_YES~{CCCCCC}' to use elevator", 0xCCCCCCAA, 1784.9822, -1302.0426, 13.6491, 4.0, 0, 1);
+
+	new string[128],
+		Float:z;
+
+	for(new i; i < sizeof(Obj_FloorDoors); i ++)
+	{
+	    Obj_FloorDoors[i][0] 	= CreateObject(18757, X_DOOR_CLOSED, -1303.171142, GetDoorsZCoordForFloor(i), 0.000000, 0.000000, 270.000000);
+		Obj_FloorDoors[i][1] 	= CreateObject(18756, X_DOOR_CLOSED, -1303.171142, GetDoorsZCoordForFloor(i), 0.000000, 0.000000, 270.000000);
+
+		format(string, sizeof(string), "{CCCCCC}[%s]\n{CCCCCC}Press '{FFFFFF}~k~~CONVERSATION_YES~{CCCCCC}' to call", FloorNames[i]);
+
+		if(i == 0)
+		    z = 13.4713;
+		else
+		    z = 13.4713 + 8.7396 + ((i-1) * 5.45155);
+
+		Label_Floors[i]         = Create3DTextLabel(string, 0xCCCCCCAA, 1783.9799, -1300.7660, z, 10.5, 0, 1);
+		// Label_Elevator, Text3D:Label_Floors[21];
+	}
+
+	// Open ground floor doors:
+	Floor_OpenDoors(0);
+	Elevator_OpenDoors();
+
+	return 1;
+}
+
+stock Elevator_Destroy()
+{
+	// Destroys the elevator.
+
+	DestroyObject(Obj_Elevator);
+	DestroyObject(Obj_ElevatorDoors[0]);
+	DestroyObject(Obj_ElevatorDoors[1]);
+	Delete3DTextLabel(Label_Elevator);
+
+	for(new i; i < sizeof(Obj_FloorDoors); i ++)
+	{
+	    DestroyObject(Obj_FloorDoors[i][0]);
+		DestroyObject(Obj_FloorDoors[i][1]);
+		Delete3DTextLabel(Label_Floors[i]);
+	}
+
+	return 1;
+}
+
+stock Elevator_OpenDoors()
+{
+	// Opens the elevator's doors.
+
+	new Float:x, Float:y, Float:z;
+
+	GetObjectPos(Obj_ElevatorDoors[0], x, y, z);
+	MoveObject(Obj_ElevatorDoors[0], X_DOOR_L_OPENED, y, z, DOORS_SPEED);
+	MoveObject(Obj_ElevatorDoors[1], X_DOOR_R_OPENED, y, z, DOORS_SPEED);
+
+	return 1;
+}
+
+stock Elevator_CloseDoors()
+{
+    // Closes the elevator's doors.
+
+    if(ElevatorState == ELEVATOR_STATE_MOVING)
+	    return 0;
+
+    new Float:x, Float:y, Float:z;
+
+	GetObjectPos(Obj_ElevatorDoors[0], x, y, z);
+	MoveObject(Obj_ElevatorDoors[0], X_DOOR_CLOSED, y, z, DOORS_SPEED);
+	MoveObject(Obj_ElevatorDoors[1], X_DOOR_CLOSED, y, z, DOORS_SPEED);
+
+	return 1;
+}
+
+stock Floor_OpenDoors(floorid)
+{
+    // Opens the doors at the specified floor.
+
+    MoveObject(Obj_FloorDoors[floorid][0], X_DOOR_L_OPENED, -1303.171142, GetDoorsZCoordForFloor(floorid), DOORS_SPEED);
+	MoveObject(Obj_FloorDoors[floorid][1], X_DOOR_R_OPENED, -1303.171142, GetDoorsZCoordForFloor(floorid), DOORS_SPEED);
+	
+	PlaySoundForPlayersInRange(6401, 50.0, X_DOOR_CLOSED, -1303.171142, GetDoorsZCoordForFloor(floorid) + 5.0);
+
+	return 1;
+}
+
+stock Floor_CloseDoors(floorid)
+{
+    // Closes the doors at the specified floor.
+
+    MoveObject(Obj_FloorDoors[floorid][0], X_DOOR_CLOSED, -1303.171142, GetDoorsZCoordForFloor(floorid), DOORS_SPEED);
+	MoveObject(Obj_FloorDoors[floorid][1], X_DOOR_CLOSED, -1303.171142, GetDoorsZCoordForFloor(floorid), DOORS_SPEED);
+	
+	PlaySoundForPlayersInRange(6401, 50.0, X_DOOR_CLOSED, -1303.171142, GetDoorsZCoordForFloor(floorid) + 5.0);
+
+	return 1;
+}
+
+stock Elevator_MoveToFloor(floorid)
+{
+	// Moves the elevator to specified floor (doors are meant to be already closed).
+
+	ElevatorState = ELEVATOR_STATE_MOVING;
+	ElevatorFloor = floorid;
+
+	// Move the elevator slowly, to give time to clients to sync the object surfing. Then, boost it up:
+	MoveObject(Obj_Elevator, 1786.678100, -1303.459472, GetElevatorZCoordForFloor(floorid), 0.25);
+    MoveObject(Obj_ElevatorDoors[0], X_DOOR_CLOSED, -1303.459472, GetDoorsZCoordForFloor(floorid), 0.25);
+    MoveObject(Obj_ElevatorDoors[1], X_DOOR_CLOSED, -1303.459472, GetDoorsZCoordForFloor(floorid), 0.25);
+    Delete3DTextLabel(Label_Elevator);
+
+	ElevatorBoostTimer = SetTimerEx("Elevator_Boost", 2000, 0, "i", floorid);
+
+	return 1;
+}
+
+public Elevator_Boost(floorid)
+{
+	// Increases the elevator's speed until it reaches 'floorid'
+	StopObject(Obj_Elevator);
+	StopObject(Obj_ElevatorDoors[0]);
+	StopObject(Obj_ElevatorDoors[1]);
+	
+	MoveObject(Obj_Elevator, 1786.678100, -1303.459472, GetElevatorZCoordForFloor(floorid), ELEVATOR_SPEED);
+    MoveObject(Obj_ElevatorDoors[0], X_DOOR_CLOSED, -1303.459472, GetDoorsZCoordForFloor(floorid), ELEVATOR_SPEED);
+    MoveObject(Obj_ElevatorDoors[1], X_DOOR_CLOSED, -1303.459472, GetDoorsZCoordForFloor(floorid), ELEVATOR_SPEED);
+
+	return 1;
+}
+
+public Elevator_TurnToIdle()
+{
+	ElevatorState = ELEVATOR_STATE_IDLE;
+	ReadNextFloorInQueue();
+
+	return 1;
+}
+
+stock RemoveFirstQueueFloor()
+{
+	// Removes the data in ElevatorQueue[0], and reorders the queue accordingly.
+
+	for(new i; i < sizeof(ElevatorQueue) - 1; i ++)
+	    ElevatorQueue[i] = ElevatorQueue[i + 1];
+
+	ElevatorQueue[sizeof(ElevatorQueue) - 1] = INVALID_FLOOR;
+
+	return 1;
+}
+
+stock AddFloorToQueue(floorid)
+{
+ 	// Adds 'floorid' at the end of the queue.
+
+	// Scan for the first empty space:
+	new slot = -1;
+	for(new i; i < sizeof(ElevatorQueue); i ++)
+	{
+	    if(ElevatorQueue[i] == INVALID_FLOOR)
+	    {
+	        slot = i;
+	        break;
+	    }
+	}
+
+	if(slot != -1)
+	{
+	    ElevatorQueue[slot] = floorid;
+
+     	// If needed, move the elevator.
+	    if(ElevatorState == ELEVATOR_STATE_IDLE)
+	        ReadNextFloorInQueue();
+
+	    return 1;
+	}
+
+	return 0;
+}
+
+stock ResetElevatorQueue()
+{
+	// Resets the queue.
+
+	for(new i; i < sizeof(ElevatorQueue); i ++)
+	{
+	    ElevatorQueue[i] 	= INVALID_FLOOR;
+	    FloorRequestedBy[i] = INVALID_PLAYER_ID;
+	}
+
+	return 1;
+}
+
+stock IsFloorInQueue(floorid)
+{
+	// Checks if the specified floor is currently part of the queue.
+
+	for(new i; i < sizeof(ElevatorQueue); i ++)
+	    if(ElevatorQueue[i] == floorid)
+	        return 1;
+
+	return 0;
+}
+
+stock ReadNextFloorInQueue()
+{
+	// Reads the next floor in the queue, closes doors, and goes to it.
+
+	if(ElevatorState != ELEVATOR_STATE_IDLE || ElevatorQueue[0] == INVALID_FLOOR)
+	    return 0;
+
+	Elevator_CloseDoors();
+	Floor_CloseDoors(ElevatorFloor);
+
+	return 1;
+}
+
+stock DidPlayerRequestElevator(playerid)
+{
+	for(new i; i < sizeof(FloorRequestedBy); i ++)
+	    if(FloorRequestedBy[i] == playerid)
+	        return 1;
+
+	return 0;
+}
+
+stock ShowElevatorDialog(playerid)
+{
+	new string[512];
+	for(new i; i < sizeof(ElevatorQueue); i ++)
+	{
+	    if(FloorRequestedBy[i] != INVALID_PLAYER_ID)
+	        strcat(string, "{FF0000}");
+
+	    strcat(string, FloorNames[i]);
+	    strcat(string, "\n");
+	}
+
+	ShowPlayerDialog(playerid, DIALOG_ID, DIALOG_STYLE_LIST, "Elevator", string, "Accept", "Cancel");
+
+	return 1;
+}
+
+stock CallElevator(playerid, floorid)
+{
+	// Calls the elevator (also used with the elevator dialog).
+
+	if(FloorRequestedBy[floorid] != INVALID_PLAYER_ID || IsFloorInQueue(floorid))
+	    return 0;
+
+	FloorRequestedBy[floorid] = playerid;
+	AddFloorToQueue(floorid);
+
+	return 1;
+}
+
+stock Float:GetElevatorZCoordForFloor(floorid)
+    return (GROUND_Z_COORD + FloorZOffsets[floorid] + ELEVATOR_OFFSET); // A small offset for the elevator object itself.
+
+stock Float:GetDoorsZCoordForFloor(floorid)
+	return (GROUND_Z_COORD + FloorZOffsets[floorid]);

BIN
samp03/filterscripts/ls_mall.amx


+ 220 - 0
samp03/filterscripts/ls_mall.pwn

@@ -0,0 +1,220 @@
+//-------------------------------------------------
+//
+// This is an example of using cessil's LS mall replacement
+// mesh, which contains enterable shop interiors which
+// you can decorate yourself.
+//
+// It's recommended you use Jernej's map editor, found on the
+// SA-MP forum, and import this script (Import .pwn) if you
+// want to place new objects in the shops.
+//
+// SA-MP 0.3d and above
+//
+//-------------------------------------------------
+
+#include <a_samp>
+#include "../include/gl_common.inc"
+
+#define MALL_OBJECT_DRAW_DIST   30.0 // Even with a streamer, keep the draw distance on the objects inside the shops low.
+
+//-------------------------------------------------
+
+RemoveBuildingsForMall(playerid)
+{
+    // Remove the original mall mesh
+	RemoveBuildingForPlayer(playerid, 6130, 1117.5859, -1490.0078, 32.7188, 10.0);
+
+	// This is the mall mesh LOD
+	RemoveBuildingForPlayer(playerid, 6255, 1117.5859, -1490.0078, 32.7188, 10.0);
+
+	// There are some trees on the outside of the mall which poke through one of the interiors
+	RemoveBuildingForPlayer(playerid, 762, 1175.3594, -1420.1875, 19.8828, 0.25);
+	RemoveBuildingForPlayer(playerid, 615, 1166.3516, -1417.6953, 13.9531, 0.25);
+}
+
+//-------------------------------------------------
+
+public OnPlayerConnect(playerid)
+{
+    RemoveBuildingsForMall(playerid);
+    return 1;
+}
+
+//-------------------------------------------------
+
+public OnFilterScriptInit()
+{
+	// Main mall mesh, interior areas
+	CreateObject(19322, 1117.580, -1490.01, 32.72,   0.00, 0.00, 0.00, 200.0);
+	CreateObject(19323, 1117.580, -1490.01, 32.72,   0.00, 0.00, 0.00, 200.0);
+	
+	// Mall windows
+    CreateObject(19325, 1155.40, -1434.89, 16.49,   0.00, 0.00, 0.30, 100.0);
+	CreateObject(19325, 1155.37, -1445.41, 16.31,   0.00, 0.00, 0.00, 100.0);
+	CreateObject(19325, 1155.29, -1452.38, 16.31,   0.00, 0.00, 0.00, 100.0);
+	CreateObject(19325, 1157.36, -1468.35, 16.31,   0.00, 0.00, 18.66, 100.0);
+	CreateObject(19325, 1160.64, -1478.37, 16.31,   0.00, 0.00, 17.76, 100.0);
+	CreateObject(19325, 1159.84, -1502.06, 16.31,   0.00, 0.00, -19.92, 100.0);
+	CreateObject(19325, 1139.28, -1523.71, 16.31,   0.00, 0.00, -69.36, 100.0);
+	CreateObject(19325, 1117.06, -1523.43, 16.51,   0.00, 0.00, -109.44, 100.0);
+	CreateObject(19325, 1097.18, -1502.43, 16.51,   0.00, 0.00, -158.58, 100.0);
+	CreateObject(19325, 1096.47, -1478.29, 16.51,   0.00, 0.00, -197.94, 100.0);
+	CreateObject(19325, 1099.70, -1468.27, 16.51,   0.00, 0.00, -197.94, 100.0);
+	CreateObject(19325, 1101.81, -1445.45, 16.22,   0.00, 0.00, -180.24, 100.0);
+	CreateObject(19325, 1101.76, -1452.47, 16.22,   0.00, 0.00, -181.62, 100.0);
+	CreateObject(19325, 1101.77, -1434.88, 16.22,   0.00, 0.00, -180.24, 100.0);
+	CreateObject(19325, 1094.31, -1444.92, 23.47,   0.00, 0.00, -180.24, 100.0);
+	CreateObject(19325, 1094.37, -1458.37, 23.47,   0.00, 0.00, -179.46, 100.0);
+	CreateObject(19325, 1093.01, -1517.44, 23.44,   0.00, 0.00, -138.72, 100.0);
+	CreateObject(19325, 1101.08, -1526.64, 23.42,   0.00, 0.00, -137.34, 100.0);
+	CreateObject(19325, 1155.12, -1526.38, 23.46,   0.00, 0.00, -42.12, 100.0);
+	CreateObject(19325, 1163.09, -1517.25, 23.46,   0.00, 0.00, -40.74, 100.0);
+	CreateObject(19325, 1163.04, -1442.06, 23.40,   0.00, 0.00, -0.12, 100.0);
+	CreateObject(19325, 1163.09, -1428.47, 23.50,   0.00, 0.00, 0.54, 100.0);
+
+	// This is an example 24/7. Normally you'd want to stream these
+	// interior objects in your streamer.
+	
+	// signs
+	CreateObject(19326, 1155.34, -1446.73, 16.38,   0.00, 0.00, -89.82, MALL_OBJECT_DRAW_DIST);
+	CreateObject(19326, 1155.25, -1443.85, 16.36,   0.00, 0.00, -89.82, MALL_OBJECT_DRAW_DIST);
+	CreateObject(19326, 1155.37, -1436.32, 16.36,   0.00, 0.00, -89.82, MALL_OBJECT_DRAW_DIST);
+	CreateObject(19326, 1155.35, -1433.51, 16.36,   0.00, 0.00, -89.70, MALL_OBJECT_DRAW_DIST);
+	CreateObject(19329, 1155.18, -1440.22, 18.70,   0.00, 0.00, 89.04, MALL_OBJECT_DRAW_DIST);
+	CreateObject(19329, 1161.59, -1431.50, 17.93,   0.00, 0.00, 0.00, MALL_OBJECT_DRAW_DIST);
+	CreateObject(19329, 1160.40, -1448.79, 17.96,   0.00, 0.00, 0.00, MALL_OBJECT_DRAW_DIST);
+
+	// 24/7 food aisles
+	CreateObject(2543, 1168.18, -1436.39, 14.79,   0.00, 0.00, 0.30, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2535, 1182.74, -1448.30, 14.70,   0.00, 0.00, -90.96, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2543, 1167.10, -1436.40, 14.79,   0.00, 0.00, 0.31, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2538, 1172.31, -1435.32, 14.79,   0.00, 0.00, 180.34, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2539, 1171.38, -1435.31, 14.79,   0.00, 0.00, 180.19, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2540, 1169.56, -1435.36, 14.79,   0.00, 0.00, 180.17, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1984, 1157.37, -1442.59, 14.79,   0.00, 0.00, -450.06, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2012, 1163.25, -1448.31, 14.75,   0.00, 0.00, -179.16, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2012, 1169.29, -1431.92, 14.75,   0.00, 0.00, 359.80, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1987, 1163.13, -1436.34, 14.79,   0.00, 0.00, 361.06, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1988, 1164.13, -1436.33, 14.79,   0.00, 0.00, 360.80, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2871, 1164.79, -1443.96, 14.79,   0.00, 0.00, 177.73, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2871, 1164.70, -1444.98, 14.79,   0.00, 0.00, 358.07, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2942, 1155.52, -1464.68, 15.43,   0.00, 0.00, -71.22, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1987, 1164.12, -1435.32, 14.77,   0.00, 0.00, 180.96, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2530, 1171.13, -1443.79, 14.79,   0.00, 0.00, -182.16, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1991, 1173.75, -1439.56, 14.79,   0.00, 0.00, 179.47, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1996, 1169.82, -1439.50, 14.79,   0.00, 0.00, 179.10, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1996, 1174.24, -1435.38, 14.79,   0.00, 0.00, 179.24, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1991, 1175.23, -1435.39, 14.79,   0.00, 0.00, 179.57, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1995, 1182.65, -1435.10, 14.79,   0.00, 0.00, 90.00, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1994, 1182.66, -1438.07, 14.79,   0.00, 0.00, 90.00, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1993, 1182.66, -1437.08, 14.79,   0.00, 0.00, 90.00, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2542, 1163.78, -1443.92, 14.76,   0.00, 0.00, 178.77, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2536, 1166.88, -1445.07, 14.70,   0.00, 0.00, -0.42, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2542, 1163.70, -1444.93, 14.78,   0.00, 0.00, -1.74, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1984, 1157.34, -1435.71, 14.79,   0.00, 0.00, -450.06, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2012, 1166.31, -1448.28, 14.75,   0.00, 0.00, -180.12, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2530, 1172.14, -1443.83, 14.79,   0.00, 0.00, -181.38, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2530, 1173.14, -1443.85, 14.79,   0.00, 0.00, -180.96, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2530, 1174.13, -1443.88, 14.79,   0.00, 0.00, -181.50, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1981, 1170.76, -1439.52, 14.79,   0.00, 0.00, -181.74, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1981, 1171.76, -1439.54, 14.79,   0.00, 0.00, -180.80, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1981, 1172.75, -1439.55, 14.79,   0.00, 0.00, -180.84, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2535, 1182.75, -1447.28, 14.70,   0.00, 0.00, -90.78, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2535, 1182.74, -1446.28, 14.70,   0.00, 0.00, -90.78, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2535, 1182.74, -1445.26, 14.70,   0.00, 0.00, -90.00, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2541, 1182.75, -1444.22, 14.79,   0.00, 0.00, -90.06, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2541, 1182.75, -1443.20, 14.79,   0.00, 0.00, -90.06, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2541, 1182.74, -1442.16, 14.79,   0.00, 0.00, -90.06, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2543, 1182.76, -1441.18, 14.79,   0.00, 0.00, -90.84, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2541, 1182.79, -1440.17, 14.79,   0.00, 0.00, -90.06, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2543, 1182.72, -1439.15, 14.79,   0.00, 0.00, -90.84, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1990, 1182.66, -1431.67, 14.79,   0.00, 0.00, 3.30, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1990, 1181.63, -1431.73, 14.79,   0.00, 0.00, 3.30, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1990, 1180.61, -1431.81, 14.79,   0.00, 0.00, 3.30, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1990, 1179.61, -1431.83, 14.79,   0.00, 0.00, 3.30, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1990, 1178.61, -1431.89, 14.79,   0.00, 0.00, 3.30, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1990, 1177.59, -1431.86, 14.79,   0.00, 0.00, 3.30, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1993, 1182.66, -1436.09, 14.79,   0.00, 0.00, 90.00, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2012, 1175.50, -1431.82, 14.75,   0.00, 0.00, 361.17, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2012, 1172.42, -1431.87, 14.75,   0.00, 0.00, 359.93, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2012, 1160.10, -1448.35, 14.75,   0.00, 0.00, -179.94, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2539, 1170.45, -1435.33, 14.79,   0.00, 0.00, 181.26, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2545, 1161.82, -1431.84, 14.91,   0.00, 0.00, -90.54, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2545, 1160.82, -1431.83, 14.91,   0.00, 0.00, -90.54, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2545, 1159.81, -1431.86, 14.91,   0.00, 0.00, -90.54, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2545, 1162.82, -1431.87, 14.91,   0.00, 0.00, -90.54, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1988, 1163.13, -1435.34, 14.79,   0.00, 0.00, 541.46, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1988, 1166.07, -1436.32, 14.79,   0.00, 0.00, 360.80, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1987, 1165.07, -1436.33, 14.79,   0.00, 0.00, 361.06, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1987, 1166.11, -1435.30, 14.77,   0.00, 0.00, 180.96, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1988, 1165.07, -1435.31, 14.79,   0.00, 0.00, 540.44, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2536, 1165.79, -1445.07, 14.70,   0.00, 0.00, -1.20, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2536, 1167.83, -1445.07, 14.70,   0.00, 0.00, -0.06, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2871, 1165.79, -1444.00, 14.79,   0.00, 0.00, 178.27, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2871, 1166.81, -1444.03, 14.79,   0.00, 0.00, 179.35, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2871, 1167.79, -1444.04, 14.79,   0.00, 0.00, 179.89, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2543, 1168.13, -1435.36, 14.79,   0.00, 0.00, 180.05, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2543, 1167.10, -1435.37, 14.79,   0.00, 0.00, 180.35, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2012, 1170.63, -1440.67, 14.75,   0.00, 0.00, 359.50, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2012, 1173.77, -1440.72, 14.75,   0.00, 0.00, 359.82, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2012, 1177.30, -1445.31, 14.75,   0.00, 0.00, 359.93, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1996, 1173.36, -1448.30, 14.79,   0.00, 0.00, 179.10, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1981, 1174.33, -1448.32, 14.79,   0.00, 0.00, -181.74, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1981, 1175.32, -1448.35, 14.79,   0.00, 0.00, -180.84, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1981, 1176.30, -1448.37, 14.79,   0.00, 0.00, -180.84, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1991, 1177.28, -1448.37, 14.79,   0.00, 0.00, 179.47, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1996, 1178.33, -1448.36, 14.79,   0.00, 0.00, 179.24, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1991, 1179.33, -1448.37, 14.79,   0.00, 0.00, 179.57, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1994, 1176.82, -1444.16, 14.79,   0.00, 0.00, -0.84, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1995, 1178.81, -1444.20, 14.79,   0.00, 0.00, -1.26, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2543, 1168.89, -1444.06, 14.79,   0.00, 0.00, 178.97, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2543, 1169.91, -1444.07, 14.79,   0.00, 0.00, 179.69, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2543, 1169.87, -1445.12, 14.79,   0.00, 0.00, -0.06, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2543, 1168.86, -1445.11, 14.79,   0.00, 0.00, 0.31, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2538, 1167.02, -1431.87, 14.79,   0.00, 0.00, 0.42, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2539, 1166.03, -1431.89, 14.79,   0.00, 0.00, 0.70, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2540, 1164.04, -1431.91, 14.79,   0.00, 0.00, 0.60, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2539, 1165.03, -1431.91, 14.79,   0.00, 0.00, 1.02, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2538, 1176.17, -1436.38, 14.79,   0.00, 0.00, 0.24, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2539, 1174.22, -1436.37, 14.79,   0.00, 0.00, -0.06, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2540, 1173.22, -1436.36, 14.79,   0.00, 0.00, 0.18, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2539, 1175.20, -1436.38, 14.79,   0.00, 0.00, -2.06, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2540, 1173.26, -1435.31, 14.79,   0.00, 0.00, 180.17, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1991, 1175.74, -1439.58, 14.79,   0.00, 0.00, 179.57, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1996, 1174.74, -1439.57, 14.79,   0.00, 0.00, 179.24, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1996, 1176.17, -1435.37, 14.79,   0.00, 0.00, 179.24, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1991, 1177.16, -1435.38, 14.79,   0.00, 0.00, 179.57, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2540, 1169.44, -1436.35, 14.79,   0.00, 0.00, 0.18, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2539, 1170.43, -1436.35, 14.79,   0.00, 0.00, 0.90, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2539, 1171.34, -1436.33, 14.79,   0.00, 0.00, 0.58, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2538, 1172.22, -1436.32, 14.79,   0.00, 0.00, 0.30, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2871, 1163.40, -1440.68, 14.79,   0.00, 0.00, 360.41, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2536, 1164.49, -1440.73, 14.70,   0.00, 0.00, -1.20, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2536, 1165.49, -1440.75, 14.70,   0.00, 0.00, -0.42, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2536, 1166.50, -1440.75, 14.70,   0.00, 0.00, -0.06, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2543, 1167.61, -1440.64, 14.79,   0.00, 0.00, 0.31, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2543, 1168.62, -1440.64, 14.79,   0.00, 0.00, 0.30, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2543, 1168.64, -1439.60, 14.79,   0.00, 0.00, 180.05, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2543, 1167.67, -1439.61, 14.79,   0.00, 0.00, 180.35, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2871, 1163.65, -1439.67, 14.79,   0.00, 0.00, 180.61, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2871, 1164.68, -1439.67, 14.79,   0.00, 0.00, 179.77, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2871, 1165.68, -1439.68, 14.79,   0.00, 0.00, 180.61, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2871, 1166.68, -1439.66, 14.79,   0.00, 0.00, 180.61, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1990, 1175.09, -1444.97, 14.79,   0.00, 0.00, -2.46, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1990, 1181.63, -1431.73, 14.79,   0.00, 0.00, 3.30, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1990, 1174.07, -1444.94, 14.79,   0.00, 0.00, 0.48, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1990, 1173.09, -1444.94, 14.79,   0.00, 0.00, -1.20, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1990, 1172.11, -1444.92, 14.79,   0.00, 0.00, -1.14, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1990, 1171.12, -1444.91, 14.79,   0.00, 0.00, -0.72, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2530, 1168.54, -1448.31, 14.79,   0.00, 0.00, -178.98, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2530, 1169.60, -1448.29, 14.79,   0.00, 0.00, -178.98, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2530, 1170.67, -1448.30, 14.79,   0.00, 0.00, -178.98, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2530, 1171.72, -1448.32, 14.79,   0.00, 0.00, -181.50, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2530, 1175.13, -1443.91, 14.79,   0.00, 0.00, -181.50, MALL_OBJECT_DRAW_DIST);
+	CreateObject(2012, 1176.82, -1440.75, 14.75,   0.00, 0.00, 359.93, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1995, 1177.71, -1439.63, 14.79,   0.00, 0.00, 0.00, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1994, 1176.73, -1439.63, 14.79,   0.00, 0.00, 0.06, MALL_OBJECT_DRAW_DIST);
+	CreateObject(1993, 1177.83, -1444.15, 14.79,   0.00, 0.00, 179.46, MALL_OBJECT_DRAW_DIST);
+
+	return 1;
+}

BIN
samp03/filterscripts/ls_prisonwalls.amx


+ 404 - 0
samp03/filterscripts/ls_prisonwalls.pwn

@@ -0,0 +1,404 @@
+// -----------------------------------------------------------------------------
+// Example Filterscript for the LS Prison Walls and Gate Objects
+// -------------------------------------------------------------
+// By Matite in February 2015
+//
+//
+// This script creates the new LS Prison Walls object, removes the existing
+// GTASA object and creates 2 sets of opening gates.
+//
+// Warning...
+// This script uses a total of:
+// * 5 objects = 1 for the replacement walls and 4 for the replacement gates
+// * 2 3D Text Labels = 1 on each set of gates
+// * Enables the /lsp command to teleport the player to the eastern prison gates
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+
+
+// -----------------------------------------------------------------------------
+// Includes
+// --------
+
+// SA-MP include
+#include <a_samp>
+
+// For PlaySoundForPlayersInRange()
+#include "../include/gl_common.inc"
+
+
+// -----------------------------------------------------------------------------
+// Defines
+// -------
+
+// Used for the eastern and southern prison gates status flags
+#define GATES_CLOSED  	0
+#define GATES_CLOSING  	1
+#define GATES_OPEN    	2
+#define GATES_OPENING   3
+
+// Used for messages sent to the player
+#define COLOR_MESSAGE_YELLOW        0xFFDD00AA
+
+
+// -----------------------------------------------------------------------------
+// Constants
+// ---------
+
+// Gate names for the 3D text labels
+static GateNames[2][] =
+{
+	"Eastern Gates",
+	"Southern Gates"
+};
+
+
+// -----------------------------------------------------------------------------
+// Variables
+// ---------
+
+// Stores the created object number of the replacement prison walls so it can
+// be destroyed when the filterscript is unloaded
+new LSPrisonWallsObject;
+
+// Stores the created object numbers of the prison walls gates so they can be
+// opened or closed and destroyed when the filterscript is unloaded
+new LSPrisonGatesObject[4];
+
+// Stores a reference to the 3D text labels used on each set of gates so they
+// can be destroyed when the filterscript is unloaded
+new Text3D:LabelGates[2];
+
+// Stores the current status of the eastern prison gates
+new EasternGatesStatus = GATES_CLOSED;
+
+// Stores the current status of the southern prison gates
+new SouthernGatesStatus = GATES_CLOSED;
+
+
+// -----------------------------------------------------------------------------
+// Callbacks
+// ---------
+
+public OnPlayerCommandText(playerid, cmdtext[])
+{
+	// Check command text
+	if (strcmp("/lsp", cmdtext, true, 4) == 0)
+	{
+	    // Set the interior
+		SetPlayerInterior(playerid, 0);
+
+		// Set player position and facing angle
+		SetPlayerPos(playerid, 1830.66 + random(2), -1538.46, 14.5);
+		SetPlayerFacingAngle(playerid, 85);
+
+		// Fix camera position after teleporting
+		SetCameraBehindPlayer(playerid);
+
+		// Send a gametext message to the player
+		GameTextForPlayer(playerid, "~b~~h~LS Prison!", 3000, 3);
+
+	    // Exit here
+	    return 1;
+	}
+
+	// Exit here (return 0 as the command was not handled in this filterscript)
+	return 0;
+}
+
+public OnFilterScriptInit()
+{
+    // Display information in the Server Console
+	print("\n");
+	print("  |---------------------------------------------------");
+	print("  |--- LS Prison Walls Filterscript");
+    print("  |--  Script v1.01");
+    print("  |--  13th February 2015");
+	print("  |---------------------------------------------------");
+
+	// Create the LS Prison Walls object
+    LSPrisonWallsObject = CreateObject(19794, 1787.13, -1565.68, 11.9688, 0, 0, 0);
+
+    // Display information in the Server Console
+    print("  |--  LS Prison Walls object created");
+    
+    // Create the LS Prison Walls Eastern Gates objects
+    LSPrisonGatesObject[0] = CreateObject(19795, 1824.318481, -1534.731201, 14.296878 - 0.01, 0, 0, 343.0);
+    LSPrisonGatesObject[1] = CreateObject(19795, 1822.407592, -1540.949951, 14.296878 - 0.01, 0, 0, 163.0);
+    
+    // Create the LS Prison Walls Southern Gates objects
+    LSPrisonGatesObject[2] = CreateObject(19796, 1752.004150, -1591.186523, 14.267195 - 0.01, 0, 0, 77.0);
+    LSPrisonGatesObject[3] = CreateObject(19796, 1756.914062, -1592.316284, 14.267195 - 0.01, 0, 0, 257.0);
+    
+    // Display information in the Server Console
+    print("  |--  LS Prison Walls Gates objects created");
+
+	// Create variable
+	new string[192];
+
+    // Create 3D Text Label at the prisons eastern gates
+    format(string, sizeof(string), "{CCCCCC}[%s]\n{CCCCCC}Press '{FFFFFF}~k~~CONVERSATION_YES~{CCCCCC}' to open or close the gates", GateNames[0]);
+    LabelGates[0] = Create3DTextLabel(string, 0xCCCCCCAA, 1823.78, -1537.98, 13.54, 10.5, 0, 1);
+    
+    // Create 3D Text Label at the prisons eastern gates
+    format(string, sizeof(string), "{CCCCCC}[%s]\n{CCCCCC}Press '{FFFFFF}~k~~CONVERSATION_YES~{CCCCCC}' to open or close the gates", GateNames[1]);
+    LabelGates[1] = Create3DTextLabel(string, 0xCCCCCCAA, 1754.27, -1592.18, 13.54, 10.5, 0, 1);
+    
+    // Display information in the Server Console
+	print("  |--  LS Prison Wall Gates 3D Text Labels created");
+	print("  |---------------------------------------------------");
+	
+	
+	// Loop
+    for (new i = 0; i < MAX_PLAYERS; i++)
+    {
+        // Check if the player is connected and not a NPC
+        if (IsPlayerConnected(i) && !IsPlayerNPC(i))
+        {
+            // Remove default GTASA LS Prison Walls and LOD map objects for the player
+            // (so any player currently ingame does not have to rejoin for them
+			//  to be removed when this filterscript is loaded)
+			RemoveBuildingForPlayer(i, 4000, 1787.13, -1565.68, 11.9688, 250.0); // Walls
+			RemoveBuildingForPlayer(i, 4080, 1787.13, -1565.68, 11.9688, 250.0); // LOD
+        }
+    }
+
+	// Exit here
+	return 1;
+}
+
+public OnFilterScriptExit()
+{
+    // Check for valid object
+	if (IsValidObject(LSPrisonWallsObject))
+	{
+		// Destroy the LS Prison Walls object
+		DestroyObject(LSPrisonWallsObject);
+
+		// Display information in the Server Console
+		print("  |---------------------------------------------------");
+    	print("  |--  LS Prison Walls object destroyed");
+    }
+    
+    // Check for valid object
+	if (IsValidObject(LSPrisonGatesObject[0]))
+	{
+		// Destroy the LS Prison Walls Eastern Gates object 1
+		DestroyObject(LSPrisonGatesObject[0]);
+
+		// Display information in the Server Console
+    	print("  |--  LS Prison Walls Eastern Gates object 1 destroyed");
+    }
+    
+    // Check for valid object
+	if (IsValidObject(LSPrisonGatesObject[1]))
+	{
+		// Destroy the LS Prison Walls Eastern Gates object 2
+		DestroyObject(LSPrisonGatesObject[1]);
+
+		// Display information in the Server Console
+    	print("  |--  LS Prison Walls Eastern Gates object 2 destroyed");
+    }
+    
+    // Check for valid object
+	if (IsValidObject(LSPrisonGatesObject[2]))
+	{
+		// Destroy the LS Prison Walls Southern Gates object 1
+		DestroyObject(LSPrisonGatesObject[2]);
+
+		// Display information in the Server Console
+    	print("  |--  LS Prison Walls Southern Gates object 1 destroyed");
+    }
+    
+    // Check for valid object
+	if (IsValidObject(LSPrisonGatesObject[3]))
+	{
+		// Destroy the LS Prison Walls Southern Gates object 2
+		DestroyObject(LSPrisonGatesObject[3]);
+
+		// Display information in the Server Console
+    	print("  |--  LS Prison Walls Southern Gates object 2 destroyed");
+    }
+
+    // Destroy 3D Text Labels on the eastern and southern gates
+    Delete3DTextLabel(LabelGates[0]);
+    Delete3DTextLabel(LabelGates[1]);
+    
+    // Display information in the Server Console
+   	print("  |--  Deleted the 3D Text Labels on the Prison Gates");
+
+   	// Display information in the Server Console
+	print("  |---------------------------------------------------");
+	print("  |--  LS Prison Walls Filterscript Unloaded");
+	print("  |---------------------------------------------------");
+
+    // Exit here
+	return 1;
+}
+
+public OnPlayerConnect(playerid)
+{
+    // Remove default GTASA LS Prison Walls and LOD map objects for the player
+	RemoveBuildingForPlayer(playerid, 4000, 1787.13, -1565.68, 11.9688, 250.0); // Walls
+	RemoveBuildingForPlayer(playerid, 4080, 1787.13, -1565.68, 11.9688, 250.0); // LOD
+
+	// Exit here (return 1 so this callback is handled in other scripts too)
+	return 1;
+}
+
+public OnObjectMoved(objectid)
+{
+	// Check if the object that moved was one of the eastern gates
+	if (objectid == LSPrisonGatesObject[0])
+	{
+	    // Check if the eastern gates were closing
+	    if (EasternGatesStatus == GATES_CLOSING)
+	    {
+	        // Set status flag for eastern gates
+		    EasternGatesStatus = GATES_CLOSED;
+	    }
+	    else
+	    {
+	        // Set status flag for eastern gates
+		    EasternGatesStatus = GATES_OPEN;
+	    }
+	}
+	// Check if the object that moved was one of the southern gates
+	else if (objectid == LSPrisonGatesObject[2])
+	{
+	    // Check if the southern gates were closing
+	    if (SouthernGatesStatus == GATES_CLOSING)
+	    {
+	        // Set status flag for southern gates
+		    SouthernGatesStatus = GATES_CLOSED;
+	    }
+	    else
+	    {
+	        // Set status flag for southern gates
+		    SouthernGatesStatus = GATES_OPEN;
+	    }
+	}
+	
+	// Exit here
+	return 1;
+}
+
+public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
+{
+	// Check if the player pressed the conversation yes key (normally the Y key)
+	if (newkeys & KEY_YES)
+	{
+		// Check if the player is outside the eastern prison gates
+	    if (IsPlayerInRangeOfPoint(playerid, 10.0, 1823.78, -1537.98, 13.54))
+	    {
+	        // Debug
+	        //printf("-->Player ID %d within 10m of the Eastern Prison Gates", playerid);
+	        
+	        // Check if the eastern gates are not currently opening (ie moving)
+	        if (EasternGatesStatus == GATES_OPENING)
+	        {
+	            // Send chat text message and exit here
+	            SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, "* Sorry, you must wait for the eastern gates to fully open first.");
+	            return 1;
+	        }
+	        // Check if the eastern gates are not currently closing (ie moving)
+	        else if (EasternGatesStatus == GATES_CLOSING)
+	        {
+	            // Send chat text message and exit here
+	            SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, "* Sorry, you must wait for the eastern gates to fully close first.");
+	            return 1;
+	        }
+
+	        // Play gate opening sound
+	        PlaySoundForPlayersInRange(1035, 50.0, 1823.78, -1537.98, 13.54);
+
+	        // Check if the eastern gates are currently open or closed
+	        if (EasternGatesStatus == GATES_CLOSED)
+	        {
+	            // Send a gametext message to the player
+				GameTextForPlayer(playerid, "~b~~h~Eastern Prison~n~~b~~h~Gates Opening!", 3000, 3);
+		
+		        // Animate the eastern gates opening (the small Z offset is required)
+		    	MoveObject(LSPrisonGatesObject[0], 1824.318481, -1534.731201, 14.296878 + 0.01, 0.002, 0, 0, 258);
+
+				// Animate the eastern gates opening (the small Z offset is required)
+		    	MoveObject(LSPrisonGatesObject[1], 1822.407592, -1540.949951, 14.296878 + 0.01, 0.002, 0, 0, 253);
+
+				// Set status flag for eastern gates
+		    	EasternGatesStatus = GATES_OPENING;
+	    	}
+	    	else
+	    	{
+	    	    // Send a gametext message to the player
+				GameTextForPlayer(playerid, "~b~~h~Eastern Prison~n~~b~~h~Gates Closing!", 3000, 3);
+				
+		        // Animate the eastern gates closing (the small Z offset is required)
+		    	MoveObject(LSPrisonGatesObject[0], 1824.318481, -1534.731201, 14.296878 - 0.01, 0.002, 0, 0, 343);
+
+				// Animate the eastern gates closing (the small Z offset is required)
+		    	MoveObject(LSPrisonGatesObject[1], 1822.407592, -1540.949951, 14.296878 - 0.01, 0.002, 0, 0, 163);
+
+				// Set status flag for eastern gates
+		    	EasternGatesStatus = GATES_CLOSING;
+	    	}
+	    }
+	    // Check if the player is outside the southern prison gates
+	    else if (IsPlayerInRangeOfPoint(playerid, 10.0, 1754.27, -1592.18, 13.54))
+	    {
+	        // Debug
+	        //printf("-->Player ID %d within 10m of the Southern Prison Gates", playerid);
+	        
+	        // Check if the southern gates are not currently opening (ie moving)
+	        if (SouthernGatesStatus == GATES_OPENING)
+	        {
+	            // Send chat text message and exit here
+	            SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, "* Sorry, you must wait for the southern gates to fully open first.");
+	            return 1;
+	        }
+	        // Check if the southern gates are not currently closing (ie moving)
+	        else if (SouthernGatesStatus == GATES_CLOSING)
+	        {
+	            // Send chat text message and exit here
+	            SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, "* Sorry, you must wait for the southern gates to fully close first.");
+	            return 1;
+	        }
+	        
+	        // Play gate opening sound
+	        PlaySoundForPlayersInRange(1035, 50.0, 1754.27, -1592.18, 13.54);
+	        
+	        // Check if the southern gates are currently open or closed
+	        if (SouthernGatesStatus == GATES_CLOSED)
+	        {
+	            // Send a gametext message to the player
+				GameTextForPlayer(playerid, "~b~~h~Southern Prison~n~~b~~h~Gates Opening!", 3000, 3);
+
+		        // Animate the southern gates opening (the small Z offset is required)
+		    	MoveObject(LSPrisonGatesObject[2], 1752.004150, -1591.186523, 14.267195 + 0.01, 0.002, 0, 0, 172);
+
+		    	// Animate the southern gates opening (the small Z offset is required)
+		    	MoveObject(LSPrisonGatesObject[3], 1756.914062, -1592.316284, 14.267195 + 0.01, 0.002, 0, 0, 187);
+
+		    	// Set status flag for southern gates
+		    	SouthernGatesStatus = GATES_OPENING;
+	    	}
+	    	else
+	    	{
+	    	    // Send a gametext message to the player
+				GameTextForPlayer(playerid, "~b~~h~Southern Prison~n~~b~~h~Gates Closing!", 3000, 3);
+
+		        // Animate the southern gates closing (the small Z offset is required)
+		    	MoveObject(LSPrisonGatesObject[2], 1752.004150, -1591.186523, 14.267195 - 0.01, 0.002, 0, 0, 77);
+
+		    	// Animate the southern gates closing (the small Z offset is required)
+		    	MoveObject(LSPrisonGatesObject[3], 1756.914062, -1592.316284, 14.267195 - 0.01, 0.002, 0, 0, 257);
+
+		    	// Set status flag for southern gates
+		    	SouthernGatesStatus = GATES_CLOSING;
+	    	}
+	    }
+	}
+
+	// Exit here (return 1 so this callback is handled in other scripts too)
+	return 1;
+}
+

BIN
samp03/filterscripts/ls_wellsfargo.amx


+ 139 - 0
samp03/filterscripts/ls_wellsfargo.pwn

@@ -0,0 +1,139 @@
+// -----------------------------------------------------------------------------
+// Example Filterscript for the LS Wells Fargo Building Object
+// -----------------------------------------------------------
+// By Matite in March 2015
+//
+//
+// This script creates the edited LS Wells Fargo Building object and
+// removes the existing GTASA building object.
+//
+// Warning...
+// This script uses a total of:
+// * 1 object = 1 for the replacement building object
+// * Enables the /lswf command to teleport the player to the LS Wells Fargo Building
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+
+
+// -----------------------------------------------------------------------------
+// Includes
+// --------
+
+// SA-MP include
+#include <a_samp>
+
+
+// -----------------------------------------------------------------------------
+// Defines
+// -------
+
+// Used for messages sent to the player
+#define COLOR_MESSAGE_YELLOW        0xFFDD00AA
+
+
+// -----------------------------------------------------------------------------
+// Variables
+// ---------
+
+// Stores the created object number of the replacement building object so
+// it can be destroyed when the filterscript is unloaded
+new LSWellsFargoObject1; // Building object
+
+
+// -----------------------------------------------------------------------------
+// Callbacks
+// ---------
+
+public OnPlayerCommandText(playerid, cmdtext[])
+{
+	// Check command text
+	if (strcmp("/lswf", cmdtext, true, 5) == 0)
+	{
+	    // Set the interior
+		SetPlayerInterior(playerid, 0);
+
+		// Set player position and facing angle
+		SetPlayerPos(playerid, 1448.43, -1468.28, 13.82);
+		SetPlayerFacingAngle(playerid, 92);
+
+		// Fix camera position after teleporting
+		SetCameraBehindPlayer(playerid);
+
+		// Send a gametext message to the player
+		GameTextForPlayer(playerid, "~b~~h~LS Wells Fargo!", 3000, 3);
+
+	    // Exit here
+	    return 1;
+	}
+
+	// Exit here (return 0 as the command was not handled in this filterscript)
+	return 0;
+}
+
+public OnFilterScriptInit()
+{
+    // Display information in the Server Console
+	print("\n");
+	print("  |---------------------------------------------------");
+	print("  |--- LS Wells Fargo Building Filterscript");
+    print("  |--  Script v1.01");
+    print("  |--  6th March 2015");
+	print("  |---------------------------------------------------");
+
+	// Create the LS Wells Fargo Building object
+    LSWellsFargoObject1 = CreateObject(19879, 1421.38, -1477.6, 42.2031, 0, 0, 0);
+
+    // Display information in the Server Console
+    print("  |--  LS Wells Fargo Building object created");
+	print("  |---------------------------------------------------");
+
+	// Loop
+    for (new i = 0; i < MAX_PLAYERS; i++)
+    {
+        // Check if the player is connected and not a NPC
+        if (IsPlayerConnected(i) && !IsPlayerNPC(i))
+        {
+            // Remove default GTASA Wells Fargo Building and LOD map objects for the player
+            // (so any player currently ingame does not have to rejoin for them
+			//  to be removed when this filterscript is loaded)
+			RemoveBuildingForPlayer(i, 4007, 1421.38, -1477.6, 42.2031, 250.0); 	// Building
+			RemoveBuildingForPlayer(i, 4009, 1421.38, -1477.6, 42.2031, 250.0); 	// LOD
+        }
+    }
+
+	// Exit here
+	return 1;
+}
+
+public OnFilterScriptExit()
+{
+    // Check for valid object
+	if (IsValidObject(LSWellsFargoObject1))
+	{
+		// Destroy the Wells Fargo Building object
+		DestroyObject(LSWellsFargoObject1);
+
+		// Display information in the Server Console
+		print("  |---------------------------------------------------");
+    	print("  |--  LS Wells Fargo Building object destroyed");
+    }
+
+   	// Display information in the Server Console
+	print("  |---------------------------------------------------");
+	print("  |--  LS Wells Fargo Building Filterscript Unloaded");
+	print("  |---------------------------------------------------");
+
+    // Exit here
+	return 1;
+}
+
+public OnPlayerConnect(playerid)
+{
+    // Remove default GTASA Wells Fargo Building and LOD map objects for the player
+	RemoveBuildingForPlayer(playerid, 4007, 1421.38, -1477.6, 42.2031, 250.0); 	// Building
+	RemoveBuildingForPlayer(playerid, 4009, 1421.38, -1477.6, 42.2031, 250.0); 	// LOD
+
+	// Exit here (return 1 so this callback is handled in other scripts too)
+	return 1;
+}
+

BIN
samp03/filterscripts/maxips.amx


+ 52 - 0
samp03/filterscripts/maxips.pwn

@@ -0,0 +1,52 @@
+// maxips FS limits the number of players connecting from a
+// single IP address.
+
+#include <a_samp>
+
+#define MAX_CONNECTIONS_FROM_IP     3
+
+//---------------------------------------------
+
+public OnFilterScriptInit()
+{
+	printf("\n*** Player IP limiting FS (maxips) Loaded. Max connections from 1 IP = %d\n",MAX_CONNECTIONS_FROM_IP);
+}
+
+//---------------------------------------------
+// GetNumberOfPlayersOnThisIP
+// Returns the number of players connecting from the
+// provided IP address
+
+stock GetNumberOfPlayersOnThisIP(test_ip[])
+{
+	new against_ip[32+1];
+	new x = 0;
+	new ip_count = 0;
+	for(x=0; x<MAX_PLAYERS; x++) {
+		if(IsPlayerConnected(x)) {
+		    GetPlayerIp(x,against_ip,32);
+		    if(!strcmp(against_ip,test_ip)) ip_count++;
+		}
+	}
+	return ip_count;
+}
+
+//---------------------------------------------
+
+public OnPlayerConnect(playerid)
+{
+	new connecting_ip[32+1];
+	GetPlayerIp(playerid,connecting_ip,32);
+	new num_players_on_ip = GetNumberOfPlayersOnThisIP(connecting_ip);
+	
+	if(num_players_on_ip > MAX_CONNECTIONS_FROM_IP) {
+		printf("MAXIPs: Connecting player(%d) exceeded %d IP connections from %s.", playerid, MAX_CONNECTIONS_FROM_IP, connecting_ip);
+	    Kick(playerid);
+	    return 1;
+	}
+
+	return 0;
+}
+	
+//---------------------------------------------
+	    

BIN
samp03/filterscripts/menutest.amx


+ 53 - 0
samp03/filterscripts/menutest.pwn

@@ -0,0 +1,53 @@
+// Test menu functionality filterscipt
+
+#include <a_samp>
+
+#define TEST_MENU_ITEMS 6
+
+new Menu:TestMenu;
+new TestMenuStrings[6][16] = {"Test1", "Test2", "Test3", "Test4", "Test5", "Test6"};
+
+HandleTestMenuSelection(playerid, row)
+{
+	new s[256];
+	
+	if(row < TEST_MENU_ITEMS) {
+		format(s,256,"You selected item %s",TestMenuStrings[row]);
+		SendClientMessage(playerid,0xFFFFFFFF,s);
+	}
+}
+
+InitTestMenu()
+{
+	TestMenu = CreateMenu("Test Menu", 1, 200.0, 150.0, 200.0, 200.0);
+
+	for(new x=0; x < TEST_MENU_ITEMS; x++) {
+    	AddMenuItem(TestMenu, 0, TestMenuStrings[x]);
+	}
+}
+
+public OnFilterScriptInit()
+{
+   	InitTestMenu();
+}
+
+public OnPlayerSelectedMenuRow(playerid, row)
+{
+    new Menu:PlayerMenu = GetPlayerMenu(playerid);
+    
+	if(PlayerMenu == TestMenu) {
+	    HandleTestMenuSelection(playerid, row);
+	}
+}
+
+public OnPlayerCommandText(playerid, cmdtext[])
+{
+	if(!strcmp(cmdtext, "/menutest", true))	{
+    	ShowMenuForPlayer(TestMenu, playerid);
+    	return 1;
+	}
+	return 0;
+}
+
+
+

BIN
samp03/filterscripts/modular_houses.amx


+ 363 - 0
samp03/filterscripts/modular_houses.pwn

@@ -0,0 +1,363 @@
+// -----------------------------------------------------------------------------
+// Example Filterscript for the new Modular House Objects
+// ------------------------------------------------------
+// By Matite in February 2015
+//
+// This script creates a Modular Island with Modular Houses just off the coast
+// in SF (near Jizzy's Nightclub).
+//
+// Warning...
+// This script uses a total of 205 player objects and enables the /mh teleport
+// command by default.
+// -----------------------------------------------------------------------------
+
+// -----------------------------------------------------------------------------
+// Includes
+// --------
+
+// SA-MP Include
+#include <a_samp>
+
+// -----------------------------------------------------------------------------
+// Defines
+// -------
+
+// Used for chat text messages
+#define COLOR_MESSAGE_YELLOW        0xFFDD00AA
+
+// -----------------------------------------------------------------------------
+// Callbacks
+// ---------
+
+public OnPlayerCommandText(playerid, cmdtext[])
+{
+	// Check command text
+	if (strcmp("/mh", cmdtext, true, 3) == 0)
+	{
+	    // Set the player interior
+		SetPlayerInterior(playerid, 0);
+		
+		// Check if the player is in any vehicle
+		if (IsPlayerInAnyVehicle(playerid))
+		{
+		    // In a Vehicle
+		    // ------------
+		    
+		    // Set vehicle position and facing angle
+		    SetVehiclePos(GetPlayerVehicleID(playerid), -3305.72 + random(2), 1602.27 + random(2), 6.2);
+		    SetVehicleZAngle(GetPlayerVehicleID(playerid), 233);
+
+			// Link vehicle to interior
+			LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
+		}
+		else
+		{
+		    // On Foot
+		    // -------
+		    
+			// Set player position and facing angle
+			SetPlayerPos(playerid, -3305.72 + random(2), 1602.27 + random(2), 6.2);
+			SetPlayerFacingAngle(playerid, 233);
+		}
+
+		// Fix camera position after teleporting
+		SetCameraBehindPlayer(playerid);
+
+		// Send a gametext message to the player
+		GameTextForPlayer(playerid, "~b~~h~Modular Houses!", 3000, 3);
+
+	    // Exit here
+	    return 1;
+	}
+
+	// Exit here (return 0 as the command was not handled in this filterscript)
+	return 0;
+}
+
+public OnFilterScriptInit()
+{
+    // Display information in the Server Console
+	print("\n");
+	print("  |---------------------------------------------------");
+	print("  |--- Modular Houses Filterscript by Matite");
+    print("  |--  Script v1.01");
+    print("  |--  28th February 2015");
+	print("  |---------------------------------------------------");
+	
+	// Loop
+	for (new i = 0; i < MAX_PLAYERS; i++)
+	{
+	    // Check if the player is connected and not a NPC
+        if (IsPlayerConnected(i) && !IsPlayerNPC(i))
+        {
+	    	// Create modular houses and island objects for the player
+	    	// (so any player currently ingame does not have to rejoin for them
+			//  to appear when this filterscript is loaded)
+			CreateMHObjects(i);
+		}
+	}
+
+    // Exit here
+	return 1;
+}
+
+public OnFilterScriptExit()
+{
+	// Display information in the Server Console
+	print("  |---------------------------------------------------");
+	print("  |--  Modular Houses Filterscript Unloaded");
+	print("  |---------------------------------------------------");
+
+	// Exit here
+	return 1;
+}
+
+public OnPlayerConnect(playerid)
+{
+	// Create modular houses and island objects for the player
+	CreateMHObjects(playerid);
+
+	// Exit here
+	return 1;
+}
+
+CreateMHObjects(playerid)
+{
+	// Create variable
+	new TempObjectNumber;
+
+	// Create modular houses and island player objects (with draw distance of 999m)
+	CreatePlayerObject(playerid,19867,-3233.1538,1472.8060,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19849,-3250.0000,1500.0000,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19539,-3343.1260,1608.7500,4.0000,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19855,-3250.0000,1500.0000,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19854,-3250.0000,1500.0000,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19856,-3250.0000,1500.0000,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19851,-3218.7495,1500.0000,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19850,-3281.2505,1500.0000,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19532,-3234.3757,1461.2500,4.0000,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19852,-3187.4990,1500.0000,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19853,-3187.4993,1562.5000,4.0000,0.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19850,-3218.7498,1562.5000,4.0000,0.0000,0.0000,180.0000,999.0);
+	CreatePlayerObject(playerid,19850,-3250.0002,1562.5000,4.0000,0.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19532,-3304.3760,1531.2500,4.0000,-0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19532,-3164.3757,1531.2500,4.0000,-0.0000,0.0000,0.0000,999.0);
+
+    // Create exterior building object and change roof tile texture
+	TempObjectNumber = CreatePlayerObject(playerid,19854,-3218.7500,1500.0000,4.0000,0.0000,0.0000,0.0000,999.0);
+	SetPlayerObjectMaterial(playerid, TempObjectNumber, 0, 5520, "BDupsHouse_LAe", "shingles3", 0);
+	
+	CreatePlayerObject(playerid,19855,-3218.7500,1500.0000,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19856,-3218.7500,1500.0000,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19856,-3187.5000,1500.0000,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19855,-3187.5000,1500.0000,4.0000,0.0000,0.0000,0.0000,999.0);
+
+    // Create exterior building object and change roof tile texture
+	TempObjectNumber = CreatePlayerObject(playerid,19854,-3187.5000,1500.0000,4.0000,0.0000,0.0000,0.0000,999.0);
+	SetPlayerObjectMaterial(playerid, TempObjectNumber, 0, 5986, "chateau_lawn", "chatshade02_law", 0);
+	
+	CreatePlayerObject(playerid,19856,-3281.2500,1500.0000,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19855,-3281.2500,1500.0000,4.0000,0.0000,0.0000,0.0000,999.0);
+
+    // Create exterior building object and change roof tile texture
+	TempObjectNumber = CreatePlayerObject(playerid,19854,-3281.2500,1500.0000,4.0000,0.0000,0.0000,0.0000,999.0);
+	SetPlayerObjectMaterial(playerid, TempObjectNumber, 0, 6284, "bev_law2", "shinglegrey_la", 0);
+	
+	CreatePlayerObject(playerid,19849,-3281.2507,1562.5000,4.0000,0.0000,0.0000,-180.0000,999.0);
+
+    // Create exterior building object and change roof tile texture
+	TempObjectNumber = CreatePlayerObject(playerid,19854,-3281.2507,1562.5000,4.0000,0.0000,0.0000,-180.0000,999.0);
+	SetPlayerObjectMaterial(playerid, TempObjectNumber, 0, 6283, "pierb_law2", "rooftiles2", 0);
+	
+	CreatePlayerObject(playerid,19855,-3281.2507,1562.5000,4.0000,0.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19856,-3281.2507,1562.5000,4.0000,0.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19532,-3234.3757,1601.2500,4.0000,0.0000,0.0000,90.0000,999.0);
+
+    // Create exterior building object and change roof tile texture
+	TempObjectNumber = CreatePlayerObject(playerid,19854,-3250.0007,1562.5000,4.0000,0.0000,0.0000,-180.0000,999.0);
+	SetPlayerObjectMaterial(playerid, TempObjectNumber, 0, 13721, "mulhousclahills", "sjmlahus26", 0);
+	
+	CreatePlayerObject(playerid,19855,-3250.0007,1562.5000,4.0000,0.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19856,-3250.0007,1562.5000,4.0000,0.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19856,-3218.7507,1562.5000,4.0000,0.0000,0.0000,-180.0000,999.0);
+
+	// Create exterior building object and change roof tile texture
+	TempObjectNumber = CreatePlayerObject(playerid,19854,-3218.7507,1562.5000,4.0000,0.0000,0.0000,-180.0000,999.0);
+	SetPlayerObjectMaterial(playerid, TempObjectNumber, 0, 3484, "vegashse5", "shingles1", 0);
+	
+	CreatePlayerObject(playerid,19855,-3218.7507,1562.5000,4.0000,0.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19542,-3031.8757,1531.2500,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19529,-3094.3757,1531.2500,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19536,-3343.1260,1531.2500,4.0000,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19542,-3374.3760,1531.2500,4.0000,0.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19532,-3094.3757,1461.2500,4.0000,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19788,-3304.3760,1461.2500,4.0000,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19532,-3094.3757,1601.2500,4.0000,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19535,-3164.3757,1601.2500,4.0000,0.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19788,-3304.3760,1601.2500,4.0000,0.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19541,-3031.8757,1461.2500,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19541,-3031.8757,1601.2500,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19541,-3374.3760,1601.2500,4.0000,0.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19541,-3374.3760,1461.2500,4.0000,0.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19543,-3343.1260,1461.2500,4.0000,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19543,-3343.1260,1601.2500,4.0000,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19542,-3094.3757,1608.7500,4.0000,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19542,-3234.3757,1608.7500,4.0000,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19541,-3304.3760,1608.7500,4.0000,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19541,-3164.3757,1608.7500,4.0000,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19540,-3031.8757,1608.7500,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19540,-3374.3760,1608.7500,4.0000,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19529,-3094.3757,1391.2500,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19534,-3164.3757,1461.2500,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19532,-3164.3757,1391.2500,4.0000,-0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19529,-3234.3757,1391.2500,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19543,-3304.3757,1422.5000,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19543,-3304.3757,1360.0000,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19542,-3234.3757,1328.7500,4.0000,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19542,-3094.3757,1328.7500,4.0000,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19542,-3031.8757,1391.2500,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19540,-3031.8757,1328.7500,4.0000,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19541,-3164.3757,1328.7500,4.0000,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19541,-3304.3757,1328.7500,4.0000,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19546,-3311.8757,1453.7500,4.0000,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19539,-3311.8757,1360.0000,4.0000,0.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19540,-3311.8757,1328.7500,4.0000,0.0000,0.0000,180.0000,999.0);
+	CreatePlayerObject(playerid,19540,-3374.3760,1453.7500,4.0000,0.0000,0.0000,180.0000,999.0);
+	CreatePlayerObject(playerid,19865,-3171.8906,1471.3014,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19865,-3171.8906,1476.3118,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19865,-3171.8906,1481.3260,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19865,-3171.8906,1486.3364,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19865,-3171.8906,1506.3838,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19865,-3171.8906,1501.3734,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19865,-3171.8906,1491.3488,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19865,-3171.8906,1496.3591,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19865,-3171.8906,1511.3954,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19865,-3171.8906,1516.4058,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19865,-3171.8906,1521.4200,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19865,-3171.8906,1526.4304,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19865,-3171.8906,1531.4427,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19865,-3171.8906,1536.4531,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19865,-3171.8906,1541.4674,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19865,-3171.8906,1546.4778,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19865,-3171.8906,1551.4934,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19865,-3171.8906,1556.5038,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19865,-3171.8906,1561.5181,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19865,-3171.8906,1566.5284,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19865,-3171.8906,1571.5409,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19865,-3171.8906,1576.5511,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19865,-3171.8906,1581.5654,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19865,-3171.8906,1586.5758,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19865,-3171.8921,1591.2007,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19866,-3265.6252,1479.1422,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19866,-3265.6252,1474.1422,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19866,-3234.3748,1474.1422,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19866,-3234.3748,1479.1422,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19867,-3295.6548,1472.8060,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19867,-3264.4043,1472.8060,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,877,-3217.8623,1518.8107,5.6301,0.0000,0.0000,-46.0000,999.0);
+	CreatePlayerObject(playerid,19867,-3201.9033,1472.8060,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19867,-3204.3455,1589.6940,4.0000,0.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19867,-3235.5959,1589.6940,4.0000,0.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19867,-3266.8464,1589.6940,4.0000,0.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19857,-3282.5649,1489.4465,5.9775,0.0000,0.0000,85.0000,999.0);
+	CreatePlayerObject(playerid,19858,-3251.3149,1489.4470,5.9780,0.0000,0.0000,85.0000,999.0);
+	CreatePlayerObject(playerid,19859,-3220.0649,1489.4470,5.9780,0.0000,0.0000,85.0000,999.0);
+	CreatePlayerObject(playerid,19860,-3188.8149,1489.4470,5.9780,0.0000,0.0000,85.0000,999.0);
+	CreatePlayerObject(playerid,19857,-3217.4358,1573.0535,5.9775,0.0000,0.0000,-95.0000,999.0);
+	CreatePlayerObject(playerid,19859,-3248.6858,1573.0535,5.9780,0.0000,0.0000,-95.0000,999.0);
+	CreatePlayerObject(playerid,19860,-3279.9358,1573.0535,5.9780,0.0000,0.0000,-95.0000,999.0);
+	CreatePlayerObject(playerid,19861,-3272.7583,1481.9060,6.4885,-85.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19862,-3241.5083,1483.8816,6.4880,-90.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19863,-3210.2583,1483.8196,6.4880,-90.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19864,-3179.0083,1483.8199,6.4880,-90.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19861,-3227.2424,1580.5940,6.4885,-85.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19862,-3258.4924,1578.5750,6.4635,-90.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19863,-3289.7424,1578.5652,6.4880,-90.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19868,-3315.4624,1593.7500,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19868,-3312.8430,1591.1295,4.0000,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19868,-3312.8430,1585.8579,4.0000,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19868,-3312.8430,1580.5906,4.0000,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19868,-3312.8430,1564.7810,4.0000,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19868,-3312.8430,1570.0482,4.0000,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19868,-3312.8430,1575.3198,4.0000,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19868,-3326.0046,1593.7500,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19868,-3315.4624,1562.1616,4.0000,0.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19868,-3326.0046,1562.1616,4.0000,0.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19868,-3328.6240,1564.7810,4.0000,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19868,-3328.6240,1570.0482,4.0000,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19868,-3328.6240,1575.3198,4.0000,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19868,-3328.6240,1580.5906,4.0000,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19868,-3328.6240,1585.8579,4.0000,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19868,-3328.6240,1591.1295,4.0000,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19868,-3320.7344,1562.1616,4.0000,0.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,1226,-3296.4019,1467.9758,7.8744,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,1226,-3265.6252,1467.9758,7.8744,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,1226,-3234.3757,1467.9758,7.8744,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,1226,-3203.1243,1467.9758,7.8744,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,1226,-3172.1250,1467.9758,7.8744,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,1226,-3204.2439,1594.5591,7.8744,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,1226,-3234.3757,1594.5591,7.8744,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,1226,-3265.6255,1594.5591,7.8744,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,1226,-3296.7024,1594.5591,7.8744,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,1226,-3172.4277,1594.5591,7.8744,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,1226,-3314.0095,1563.0968,7.8744,0.0000,0.0000,-45.0000,999.0);
+	CreatePlayerObject(playerid,1226,-3327.6401,1563.3578,7.8744,0.0000,0.0000,-135.0000,999.0);
+	CreatePlayerObject(playerid,1226,-3327.4702,1592.8082,7.8744,0.0000,0.0000,135.0000,999.0);
+	CreatePlayerObject(playerid,1226,-3313.7534,1592.6093,7.8744,0.0000,0.0000,45.0000,999.0);
+	CreatePlayerObject(playerid,762,-3321.2837,1460.1271,8.1565,0.0000,0.0000,-136.0000,999.0);
+	CreatePlayerObject(playerid,762,-3321.2837,1478.6985,8.1565,0.0000,0.0000,-178.0000,999.0);
+	CreatePlayerObject(playerid,762,-3321.2837,1497.2699,8.1565,0.0000,0.0000,166.0000,999.0);
+	CreatePlayerObject(playerid,762,-3321.2837,1515.8413,8.1565,0.0000,0.0000,128.0000,999.0);
+	CreatePlayerObject(playerid,762,-3321.2837,1534.4127,8.1565,0.0000,0.0000,82.0000,999.0);
+	CreatePlayerObject(playerid,762,-3321.2837,1552.9843,8.1565,0.0000,0.0000,37.0000,999.0);
+	CreatePlayerObject(playerid,762,-3141.8879,1484.2739,8.1565,0.0000,0.0000,-136.0000,999.0);
+	CreatePlayerObject(playerid,762,-3141.8879,1502.8453,8.1565,0.0000,0.0000,-178.0000,999.0);
+	CreatePlayerObject(playerid,762,-3141.8879,1521.4167,8.1565,0.0000,0.0000,166.0000,999.0);
+	CreatePlayerObject(playerid,762,-3141.8879,1539.9882,8.1565,0.0000,0.0000,128.0000,999.0);
+	CreatePlayerObject(playerid,762,-3141.8879,1558.5596,8.1565,0.0000,0.0000,82.0000,999.0);
+	CreatePlayerObject(playerid,762,-3141.8879,1577.1311,8.1565,0.0000,0.0000,37.0000,999.0);
+	CreatePlayerObject(playerid,759,-3174.4050,1591.4492,4.0000,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,759,-3202.9797,1478.9318,4.0000,0.0000,0.0000,82.0000,999.0);
+	CreatePlayerObject(playerid,759,-3293.6179,1528.0867,4.0000,0.0000,0.0000,-142.0000,999.0);
+	CreatePlayerObject(playerid,759,-3268.6069,1528.0867,4.0000,0.0000,0.0000,-81.0000,999.0);
+	CreatePlayerObject(playerid,759,-3280.7466,1528.0867,4.0000,0.0000,0.0000,-38.0000,999.0);
+	CreatePlayerObject(playerid,759,-3287.2175,1528.0867,4.0000,0.0000,0.0000,11.0000,999.0);
+	CreatePlayerObject(playerid,759,-3274.6274,1528.0867,4.0000,0.0000,0.0000,63.0000,999.0);
+	CreatePlayerObject(playerid,808,-3234.3008,1584.7771,5.5884,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,808,-3206.2786,1528.3306,5.5884,0.0000,0.0000,-122.0000,999.0);
+	CreatePlayerObject(playerid,808,-3231.6143,1528.3306,5.5884,0.0000,0.0000,-32.0000,999.0);
+	CreatePlayerObject(playerid,885,-3231.0566,1534.4080,3.9827,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,885,-3206.9106,1534.4080,3.9827,0.0000,0.0000,69.0000,999.0);
+	CreatePlayerObject(playerid,885,-3218.6855,1534.4080,3.9827,0.0000,0.0000,125.0000,999.0);
+	CreatePlayerObject(playerid,628,-3248.2051,1487.5242,5.9592,0.0000,0.0000,-131.0000,999.0);
+	CreatePlayerObject(playerid,628,-3226.1389,1523.6616,5.2747,0.0000,0.0000,-120.0000,999.0);
+	CreatePlayerObject(playerid,628,-3223.3250,1525.0994,5.2747,0.0000,0.0000,-74.0000,999.0);
+	CreatePlayerObject(playerid,628,-3223.4836,1522.1924,5.2747,0.0000,0.0000,-38.0000,999.0);
+	CreatePlayerObject(playerid,628,-3220.8762,1574.8800,5.9524,0.0000,0.0000,28.0000,999.0);
+	CreatePlayerObject(playerid,759,-3211.6606,1513.9496,4.0000,0.0000,0.0000,107.0000,999.0);
+	CreatePlayerObject(playerid,624,-3264.0588,1529.2220,3.2300,0.0000,0.0000,15.0000,999.0);
+	CreatePlayerObject(playerid,624,-3236.3870,1529.2220,3.2300,0.0000,0.0000,53.0000,999.0);
+	CreatePlayerObject(playerid,817,-3263.4792,1533.7153,4.4050,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,817,-3260.5073,1533.7153,4.4050,0.0000,0.0000,30.0000,999.0);
+	CreatePlayerObject(playerid,817,-3257.5352,1533.7153,4.4050,0.0000,0.0000,54.0000,999.0);
+	CreatePlayerObject(playerid,817,-3254.5632,1533.7153,4.4050,0.0000,0.0000,72.0000,999.0);
+	CreatePlayerObject(playerid,817,-3251.5913,1533.7153,4.4050,0.0000,0.0000,39.0000,999.0);
+	CreatePlayerObject(playerid,817,-3248.6191,1533.7153,4.4050,0.0000,0.0000,39.0000,999.0);
+	CreatePlayerObject(playerid,817,-3239.8359,1533.7153,4.4050,0.0000,0.0000,105.0000,999.0);
+	CreatePlayerObject(playerid,817,-3236.8638,1533.7153,4.4050,0.0000,0.0000,47.0000,999.0);
+	CreatePlayerObject(playerid,817,-3242.8079,1533.7153,4.4050,0.0000,0.0000,68.0000,999.0);
+	CreatePlayerObject(playerid,817,-3245.7319,1533.7153,4.4050,0.0000,0.0000,28.0000,999.0);
+	CreatePlayerObject(playerid,817,-3238.2627,1553.1128,4.4050,0.0000,0.0000,82.0000,999.0);
+	CreatePlayerObject(playerid,817,-3241.5566,1553.1128,4.4050,0.0000,0.0000,125.0000,999.0);
+	CreatePlayerObject(playerid,817,-3244.4338,1553.1128,4.4050,0.0000,0.0000,153.0000,999.0);
+	CreatePlayerObject(playerid,817,-3246.8398,1553.1128,4.4050,0.0000,0.0000,-179.0000,999.0);
+	CreatePlayerObject(playerid,817,-3249.6064,1553.1128,4.4050,0.0000,0.0000,-145.0000,999.0);
+	CreatePlayerObject(playerid,817,-3252.4700,1553.1128,4.4050,0.0000,0.0000,-96.0000,999.0);
+	CreatePlayerObject(playerid,817,-3255.2151,1553.1128,4.4050,0.0000,0.0000,-79.0000,999.0);
+	CreatePlayerObject(playerid,817,-3257.8047,1553.1128,4.4050,0.0000,0.0000,-32.0000,999.0);
+	CreatePlayerObject(playerid,817,-3265.5815,1582.6428,4.4050,0.0000,0.0000,-14.0000,999.0);
+
+	// Exit here
+	return 1;
+}
+

BIN
samp03/filterscripts/modular_island.amx


+ 194 - 0
samp03/filterscripts/modular_island.pwn

@@ -0,0 +1,194 @@
+// -----------------------------------------------------------------------------
+// Example Filterscript for the new Modular Island Objects
+// -------------------------------------------------------
+// By Matite in January 2015
+//
+// This script creates a Modular Island just off the coast in SF (next to the
+// docks near the hospital).
+//
+// Warning...
+// This script uses a total of 87 player objects
+// -----------------------------------------------------------------------------
+
+// -----------------------------------------------------------------------------
+// Includes
+// --------
+
+// SA-MP Include
+#include <a_samp>
+
+// -----------------------------------------------------------------------------
+// Callbacks
+// ---------
+
+// Un-comment the OnPlayerCommandText callback below (remove the "/*" and the "*/")
+// to enable a simple teleport command (/mi) which teleports the player to
+// the modular island in SF.
+
+/*
+public OnPlayerCommandText(playerid, cmdtext[])
+{
+	// Check command text
+	if (strcmp("/mi", cmdtext, true, 3) == 0)
+	{
+	    // Set the interior
+		SetPlayerInterior(playerid, 0);
+
+		// Set player position and facing angle
+		SetPlayerPos(playerid, -3343.57 + random(2), 194.34 + random(2), 6.2);
+		SetPlayerFacingAngle(playerid, 315);
+
+		// Fix camera position after teleporting
+		SetCameraBehindPlayer(playerid);
+
+		// Send a gametext message to the player
+		GameTextForPlayer(playerid, "~b~~h~Modular Island!", 3000, 3);
+
+	    // Exit here
+	    return 1;
+	}
+
+	// Exit here (return 0 as the command was not handled in this filterscript)
+	return 0;
+}
+*/
+
+public OnFilterScriptInit()
+{
+    // Display information in the Server Console
+	print("\n");
+	print("  |---------------------------------------------------");
+	print("  |--- Modular Island Filterscript by Matite");
+    print("  |--  Script v1.01");
+    print("  |--  12th January 2015");
+	print("  |---------------------------------------------------");
+	
+	// Loop
+	for (new i = 0; i < MAX_PLAYERS; i++)
+	{
+	    // Check if the player is connected and not a NPC
+        if (IsPlayerConnected(i) && !IsPlayerNPC(i))
+        {
+	    	// Create modular island objects for the player
+	    	// (so any player currently ingame does not have to rejoin for them
+			//  to appear when this filterscript is loaded)
+			CreateMIObjects(i);
+		}
+	}
+
+    // Exit here
+	return 1;
+}
+
+public OnFilterScriptExit()
+{
+	// Display information in the Server Console
+	print("  |---------------------------------------------------");
+	print("  |--  Modular Island Filterscript Unloaded");
+	print("  |---------------------------------------------------");
+
+	// Exit here
+	return 1;
+}
+
+public OnPlayerConnect(playerid)
+{
+	// Create modular island objects for the player
+	CreateMIObjects(playerid);
+
+	// Exit here
+	return 1;
+}
+
+CreateMIObjects(playerid)
+{
+    // Create modular island player objects (with draw distance of 599m)
+    CreatePlayerObject(playerid,19529,-3130.000000,0.000000,4.000000,0.000000,0.000000,0.000000, 599.0);
+	CreatePlayerObject(playerid,19530,-3130.000000,140.000000,4.000000,0.000000,0.000000,0.000000, 599.0);
+	CreatePlayerObject(playerid,19531,-3130.000000,280.000000,4.000000,0.000000,0.000000,0.000000, 599.0);
+	CreatePlayerObject(playerid,19532,-3130.000000,70.000000,4.000000,0.000000,0.000000,90.000000, 599.0);
+	CreatePlayerObject(playerid,19532,-3130.000000,210.000000,4.000000,0.000000,0.000000,90.000000, 599.0);
+	CreatePlayerObject(playerid,19533,-3238.750000,210.000000,4.000000,0.000000,0.000000,90.000000, 599.0);
+	CreatePlayerObject(playerid,19534,-3200.000000,210.000000,4.000000,0.000000,0.000000,90.000000, 599.0);
+	CreatePlayerObject(playerid,19532,-3200.000000,280.000000,4.000000,0.000000,0.000000,0.000000, 599.0);
+	CreatePlayerObject(playerid,19534,-3200.000000,70.000000,4.000000,0.000000,0.000000,90.000000, 599.0);
+	CreatePlayerObject(playerid,19532,-3200.000000,140.000000,4.000000,0.000000,0.000000,0.000000, 599.0);
+	CreatePlayerObject(playerid,19534,-3200.000000,70.000000,4.000000,0.000000,0.000000,90.000000, 599.0);
+	CreatePlayerObject(playerid,19532,-3200.000000,0.000000,4.000000,0.000000,0.000000,0.000000, 599.0);
+	CreatePlayerObject(playerid,19535,-3277.500000,210.000000,4.000000,0.000000,0.000000,270.000000, 599.0);
+	CreatePlayerObject(playerid,19532,-3277.500000,140.000000,4.000000,0.000000,0.000000,0.000000, 599.0);
+	CreatePlayerObject(playerid,19532,-3277.500000,280.000000,4.000000,0.000000,0.000000,0.000000, 599.0);
+	CreatePlayerObject(playerid,19532,-3277.500000,0.000000,4.000000,0.000000,0.000000,0.000000, 599.0);
+	CreatePlayerObject(playerid,19535,-3277.500000,70.000000,4.000000,0.000000,0.000000,270.000000, 599.0);
+	CreatePlayerObject(playerid,19533,-3238.750000,70.000000,4.000000,0.000000,0.000000,90.000000, 599.0);
+	CreatePlayerObject(playerid,19536,-3238.750000,0.000000,4.000000,0.000000,0.000000,90.000000, 599.0);
+	CreatePlayerObject(playerid,19537,-3238.750000,140.000000,4.000000,0.000000,0.000000,90.000000, 599.0);
+	CreatePlayerObject(playerid,19538,-3238.750000,280.000000,4.000000,0.000000,0.000000,90.000000, 599.0);
+	CreatePlayerObject(playerid,19542,-3052.500000,0.000000,4.000000,0.000000,0.000000,0.000000, 599.0);
+	CreatePlayerObject(playerid,19541,-3052.500000,70.000000,4.000000,0.000000,0.000000,0.000000, 599.0);
+	CreatePlayerObject(playerid,19535,-3060.000000,70.000000,4.000000,0.000000,0.000000,90.000000, 599.0);
+	CreatePlayerObject(playerid,19532,-3060.000000,0.000000,4.000000,0.000000,0.000000,0.000000, 599.0);
+	CreatePlayerObject(playerid,19532,-3060.000000,140.000000,4.000000,0.000000,0.000000,0.000000, 599.0);
+	CreatePlayerObject(playerid,19535,-3060.000000,210.000000,4.000000,0.000000,0.000000,90.000000, 599.0);
+	CreatePlayerObject(playerid,19532,-3060.000000,280.000000,4.000000,0.000000,0.000000,0.000000, 599.0);
+	CreatePlayerObject(playerid,19542,-3052.500000,140.000000,4.000000,0.000000,0.000000,0.000000, 599.0);
+	CreatePlayerObject(playerid,19541,-3052.500000,210.000000,4.000000,0.000000,0.000000,0.000000, 599.0);
+	CreatePlayerObject(playerid,19542,-3052.500000,280.000000,4.000000,0.000000,0.000000,0.000000, 599.0);
+	CreatePlayerObject(playerid,19540,-3052.500000,-62.500000,4.000000,0.000000,0.000000,270.000000, 599.0);
+	CreatePlayerObject(playerid,19541,-3060.000000,-62.500000,4.000000,0.000000,0.000000,-90.000000, 599.0);
+	CreatePlayerObject(playerid,19542,-3130.000000,-62.500000,4.000000,0.000000,0.000000,270.000000, 599.0);
+	CreatePlayerObject(playerid,19541,-3200.000000,-62.500000,4.000000,0.000000,0.000000,-90.000000, 599.0);
+	CreatePlayerObject(playerid,19539,-3238.750000,-62.500000,4.000000,0.000000,0.000000,270.000000, 599.0);
+	CreatePlayerObject(playerid,19541,-3277.500000,-62.500000,4.000000,0.000000,0.000000,-90.000000, 599.0);
+	CreatePlayerObject(playerid,19540,-3285.000000,-62.500000,4.000000,0.000000,0.000000,180.000000, 599.0);
+	CreatePlayerObject(playerid,19542,-3410.000488,0.000000,4.000000,0.000000,0.000000,270.000000, 599.0);
+	CreatePlayerObject(playerid,19541,-3285.000000,70.000000,4.000000,0.000000,0.000000,180.000000, 599.0);
+	CreatePlayerObject(playerid,19543,-3316.250000,210.000000,4.000000,0.000000,0.000000,90.000000, 599.0);
+	CreatePlayerObject(playerid,19546,-3285.000000,202.500000,4.000000,0.000000,0.000000,270.000000, 599.0);
+	CreatePlayerObject(playerid,19540,-3472.500000,342.500000,4.000000,0.000000,0.000000,450.000000, 599.0);
+	CreatePlayerObject(playerid,19546,-3285.000000,0.000000,4.000000,0.000000,0.000000,270.000000, 599.0);
+	CreatePlayerObject(playerid,19546,-3285.000000,0.000000,4.000000,0.000000,0.000000,180.000000, 599.0);
+	CreatePlayerObject(playerid,19542,-3410.000000,0.000000,4.000000,0.000000,0.000000,450.000000, 599.0);
+	CreatePlayerObject(playerid,19540,-3472.500000,0.000000,4.000000,0.000000,0.000000,180.000000, 599.0);
+	CreatePlayerObject(playerid,19540,-3472.500000,0.000000,4.000000,0.000000,0.000000,450.000000, 599.0);
+	CreatePlayerObject(playerid,19547,-3347.500000,280.000000,4.000000,0.000000,0.000000,90.000000, 599.0);
+	CreatePlayerObject(playerid,19539,-3285.000000,108.750000,4.000000,0.000000,0.000000,180.000000, 599.0);
+	CreatePlayerObject(playerid,19542,-3410.000000,202.500000,4.000000,0.000000,0.000000,270.000000, 599.0);
+	CreatePlayerObject(playerid,19543,-3378.750000,210.000000,4.000000,0.000000,0.000000,90.000000, 599.0);
+	CreatePlayerObject(playerid,19543,-3441.250000,210.000000,4.000000,0.000000,0.000000,90.000000, 599.0);
+	CreatePlayerObject(playerid,19536,-3441.250000,280.000000,4.000000,0.000000,0.000000,90.000000, 599.0);
+	CreatePlayerObject(playerid,19540,-3472.500000,202.500000,4.000000,0.000000,0.000000,180.000000, 599.0);
+	CreatePlayerObject(playerid,19542,-3472.500000,265.000000,4.000000,0.000000,0.000000,180.000000, 599.0);
+	CreatePlayerObject(playerid,19541,-3472.500000,335.000000,4.000000,0.000000,0.000000,180.000000, 599.0);
+	CreatePlayerObject(playerid,19542,-3410.000000,342.500000,4.000000,0.000000,0.000000,90.000000, 599.0);
+	CreatePlayerObject(playerid,19535,-3277.500000,350.000000,4.000000,0.000000,0.000000,270.000000, 599.0);
+	CreatePlayerObject(playerid,19535,-3200.000000,350.000000,4.000000,0.000000,0.000000,180.000000, 599.0);
+	CreatePlayerObject(playerid,19535,-3060.000000,350.000000,4.000000,0.000000,0.000000,180.000000, 599.0);
+	CreatePlayerObject(playerid,19532,-3130.000000,350.000000,4.000000,0.000000,0.000000,90.000000, 599.0);
+	CreatePlayerObject(playerid,19533,-3238.750000,350.000000,4.000000,0.000000,0.000000,90.000000, 599.0);
+	CreatePlayerObject(playerid,19546,-3285.000000,342.500000,4.000000,0.000000,0.000000,180.000000, 599.0);
+	CreatePlayerObject(playerid,19540,-3285.000000,482.500000,4.000000,0.000000,0.000000,450.000000, 599.0);
+	CreatePlayerObject(playerid,19542,-3222.500000,482.500000,4.000000,0.000000,0.000000,90.000000, 599.0);
+	CreatePlayerObject(playerid,19536,-3238.750000,420.000000,4.000000,0.000000,0.000000,90.000000, 599.0);
+	CreatePlayerObject(playerid,19541,-3285.000000,412.500000,4.000000,0.000000,0.000000,180.000000, 599.0);
+	CreatePlayerObject(playerid,19541,-3052.500000,350.000000,4.000000,0.000000,0.000000,0.000000, 599.0);
+	CreatePlayerObject(playerid,19540,-3052.500000,482.500000,4.000000,0.000000,0.000000,0.000000, 599.0);
+	CreatePlayerObject(playerid,19539,-3052.500000,388.750000,4.000000,0.000000,0.000000,0.000000, 599.0);
+	CreatePlayerObject(playerid,19539,-3083.750000,482.500000,4.000000,0.000000,0.000000,90.000000, 599.0);
+	CreatePlayerObject(playerid,19541,-3122.500000,482.500000,4.000000,0.000000,0.000000,90.000000, 599.0);
+	CreatePlayerObject(playerid,19541,-3137.500000,482.500000,4.000000,0.000000,0.000000,90.000000, 599.0);
+	CreatePlayerObject(playerid,19541,-3152.500000,482.500000,4.000000,0.000000,0.000000,90.000000, 599.0);
+	CreatePlayerObject(playerid,19529,-3130.000000,420.000000,4.000000,0.000000,0.000000,0.000000, 599.0);
+	CreatePlayerObject(playerid,19543,-3277.500000,388.750000,4.000000,0.000000,0.000000,0.000000, 599.0);
+	CreatePlayerObject(playerid,19543,-3277.500000,451.250000,4.000000,0.000000,0.000000,0.000000, 599.0);
+	CreatePlayerObject(playerid,19543,-3200.000000,388.750000,4.000000,0.000000,0.000000,0.000000, 599.0);
+	CreatePlayerObject(playerid,19543,-3200.000000,451.250000,4.000000,0.000000,0.000000,0.000000, 599.0);
+	CreatePlayerObject(playerid,19543,-3060.000000,388.750000,4.000000,0.000000,0.000000,0.000000, 599.0);
+	CreatePlayerObject(playerid,19543,-3060.000000,451.250000,4.000000,0.000000,0.000000,0.000000, 599.0);
+	CreatePlayerObject(playerid,19539,-3285.000000,451.250000,4.000000,0.000000,0.000000,180.000000, 599.0);
+	CreatePlayerObject(playerid,19539,-3052.500000,451.250000,4.000000,0.000000,0.000000,0.000000, 599.0);
+	
+	// Exit here
+	return 1;
+}
+

BIN
samp03/filterscripts/netstats.amx


+ 70 - 0
samp03/filterscripts/netstats.pwn

@@ -0,0 +1,70 @@
+//
+// Admin netstats display
+//
+
+#include <a_samp>
+#include "../include/gl_common.inc"
+
+#define ADMINFS_MESSAGE_COLOR 0xFF444499
+#define ADMIN_NETSTATS_DIALOGID 12898
+
+new gNetStatsPlayerId = INVALID_PLAYER_ID;
+new gNetStatsTimerId = 0;
+
+forward NetStatsDisplay();
+
+//------------------------------------------------
+
+public OnFilterScriptInit()
+{
+	print("\n--Admin Netstats FS loaded.\n");
+	return 1;
+}
+
+//------------------------------------------------
+
+public NetStatsDisplay()
+{
+	new netstats_str[2048+1];
+	GetNetworkStats(netstats_str, 2048);
+	ShowPlayerDialog(gNetStatsPlayerId, ADMIN_NETSTATS_DIALOGID, DIALOG_STYLE_MSGBOX, "Server NetStats", netstats_str, "Ok", "");
+}
+
+//------------------------------------------------
+
+public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
+{
+    if(!IsPlayerAdmin(playerid)) return 0; // this is an admin only script
+
+	if(dialogid == ADMIN_NETSTATS_DIALOGID) {
+		KillTimer(gNetStatsTimerId);
+		gNetStatsPlayerId = INVALID_PLAYER_ID;
+		return 1;
+	}
+	
+	return  0;
+}
+
+//------------------------------------------------
+
+public OnPlayerCommandText(playerid, cmdtext[])
+{
+	new cmd[256+1];
+	new	idx;
+
+	if(!IsPlayerAdmin(playerid)) return 0;
+	
+	cmd = strtok(cmdtext, idx);
+	
+    // netstats command
+	if(strcmp("/netstats", cmd, true) == 0)
+	{
+	    gNetStatsPlayerId = playerid;
+	    NetStatsDisplay();
+	    gNetStatsTimerId = SetTimer("NetStatsDisplay", 3000, true); // this will refresh the display every 3 seconds
+	    return 1;
+	}
+	
+	return 0;
+}
+//------------------------------------------------

BIN
samp03/filterscripts/npc_record.amx


+ 75 - 0
samp03/filterscripts/npc_record.pwn

@@ -0,0 +1,75 @@
+//-------------------------------------------------
+//
+//  Recording player data for NPC playback
+//  Kye 2009
+//
+//-------------------------------------------------
+
+#pragma tabsize 0
+
+#include <a_samp>
+#include <core>
+#include <float>
+
+#include "../include/gl_common.inc"
+
+//-------------------------------------------------
+
+public OnPlayerCommandText(playerid, cmdtext[])
+{
+	new cmd[256];
+	new idx;
+	cmd = strtok(cmdtext, idx);
+	
+	if(!IsPlayerAdmin(playerid)) return 0; // this is an admin only script
+	
+	// Start recording vehicle data (/vrecord recording_name[])
+	// Find the recording_name[] file in /scriptfiles/
+ 	if(strcmp(cmd, "/vrecord", true) == 0) {
+	    new tmp[512];
+      	tmp = strtok(cmdtext, idx);
+		if(!strlen(tmp)) {
+			SendClientMessage(playerid,0xFF0000FF,"Usage: /vrecord {name}");
+			return 1;
+		}
+		if(!IsPlayerInAnyVehicle(playerid)) {
+            SendClientMessage(playerid,0xFF0000FF,"Recording: Get in a vehicle.");
+			return 1;
+		}
+		StartRecordingPlayerData(playerid,PLAYER_RECORDING_TYPE_DRIVER,tmp);
+		SendClientMessage(playerid,0xFF0000FF,"Recording: started.");
+		return 1;
+	}
+
+	// Start recording onfoot data (/ofrecord recording_name[])
+	// Find the recording_name[] file in /scriptfiles/
+ 	if(strcmp(cmd, "/ofrecord", true) == 0) {
+	    new tmp[512];
+      	tmp = strtok(cmdtext, idx);
+		if(!strlen(tmp)) {
+			SendClientMessage(playerid,0xFF0000FF,"Usage: /ofrecord {name}");
+			return 1;
+		}
+ 		if(IsPlayerInAnyVehicle(playerid)) {
+            SendClientMessage(playerid,0xFF0000FF,"Recording: Leave the vehicle and reuse the command.");
+			return 1;
+		}
+		StartRecordingPlayerData(playerid,PLAYER_RECORDING_TYPE_ONFOOT,tmp);
+		SendClientMessage(playerid,0xFF0000FF,"Recording: started.");
+		return 1;
+	}
+	
+	// Stop recording any data
+	if(strcmp(cmd, "/stoprecord", true) == 0) {
+		StopRecordingPlayerData(playerid);
+		SendClientMessage(playerid,0xFF0000FF,"Recording: stopped.");
+		return 1;
+	}
+
+	return 0;
+}
+
+//-------------------------------------------------
+// EOF
+
+

BIN
samp03/filterscripts/ospawner.amx


+ 416 - 0
samp03/filterscripts/ospawner.pwn

@@ -0,0 +1,416 @@
+//
+// Admin spawner using previews. For SA-MP 0.3x and above.
+// - Kye 2012
+//
+
+#include <a_samp>
+#include "../include/gl_common.inc"
+
+#define TOTAL_ITEMS         20000
+#define SELECTION_ITEMS 	21
+#define ITEMS_PER_LINE  	7
+
+#define HEADER_TEXT "Objects"
+#define NEXT_TEXT   "Next"
+#define PREV_TEXT   "Prev"
+
+#define DIALOG_BASE_X   	75.0
+#define DIALOG_BASE_Y   	130.0
+#define DIALOG_WIDTH    	550.0
+#define DIALOG_HEIGHT   	180.0
+#define SPRITE_DIM_X    	60.0
+#define SPRITE_DIM_Y    	70.0
+
+new gTotalItems = TOTAL_ITEMS;
+
+new PlayerText:gBackgroundTextDrawId[MAX_PLAYERS];
+new PlayerText:gNextButtonTextDrawId[MAX_PLAYERS];
+new PlayerText:gPrevButtonTextDrawId[MAX_PLAYERS];
+new PlayerText:gSelectionItems[MAX_PLAYERS][SELECTION_ITEMS];
+new PlayerText:gCurrentPageTextDrawId[MAX_PLAYERS];
+new PlayerText:gHeaderTextDrawId[MAX_PLAYERS];
+new gSelectionItemsTag[MAX_PLAYERS][SELECTION_ITEMS];
+new gItemAt[MAX_PLAYERS];
+
+//------------------------------------------------
+
+public OnFilterScriptInit()
+{
+	print("\n--Admin Vehicle Spawner Loaded\n");
+	return 1;
+}
+
+//------------------------------------------------
+
+GetNumberOfPages()
+{
+	if((gTotalItems >= SELECTION_ITEMS) && (gTotalItems % SELECTION_ITEMS) == 0)
+	{
+		return (gTotalItems / SELECTION_ITEMS);
+	}
+	else return (gTotalItems / SELECTION_ITEMS) + 1;
+}
+
+//------------------------------------------------
+
+PlayerText:CreateCurrentPageTextDraw(playerid, Float:Xpos, Float:Ypos)
+{
+	new PlayerText:txtInit;
+   	txtInit = CreatePlayerTextDraw(playerid, Xpos, Ypos, "0/0");
+   	PlayerTextDrawUseBox(playerid, txtInit, 0);
+	PlayerTextDrawLetterSize(playerid, txtInit, 0.4, 1.1);
+	PlayerTextDrawFont(playerid, txtInit, 1);
+	PlayerTextDrawSetShadow(playerid, txtInit, 0);
+    PlayerTextDrawSetOutline(playerid, txtInit, 1);
+    PlayerTextDrawColor(playerid, txtInit, 0xACCBF1FF);
+    PlayerTextDrawShow(playerid, txtInit);
+    return txtInit;
+}
+
+//------------------------------------------------
+// Creates a button textdraw and returns the textdraw ID.
+
+PlayerText:CreatePlayerDialogButton(playerid, Float:Xpos, Float:Ypos, Float:Width, Float:Height, button_text[])
+{
+ 	new PlayerText:txtInit;
+   	txtInit = CreatePlayerTextDraw(playerid, Xpos, Ypos, button_text);
+   	PlayerTextDrawUseBox(playerid, txtInit, 1);
+   	PlayerTextDrawBoxColor(playerid, txtInit, 0x000000FF);
+   	PlayerTextDrawBackgroundColor(playerid, txtInit, 0x000000FF);
+	PlayerTextDrawLetterSize(playerid, txtInit, 0.4, 1.1);
+	PlayerTextDrawFont(playerid, txtInit, 1);
+	PlayerTextDrawSetShadow(playerid, txtInit, 0); // no shadow
+    PlayerTextDrawSetOutline(playerid, txtInit, 0);
+    PlayerTextDrawColor(playerid, txtInit, 0x4A5A6BFF);
+    PlayerTextDrawSetSelectable(playerid, txtInit, 1);
+    PlayerTextDrawAlignment(playerid, txtInit, 2);
+    PlayerTextDrawTextSize(playerid, txtInit, Height, Width); // The width and height are reversed for centering.. something the game does <g>
+    PlayerTextDrawShow(playerid, txtInit);
+    return txtInit;
+}
+ 
+//------------------------------------------------
+
+PlayerText:CreatePlayerHeaderTextDraw(playerid, Float:Xpos, Float:Ypos, header_text[])
+{
+	new PlayerText:txtInit;
+   	txtInit = CreatePlayerTextDraw(playerid, Xpos, Ypos, header_text);
+   	PlayerTextDrawUseBox(playerid, txtInit, 0);
+	PlayerTextDrawLetterSize(playerid, txtInit, 1.25, 3.0);
+	PlayerTextDrawFont(playerid, txtInit, 0);
+	PlayerTextDrawSetShadow(playerid, txtInit, 0);
+    PlayerTextDrawSetOutline(playerid, txtInit, 1);
+    PlayerTextDrawColor(playerid, txtInit, 0xACCBF1FF);
+    PlayerTextDrawShow(playerid, txtInit);
+    return txtInit;
+}
+
+//------------------------------------------------
+
+PlayerText:CreatePlayerBackgroundTextDraw(playerid, Float:Xpos, Float:Ypos, Float:Width, Float:Height)
+{
+	new PlayerText:txtBackground = CreatePlayerTextDraw(playerid, Xpos, Ypos,
+	"                                           ~n~"); // enough space for everyone
+    PlayerTextDrawUseBox(playerid, txtBackground, 1);
+    PlayerTextDrawBoxColor(playerid, txtBackground, 0x4A5A6BBB);
+	PlayerTextDrawLetterSize(playerid, txtBackground, 5.0, 5.0);
+	PlayerTextDrawFont(playerid, txtBackground, 0);
+	PlayerTextDrawSetShadow(playerid, txtBackground, 0);
+    PlayerTextDrawSetOutline(playerid, txtBackground, 0);
+    PlayerTextDrawColor(playerid, txtBackground,0xFFFFFFFF);
+    PlayerTextDrawTextSize(playerid, txtBackground, Width, Height);
+   	PlayerTextDrawBackgroundColor(playerid, txtBackground, 0x4A5A6BBB);
+    PlayerTextDrawShow(playerid, txtBackground);
+    return txtBackground;
+}
+
+//------------------------------------------------
+// Creates a model preview sprite
+
+PlayerText:CreateModelPreviewTextDraw(playerid, modelindex, Float:Xpos, Float:Ypos, Float:width, Float:height)
+{
+    new PlayerText:txtPlayerSprite = CreatePlayerTextDraw(playerid, Xpos, Ypos, ""); // it has to be set with SetText later
+    PlayerTextDrawFont(playerid, txtPlayerSprite, TEXT_DRAW_FONT_MODEL_PREVIEW);
+    PlayerTextDrawColor(playerid, txtPlayerSprite, 0xFFFFFFFF);
+    PlayerTextDrawBackgroundColor(playerid, txtPlayerSprite, 0x88888899);
+    PlayerTextDrawTextSize(playerid, txtPlayerSprite, width, height); // Text size is the Width:Height
+    PlayerTextDrawSetPreviewModel(playerid, txtPlayerSprite, modelindex);
+    if(modelindex > 319) {
+    	PlayerTextDrawSetPreviewRot(playerid,txtPlayerSprite, -15.0, 0.0, 0.0);
+	}
+    PlayerTextDrawSetSelectable(playerid, txtPlayerSprite, 1);
+    PlayerTextDrawShow(playerid,txtPlayerSprite);
+    return txtPlayerSprite;
+}
+
+//------------------------------------------------
+
+DestroyPlayerModelPreviews(playerid)
+{
+	new x=0;
+	while(x != SELECTION_ITEMS) {
+	    if(gSelectionItems[playerid][x] != PlayerText:INVALID_TEXT_DRAW) {
+			PlayerTextDrawDestroy(playerid, gSelectionItems[playerid][x]);
+			gSelectionItems[playerid][x] = PlayerText:INVALID_TEXT_DRAW;
+		}
+		x++;
+	}
+}
+
+//------------------------------------------------
+
+ShowPlayerModelPreviews(playerid)
+{
+    new x=0;
+	new Float:BaseX = DIALOG_BASE_X;
+	new Float:BaseY = DIALOG_BASE_Y - (SPRITE_DIM_Y * 0.33); // down a bit
+	new linetracker = 0;
+	
+	new itemat = GetPVarInt(playerid, "ospawner_page") * SELECTION_ITEMS;
+
+	// Destroy any previous ones created
+	DestroyPlayerModelPreviews(playerid);
+
+	while(x != SELECTION_ITEMS && itemat < gTotalItems) {
+	    if(linetracker == 0) {
+	        BaseX = DIALOG_BASE_X + 25.0; // in a bit from the box
+	        BaseY += SPRITE_DIM_Y + 1.0; // move on the Y for the next line
+		}
+  		gSelectionItems[playerid][x] = CreateModelPreviewTextDraw(playerid, itemat, BaseX, BaseY, SPRITE_DIM_X, SPRITE_DIM_Y);
+  		gSelectionItemsTag[playerid][x] = itemat;
+		BaseX += SPRITE_DIM_X + 1.0; // move on the X for the next sprite
+		linetracker++;
+		if(linetracker == ITEMS_PER_LINE) linetracker = 0;
+		itemat++;
+		x++;
+	}
+}
+
+//------------------------------------------------
+
+UpdatePageTextDraw(playerid)
+{
+	new PageText[64+1];
+	format(PageText, 64, "%d/%d", GetPVarInt(playerid,"ospawner_page") + 1, GetNumberOfPages());
+	PlayerTextDrawSetString(playerid, gCurrentPageTextDrawId[playerid], PageText);
+}
+
+//------------------------------------------------
+
+CreateSelectionMenu(playerid)
+{
+	gBackgroundTextDrawId[playerid] = CreatePlayerBackgroundTextDraw(playerid, DIALOG_BASE_X, DIALOG_BASE_Y + 20.0, DIALOG_WIDTH, DIALOG_HEIGHT);
+	gHeaderTextDrawId[playerid] = CreatePlayerHeaderTextDraw(playerid, DIALOG_BASE_X, DIALOG_BASE_Y, HEADER_TEXT);
+    gCurrentPageTextDrawId[playerid] = CreateCurrentPageTextDraw(playerid, DIALOG_WIDTH - 50.0, DIALOG_BASE_Y + 15.0);
+    gNextButtonTextDrawId[playerid] = CreatePlayerDialogButton(playerid, DIALOG_WIDTH - 30.0, DIALOG_BASE_Y+DIALOG_HEIGHT+100.0, 50.0, 16.0, NEXT_TEXT);
+    gPrevButtonTextDrawId[playerid] = CreatePlayerDialogButton(playerid, DIALOG_WIDTH - 90.0, DIALOG_BASE_Y+DIALOG_HEIGHT+100.0, 50.0, 16.0, PREV_TEXT);
+
+    ShowPlayerModelPreviews(playerid);
+    UpdatePageTextDraw(playerid);
+}
+
+//------------------------------------------------
+
+DestroySelectionMenu(playerid)
+{
+	DestroyPlayerModelPreviews(playerid);
+
+	PlayerTextDrawDestroy(playerid, gHeaderTextDrawId[playerid]);
+	PlayerTextDrawDestroy(playerid, gBackgroundTextDrawId[playerid]);
+	PlayerTextDrawDestroy(playerid, gCurrentPageTextDrawId[playerid]);
+	PlayerTextDrawDestroy(playerid, gNextButtonTextDrawId[playerid]);
+	PlayerTextDrawDestroy(playerid, gPrevButtonTextDrawId[playerid]);
+
+	gHeaderTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
+    gBackgroundTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
+    gCurrentPageTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
+    gNextButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
+    gPrevButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
+}
+
+//------------------------------------------------
+
+SpawnVehicle_InfrontOfPlayer(playerid, vehiclemodel, color1, color2)
+{
+	new Float:x,Float:y,Float:z;
+	new Float:facing;
+	new Float:distance;
+
+    GetPlayerPos(playerid, x, y, z);
+    GetPlayerFacingAngle(playerid, facing);
+
+    new Float:size_x,Float:size_y,Float:size_z;
+	GetVehicleModelInfo(vehiclemodel, VEHICLE_MODEL_INFO_SIZE, size_x, size_y, size_z);
+
+	distance = size_x + 0.5;
+
+  	x += (distance * floatsin(-facing, degrees));
+    y += (distance * floatcos(-facing, degrees));
+
+	facing += 90.0;
+	if(facing > 360.0) facing -= 360.0;
+
+	return CreateVehicle(vehiclemodel, x, y, z + (size_z * 0.25), facing, color1, color2, -1);
+}
+
+//------------------------------------------------
+
+SpawnObject_InfrontOfPlayer(playerid, model)
+{
+	new Float:x,Float:y,Float:z;
+	new Float:facing;
+	new Float:distance;
+
+    GetPlayerPos(playerid, x, y, z);
+    GetPlayerFacingAngle(playerid, facing);
+    
+    distance = 5.0;
+
+  	x += (distance * floatsin(-facing, degrees));
+    y += (distance * floatcos(-facing, degrees));
+
+	facing += 90.0;
+	if(facing > 360.0) facing -= 360.0;
+
+	return CreateObject(model, x, y, z, 0.0, 0.0, 0.0, 300.0);
+}
+
+//------------------------------------------------
+
+HandlePlayerItemSelection(playerid, selecteditem)
+{
+    if(gSelectionItemsTag[playerid][selecteditem] >= 0 && gSelectionItemsTag[playerid][selecteditem] < 319) {
+        SetPlayerSkin(playerid, gSelectionItemsTag[playerid][selecteditem]);
+		return;
+	}
+	if(gSelectionItemsTag[playerid][selecteditem] >= 400 && gSelectionItemsTag[playerid][selecteditem] < 612) {
+		// In this case we're spawning a vehicle for them
+    	SpawnVehicle_InfrontOfPlayer(playerid, gSelectionItemsTag[playerid][selecteditem], -1, -1);
+    	return;
+	}
+    if(gSelectionItemsTag[playerid][selecteditem] > 615) {
+    	new objectid = SpawnObject_InfrontOfPlayer(playerid, gSelectionItemsTag[playerid][selecteditem]);
+    	EditObject(playerid, objectid);
+    	return;
+	}
+}
+
+//------------------------------------------------
+
+public OnPlayerConnect(playerid)
+{
+	// Init all of the textdraw related globals
+    gHeaderTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
+    gBackgroundTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
+    gCurrentPageTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
+    gNextButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
+    gPrevButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
+    
+	new x=0;
+	while(x != SELECTION_ITEMS) {
+        gSelectionItems[playerid][x] = PlayerText:INVALID_TEXT_DRAW;
+        x++;
+	}
+
+	gItemAt[playerid] = 0;
+	
+	return 1; // Allow other scripts to keep processing OnPlayerConnect
+}
+
+//-------------------------------------------
+// Even though only Player* textdraws are used in this script,
+// OnPlayerClickTextDraw is still required to handle ESC
+
+public OnPlayerClickTextDraw(playerid, Text:clickedid)
+{
+   	if(GetPVarInt(playerid, "ospawner_active") == 0) return 0;
+
+	// Handle: They cancelled (with ESC)
+	if(clickedid == Text:INVALID_TEXT_DRAW) {
+        DestroySelectionMenu(playerid);
+        SetPVarInt(playerid, "ospawner_active", 0);
+        PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
+        return 1;
+	}
+	
+	return 0;
+}
+
+//------------------------------------------------
+
+public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
+{
+	if(GetPVarInt(playerid, "ospawner_active") == 0) return 0;
+
+	new curpage = GetPVarInt(playerid, "ospawner_page");
+	
+	// Handle: next button
+	if(playertextid == gNextButtonTextDrawId[playerid]) {
+	    if(curpage < (GetNumberOfPages() - 1)) {
+	        SetPVarInt(playerid, "ospawner_page", curpage + 1);
+	        ShowPlayerModelPreviews(playerid);
+         	UpdatePageTextDraw(playerid);
+         	PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
+		} else {
+		    PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
+		}
+		return 1;
+	}
+	
+	// Handle: previous button
+	if(playertextid == gPrevButtonTextDrawId[playerid]) {
+	    if(curpage > 0) {
+	    	SetPVarInt(playerid, "ospawner_page", curpage - 1);
+	    	ShowPlayerModelPreviews(playerid);
+	    	UpdatePageTextDraw(playerid);
+	    	PlayerPlaySound(playerid, 1084, 0.0, 0.0, 0.0);
+		} else {
+		    PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
+		}
+		return 1;
+	}
+	
+	// Search in the array of textdraws used for the items
+	new x=0;
+	while(x != SELECTION_ITEMS) {
+	    if(playertextid == gSelectionItems[playerid][x]) {
+	        DestroySelectionMenu(playerid);
+	        CancelSelectTextDraw(playerid);
+	        HandlePlayerItemSelection(playerid, x);
+	        PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
+        	SetPVarInt(playerid, "ospawner_active", 0);
+        	return 1;
+		}
+		x++;
+	}
+	
+	return 0;
+}
+
+//------------------------------------------------
+
+public OnPlayerCommandText(playerid, cmdtext[])
+{
+	new cmd[256+1];
+	new	idx;
+
+	if(!IsPlayerAdmin(playerid)) return 0;
+	
+	cmd = strtok(cmdtext, idx);
+
+	if(strcmp("/ospawner", cmd, true) == 0)
+	{
+	    // If there was a previously created selection menu, destroy it
+		DestroySelectionMenu(playerid);
+
+	    SetPVarInt(playerid, "ospawner_active", 1);
+	    SetPVarInt(playerid, "ospawner_page", 1);
+	    
+	    CreateSelectionMenu(playerid);
+	    SelectTextDraw(playerid, 0xACCBF1FF);
+	    return 1;
+	}
+	
+	return 0;
+}
+//------------------------------------------------

BIN
samp03/filterscripts/pirateship.amx


+ 177 - 0
samp03/filterscripts/pirateship.pwn

@@ -0,0 +1,177 @@
+//
+// Used for testing interpolated rotations with MoveObject
+// Also used to test AttachObjectToObject
+// A pirate ship goes around and visits some route points
+//
+// SA-MP 0.3d and above
+//
+// - Kye 2011
+//
+
+#include <a_samp>
+#include "../include/gl_common.inc" // for PlaySoundForPlayersInRange()
+
+#define NUM_SHIP_ROUTE_POINTS   25
+#define SHIP_OBJECT_ID          8493 // pirate ship
+#define SHIP_SKULL_ATTACH       3524
+#define SHIP_RAILS_ATTACH       9159
+#define SHIP_LINES_ATTACH       8981
+#define SHIP_MOVE_SPEED         10.0
+#define SHIP_DRAW_DISTANCE      800.0
+
+// Pirate ship route points (position/rotation)
+new Float:gShipRoutePoints[NUM_SHIP_ROUTE_POINTS][6] = {
+{-2389.81, 1434.84, 13.51,   0.00, 0.0, -87.36},
+{-2319.54, 1450.75, 13.91,   1.0, 0.0, -71.70},
+{-2245.87, 1479.80, 14.21,   5.00, 0.0, -63.84},
+{-2168.53, 1535.31, 15.73,   1.00, 0.0, -50.76},
+{-2096.43, 1634.13, 15.73,   0.00, 0.0, -36.60},
+{-2036.11, 1734.57, 15.27,   -1.00, 0.0, -20.22},
+{-2018.20, 1841.61, 15.27,   -5.00, 0.00, -4.86},
+{-2043.70, 1936.95, 15.27,   -1.00, 0.00, 25.32},
+{-2104.07, 2023.54, 12.78,   0.00, 0.00, 49.14},
+{-2206.40, 2065.64, 16.76,   1.00, 0.00, 73.32},
+{-2298.24, 2070.62, 14.59,   5.00, 0.00, 91.62},
+{-2412.24, 2067.55, 14.59,   1.00, 0.00, 91.62},
+{-2528.28, 2057.22, 12.30,   0.00, 0.00, 99.78},
+{-2626.64, 2032.14, 17.04,   -1.00, 0.00, 106.98},
+{-2727.60, 1996.95, 15.36,   -5.00, 0.00, 106.98},
+{-2808.88, 1953.08, 15.36,   -1.00, 0.00, 121.62},
+{-2886.19, 1876.19, 16.68,   0.00, 0.00, 143.16},
+{-2911.09, 1782.21, 16.68,   -1.00, 0.00, 173.34},
+{-2898.36, 1678.83, 14.88,   0.00, 0.00, 194.58},
+{-2851.29, 1601.46, 16.13,   1.00, 0.00, 228.42},
+{-2760.72, 1557.18, 16.13,   0.00, 0.00, 257.52},
+{-2665.41, 1535.22, 16.13,   -1.00, 0.00, 257.52},
+{-2589.06, 1509.08, 16.13,   0.00, 0.00, 239.88},
+{-2517.74, 1463.39, 14.59,   1.00, 0.00, 243.78},
+{-2456.12, 1441.11, 14.59,   0.00, 0.00, 254.76}
+};
+
+
+new gShipCurrentPoint = 1; // current route point the ship is at
+
+// SA-MP objects
+new gMainShipObjectId;
+new gShipSkullAttachment[4];
+new gShipRailsAttachment;
+new gShipLinesAttachment;
+
+forward StartMovingTimer();
+
+//-------------------------------------------------
+
+public StartMovingTimer()
+{
+	MoveObject(gMainShipObjectId,gShipRoutePoints[gShipCurrentPoint][0],
+	                           gShipRoutePoints[gShipCurrentPoint][1],
+							   gShipRoutePoints[gShipCurrentPoint][2],
+							   SHIP_MOVE_SPEED / 4.0, // bit slower for the first point
+							   gShipRoutePoints[gShipCurrentPoint][3],
+							   gShipRoutePoints[gShipCurrentPoint][4],
+							   gShipRoutePoints[gShipCurrentPoint][5]);
+}
+
+//-------------------------------------------------
+
+public OnFilterScriptInit()
+{
+	gMainShipObjectId = CreateObject(SHIP_OBJECT_ID, gShipRoutePoints[0][0], gShipRoutePoints[0][1], gShipRoutePoints[0][2],
+									gShipRoutePoints[0][3], gShipRoutePoints[0][4], gShipRoutePoints[0][5], SHIP_DRAW_DISTANCE);
+
+	gShipSkullAttachment[0] = CreateObject(SHIP_SKULL_ATTACH, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, SHIP_DRAW_DISTANCE);
+	AttachObjectToObject(gShipSkullAttachment[0], gMainShipObjectId, 4.11, -5.53, -9.78, 0.0, 0.0, 90.0);
+
+	gShipSkullAttachment[1] = CreateObject(SHIP_SKULL_ATTACH, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, SHIP_DRAW_DISTANCE);
+	AttachObjectToObject(gShipSkullAttachment[1], gMainShipObjectId, -4.11, -5.53, -9.78, 0.0, 0.0, -90.0);
+	
+	gShipSkullAttachment[2] = CreateObject(SHIP_SKULL_ATTACH, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, SHIP_DRAW_DISTANCE);
+	AttachObjectToObject(gShipSkullAttachment[2], gMainShipObjectId, -4.3378, -15.2887, -9.7863, 0.0, 0.0, -90.0);
+	
+	gShipSkullAttachment[3] = CreateObject(SHIP_SKULL_ATTACH, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, SHIP_DRAW_DISTANCE);
+	AttachObjectToObject(gShipSkullAttachment[3], gMainShipObjectId, 4.3378, -15.2887, -9.7863, 0.0, 0.0, 90.0);
+	
+	gShipRailsAttachment = CreateObject(SHIP_RAILS_ATTACH, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, SHIP_DRAW_DISTANCE);
+	AttachObjectToObject(gShipRailsAttachment, gMainShipObjectId, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
+	
+	gShipLinesAttachment = CreateObject(SHIP_LINES_ATTACH, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, SHIP_DRAW_DISTANCE);
+	AttachObjectToObject(gShipLinesAttachment, gMainShipObjectId, -0.5468, -6.1875, -0.4375, 0.0, 0.0, 0.0);
+
+	SetTimer("StartMovingTimer",30*1000,0); // pause at route 0 for 30 seconds
+
+	return 1;
+}
+
+//-------------------------------------------------
+
+public OnFilterScriptExit()
+{
+	new x=0;
+	
+    DestroyObject(gMainShipObjectId);
+
+	x=0;
+	while(x != 4) {
+	    DestroyObject(gShipSkullAttachment[x]);
+		x++;
+	}
+	
+	DestroyObject(gShipRailsAttachment);
+	DestroyObject(gShipLinesAttachment);
+	
+	return 1;
+}
+
+//-------------------------------------------------
+
+public OnObjectMoved(objectid)
+{
+    if(objectid != gMainShipObjectId) return 0;
+    
+	if(gShipCurrentPoint > 0 && !(gShipCurrentPoint % 3)) {
+	    // play some seagulls audio every 3 points
+		PlaySoundForPlayersInRange(6200, 100.0, gShipRoutePoints[gShipCurrentPoint][0],
+						gShipRoutePoints[gShipCurrentPoint][1],
+						gShipRoutePoints[gShipCurrentPoint][2]);
+	}
+						
+    gShipCurrentPoint++;
+    
+    if(gShipCurrentPoint == NUM_SHIP_ROUTE_POINTS) {
+		gShipCurrentPoint = 0;
+
+   		MoveObject(gMainShipObjectId,gShipRoutePoints[gShipCurrentPoint][0],
+	                           gShipRoutePoints[gShipCurrentPoint][1],
+							   gShipRoutePoints[gShipCurrentPoint][2],
+							   SHIP_MOVE_SPEED / 4.0, // slower for the last route
+							   gShipRoutePoints[gShipCurrentPoint][3],
+							   gShipRoutePoints[gShipCurrentPoint][4],
+							   gShipRoutePoints[gShipCurrentPoint][5]);
+		return 1;
+	}
+	
+ 	if(gShipCurrentPoint == 1) {
+	    // Before heading to the first route we should wait a bit
+	    SetTimer("StartMovingTimer",30*1000,0); // pause at route 0 for 30 seconds
+		return 1;
+	}
+	
+	/*
+    new tempdebug[256+1];
+    format(tempdebug,256,"The ship is at route: %d", gShipCurrentPoint);
+    SendClientMessageToAll(0xFFFFFFFF,tempdebug);*/
+    
+    MoveObject(gMainShipObjectId,gShipRoutePoints[gShipCurrentPoint][0],
+	                           gShipRoutePoints[gShipCurrentPoint][1],
+							   gShipRoutePoints[gShipCurrentPoint][2],
+							   SHIP_MOVE_SPEED,
+							   gShipRoutePoints[gShipCurrentPoint][3],
+							   gShipRoutePoints[gShipCurrentPoint][4],
+							   gShipRoutePoints[gShipCurrentPoint][5]);
+
+ 	return 1;
+}
+
+//-------------------------------------------------
+
+

BIN
samp03/filterscripts/pnetstats.amx


+ 78 - 0
samp03/filterscripts/pnetstats.pwn

@@ -0,0 +1,78 @@
+//
+// Admin player netstats display
+//
+
+#include <a_samp>
+#include "../include/gl_common.inc"
+
+#define ADMINFS_MESSAGE_COLOR 0xFF444499
+#define ADMIN_NETSTATS_DIALOGID 12898
+
+new gNetStatsPlayerId = INVALID_PLAYER_ID;
+new gNetStatsDisplayId = INVALID_PLAYER_ID;
+
+new gNetStatsTimerId = 0;
+
+forward NetStatsDisplay();
+
+//------------------------------------------------
+
+public OnFilterScriptInit()
+{
+	print("\n--Admin Netstats FS loaded.\n");
+	return 1;
+}
+
+//------------------------------------------------
+
+public NetStatsDisplay()
+{
+	new netstats_str[2048+1];
+	GetPlayerNetworkStats(gNetStatsDisplayId, netstats_str, 2048);
+	ShowPlayerDialog(gNetStatsPlayerId, ADMIN_NETSTATS_DIALOGID, DIALOG_STYLE_MSGBOX, "Player NetStats", netstats_str, "Ok", "");
+}
+
+//------------------------------------------------
+
+public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
+{
+    if(!IsPlayerAdmin(playerid)) return 0; // this is an admin only script
+
+	if(dialogid == ADMIN_NETSTATS_DIALOGID) {
+		KillTimer(gNetStatsTimerId);
+		gNetStatsPlayerId = INVALID_PLAYER_ID;
+		return 1;
+	}
+	
+	return  0;
+}
+
+//------------------------------------------------
+
+public OnPlayerCommandText(playerid, cmdtext[])
+{
+	new cmd[256+1];
+	new	idx;
+
+	if(!IsPlayerAdmin(playerid)) return 0;
+	
+	cmd = strtok(cmdtext, idx);
+	
+    // netstats command
+	if(strcmp("/pnetstats", cmd, true) == 0)
+	{
+	    new tmp[128];
+		tmp = strtok(cmdtext, idx);
+		if(!strlen(tmp)) { return 1; }
+		 
+	    gNetStatsPlayerId = playerid;
+	    gNetStatsDisplayId = strval(tmp);
+	    
+	    NetStatsDisplay();
+	    gNetStatsTimerId = SetTimer("NetStatsDisplay", 3000, true); // this will refresh the display every 3 seconds
+	    return 1;
+	}
+	
+	return 0;
+}
+//------------------------------------------------

BIN
samp03/filterscripts/pnetstats2.amx


+ 99 - 0
samp03/filterscripts/pnetstats2.pwn

@@ -0,0 +1,99 @@
+//
+// Admin player netstats display
+// Using NetStats_* functions.
+//
+// -Rcon login admin then:
+// /pnetstats2 (playerid)
+//
+
+#include <a_samp>
+#include "../include/gl_common.inc"
+
+#define ADMINFS_MESSAGE_COLOR 0xFF444499
+#define ADMIN_NETSTATS_DIALOGID 12899
+
+new gNetStatsPlayerId = INVALID_PLAYER_ID;
+new gNetStatsDisplayId = INVALID_PLAYER_ID;
+
+new gNetStatsTimerId = 0;
+
+forward NetStatsDisplay();
+
+//------------------------------------------------
+
+public OnFilterScriptInit()
+{
+	print("\n--Admin Netstats FS loaded.\n");
+	return 1;
+}
+
+//------------------------------------------------
+
+BuildPlayerNetstatString(playerid, ret_str[], ret_str_len)
+{
+	new szPlayerIpPort[64+1];
+	NetStats_GetIpPort(playerid, szPlayerIpPort, 64);
+	
+	format(ret_str, ret_str_len, "IP_Port: %s\nConnected Time (ms): %d\nConnection Status: %d\nPacket Loss: %.2f\nMessages Recv: %d\nMessages Sent: %d\nMessages/sec: %d",
+	        szPlayerIpPort,
+	        NetStats_GetConnectedTime(playerid),
+	        NetStats_ConnectionStatus(playerid),
+	        NetStats_PacketLossPercent(playerid),
+	        NetStats_MessagesReceived(playerid),
+	        NetStats_MessagesSent(playerid),
+	        NetStats_MessagesRecvPerSecond(playerid));
+}
+
+//------------------------------------------------
+
+public NetStatsDisplay()
+{
+	new netstats_str[1024+1];
+	BuildPlayerNetstatString(gNetStatsDisplayId, netstats_str, 1024);
+	ShowPlayerDialog(gNetStatsPlayerId, ADMIN_NETSTATS_DIALOGID, DIALOG_STYLE_MSGBOX, "Player NetStats", netstats_str, "Ok", "");
+}
+
+//------------------------------------------------
+
+public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
+{
+    if(!IsPlayerAdmin(playerid)) return 0; // this is an admin only script
+
+	if(dialogid == ADMIN_NETSTATS_DIALOGID) {
+		KillTimer(gNetStatsTimerId);
+		gNetStatsPlayerId = INVALID_PLAYER_ID;
+		return 1;
+	}
+	
+	return  0;
+}
+
+//------------------------------------------------
+
+public OnPlayerCommandText(playerid, cmdtext[])
+{
+	new cmd[256+1];
+	new	idx;
+
+	if(!IsPlayerAdmin(playerid)) return 0;
+	
+	cmd = strtok(cmdtext, idx);
+	
+    // netstats command
+	if(strcmp("/pnetstats2", cmd, true) == 0)
+	{
+	    new tmp[128];
+		tmp = strtok(cmdtext, idx);
+		if(!strlen(tmp)) { return 1; }
+		 
+	    gNetStatsPlayerId = playerid;
+	    gNetStatsDisplayId = strval(tmp);
+	    
+	    NetStatsDisplay();
+	    gNetStatsTimerId = SetTimer("NetStatsDisplay", 3000, true); // this will refresh the display every 3 seconds
+	    return 1;
+	}
+	
+	return 0;
+}
+//------------------------------------------------

BIN
samp03/filterscripts/safe_animated.amx


+ 212 - 0
samp03/filterscripts/safe_animated.pwn

@@ -0,0 +1,212 @@
+// -----------------------------------------------------------------------------
+// Example Filterscript for the new Safe with Door
+// -----------------------------------------------
+// By Matite in January 2015
+//
+// v1.0.1
+// * Inital release in RC1
+//
+// v1.0.2
+// * Changed the Z offset in the MoveObject parameters to fix an issue with
+//   movement caused by rounding on some PCs
+//
+// This script removes the existing safe in Madd Dogg's Mansion then creates the
+// new safe and door object in its place. You can then use commands to open and
+// close the safe door.
+//
+// You can use the following commands:
+// * /safe = Teleports the player to the safe in Madd Dogg's Mansion
+// * /openopen = Makes the safe door open
+// * /closesafe = Makes the safe door close
+//
+// Warning...
+// This script uses a total of 2 objects
+// -----------------------------------------------------------------------------
+
+
+// -----------------------------------------------------------------------------
+// Includes
+// --------
+
+// SA-MP include
+#include <a_samp>
+
+
+// ------------------------------------------------------------------------------
+// Defines
+// -------
+
+// Safe door status
+#define SAFE_DOOR_OPEN      (1)
+#define SAFE_DOOR_CLOSED    (0)
+
+
+// ------------------------------------------------------------------------------
+// Variables
+// ---------
+
+// Stores the created object number of the safe
+new SafeObject;
+
+// Stores the created object number of the safe door
+new SafeDoorObject;
+
+// Tracks the status of the safe door (ie whether it is open or closed)
+new SafeDoorStatus = SAFE_DOOR_CLOSED;
+
+
+// ------------------------------------------------------------------------------
+// Callbacks
+// ---------
+
+
+public OnPlayerCommandText(playerid, cmdtext[])
+{
+	// Check command text
+	if (strcmp("/safe", cmdtext, true, 5) == 0)
+	{
+	    // Set the interior
+		SetPlayerInterior(playerid, 5);
+
+		// Set player position and facing angle
+		SetPlayerPos(playerid, 1230.61, -808.15, 1084.1);
+		SetPlayerFacingAngle(playerid, 0);
+
+		// Fix camera position after teleporting
+		SetCameraBehindPlayer(playerid);
+
+		// Send a gametext message to the player
+		GameTextForPlayer(playerid, "~b~~h~Safe And Door!", 3000, 3);
+
+	    // Exit here
+	    return 1;
+	}
+	else if (strcmp("/opensafe", cmdtext, true, 9) == 0)
+	{
+	    // Check if the safe door is already open
+	    if (SafeDoorStatus == SAFE_DOOR_OPEN)
+	    {
+	        // Send a gametext message to the player and exit here
+			GameTextForPlayer(playerid, "~r~~h~Safe Door~n~~r~~h~Already Open!", 3000, 3);
+	        return 1;
+	    }
+	
+	    // Animate the safe door opening (the small Z offset is required)
+	    MoveObject(SafeDoorObject, 1230.225708, -806.648803, 1083.5 + 0.01, 0.005, 0, 0, 280);
+	
+	    // Set the safe door status
+	    SafeDoorStatus = SAFE_DOOR_OPEN;
+	    
+	    // Send a gametext message to the player
+		GameTextForPlayer(playerid, "~b~~h~Safe Door Opened!", 3000, 3);
+
+	    // Exit here
+	    return 1;
+	}
+	else if (strcmp("/closesafe", cmdtext, true, 10) == 0)
+	{
+	    // Check if the safe door is already open
+	    if (SafeDoorStatus == SAFE_DOOR_CLOSED)
+	    {
+	        // Send a gametext message to the player and exit here
+			GameTextForPlayer(playerid, "~r~~h~Safe Door~n~~r~~h~Already Closed!", 3000, 3);
+	        return 1;
+	    }
+
+	    // Animate the safe door closing (the small Z offset is required)
+	    MoveObject(SafeDoorObject, 1230.225708, -806.648803, 1083.5 - 0.01, 0.005, 0, 0, 0);
+
+	    // Set the safe door status
+	    SafeDoorStatus = SAFE_DOOR_CLOSED;
+
+	    // Send a gametext message to the player
+		GameTextForPlayer(playerid, "~b~~h~Safe Door Closed!", 3000, 3);
+
+	    // Exit here
+	    return 1;
+	}
+
+	// Exit here (return 0 as the command was not handled in this filterscript)
+	return 0;
+}
+
+public OnFilterScriptInit()
+{
+    // Display information in the Server Console
+	print("\n");
+	print("  |---------------------------------------------------");
+	print("  |--- Safe and Door Filterscript by Matite");
+    print("  |--  Script v1.02");
+    print("  |--  13th February 2015");
+	print("  |---------------------------------------------------");
+
+	// Create the safe object
+    SafeObject = CreateObject(19618, 1230.646118, -806.418823, 1083.5, 0, 0, 0);
+    
+    // Display information in the Server Console
+    print("  |--  Safe object created");
+    
+    // Create the safe door object
+    SafeDoorObject = CreateObject(19619, 1230.225708, -806.648803, 1083.5 - 0.01, 0, 0, 0);
+
+    // Display information in the Server Console
+    print("  |--  Safe door object created");
+    print("  |---------------------------------------------------");
+    
+    // Loop
+    for (new i = 0; i < MAX_PLAYERS; i++)
+    {
+        // Check if the player is connected and is not a NPC
+        if (IsPlayerConnected(i) && !IsPlayerNPC(i))
+        {
+            // Remove default GTASA safe object in Madd Dogg's Mansion office
+            // (we do this now incase the filterscipt was loaded after the player joined)
+			RemoveBuildingForPlayer(i, 2332, 1230.646118, -806.418823, 1083.5, 10.0);
+        }
+    }
+
+    // Exit here
+	return 1;
+}
+
+public OnFilterScriptExit()
+{
+	// Check for valid object
+	if (IsValidObject(SafeObject))
+	{
+		// Destroy the safe object
+		DestroyObject(SafeObject);
+
+		// Display information in the Server Console
+		print("  |---------------------------------------------------");
+    	print("  |--  Safe object destroyed");
+    }
+    
+    // Check for valid object
+	if (IsValidObject(SafeDoorObject))
+	{
+		// Destroy the safe door object
+		DestroyObject(SafeDoorObject);
+
+		// Display information in the Server Console
+    	print("  |--  Safe door object destroyed");
+    }
+
+    // Display information in the Server Console
+	print("  |---------------------------------------------------");
+	print("  |--  Safe and Door Filterscript Unloaded");
+	print("  |---------------------------------------------------");
+
+	// Exit here
+	return 1;
+}
+
+public OnPlayerConnect(playerid)
+{
+    // Remove default GTASA safe object in Madd Dogg's Mansion office
+	RemoveBuildingForPlayer(playerid, 2332, 1230.646118, -806.418823, 1083.5, 10.0);
+
+	// Exit here
+	return 1;
+}
+

BIN
samp03/filterscripts/samp_anims.amx


+ 65 - 0
samp03/filterscripts/samp_anims.pwn

@@ -0,0 +1,65 @@
+// -----------------------------------------------------------------------------
+// Example Filterscript for the new SA-MP Animations
+// -------------------------------------------------
+// By Matite in January 2015
+//
+// This script tests the new SA-MP animation/pose inside the SAMP.ifp file.
+//
+// -----------------------------------------------------------------------------
+
+
+// -----------------------------------------------------------------------------
+// Includes
+// --------
+
+// SA-MP include
+#include <a_samp>
+
+// ------------------------------------------------------------------------------
+// Callbacks
+// ---------
+
+public OnPlayerCommandText(playerid, cmdtext[])
+{
+	// Check command text
+	if (strcmp("/fish", cmdtext, true, 5) == 0)
+	{
+		// Apply animation
+		ApplyAnimation(playerid, "SAMP", "FishingIdle", 4.1, 0, 1, 1, 1, 1);
+
+		// Send a gametext message to the player
+		GameTextForPlayer(playerid, "~b~~h~Fishing Animation Pose!", 3000, 3);
+
+	    // Exit here
+	    return 1;
+	}
+
+	// Exit here (return 0 as the command was not handled in this filterscript)
+	return 0;
+}
+
+public OnFilterScriptInit()
+{
+    // Display information in the Server Console
+	print("\n");
+	print("  |---------------------------------------------------");
+	print("  |--- SA-MP Animations Filterscript by Matite");
+    print("  |--  Script v1.01");
+    print("  |--  12th January 2015");
+	print("  |---------------------------------------------------");
+
+    // Exit here
+	return 1;
+}
+
+public OnFilterScriptExit()
+{
+	// Display information in the Server Console
+	print("  |---------------------------------------------------");
+	print("  |--  SA-MP Animations Filterscript Unloaded");
+	print("  |---------------------------------------------------");
+
+	// Exit here
+	return 1;
+}
+

BIN
samp03/filterscripts/sf_building1.amx


+ 176 - 0
samp03/filterscripts/sf_building1.pwn

@@ -0,0 +1,176 @@
+// -----------------------------------------------------------------------------
+// Example Filterscript for the new SF Building 1
+// ----------------------------------------------
+// By Matite in February 2015
+//
+//
+// This script creates the new SF Building 1 object and removes the existing
+// GTASA building object.
+//
+// Warning...
+// This script uses a total of:
+// * 3 objects = 1 for the replacement land object, 1 for the outside object
+//   and 1 for the inside object
+// * Enables the /sfb command to teleport the player to the SF Building 1
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+
+
+// -----------------------------------------------------------------------------
+// Includes
+// --------
+
+// SA-MP include
+#include <a_samp>
+
+
+// -----------------------------------------------------------------------------
+// Defines
+// -------
+
+// Used for messages sent to the player
+#define COLOR_MESSAGE_YELLOW        0xFFDD00AA
+
+
+// -----------------------------------------------------------------------------
+// Variables
+// ---------
+
+// Stores the created object numbers of the replacement building objects so
+// they can be destroyed when the filterscript is unloaded
+new SFBuilding1Object1; // Land object
+new SFBuilding1Object2; // Outside object
+new SFBuilding1Object3; // Inside object
+
+
+// -----------------------------------------------------------------------------
+// Callbacks
+// ---------
+
+public OnPlayerCommandText(playerid, cmdtext[])
+{
+	// Check command text
+	if (strcmp("/sfb", cmdtext, true, 4) == 0)
+	{
+	    // Set the interior
+		SetPlayerInterior(playerid, 0);
+
+		// Set player position and facing angle
+		SetPlayerPos(playerid, -2706.56, 870.91 + random(2), 71.86);
+		SetPlayerFacingAngle(playerid, 180);
+
+		// Fix camera position after teleporting
+		SetCameraBehindPlayer(playerid);
+
+		// Send a gametext message to the player
+		GameTextForPlayer(playerid, "~b~~h~SF Building!", 3000, 3);
+
+	    // Exit here
+	    return 1;
+	}
+
+	// Exit here (return 0 as the command was not handled in this filterscript)
+	return 0;
+}
+
+public OnFilterScriptInit()
+{
+    // Display information in the Server Console
+	print("\n");
+	print("  |---------------------------------------------------");
+	print("  |--- SF Building 1 Filterscript");
+    print("  |--  Script v1.01");
+    print("  |--  10th February 2015");
+	print("  |---------------------------------------------------");
+
+	// Create the SF Building 1 Land object
+    SFBuilding1Object1 = CreateObject(19600, -2719.02, 861.211, 72.1562, 0, 0, 0);
+
+    // Display information in the Server Console
+    print("  |--  SF Building 1 Land object created");
+
+    // Create the SF Building 1 Outside object
+    SFBuilding1Object2 = CreateObject(19598, -2719.02, 861.211, 72.1562, 0, 0, 0);
+
+    // Display information in the Server Console
+    print("  |--  SF Building 1 Outside object created");
+    
+    // Create the SF Building 1 Inside object
+    SFBuilding1Object3 = CreateObject(19599, -2719.02, 861.211, 72.1562, 0, 0, 0);
+
+    // Display information in the Server Console
+    print("  |--  SF Building 1 Inside object created");
+	print("  |---------------------------------------------------");
+
+	// Loop
+    for (new i = 0; i < MAX_PLAYERS; i++)
+    {
+        // Check if the player is connected and not a NPC
+        if (IsPlayerConnected(i) && !IsPlayerNPC(i))
+        {
+            // Remove default GTASA SF Building and LOD map objects for the player
+            // (so any player currently ingame does not have to rejoin for them
+			//  to be removed when this filterscript is loaded)
+			RemoveBuildingForPlayer(i, 9510, -2719.02, 861.211, 72.1562, 250.0); // Building
+			RemoveBuildingForPlayer(i, 9671, -2719.02, 861.211, 72.1562, 250.0); // LOD
+			RemoveBuildingForPlayer(i, 715, -2693.24, 852.60, 71.74, 8.0); // Tree (casts a shadow inside)
+        }
+    }
+
+	// Exit here
+	return 1;
+}
+
+public OnFilterScriptExit()
+{
+    // Check for valid object
+	if (IsValidObject(SFBuilding1Object1))
+	{
+		// Destroy the SF Building 1 Land object
+		DestroyObject(SFBuilding1Object1);
+
+		// Display information in the Server Console
+		print("  |---------------------------------------------------");
+    	print("  |--  SF Building 1 Land object destroyed");
+    }
+    
+    // Check for valid object
+	if (IsValidObject(SFBuilding1Object2))
+	{
+		// Destroy the SF Building 1 Outside object
+		DestroyObject(SFBuilding1Object2);
+
+		// Display information in the Server Console
+    	print("  |--  SF Building 1 Outside object destroyed");
+    }
+    
+    // Check for valid object
+	if (IsValidObject(SFBuilding1Object3))
+	{
+		// Destroy the SF Building 1 Inside object
+		DestroyObject(SFBuilding1Object3);
+
+		// Display information in the Server Console
+    	print("  |--  SF Building 1 Inside object destroyed");
+    }
+
+   	// Display information in the Server Console
+	print("  |---------------------------------------------------");
+	print("  |--  SF Building 1 Filterscript Unloaded");
+	print("  |---------------------------------------------------");
+
+    // Exit here
+	return 1;
+}
+
+public OnPlayerConnect(playerid)
+{
+    // Remove default GTASA SF Building and LOD map objects for the player
+	RemoveBuildingForPlayer(playerid, 9510, -2719.02, 861.211, 72.1562, 250.0); // Building
+	RemoveBuildingForPlayer(playerid, 9671, -2719.02, 861.211, 72.1562, 250.0); // LOD
+	RemoveBuildingForPlayer(playerid, 715, -2693.24, 852.60, 71.74, 8.0); // Tree (casts a shadow inside)
+
+	// Exit here (return 1 so this callback is handled in other scripts too)
+	return 1;
+}
+

BIN
samp03/filterscripts/sf_zombotech.amx


+ 664 - 0
samp03/filterscripts/sf_zombotech.pwn

@@ -0,0 +1,664 @@
+// -----------------------------------------------------------------------------
+// Example Filterscript for the new SF ZomboTech Building and Lab with Elevator
+// ----------------------------------------------------------------------------
+// Original elevator code by Zamaroht in 2010
+//
+// Updated by Kye in 2011
+// * Added a sound effect for the elevator starting/stopping
+//
+// Edited by Matite in January 2015
+// * Added code to remove the existing building, add the new buildings and
+//   adapted the elevator code so it works in this new building
+//
+//
+// This script creates the new SF ZomboTech building and the lab objects, removes
+// the existing GTASA building object and creates an elevator that can be used to
+// travel between the building foyer and the lab.
+//
+// You can un-comment the OnPlayerCommandText callback below to enable a simple
+// teleport command (/zl) that teleports you to the ZomboTech Lab elevator.
+//
+// Warning...
+// This script uses a total of:
+// * 9 objects = 1 for the elevator, 2 for the elevator doors, 4 for the elevator
+//   floor doors and 2 for the buildings (replacement ZomboTech building and lab)
+// * 3 3D Text Labels = 2 on the floors and 1 in the elevator
+// * 1 dialog (for the elevator)
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+
+
+// -----------------------------------------------------------------------------
+// Includes
+// --------
+
+// SA-MP include
+#include <a_samp>
+
+// For PlaySoundForPlayersInRange()
+#include "../include/gl_common.inc"
+
+// -----------------------------------------------------------------------------
+// Defines
+// -------
+
+// Movement speed of the elevator
+#define ELEVATOR_SPEED      (5.0)
+
+// Movement speed of the doors
+#define DOORS_SPEED         (5.0)
+
+// Time in ms that the elevator will wait in each floor before continuing with the queue...
+// be sure to give enough time for doors to open
+#define ELEVATOR_WAIT_TIME  (5000)
+
+// Dialog ID for the ZomboTech building elevator dialog
+#define DIALOG_ID           (875)
+
+// Position defines
+#define X_DOOR_CLOSED       (-1951.603027)
+#define X_DOOR_L_OPENED     X_DOOR_CLOSED + 1.6
+#define X_DOOR_R_OPENED     X_DOOR_CLOSED - 1.6
+#define GROUND_Z_COORD      (47.451492)
+#define X_ELEVATOR_POS      (-1951.603027)
+#define Y_ELEVATOR_POS      (636.418334)
+
+// Elevator state defines
+#define ELEVATOR_STATE_IDLE     (0)
+#define ELEVATOR_STATE_WAITING  (1)
+#define ELEVATOR_STATE_MOVING   (2)
+
+// Invalid floor define
+#define INVALID_FLOOR           (-1)
+
+// -----------------------------------------------------------------------------
+// Constants
+// ---------
+
+// Elevator floor names for the 3D text labels
+static FloorNames[2][] =
+{
+	"Ground Floor",
+	"ZomboTech Lab"
+};
+
+// Elevator floor Z heights
+static Float:FloorZOffsets[2] =
+{
+    0.0,		// Ground Floor
+    -21.628007	// ZomboTech Lab   -21.598007
+};
+
+// -----------------------------------------------------------------------------
+// Variables
+// ---------
+
+// Stores the created object numbers of the replacement building and the lab so
+// they can be destroyed when the filterscript is unloaded
+new SFZomboTechBuildingObject;
+new SFZomboTechLabObject;
+
+// Stores the created object numbers of the elevator, the elevator doors and
+// the elevator floor doors so they can be destroyed when the filterscript
+// is unloaded
+new Obj_Elevator, Obj_ElevatorDoors[2],	Obj_FloorDoors[2][2];
+
+// Stores a reference to the 3D text labels used on each floor and inside the
+// elevator itself so they can be detroyed when the filterscript is unloaded
+new Text3D:Label_Elevator, Text3D:Label_Floors[2];
+
+// Stores the current state of the elevator (ie ELEVATOR_STATE_IDLE,
+// ELEVATOR_STATE_WAITING or ELEVATOR_STATE_MOVING)
+new ElevatorState;
+
+// Stores the current floor the elevator is on or heading to... if the value is
+// ELEVATOR_STATE_IDLE or ELEVATOR_STATE_WAITING this is the current floor. If
+// the value is ELEVATOR_STATE_MOVING then it is the floor it's moving to
+new	ElevatorFloor;
+
+// Stores the elevator queue for each floor
+new ElevatorQueue[2];
+
+// Stores who requested the floor for the elevator queue...
+// FloorRequestedBy[floor_id] = playerid;  (stores who requested which floor)
+new	FloorRequestedBy[2];
+
+// Used for a timer that makes the elevator move faster after players start
+// surfing the object
+new ElevatorBoostTimer;
+
+// -----------------------------------------------------------------------------
+// Function Forwards
+// -----------------
+
+// Public:
+forward CallElevator(playerid, floorid);    // You can use INVALID_PLAYER_ID too.
+forward ShowElevatorDialog(playerid);
+
+// Private:
+forward Elevator_Initialize();
+forward Elevator_Destroy();
+
+forward Elevator_OpenDoors();
+forward Elevator_CloseDoors();
+forward Floor_OpenDoors(floorid);
+forward Floor_CloseDoors(floorid);
+
+forward Elevator_MoveToFloor(floorid);
+forward Elevator_Boost(floorid);        	// Increases the elevator speed until it reaches 'floorid'.
+forward Elevator_TurnToIdle();
+
+forward ReadNextFloorInQueue();
+forward RemoveFirstQueueFloor();
+forward AddFloorToQueue(floorid);
+forward IsFloorInQueue(floorid);
+forward ResetElevatorQueue();
+
+forward DidPlayerRequestElevator(playerid);
+
+forward Float:GetElevatorZCoordForFloor(floorid);
+forward Float:GetDoorsZCoordForFloor(floorid);
+
+// -----------------------------------------------------------------------------
+// Callbacks
+// ---------
+
+// Un-comment the OnPlayerCommandText callback below (remove the "/*" and the "*/")
+// to enable a simple teleport command (/zl) which teleports the player to
+// the Zombotech Lab elevator.
+
+/*
+public OnPlayerCommandText(playerid, cmdtext[])
+{
+	// Check command text
+	if (strcmp("/zl", cmdtext, true, 3) == 0)
+	{
+	    // Set the interior
+		SetPlayerInterior(playerid, 0);
+
+		// Set player position and facing angle
+		SetPlayerPos(playerid, -1957.11 + random(2), 644.36 + random(2), 47.6);
+		SetPlayerFacingAngle(playerid, 215);
+
+		// Fix camera position after teleporting
+		SetCameraBehindPlayer(playerid);
+
+		// Send a gametext message to the player
+		GameTextForPlayer(playerid, "~b~~h~ZomboTech Lab!", 3000, 3);
+
+	    // Exit here
+	    return 1;
+	}
+
+	// Exit here (return 0 as the command was not handled in this filterscript)
+	return 0;
+}
+*/
+
+public OnFilterScriptInit()
+{
+    // Display information in the Server Console
+	print("\n");
+	print("  |---------------------------------------------------");
+	print("  |--- SF ZomboTech Filterscript");
+    print("  |--  Script v1.01");
+    print("  |--  12th January 2015");
+	print("  |---------------------------------------------------");
+
+	// Create the SF ZomboTech Building object
+    SFZomboTechBuildingObject = CreateObject(19593, -1951.687500, 660.023986, 89.507797, 0, 0, 0);
+
+    // Create the SF ZomboTech Lab object
+    SFZomboTechLabObject = CreateObject(19594, -1951.687500, 660.023986, 29.507797, 0, 0, 0);
+
+    // Display information in the Server Console
+    print("  |--  SF ZomboTech Building and Lab objects created");
+
+    // Reset the elevator queue
+	ResetElevatorQueue();
+	
+	// Create the elevator object, the elevator doors and the floor doors
+	Elevator_Initialize();
+	
+	// Display information in the Server Console
+    print("  |--  SF ZomboTech Building Elevator created");
+    print("  |---------------------------------------------------");
+    
+    // Loop
+    for (new i = 0; i < MAX_PLAYERS; i++)
+    {
+        // Check if the player is connected and not a NPC
+        if (IsPlayerConnected(i) && !IsPlayerNPC(i))
+        {
+            // Remove default GTASA SF ZomboTech map object and LOD for the player
+            // (so any player currently ingame does not have to rejoin for them
+			//  to be removed when this filterscript is loaded)
+			RemoveBuildingForPlayer(i, 10027, -1951.687500, 660.023986, 89.507797, 250.0); // Building
+			RemoveBuildingForPlayer(i, 9939, -1951.687500, 660.023986, 89.507797, 250.0); // LOD
+        }
+    }
+
+	// Exit here
+	return 1;
+}
+
+public OnFilterScriptExit()
+{
+    // Check for valid object
+	if (IsValidObject(SFZomboTechBuildingObject))
+	{
+		// Destroy the SF ZombotTech Building object
+		DestroyObject(SFZomboTechBuildingObject);
+
+		// Display information in the Server Console
+		print("  |---------------------------------------------------");
+    	print("  |--  SF ZomboTech Building object destroyed");
+    }
+
+    // Check for valid object
+	if (IsValidObject(SFZomboTechLabObject))
+	{
+		// Destroy the SF ZomboTech Lab object
+		DestroyObject(SFZomboTechLabObject);
+
+		// Display information in the Server Console
+    	print("  |--  SF ZomboTech Lab object destroyed");
+    }
+    
+    // Destroy the elevator, the elevator doors and the elevator floor doors
+	Elevator_Destroy();
+	
+	// Display information in the Server Console
+    print("  |--  SF ZomboTech Building Elevator destroyed");
+    print("  |---------------------------------------------------");
+    	
+    // Exit here
+	return 1;
+}
+
+public OnPlayerConnect(playerid)
+{
+    // Remove default GTASA SF ZomboTech map object and LOD for the player
+	RemoveBuildingForPlayer(playerid, 10027, -1951.687500, 660.023986, 89.507797, 250.0); // Building
+	RemoveBuildingForPlayer(playerid, 9939, -1951.687500, 660.023986, 89.507797, 250.0); // LOD
+
+	// Exit here
+	return 1;
+}
+
+public OnObjectMoved(objectid)
+{
+    new Float:x, Float:y, Float:z;
+	for(new i; i < sizeof(Obj_FloorDoors); i ++)
+	{
+		if(objectid == Obj_FloorDoors[i][0])
+		{
+		    GetObjectPos(Obj_FloorDoors[i][0], x, y, z);
+
+            // A floor door has shut so move the elevator to the next floor in the queue
+		    if (x == X_DOOR_CLOSED)
+		    {
+				Elevator_MoveToFloor(ElevatorQueue[0]);
+				RemoveFirstQueueFloor();
+			}
+		}
+	}
+	
+	if(objectid == Obj_Elevator)   // The elevator reached the specified floor.
+	{
+	    KillTimer(ElevatorBoostTimer);  // Kills the timer, in case the elevator reached the floor before boost.
+
+	    FloorRequestedBy[ElevatorFloor] = INVALID_PLAYER_ID;
+
+	    Elevator_OpenDoors();
+	    Floor_OpenDoors(ElevatorFloor);
+
+	    GetObjectPos(Obj_Elevator, x, y, z);
+	    Label_Elevator	= Create3DTextLabel("{CCCCCC}Press '{FFFFFF}~k~~CONVERSATION_YES~{CCCCCC}' to use elevator", 0xCCCCCCAA, X_ELEVATOR_POS - 1.8, Y_ELEVATOR_POS + 1.6, z - 0.6, 4.0, 0, 1);
+
+	    ElevatorState 	= ELEVATOR_STATE_WAITING;
+	    SetTimer("Elevator_TurnToIdle", ELEVATOR_WAIT_TIME, 0);
+	}
+
+	return 1;
+}
+
+public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
+{
+    if(dialogid == DIALOG_ID)
+    {
+        if(!response)
+            return 0;
+
+        if(FloorRequestedBy[listitem] != INVALID_PLAYER_ID || IsFloorInQueue(listitem))
+            GameTextForPlayer(playerid, "~r~The floor is already in the queue", 3500, 4);
+		else if(DidPlayerRequestElevator(playerid))
+		    GameTextForPlayer(playerid, "~r~You already requested the elevator", 3500, 4);
+		else
+	        CallElevator(playerid, listitem);
+
+		return 1;
+    }
+
+	return 0;
+}
+
+public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
+{
+	if(!IsPlayerInAnyVehicle(playerid) && (newkeys & KEY_YES))
+	{
+	    new Float:pos[3];
+	    GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
+
+		//printf("X = %0.2f | Y = %0.2f | Z = %0.2f", pos[0], pos[1], pos[2]);
+	    
+	    if(pos[1] < (Y_ELEVATOR_POS + 1.8) && pos[1] > (Y_ELEVATOR_POS - 1.8) && pos[0] < (X_ELEVATOR_POS + 1.8) && pos[0] > (X_ELEVATOR_POS - 1.8))    // He is using the elevator button
+	        ShowElevatorDialog(playerid);
+		else    // Is the player using a floor button?
+		{
+		    if(pos[1] > (Y_ELEVATOR_POS + 1.81) && pos[1] < (Y_ELEVATOR_POS + 3.8) && pos[0] < (X_ELEVATOR_POS - 1.81) && pos[0] > (X_ELEVATOR_POS - 3.8))
+		    {
+		        // Create variable
+		        new i = 0;
+		        
+		        // Check for ground floor
+		        if (pos[2] > (GROUND_Z_COORD - 2) && pos[2] < (GROUND_Z_COORD + 2))
+		        {
+		            i = 0;
+		        }
+		        else i = 1;
+		        
+		        //printf("Floor = %d | State = %d | i = %d", ElevatorFloor, ElevatorState, i);
+		        
+		        // Check if the elevator is not moving and already on the requested floor
+		        if (ElevatorState != ELEVATOR_STATE_MOVING && ElevatorFloor == i)
+		        {
+		            // Display a gametext message and exit here
+		            GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~r~ZomboTech Elevator~n~~r~Is Already On~n~~r~This Floor!", 3000, 5);
+		            return 1;
+		        }
+				
+			    //printf("Call Elevator to Floor %i", i);
+			    
+				CallElevator(playerid, i);
+				GameTextForPlayer(playerid, "~r~Elevator called", 3500, 4);
+		    }
+		}
+	}
+
+	return 1;
+}
+
+// ------------------------ Functions ------------------------
+stock Elevator_Initialize()
+{
+	// Initializes the elevator.
+
+	Obj_Elevator 			= CreateObject(18755, X_ELEVATOR_POS, Y_ELEVATOR_POS, GROUND_Z_COORD, 0.000000, 0.000000, 270.000000);
+	Obj_ElevatorDoors[0] 	= CreateObject(18757, X_ELEVATOR_POS, Y_ELEVATOR_POS, GROUND_Z_COORD, 0.000000, 0.000000, 270.000000);
+	Obj_ElevatorDoors[1] 	= CreateObject(18756, X_ELEVATOR_POS, Y_ELEVATOR_POS, GROUND_Z_COORD, 0.000000, 0.000000, 270.000000);
+
+	Label_Elevator          = Create3DTextLabel("{CCCCCC}Press '{FFFFFF}~k~~CONVERSATION_YES~{CCCCCC}' to use elevator", 0xCCCCCCAA, X_ELEVATOR_POS - 1.8, Y_ELEVATOR_POS + 1.6, GROUND_Z_COORD - 0.6, 4.0, 0, 1);
+
+	new string[128],
+		Float:z;
+
+	for(new i; i < sizeof(Obj_FloorDoors); i ++)
+	{
+	    Obj_FloorDoors[i][0] 	= CreateObject(18757, X_ELEVATOR_POS, Y_ELEVATOR_POS + 0.245, GetDoorsZCoordForFloor(i), 0.000000, 0.000000, 270.000000);
+		Obj_FloorDoors[i][1] 	= CreateObject(18756, X_ELEVATOR_POS, Y_ELEVATOR_POS + 0.245, GetDoorsZCoordForFloor(i), 0.000000, 0.000000, 270.000000);
+
+		format(string, sizeof(string), "{CCCCCC}[%s]\n{CCCCCC}Press '{FFFFFF}~k~~CONVERSATION_YES~{CCCCCC}' to call", FloorNames[i]);
+
+		if(i == 0)
+		    z = 47.460277;
+		else
+		    z = 25.820274;
+
+		Label_Floors[i]         = Create3DTextLabel(string, 0xCCCCCCAA, X_ELEVATOR_POS - 2.5, Y_ELEVATOR_POS + 2.5, z - 0.2, 10.5, 0, 1);
+	}
+
+	// Open ground floor doors:
+	Floor_OpenDoors(0);
+	Elevator_OpenDoors();
+
+	return 1;
+}
+
+stock Elevator_Destroy()
+{
+	// Destroys the elevator and the elevator doors
+	DestroyObject(Obj_Elevator);
+	DestroyObject(Obj_ElevatorDoors[0]);
+	DestroyObject(Obj_ElevatorDoors[1]);
+	
+	// Destroy the 3D text label inside the elevator
+	Delete3DTextLabel(Label_Elevator);
+
+	// Loop
+	for(new i; i < sizeof(Obj_FloorDoors); i ++)
+	{
+	    // Destroy the elevator floor doors and the floor 3D text labels
+	    DestroyObject(Obj_FloorDoors[i][0]);
+		DestroyObject(Obj_FloorDoors[i][1]);
+		Delete3DTextLabel(Label_Floors[i]);
+	}
+
+	return 1;
+}
+
+stock Elevator_OpenDoors()
+{
+	// Opens the elevator's doors.
+
+	new Float:x, Float:y, Float:z;
+
+	GetObjectPos(Obj_ElevatorDoors[0], x, y, z);
+	MoveObject(Obj_ElevatorDoors[0], X_DOOR_L_OPENED, y, z, DOORS_SPEED);
+	MoveObject(Obj_ElevatorDoors[1], X_DOOR_R_OPENED, y, z, DOORS_SPEED);
+
+	return 1;
+}
+
+stock Elevator_CloseDoors()
+{
+    // Closes the elevator's doors.
+
+    if(ElevatorState == ELEVATOR_STATE_MOVING)
+	    return 0;
+
+    new Float:x, Float:y, Float:z;
+
+	GetObjectPos(Obj_ElevatorDoors[0], x, y, z);
+	MoveObject(Obj_ElevatorDoors[0], X_DOOR_CLOSED, y, z, DOORS_SPEED);
+	MoveObject(Obj_ElevatorDoors[1], X_DOOR_CLOSED, y, z, DOORS_SPEED);
+
+	return 1;
+}
+
+stock Floor_OpenDoors(floorid)
+{
+    // Opens the doors at the specified floor.
+
+    MoveObject(Obj_FloorDoors[floorid][0], X_DOOR_L_OPENED, Y_ELEVATOR_POS + 0.245, GetDoorsZCoordForFloor(floorid), DOORS_SPEED);
+	MoveObject(Obj_FloorDoors[floorid][1], X_DOOR_R_OPENED, Y_ELEVATOR_POS + 0.245, GetDoorsZCoordForFloor(floorid), DOORS_SPEED);
+	
+	PlaySoundForPlayersInRange(6401, 50.0, X_ELEVATOR_POS, Y_ELEVATOR_POS, GetDoorsZCoordForFloor(floorid) + 5.0);
+
+	return 1;
+}
+
+stock Floor_CloseDoors(floorid)
+{
+    // Closes the doors at the specified floor.
+
+    MoveObject(Obj_FloorDoors[floorid][0], X_ELEVATOR_POS, Y_ELEVATOR_POS + 0.245, GetDoorsZCoordForFloor(floorid), DOORS_SPEED);
+	MoveObject(Obj_FloorDoors[floorid][1], X_ELEVATOR_POS, Y_ELEVATOR_POS + 0.245, GetDoorsZCoordForFloor(floorid), DOORS_SPEED);
+	
+	PlaySoundForPlayersInRange(6401, 50.0, X_ELEVATOR_POS, Y_ELEVATOR_POS, GetDoorsZCoordForFloor(floorid) + 5.0);
+
+	return 1;
+}
+
+stock Elevator_MoveToFloor(floorid)
+{
+	// Moves the elevator to specified floor (doors are meant to be already closed).
+
+	ElevatorState = ELEVATOR_STATE_MOVING;
+	ElevatorFloor = floorid;
+
+	// Move the elevator slowly, to give time to clients to sync the object surfing. Then, boost it up:
+	MoveObject(Obj_Elevator, X_ELEVATOR_POS, Y_ELEVATOR_POS, GetElevatorZCoordForFloor(floorid), 0.25);
+    MoveObject(Obj_ElevatorDoors[0], X_ELEVATOR_POS, Y_ELEVATOR_POS, GetDoorsZCoordForFloor(floorid), 0.25);
+    MoveObject(Obj_ElevatorDoors[1], X_ELEVATOR_POS, Y_ELEVATOR_POS, GetDoorsZCoordForFloor(floorid), 0.25);
+    Delete3DTextLabel(Label_Elevator);
+
+	ElevatorBoostTimer = SetTimerEx("Elevator_Boost", 2000, 0, "i", floorid);
+
+	return 1;
+}
+
+public Elevator_Boost(floorid)
+{
+	// Increases the elevator's speed until it reaches 'floorid'
+	StopObject(Obj_Elevator);
+	StopObject(Obj_ElevatorDoors[0]);
+	StopObject(Obj_ElevatorDoors[1]);
+	
+	MoveObject(Obj_Elevator, X_ELEVATOR_POS, Y_ELEVATOR_POS, GetElevatorZCoordForFloor(floorid), ELEVATOR_SPEED);
+    MoveObject(Obj_ElevatorDoors[0], X_ELEVATOR_POS, Y_ELEVATOR_POS, GetDoorsZCoordForFloor(floorid), ELEVATOR_SPEED);
+    MoveObject(Obj_ElevatorDoors[1], X_ELEVATOR_POS, Y_ELEVATOR_POS, GetDoorsZCoordForFloor(floorid), ELEVATOR_SPEED);
+
+	return 1;
+}
+
+public Elevator_TurnToIdle()
+{
+	ElevatorState = ELEVATOR_STATE_IDLE;
+	ReadNextFloorInQueue();
+
+	return 1;
+}
+
+stock RemoveFirstQueueFloor()
+{
+	// Removes the data in ElevatorQueue[0], and reorders the queue accordingly.
+
+	for(new i; i < sizeof(ElevatorQueue) - 1; i ++)
+	    ElevatorQueue[i] = ElevatorQueue[i + 1];
+
+	ElevatorQueue[sizeof(ElevatorQueue) - 1] = INVALID_FLOOR;
+
+	return 1;
+}
+
+stock AddFloorToQueue(floorid)
+{
+ 	// Adds 'floorid' at the end of the queue.
+
+	// Scan for the first empty space:
+	new slot = -1;
+	for(new i; i < sizeof(ElevatorQueue); i ++)
+	{
+	    if(ElevatorQueue[i] == INVALID_FLOOR)
+	    {
+	        slot = i;
+	        break;
+	    }
+	}
+
+	if(slot != -1)
+	{
+	    ElevatorQueue[slot] = floorid;
+
+     	// If needed, move the elevator.
+	    if(ElevatorState == ELEVATOR_STATE_IDLE)
+	        ReadNextFloorInQueue();
+
+	    return 1;
+	}
+
+	return 0;
+}
+
+stock ResetElevatorQueue()
+{
+	// Resets the queue.
+
+	for(new i; i < sizeof(ElevatorQueue); i ++)
+	{
+	    ElevatorQueue[i] 	= INVALID_FLOOR;
+	    FloorRequestedBy[i] = INVALID_PLAYER_ID;
+	}
+
+	return 1;
+}
+
+stock IsFloorInQueue(floorid)
+{
+	// Checks if the specified floor is currently part of the queue.
+
+	for(new i; i < sizeof(ElevatorQueue); i ++)
+	    if(ElevatorQueue[i] == floorid)
+	        return 1;
+
+	return 0;
+}
+
+stock ReadNextFloorInQueue()
+{
+	// Reads the next floor in the queue, closes doors, and goes to it.
+
+	if(ElevatorState != ELEVATOR_STATE_IDLE || ElevatorQueue[0] == INVALID_FLOOR)
+	    return 0;
+
+	Elevator_CloseDoors();
+	Floor_CloseDoors(ElevatorFloor);
+
+	return 1;
+}
+
+stock DidPlayerRequestElevator(playerid)
+{
+	for(new i; i < sizeof(FloorRequestedBy); i ++)
+	    if(FloorRequestedBy[i] == playerid)
+	        return 1;
+
+	return 0;
+}
+
+stock ShowElevatorDialog(playerid)
+{
+	new string[512];
+	for(new i; i < sizeof(ElevatorQueue); i ++)
+	{
+	    if(FloorRequestedBy[i] != INVALID_PLAYER_ID)
+	        strcat(string, "{FF0000}");
+
+	    strcat(string, FloorNames[i]);
+	    strcat(string, "\n");
+	}
+
+	ShowPlayerDialog(playerid, DIALOG_ID, DIALOG_STYLE_LIST, "ZomboTech Elevator...", string, "Accept", "Cancel");
+
+	return 1;
+}
+
+stock CallElevator(playerid, floorid)
+{
+	// Calls the elevator (also used with the elevator dialog).
+
+	if(FloorRequestedBy[floorid] != INVALID_PLAYER_ID || IsFloorInQueue(floorid))
+	    return 0;
+
+	FloorRequestedBy[floorid] = playerid;
+	AddFloorToQueue(floorid);
+
+	return 1;
+}
+
+stock Float:GetElevatorZCoordForFloor(floorid)
+    return (GROUND_Z_COORD + FloorZOffsets[floorid]);
+
+stock Float:GetDoorsZCoordForFloor(floorid)
+	return (GROUND_Z_COORD + FloorZOffsets[floorid]);

BIN
samp03/filterscripts/skinchanger.amx


+ 366 - 0
samp03/filterscripts/skinchanger.pwn

@@ -0,0 +1,366 @@
+//
+// Admin player skin changer using previews. For SA-MP 0.3x and above.
+// - Kye 2012
+//
+
+#include <a_samp>
+#include "../include/gl_common.inc"
+
+#define TOTAL_ITEMS         312
+#define SELECTION_ITEMS 	21
+#define ITEMS_PER_LINE  	7
+
+#define HEADER_TEXT "Skins"
+#define NEXT_TEXT   "Next"
+#define PREV_TEXT   "Prev"
+
+#define DIALOG_BASE_X   	75.0
+#define DIALOG_BASE_Y   	130.0
+#define DIALOG_WIDTH    	550.0
+#define DIALOG_HEIGHT   	180.0
+#define SPRITE_DIM_X    	60.0
+#define SPRITE_DIM_Y    	70.0
+
+new gTotalItems = TOTAL_ITEMS;
+new PlayerText:gCurrentPageTextDrawId[MAX_PLAYERS];
+new PlayerText:gHeaderTextDrawId[MAX_PLAYERS];
+new PlayerText:gBackgroundTextDrawId[MAX_PLAYERS];
+new PlayerText:gNextButtonTextDrawId[MAX_PLAYERS];
+new PlayerText:gPrevButtonTextDrawId[MAX_PLAYERS];
+new PlayerText:gSelectionItems[MAX_PLAYERS][SELECTION_ITEMS];
+new gSelectionItemsTag[MAX_PLAYERS][SELECTION_ITEMS];
+new gItemAt[MAX_PLAYERS];
+
+new gItemList[TOTAL_ITEMS] = {
+0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,
+50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,
+97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,
+132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,
+167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,
+202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,
+237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,
+272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,
+300,301,302,303,304,305,306,307,308,309,310,311
+};
+
+//------------------------------------------------
+
+public OnFilterScriptInit()
+{
+	print("\n--Admin Player Skin Changer Loaded\n");
+	return 1;
+}
+
+//------------------------------------------------
+
+GetNumberOfPages()
+{
+	if((gTotalItems >= SELECTION_ITEMS) && (gTotalItems % SELECTION_ITEMS) == 0)
+	{
+		return (gTotalItems / SELECTION_ITEMS);
+	}
+	else return (gTotalItems / SELECTION_ITEMS) + 1;
+}
+
+//------------------------------------------------
+
+PlayerText:CreateCurrentPageTextDraw(playerid, Float:Xpos, Float:Ypos)
+{
+	new PlayerText:txtInit;
+   	txtInit = CreatePlayerTextDraw(playerid, Xpos, Ypos, "0/0");
+   	PlayerTextDrawUseBox(playerid, txtInit, 0);
+	PlayerTextDrawLetterSize(playerid, txtInit, 0.4, 1.1);
+	PlayerTextDrawFont(playerid, txtInit, 1);
+	PlayerTextDrawSetShadow(playerid, txtInit, 0);
+    PlayerTextDrawSetOutline(playerid, txtInit, 1);
+    PlayerTextDrawColor(playerid, txtInit, 0xACCBF1FF);
+    PlayerTextDrawShow(playerid, txtInit);
+    return txtInit;
+}
+
+//------------------------------------------------
+// Creates a button textdraw and returns the textdraw ID.
+
+PlayerText:CreatePlayerDialogButton(playerid, Float:Xpos, Float:Ypos, Float:Width, Float:Height, button_text[])
+{
+ 	new PlayerText:txtInit;
+   	txtInit = CreatePlayerTextDraw(playerid, Xpos, Ypos, button_text);
+   	PlayerTextDrawUseBox(playerid, txtInit, 1);
+   	PlayerTextDrawBoxColor(playerid, txtInit, 0x000000FF);
+   	PlayerTextDrawBackgroundColor(playerid, txtInit, 0x000000FF);
+	PlayerTextDrawLetterSize(playerid, txtInit, 0.4, 1.1);
+	PlayerTextDrawFont(playerid, txtInit, 1);
+	PlayerTextDrawSetShadow(playerid, txtInit, 0); // no shadow
+    PlayerTextDrawSetOutline(playerid, txtInit, 0);
+    PlayerTextDrawColor(playerid, txtInit, 0x4A5A6BFF);
+    PlayerTextDrawSetSelectable(playerid, txtInit, 1);
+    PlayerTextDrawAlignment(playerid, txtInit, 2);
+    PlayerTextDrawTextSize(playerid, txtInit, Height, Width); // The width and height are reversed for centering.. something the game does <g>
+    PlayerTextDrawShow(playerid, txtInit);
+    return txtInit;
+}
+ 
+//------------------------------------------------
+
+PlayerText:CreatePlayerHeaderTextDraw(playerid, Float:Xpos, Float:Ypos, header_text[])
+{
+	new PlayerText:txtInit;
+   	txtInit = CreatePlayerTextDraw(playerid, Xpos, Ypos, header_text);
+   	PlayerTextDrawUseBox(playerid, txtInit, 0);
+	PlayerTextDrawLetterSize(playerid, txtInit, 1.25, 3.0);
+	PlayerTextDrawFont(playerid, txtInit, 0);
+	PlayerTextDrawSetShadow(playerid, txtInit, 0);
+    PlayerTextDrawSetOutline(playerid, txtInit, 1);
+    PlayerTextDrawColor(playerid, txtInit, 0xACCBF1FF);
+    PlayerTextDrawShow(playerid, txtInit);
+    return txtInit;
+}
+
+//------------------------------------------------
+
+PlayerText:CreatePlayerBackgroundTextDraw(playerid, Float:Xpos, Float:Ypos, Float:Width, Float:Height)
+{
+	new PlayerText:txtBackground = CreatePlayerTextDraw(playerid, Xpos, Ypos,
+	"                                            ~n~"); // enough space for everyone
+    PlayerTextDrawUseBox(playerid, txtBackground, 1);
+    PlayerTextDrawBoxColor(playerid, txtBackground, 0x4A5A6BBB);
+	PlayerTextDrawLetterSize(playerid, txtBackground, 5.0, 5.0);
+	PlayerTextDrawFont(playerid, txtBackground, 0);
+	PlayerTextDrawSetShadow(playerid, txtBackground, 0);
+    PlayerTextDrawSetOutline(playerid, txtBackground, 0);
+    PlayerTextDrawColor(playerid, txtBackground,0x000000FF);
+    PlayerTextDrawTextSize(playerid, txtBackground, Width, Height);
+   	PlayerTextDrawBackgroundColor(playerid, txtBackground, 0x4A5A6BBB);
+    PlayerTextDrawShow(playerid, txtBackground);
+    return txtBackground;
+}
+
+//------------------------------------------------
+// Creates a model preview sprite
+
+PlayerText:CreateModelPreviewTextDraw(playerid, modelindex, Float:Xpos, Float:Ypos, Float:width, Float:height)
+{
+    new PlayerText:txtPlayerSprite = CreatePlayerTextDraw(playerid, Xpos, Ypos, ""); // it has to be set with SetText later
+    PlayerTextDrawFont(playerid, txtPlayerSprite, TEXT_DRAW_FONT_MODEL_PREVIEW);
+    PlayerTextDrawColor(playerid, txtPlayerSprite, 0xFFFFFFFF);
+    PlayerTextDrawBackgroundColor(playerid, txtPlayerSprite, 0x88888899);
+    PlayerTextDrawTextSize(playerid, txtPlayerSprite, width, height); // Text size is the Width:Height
+    PlayerTextDrawSetPreviewModel(playerid, txtPlayerSprite, modelindex);
+    PlayerTextDrawSetSelectable(playerid, txtPlayerSprite, 1);
+    PlayerTextDrawShow(playerid,txtPlayerSprite);
+    return txtPlayerSprite;
+}
+
+//------------------------------------------------
+
+DestroyPlayerModelPreviews(playerid)
+{
+	new x=0;
+	while(x != SELECTION_ITEMS) {
+	    if(gSelectionItems[playerid][x] != PlayerText:INVALID_TEXT_DRAW) {
+			PlayerTextDrawDestroy(playerid, gSelectionItems[playerid][x]);
+			gSelectionItems[playerid][x] = PlayerText:INVALID_TEXT_DRAW;
+		}
+		x++;
+	}
+}
+
+//------------------------------------------------
+
+ShowPlayerModelPreviews(playerid)
+{
+    new x=0;
+	new Float:BaseX = DIALOG_BASE_X;
+	new Float:BaseY = DIALOG_BASE_Y - (SPRITE_DIM_Y * 0.33); // down a bit
+	new linetracker = 0;
+	
+	new itemat = GetPVarInt(playerid, "skinc_page") * SELECTION_ITEMS;
+	
+	// Destroy any previous ones created
+	DestroyPlayerModelPreviews(playerid);
+
+	while(x != SELECTION_ITEMS && itemat < gTotalItems) {
+	    if(linetracker == 0) {
+	        BaseX = DIALOG_BASE_X + 25.0; // in a bit from the box
+	        BaseY += SPRITE_DIM_Y + 1.0; // move on the Y for the next line
+		}
+  		gSelectionItems[playerid][x] = CreateModelPreviewTextDraw(playerid, gItemList[itemat], BaseX, BaseY, SPRITE_DIM_X, SPRITE_DIM_Y);
+  		gSelectionItemsTag[playerid][x] = gItemList[itemat];
+		BaseX += SPRITE_DIM_X + 1.0; // move on the X for the next sprite
+		linetracker++;
+		if(linetracker == ITEMS_PER_LINE) linetracker = 0;
+		itemat++;
+		x++;
+	}
+}
+
+//------------------------------------------------
+
+UpdatePageTextDraw(playerid)
+{
+	new PageText[64+1];
+	format(PageText, 64, "%d/%d", GetPVarInt(playerid,"skinc_page") + 1, GetNumberOfPages());
+	PlayerTextDrawSetString(playerid, gCurrentPageTextDrawId[playerid], PageText);
+}
+
+//------------------------------------------------
+
+CreateSelectionMenu(playerid)
+{
+    gBackgroundTextDrawId[playerid] = CreatePlayerBackgroundTextDraw(playerid, DIALOG_BASE_X, DIALOG_BASE_Y + 20.0, DIALOG_WIDTH, DIALOG_HEIGHT);
+    gHeaderTextDrawId[playerid] = CreatePlayerHeaderTextDraw(playerid, DIALOG_BASE_X, DIALOG_BASE_Y, HEADER_TEXT);
+    gCurrentPageTextDrawId[playerid] = CreateCurrentPageTextDraw(playerid, DIALOG_WIDTH - 30.0, DIALOG_BASE_Y + 15.0);
+    gNextButtonTextDrawId[playerid] = CreatePlayerDialogButton(playerid, DIALOG_WIDTH - 30.0, DIALOG_BASE_Y+DIALOG_HEIGHT+100.0, 50.0, 16.0, NEXT_TEXT);
+    gPrevButtonTextDrawId[playerid] = CreatePlayerDialogButton(playerid, DIALOG_WIDTH - 90.0, DIALOG_BASE_Y+DIALOG_HEIGHT+100.0, 50.0, 16.0, PREV_TEXT);
+
+    ShowPlayerModelPreviews(playerid);
+    UpdatePageTextDraw(playerid);
+}
+
+//------------------------------------------------
+
+DestroySelectionMenu(playerid)
+{
+	DestroyPlayerModelPreviews(playerid);
+
+	PlayerTextDrawDestroy(playerid, gHeaderTextDrawId[playerid]);
+	PlayerTextDrawDestroy(playerid, gBackgroundTextDrawId[playerid]);
+	PlayerTextDrawDestroy(playerid, gCurrentPageTextDrawId[playerid]);
+	PlayerTextDrawDestroy(playerid, gNextButtonTextDrawId[playerid]);
+	PlayerTextDrawDestroy(playerid, gPrevButtonTextDrawId[playerid]);
+
+	gHeaderTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
+    gBackgroundTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
+    gCurrentPageTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
+    gNextButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
+    gPrevButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
+}
+
+//------------------------------------------------
+
+HandlePlayerItemSelection(playerid, selecteditem)
+{
+	// In this case we change the player's skin
+  	if(gSelectionItemsTag[playerid][selecteditem] >= 0 && gSelectionItemsTag[playerid][selecteditem] < 319) {
+        SetPlayerSkin(playerid, gSelectionItemsTag[playerid][selecteditem]);
+		return;
+	}
+}
+
+//------------------------------------------------
+
+public OnPlayerConnect(playerid)
+{
+	// Init all of the textdraw related globals
+    gHeaderTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
+    gBackgroundTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
+    gCurrentPageTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
+    gNextButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
+    gPrevButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
+    
+    for(new x=0; x < SELECTION_ITEMS; x++) {
+        gSelectionItems[playerid][x] = PlayerText:INVALID_TEXT_DRAW;
+	}
+	
+	gItemAt[playerid] = 0;
+	
+	return 1; // Allow other scripts to keep processing OnPlayerConnect
+}
+
+//-------------------------------------------
+// Even though only Player* textdraws are used in this script,
+// OnPlayerClickTextDraw is still required to handle ESC
+
+public OnPlayerClickTextDraw(playerid, Text:clickedid)
+{
+   	if(GetPVarInt(playerid, "skinc_active") == 0) return 0;
+
+	// Handle: They cancelled (with ESC)
+	if(clickedid == Text:INVALID_TEXT_DRAW) {
+        DestroySelectionMenu(playerid);
+        SetPVarInt(playerid, "skinc_active", 0);
+        PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
+        return 1;
+	}
+	
+	return 0;
+}
+
+//------------------------------------------------
+
+public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
+{
+	if(GetPVarInt(playerid, "skinc_active") == 0) return 0;
+
+	new curpage = GetPVarInt(playerid, "skinc_page");
+	
+	// Handle: next button
+	if(playertextid == gNextButtonTextDrawId[playerid]) {
+	    if(curpage < (GetNumberOfPages() - 1)) {
+	        SetPVarInt(playerid, "skinc_page", curpage + 1);
+	        ShowPlayerModelPreviews(playerid);
+         	UpdatePageTextDraw(playerid);
+         	PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
+		} else {
+		    PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
+		}
+		return 1;
+	}
+	
+	// Handle: previous button
+	if(playertextid == gPrevButtonTextDrawId[playerid]) {
+	    if(curpage > 0) {
+	    	SetPVarInt(playerid, "skinc_page", curpage - 1);
+	    	ShowPlayerModelPreviews(playerid);
+	    	UpdatePageTextDraw(playerid);
+	    	PlayerPlaySound(playerid, 1084, 0.0, 0.0, 0.0);
+		} else {
+		    PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
+		}
+		return 1;
+	}
+	
+	// Search in the array of textdraws used for the items
+	new x=0;
+	while(x != SELECTION_ITEMS) {
+	    if(playertextid == gSelectionItems[playerid][x]) {
+	        HandlePlayerItemSelection(playerid, x);
+	        PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
+	        DestroySelectionMenu(playerid);
+	        CancelSelectTextDraw(playerid);
+        	SetPVarInt(playerid, "skinc_active", 0);
+        	return 1;
+		}
+		x++;
+	}
+	
+	return 0;
+}
+
+//------------------------------------------------
+
+public OnPlayerCommandText(playerid, cmdtext[])
+{
+	new cmd[256+1];
+	new	idx;
+
+	if(!IsPlayerAdmin(playerid)) return 0;
+	
+	cmd = strtok(cmdtext, idx);
+
+	if(strcmp("/skinchange", cmd, true) == 0)
+	{
+ 		// If there was a previously created selection menu, destroy it
+		DestroySelectionMenu(playerid);
+		
+	    SetPVarInt(playerid, "skinc_active", 1);
+	    //SetPVarInt(playerid, "skinc_page", 0); // will reset the page back to the first
+	    
+	    CreateSelectionMenu(playerid);
+	    SelectTextDraw(playerid, 0xACCBF1FF);
+	    return 1;
+	}
+	
+	return 0;
+}
+//------------------------------------------------

BIN
samp03/filterscripts/stunt_island.amx


+ 1092 - 0
samp03/filterscripts/stunt_island.pwn

@@ -0,0 +1,1092 @@
+// -----------------------------------------------------------------------------
+// Example Filterscript for the new Stunt Island
+// ---------------------------------------------
+// By Matite and Kye in January 2015
+//
+// Updated to v1.02 by Matite in February 2015
+// * Added code to display the current lap record details when the player
+//   types the /si teleport command
+//
+// This script creates a Modular Island with a stunt set made of the new half tube
+// objects. The location is just off the coast in the northern part of the map. It
+// also enables a teleport (/si) to get there and AutoFix (/af) for vehicles.
+//
+// Warning, this script...
+// * Uses a total of 467 player objects
+// * Adds 6 x Infernuses
+// * Has a teleport (/si) command enabled by default
+// * Enables AutoFix (/af) for all players by default
+// * Enables 10x NOS for all Infernuses by default
+// * Enables adding 10x NOS to all Infernuses by using the fire key
+// * Disables vehicle collisions for the Infernuses created by this script
+//
+// Note: you can enable the /flip command by removing the code comment lines
+// -----------------------------------------------------------------------------
+
+// -----------------------------------------------------------------------------
+// Includes
+// --------
+
+// SA-MP Include
+#include <a_samp>
+
+// -----------------------------------------------------------------------------
+// Defines
+// -------
+
+// Used for chat text messages
+#define COLOR_MESSAGE_YELLOW        0xFFDD00AA
+
+// Number of map specific vehicles created by this script
+#define NUM_SI_VEHICLES             6
+
+// -----------------------------------------------------------------------------
+// Forwards
+// --------
+
+// Used for the autofix timer (this timer runs all the time)
+forward SIAutoFix();
+forward IsSIInfernus(vehicleid);
+
+// -----------------------------------------------------------------------------
+// Variables
+// ---------
+
+// Stores the vehicle number of each Infernus created by this filterscript so
+// they can be deleted if the filterscript is unloaded
+new SIInfernus[NUM_SI_VEHICLES];
+
+// Tracks whether the player has AutoFix disabled
+new SIAutoFixDisabled[MAX_PLAYERS];
+
+// Stores a reference to the AutoFix timer so it can be killed when this
+// filterscript is unloaded
+new SIAutoFixTimer;
+
+// Stores the race checkpoint locations for the Stunt Island
+new Float:StuntIslandCPs[26][3] =
+{
+    // X Position		Y Position		Z Position
+	// -------------------------------------------
+
+	{121.96,		 	3422.62, 		7.49},
+	{262.83,		 	3422.62, 		40.86},
+	{295.66,		 	3422.62, 		82.13},
+	{332.11,		 	3257.69, 		81.25},
+	{299.93,		 	3337.11, 		62.03},
+	{311.17,		 	3475.42, 		62.03},
+	{311.17,		 	3647.12, 		84.18},
+	{322.48,		 	3698.05, 		125.61},
+	{29.69,		 		3698.05, 		27.91},
+	{73.18,		 		3666.20, 		32.08},
+	{241.21,		 	3679.01, 		31.72},
+	{241.21,		 	3369.28, 		31.72},
+	{159.44,		 	3298.87, 		108.01},
+	{159.44,		 	3440.01, 		84.34},
+	{159.44,		 	3514.15, 		60.68},
+	{159.44,		 	3679.18, 		82.83},
+	{247.58,		 	3739.98, 		71.60},
+	{235.02,		 	3607.64, 		67.86},
+	{174.86,		 	3494.73, 		67.86},
+	{130.26,		 	3406.86, 		52.24},
+	{119.19,		 	3362.98, 		40.44},
+	{108.01,		 	3304.27, 		35.76},
+	{123.23,            3217.41,        35.76},
+	{139.88,		 	3341.60, 		16.22},
+	{183.17,		 	3456.39, 		16.22},
+	{110.25,		 	3498.03, 		11.18}
+};
+
+// Stores the players current race checkpoint
+new SIPlayerCP[MAX_PLAYERS];
+
+// Stores the players race start time so it can be subtracted
+// from the end race time to get the total race time
+new SIPlayerStartTime[MAX_PLAYERS];
+
+// Stores the fastest lap time in seconds
+new FastestLapTime = 999;
+
+// Stores the name of the player who has the fastest lap time
+new FastestLapName[MAX_PLAYER_NAME + 1];
+
+// -----------------------------------------------------------------------------
+// Callbacks
+// ---------
+
+public OnPlayerStateChange(playerid, newstate, oldstate)
+{
+	// Check if the new player state is driver or passenger
+    if (newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
+	{
+        // Get the players vehicle ID
+        new player_vehicle = GetPlayerVehicleID(playerid);
+        
+        // Check if the player is driving one of the Infernuses created by this filterscript
+        if (IsSIInfernus(player_vehicle))
+		{
+		    // Disable vehicle collisions and set PVar
+            DisableRemoteVehicleCollisions(playerid, true);
+            SetPVarInt(playerid, "SIVehicleCols", 1);
+		}
+	}
+	else
+	{
+	    // Check if the PVar is set (player had vehicle collisions disabled)
+	    if (GetPVarInt(playerid, "SIVehicleCols"))
+		{
+		    // Enable vehicle collisions and set PVar
+		    DisableRemoteVehicleCollisions(playerid, false);
+		    SetPVarInt(playerid, "SIVehicleCols", 0);
+		}
+	}
+	
+	// Exit here (return 1 so this callback is handled in other filterscripts)
+	return 1;
+}
+
+public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
+{
+    // Check for FIRE key
+	if (newkeys & KEY_FIRE)
+	{
+	    // Fire Key is usually the Left Mouse Button
+		// -----------------------------------------
+
+	    // Check if player is in any vehicle
+	    if (!IsPlayerInAnyVehicle(playerid)) return 1;
+
+	    // Do not allow passengers to use this on people driving
+		if (GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return 1;
+		
+		// Check if the vehicle model is an Infernus
+		if (GetVehicleModel(GetPlayerVehicleID(playerid)) == 411)
+		{
+		    // Add 10x NOS
+		    AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
+		    
+		    // Debug
+		    //printf("-->Added 10x NOS to Vehicle Number %d for Player ID %d", GetPlayerVehicleID(playerid), playerid);
+		}
+	}
+
+	// Exit here (return 1 so this callback is handled in other filterscripts)
+	return 1;
+}
+
+public OnPlayerEnterRaceCheckpoint(playerid)
+{
+	// Get the player pos
+    new Float:x, Float:y, Float:z;
+	GetPlayerPos(playerid, x, y, z);
+	
+	// Increase current checkpoint
+	SIPlayerCP[playerid]++;
+	
+	// Debug
+	//printf("-->Player ID %d Current CP is %d of %d", playerid, SIPlayerCP[playerid], sizeof(StuntIslandCPs));
+
+    // Check if the race checkpoint is the start line
+	if (SIPlayerCP[playerid] == 1)
+	{
+	    // Reset current checkpoint (in case the player drove back to the start CP and did not type /si)
+	    SIPlayerCP[playerid] = 1;
+	    
+	    // Store the players race start time
+	    SIPlayerStartTime[playerid] = gettime();
+	    
+	    // Debug
+	    //printf("-->Race start time for Player %d is %d", playerid, SIPlayerStartTime[playerid]);
+	    
+	    // Send a gametext message to the player
+		GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~~h~Race Timer Started!", 3000, 3);
+		
+		// Format chat text message for all
+		new strTempString[64];
+		new PlayerName[MAX_PLAYER_NAME + 1];
+		GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
+        format(strTempString, sizeof(strTempString), "* %s (ID:%d) started their timed lap.", PlayerName, playerid);
+        SendClientMessageToAll(COLOR_MESSAGE_YELLOW, strTempString);
+
+	    // Play a sound
+	    PlayerPlaySound(playerid, 1139, x, y, z);
+	    
+	    // Create next checkpoint
+		SetPlayerRaceCheckpoint(playerid, 0, StuntIslandCPs[SIPlayerCP[playerid]][0], StuntIslandCPs[SIPlayerCP[playerid]][1], StuntIslandCPs[SIPlayerCP[playerid]][2], StuntIslandCPs[SIPlayerCP[playerid] + 1][0], StuntIslandCPs[SIPlayerCP[playerid] + 1][1], StuntIslandCPs[SIPlayerCP[playerid] + 1][2], 12.0);
+	}
+	// Check if the race checkpoint is the finish line
+	else if (SIPlayerCP[playerid] == sizeof(StuntIslandCPs))
+	{
+	    // Get the total lap time
+	    new TotalLapTime = gettime() - SIPlayerStartTime[playerid];
+	    
+	    // Get player name and store
+	    new PlayerName[MAX_PLAYER_NAME + 1];
+		GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
+		
+		// Create variable
+		new strTempString[128];
+	    
+	    // Check if the players total lap time is faster than the current fastest lap time
+	    if (TotalLapTime < FastestLapTime)
+	    {
+	        // Check if no previous fastest lap record exists
+	        if (FastestLapTime == 999)
+	        {
+	            // Format chat text messages for all
+	        	format(strTempString, sizeof(strTempString), "** %s (ID:%d) completed their timed lap in %d seconds and set a new record.", PlayerName, playerid, TotalLapTime);
+	        	SendClientMessageToAll(COLOR_MESSAGE_YELLOW, strTempString);
+		 	}
+	        else
+	        {
+		        // Format chat text messages for all
+	        	format(strTempString, sizeof(strTempString), "** %s (ID:%d) completed their timed lap in %d seconds beating the existing record", PlayerName, playerid, TotalLapTime);
+	        	SendClientMessageToAll(COLOR_MESSAGE_YELLOW, strTempString);
+	        	format(strTempString, sizeof(strTempString), "*  of %d seconds previously set by %s.", FastestLapTime, FastestLapName);
+	        	SendClientMessageToAll(COLOR_MESSAGE_YELLOW, strTempString);
+        	}
+        
+	        // Store new fastest lap time
+	        FastestLapTime = TotalLapTime;
+	        
+	        // Store new fastest lap time name
+			format(FastestLapName, sizeof(FastestLapName), "%s", PlayerName);
+	    }
+	    else
+	    {
+	        // Format chat text message for all
+    	    format(strTempString, sizeof(strTempString), "* %s (ID:%d) completed their timed lap in %d seconds.", PlayerName, playerid, TotalLapTime);
+	        SendClientMessageToAll(COLOR_MESSAGE_YELLOW, strTempString);
+	    }
+        
+	    // Send a gametext message to the player
+		GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~~h~Finished!", 3000, 3);
+		
+	    // Play a sound
+	    PlayerPlaySound(playerid, 1139, x, y, z);
+	    
+        // Set current checkpoint
+		SIPlayerCP[playerid] = 0;
+
+		// Create start checkpoint
+		SetPlayerRaceCheckpoint(playerid, 1, StuntIslandCPs[SIPlayerCP[playerid]][0], StuntIslandCPs[SIPlayerCP[playerid]][1], StuntIslandCPs[SIPlayerCP[playerid]][2], StuntIslandCPs[SIPlayerCP[playerid] + 1][0], StuntIslandCPs[SIPlayerCP[playerid] + 1][1], StuntIslandCPs[SIPlayerCP[playerid] + 1][2], 12.0);
+	}
+	// Check if the race finish line is next
+	else if (SIPlayerCP[playerid] == sizeof(StuntIslandCPs) - 1)
+	{
+	    // Send a gametext message to the player
+		GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~~h~Finish Line Is Next!", 3000, 3);
+		
+	    // Play a sound
+	    PlayerPlaySound(playerid, 1138, x, y, z);
+	    
+		// Create next checkpoint (finish line)
+		SetPlayerRaceCheckpoint(playerid, 1, StuntIslandCPs[SIPlayerCP[playerid]][0], StuntIslandCPs[SIPlayerCP[playerid]][1], StuntIslandCPs[SIPlayerCP[playerid]][2], -1, -1, -1, 12.0);
+	}
+	else
+	{
+	    // Play a sound
+	    PlayerPlaySound(playerid, 1138, x, y, z);
+	    
+		// Create next checkpoint
+		SetPlayerRaceCheckpoint(playerid, 0, StuntIslandCPs[SIPlayerCP[playerid]][0], StuntIslandCPs[SIPlayerCP[playerid]][1], StuntIslandCPs[SIPlayerCP[playerid]][2], StuntIslandCPs[SIPlayerCP[playerid] + 1][0], StuntIslandCPs[SIPlayerCP[playerid] + 1][1], StuntIslandCPs[SIPlayerCP[playerid] + 1][2], 12.0);
+	}
+
+	// Exit here
+	return 1;
+}
+
+public OnPlayerCommandText(playerid, cmdtext[])
+{
+	// Check command text
+	if (strcmp("/si", cmdtext, true, 3) == 0)
+	{
+	    // Set the player interior
+		SetPlayerInterior(playerid, 0);
+		
+		// Check if the player is in any vehicle
+		if (IsPlayerInAnyVehicle(playerid))
+		{
+		    // In a Vehicle
+		    // ------------
+		    
+		    // Set vehicle position and facing angle
+		    SetVehiclePos(GetPlayerVehicleID(playerid), 27.24 + random(2), 3422.45, 6.2);
+		    SetVehicleZAngle(GetPlayerVehicleID(playerid), 270);
+
+			// Link vehicle to interior
+			LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
+		}
+		else
+		{
+		    // On Foot
+		    // -------
+		    
+			// Set player position and facing angle
+			SetPlayerPos(playerid, 27.24 + random(2), 3422.45, 6.2);
+			SetPlayerFacingAngle(playerid, 270);
+		}
+
+		// Fix camera position after teleporting
+		SetCameraBehindPlayer(playerid);
+		
+		// Display chat text message to the player
+		SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, "* You teleported to the Stunt Island... drive into the checkpoint to start your timed lap.");
+
+		// Check if there is a previous lap record
+		if (FastestLapTime != 999)
+		{
+		    // Create variable
+			new strTempString[128];
+			
+			// Format and display chat text message to the player
+			format(strTempString, sizeof(strTempString), "* The current record is %d seconds previously set by %s.", FastestLapTime, FastestLapName);
+       		SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, strTempString);
+       	}
+
+		// Send a gametext message to the player
+		GameTextForPlayer(playerid, "~b~~h~Stunt Island!", 3000, 3);
+		
+		// Set current checkpoint
+		SIPlayerCP[playerid] = 0;
+		
+		// Create start checkpoint
+		SetPlayerRaceCheckpoint(playerid, 1, StuntIslandCPs[SIPlayerCP[playerid]][0], StuntIslandCPs[SIPlayerCP[playerid]][1], StuntIslandCPs[SIPlayerCP[playerid]][2], StuntIslandCPs[SIPlayerCP[playerid] + 1][0], StuntIslandCPs[SIPlayerCP[playerid] + 1][1], StuntIslandCPs[SIPlayerCP[playerid] + 1][2], 12.0);
+
+	    // Exit here
+	    return 1;
+	}
+	else if (strcmp("/af", cmdtext, true, 3) == 0)
+	{
+		// Check if AutoFix is enabled for the player
+		if (SIAutoFixDisabled[playerid] == 0)
+		{
+		    // Set flag
+		    SIAutoFixDisabled[playerid] = 1;
+		    
+		    // Display a chat text message to the player
+			SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, "* You disabled AutoFix for your vehicle.");
+		    
+		    // Send a gametext message to the player
+			GameTextForPlayer(playerid, "~g~~h~AutoFix Disabled!", 3000, 3);
+		}
+		else
+		{
+		    // Set flag
+		    SIAutoFixDisabled[playerid] = 0;
+		    
+		    // Display a chat text message to the player
+			SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, "* You enabled AutoFix for your vehicle.");
+		    
+			// Send a gametext message to the player
+			GameTextForPlayer(playerid, "~g~~h~AutoFix Enabled!", 3000, 3);
+		}
+
+	    // Exit here
+	    return 1;
+	}
+	/*
+	else if (strcmp("/flip", cmdtext, true, 5) == 0)
+	{
+		// Check to see if the player is not a driver of any vehicle
+		if (GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
+		{
+			// Send chat text message to the player and exit here
+		    SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, "* You must be the driver of a vehicle before using the /flip command.");
+		    return 1;
+		}
+
+	    // Create variables
+		new Float:x;
+		new Float:y;
+		new Float:z;
+		new Float:a;
+		new playervid = GetPlayerVehicleID(playerid);
+
+		// Get Vehicle Pos
+		GetVehiclePos(playervid, x, y, z);
+	    GetVehicleZAngle(playervid, a);
+
+	    // Flip the vehicle
+	    SetVehiclePos(playervid, x, y, z + 2);
+	    SetVehicleZAngle(playervid, a);
+
+	    // Display a chat text message to the player
+		SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, "* Your vehicle has been flipped.");
+
+		// Send a gametext message to the player
+		GameTextForPlayer(playerid, "~g~~h~Vehicle Flipped!", 3000, 3);
+
+	    // Exit here
+	    return 1;
+	}*/
+
+	// Exit here (return 0 as the command was not handled in this filterscript)
+	return 0;
+}
+
+public OnVehicleSpawn(vehicleid)
+{
+	// Check if the vehicle is an Infernus
+	if (GetVehicleModel(vehicleid) == 411)
+	{
+	    // Add 10x NOS to the vehicle
+	    AddVehicleComponent(vehicleid, 1010);
+	}
+	
+	// Return 0 so this callback is processed by other filterscripts and the gamemode
+	return 0;
+}
+
+public OnFilterScriptInit()
+{
+    // Display information in the Server Console
+	print("\n");
+	print("  |---------------------------------------------------");
+	print("  |--- Stunt Island Filterscript by Matite and Kye");
+    print("  |--  Script v1.02");
+    print("  |--  13th February 2015");
+	print("  |---------------------------------------------------");
+	
+	// Loop
+	for (new i = 0; i < MAX_PLAYERS; i++)
+	{
+	    // Check if the player is connected and not a NPC
+        if (IsPlayerConnected(i) && !IsPlayerNPC(i))
+        {
+	    	// Create stunt island objects for the player
+	    	// (so any player currently ingame does not have to rejoin for them
+			//  to appear when this filterscript is loaded)
+			CreateSIObjects(i);
+		}
+	}
+	
+	// Create NUM_SI_VEHICLES Infernuses
+	for (new i = 0; i < NUM_SI_VEHICLES; i++)
+	{
+	    // Create an Infernus and remember the vehicle number so it can be
+	    // deleted when this filterscript is unloaded
+	    SIInfernus[i] = CreateVehicle(411, 89.45, 3445.0 + (i * 6.0), 5.05, 90.0, -1, -1, 30);
+	    
+	    // Check that the vehicle was created ok
+	    if(SIInfernus[i] != INVALID_VEHICLE_ID)
+		{
+		    // Add 10x NOS to the Infernus
+        	AddVehicleComponent(SIInfernus[i], 1010);
+		}
+	}
+	
+	// Start the AutoFix timer (every 1.803 seconds the timer is triggered)
+	SIAutoFixTimer = SetTimer("SIAutoFix", 1803, 1);
+
+    // Exit here
+	return 1;
+}
+
+public OnFilterScriptExit()
+{
+	// Display information in the Server Console
+	print("  |---------------------------------------------------");
+	print("  |--  Stunt Island Filterscript Unloaded");
+	print("  |---------------------------------------------------");
+	
+	// Delete 6 Infernuses
+	for (new i = 0; i < NUM_SI_VEHICLES; i++)
+	{
+	    // Delete the Infernus vehicles created by this filterscript
+	    DestroyVehicle(SIInfernus[i]);
+	}
+	
+	// Kill the AutoFix timer
+	KillTimer(SIAutoFixTimer);
+
+	// Exit here
+	return 1;
+}
+
+public OnPlayerConnect(playerid)
+{
+	// Create stunt island objects for the player
+	CreateSIObjects(playerid);
+
+	// Exit here
+	return 1;
+}
+
+CreateSIObjects(playerid)
+{
+	// Create variable
+	new TempObjectNumber;
+	
+    // Create stunt island player objects (with draw distance of 999m)
+    CreatePlayerObject(playerid,19672,331.9166,3396.5845,85.9599,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19532,77.5000,3570.0000,4.3077,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19542,335.0000,3570.0000,4.3077,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19540,335.0000,3757.5000,4.3077,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19532,7.5000,3500.0000,4.3077,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19535,77.5000,3422.5000,4.3077,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19532,7.5000,3640.0000,4.3077,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19532,-62.5000,3570.0000,4.3077,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19539,335.0000,3663.7500,4.3077,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19533,77.5000,3678.7500,4.3077,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19533,77.5000,3461.2500,4.3077,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19542,7.5000,3835.0000,4.3077,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19533,-62.5000,3678.7500,4.3077,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19531,-132.5000,3570.0000,4.3077,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19538,-132.5000,3678.7500,4.3077,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19532,-132.5000,3500.0000,4.3077,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19534,-62.5000,3500.0000,4.3077,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19534,-62.5000,3640.0000,4.3077,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19541,-62.4998,3835.0000,4.3077,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19541,84.9997,3827.5000,4.3078,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19538,-132.5000,3461.2500,4.3077,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19532,-132.5000,3640.0000,4.3077,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19533,-62.5000,3461.2500,4.3077,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19532,7.5000,3422.5000,4.3077,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19532,-132.5000,3422.5000,4.3077,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19538,-132.5000,3383.7500,4.3077,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19542,-55.0000,3227.5000,4.3077,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19545,-62.5000,3383.7500,4.3077,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19543,-202.5000,3383.7500,4.3077,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19533,-202.5000,3461.2500,4.3077,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19541,15.0001,3352.5000,4.3077,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19541,77.5000,3835.0000,4.3077,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19541,-62.5000,3165.0000,4.3077,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19542,-132.5000,3165.0000,4.3077,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19541,-202.5000,3165.0000,4.3077,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19539,-210.0000,3383.7500,4.3077,0.0000,0.0000,180.0000,999.0);
+	CreatePlayerObject(playerid,19541,-210.0000,3422.5000,4.3077,0.0000,0.0000,180.0000,999.0);
+	CreatePlayerObject(playerid,19539,-210.0000,3461.2500,4.3077,0.0000,0.0000,180.0000,999.0);
+	CreatePlayerObject(playerid,19541,-210.0000,3499.9998,4.3077,0.0000,0.0000,180.0000,999.0);
+	CreatePlayerObject(playerid,19532,-202.5000,3570.0000,4.3077,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19533,-202.5000,3678.7500,4.3077,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19542,-210.0000,3570.0000,4.3077,0.0000,0.0000,180.0000,999.0);
+	CreatePlayerObject(playerid,19541,-210.0000,3640.0000,4.3077,0.0000,0.0000,180.0000,999.0);
+	CreatePlayerObject(playerid,19539,-210.0000,3678.7500,4.3077,0.0000,0.0000,180.0000,999.0);
+	CreatePlayerObject(playerid,19541,-202.4998,3710.0000,4.3077,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19540,335.0000,3257.5000,4.3077,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19546,85.0000,3352.5000,4.3077,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19547,-132.5000,3290.0000,4.3077,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19546,-54.9999,3352.5000,4.3077,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19543,-62.5000,3321.2500,4.3077,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19543,-62.5000,3258.7500,4.3077,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19536,-132.5000,3196.2500,4.3077,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19543,-62.5000,3196.2500,4.3077,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19540,-55.0000,3165.0000,4.3077,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19542,-210.0000,3290.0000,4.3077,0.0000,0.0000,180.0000,999.0);
+	CreatePlayerObject(playerid,19543,-202.5000,3321.2500,4.3077,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19543,-202.5000,3258.7500,4.3077,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19543,-202.5000,3196.2500,4.3077,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19539,-210.0000,3196.2500,4.3077,0.0000,0.0000,180.0000,999.0);
+	CreatePlayerObject(playerid,19546,84.9999,3757.5000,4.3077,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19532,77.5000,3772.5000,4.3077,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19539,178.7500,3757.5000,4.3077,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19540,85.0000,3835.0000,4.3077,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19540,-69.9998,3835.0000,4.3077,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19546,-69.9998,3710.0000,4.3080,0.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19532,-62.4999,3772.5000,4.3077,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19539,-163.7498,3710.0000,4.3077,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19539,-69.9998,3803.7500,4.3077,0.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19539,335.0000,3726.2500,4.3077,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19529,7.5000,3570.0000,4.3077,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19539,241.2500,3757.5000,4.3077,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19539,303.7500,3757.5000,4.3077,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19539,241.2500,3257.5000,4.3077,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19539,303.7500,3257.5000,4.3077,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19535,-62.5000,3422.5000,4.3077,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19535,-202.5000,3422.5000,4.3077,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19535,-202.5000,3500.0000,4.3077,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19535,-202.5000,3640.0000,4.3077,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19535,77.5000,3640.0000,4.3077,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19670,149.4099,3422.5000,-40.2988,0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19646,300.0856,3261.5845,83.4814,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19642,124.1813,3422.5000,8.8521,0.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19647,134.1813,3422.5000,8.8520,0.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19650,96.9146,3422.5000,6.1717,0.0000,-10.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19643,114.1813,3422.5000,8.8521,0.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19659,-15.6602,3682.0776,29.3538,0.0000,0.0000,0.0000,999.0);
+
+	TempObjectNumber = CreatePlayerObject(playerid,19665,311.1857,3531.0288,86.7789,0.0000,0.0000,-90.0000,999.0);
+	SetPlayerObjectMaterial(playerid, TempObjectNumber, 0, 19659, "MatTubes", "YellowDirt1", 0);
+	
+	TempObjectNumber = CreatePlayerObject(playerid,19667,305.6357,3426.5845,95.3124,0.0000,0.0000,-90.0000,999.0);
+	SetPlayerObjectMaterial(playerid, TempObjectNumber, 0, 19659, "MatTubes", "BlueDirt1", 0);
+	
+	CreatePlayerObject(playerid,19664,70.0058,3666.1621,31.6038,0.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19663,331.9166,3381.5845,81.2314,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19661,326.6671,3417.2505,83.4814,0.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19662,337.7673,3671.4116,87.1412,0.0000,0.0000,90.0000,999.0);
+	
+	TempObjectNumber = CreatePlayerObject(playerid,19651,284.1701,3276.5845,73.4814,0.0000,0.0000,90.0000,999.0);
+	SetPlayerObjectMaterial(playerid, TempObjectNumber, 0, 19659, "MatTubes", "GreenDirt1", 0);
+	
+	TempObjectNumber = CreatePlayerObject(playerid,19652,266.0011,3406.5845,53.4814,0.0000,0.0000,180.0000,999.0);
+	SetPlayerObjectMaterial(playerid, TempObjectNumber, 0, 19659, "MatTubes", "GreenDirt1", 0);
+	
+	CreatePlayerObject(playerid,19660,316.0011,3245.9185,83.4814,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19672,188.5509,3422.5000,25.7300,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19649,203.5318,3422.5000,26.3325,0.0000,20.0000,180.0000,999.0);
+	CreatePlayerObject(playerid,19674,200.6326,3498.2903,17.2481,0.0000,0.0000,180.0000,999.0);
+	CreatePlayerObject(playerid,19676,140.8339,3498.2903,12.0060,0.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19673,231.6195,3422.5000,36.5668,0.0000,15.0000,180.0000,999.0);
+	CreatePlayerObject(playerid,19675,144.5353,3422.5000,9.2890,0.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19678,120.0057,3697.9932,51.5540,0.0000,0.0000,180.0000,999.0);
+	CreatePlayerObject(playerid,19675,154.9452,3422.5000,10.6383,0.0000,5.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19675,165.1978,3422.5000,12.8897,0.0000,10.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19675,175.2152,3422.5000,16.0262,0.0000,15.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19670,255.9339,3422.5000,-7.4172,0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19673,241.1739,3422.5000,39.5792,0.0000,10.0000,180.0000,999.0);
+	CreatePlayerObject(playerid,19673,250.9545,3422.5000,41.7474,0.0000,5.0000,180.0000,999.0);
+	CreatePlayerObject(playerid,19673,260.8867,3422.5000,43.0549,0.0000,0.0000,180.0000,999.0);
+	
+	TempObjectNumber = CreatePlayerObject(playerid,19652,266.0011,3406.5845,73.4814,0.0000,0.0000,180.0000,999.0);
+	SetPlayerObjectMaterial(playerid, TempObjectNumber, 0, 19659, "MatTubes", "GreenDirt1", 0);
+	
+	CreatePlayerObject(playerid,19649,291.0011,3422.5000,83.4814,0.0000,-0.0000,180.0000,999.0);
+	CreatePlayerObject(playerid,19670,291.0011,3422.5000,33.4567,0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19684,314.6369,3697.9932,126.3243,0.0000,0.0000,180.0000,999.0);
+	CreatePlayerObject(playerid,19682,213.1957,3717.7407,29.3538,0.0000,0.0000,-135.0000,999.0);
+	CreatePlayerObject(playerid,19681,157.1870,3668.5852,29.3538,0.0000,0.0000,45.0000,999.0);
+	CreatePlayerObject(playerid,19686,260.6396,3739.9441,70.3298,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19685,181.5493,3697.9929,58.8229,0.0000,-30.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19663,331.9166,3331.5845,81.2314,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19670,331.9167,3356.5845,33.4567,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19663,331.9166,3281.5845,81.2314,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19646,300.0856,3271.5845,83.4814,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19670,331.9166,3306.5845,33.4567,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19649,300.0856,3301.5845,63.4814,0.0000,-0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19649,300.0856,3351.5845,63.4814,0.0000,-0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19649,300.0856,3401.5845,63.4814,0.0000,-0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19670,300.0855,3356.5845,13.4567,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19670,300.0856,3306.5845,13.4567,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19649,311.1857,3451.5845,63.4814,0.0000,-0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19649,311.1857,3501.5845,63.4814,0.0000,-0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19670,311.1857,3466.5845,13.4567,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19670,311.1858,3516.5845,13.4567,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19649,311.1857,3575.2466,87.1413,0.0000,-0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19663,311.1858,3625.2466,84.8912,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19670,311.1857,3560.2466,37.1166,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19661,316.4353,3660.9126,87.1412,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19670,311.1857,3625.2466,32.6165,0.0000,0.0000,90.0000,999.0);
+	
+	TempObjectNumber = CreatePlayerObject(playerid,19652,358.9323,3682.0776,97.1412,0.0000,0.0000,-90.0000,999.0);
+	SetPlayerObjectMaterial(playerid, TempObjectNumber, 0, 19659, "MatTubes", "GreenDirt1", 0);
+	
+	TempObjectNumber = CreatePlayerObject(playerid,19652,358.9323,3682.0776,117.1413,0.0000,0.0000,-90.0000,999.0);
+	SetPlayerObjectMaterial(playerid, TempObjectNumber, 0, 19659, "MatTubes", "GreenDirt1", 0);
+	
+	TempObjectNumber = CreatePlayerObject(playerid,19667,95.0057,3729.8225,46.0054,-90.0000,0.0000,0.0000,999.0);
+	SetPlayerObjectMaterial(playerid, TempObjectNumber, 0, 19659, "MatTubes", "BlueDirt1", 0);
+	
+	CreatePlayerObject(playerid,19662,337.7672,3692.7434,127.1412,0.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19684,290.5576,3697.9929,119.8723,0.0000,15.0000,180.0000,999.0);
+	CreatePlayerObject(playerid,19649,257.7041,3697.9929,101.8476,0.0000,-30.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19649,214.4028,3697.9929,76.8476,0.0000,-30.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19685,157.4701,3697.9929,52.3709,0.0000,-15.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19670,149.8595,3697.9929,1.6564,0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19670,343.0168,3682.0776,37.1165,0.0000,0.0000,90.0000,999.0);
+	
+	TempObjectNumber = CreatePlayerObject(playerid,19667,95.0057,3729.8225,34.9053,-90.0000,0.0000,0.0000,999.0);
+	SetPlayerObjectMaterial(playerid, TempObjectNumber, 0, 19659, "MatTubes", "BlueDirt1", 0);
+	
+	TempObjectNumber = CreatePlayerObject(playerid,19668,124.6504,3397.5898,84.0644,0.0000,15.0000,-90.0000,999.0);
+	SetPlayerObjectMaterial(playerid, TempObjectNumber, 0, 19659, "MatTubes", "BlueDirt1", 0);
+	
+	TempObjectNumber = CreatePlayerObject(playerid,19666,159.4614,3413.4658,108.9914,0.0000,0.0000,90.0000,999.0);
+	SetPlayerObjectMaterial(playerid, TempObjectNumber, 0, 19659, "MatTubes", "YellowDirt1", 0);
+	
+	CreatePlayerObject(playerid,19680,70.0058,3697.9932,29.3538,0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19670,25.0058,3697.9932,-20.6709,0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19649,20.0058,3697.9932,29.3539,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19659,-15.6602,3682.0776,34.8538,180.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19649,20.0058,3666.1621,29.3538,0.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19649,120.0058,3666.1621,29.3538,0.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19670,25.0058,3666.1621,-20.6709,0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19664,241.2924,3679.2480,31.6038,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19649,185.1914,3693.1628,29.3538,0.0000,0.0000,-135.0000,999.0);
+	CreatePlayerObject(playerid,19661,236.0429,3714.9141,29.3538,0.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19670,125.0058,3666.1621,-20.6709,0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19648,241.2924,3599.2480,29.3538,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19644,110.4799,3498.2903,11.5691,0.0000,0.0000,180.0000,999.0);
+	CreatePlayerObject(playerid,19670,241.2924,3679.2480,-16.1709,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19647,241.2924,3569.2480,29.3539,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19664,241.2924,3489.2480,31.6038,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19670,241.2924,3489.2480,-16.1709,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19663,241.2924,3419.2480,27.1038,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19646,241.2924,3459.2480,29.3538,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19646,241.2924,3449.2480,29.3538,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19664,241.2924,3369.2480,31.6038,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19670,241.2924,3369.2480,-16.1709,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19663,241.2924,3319.2480,27.1038,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19661,236.0429,3283.5820,29.3538,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19661,235.9641,3283.5449,34.8538,-180.0000,0.0000,179.0000,999.0);
+	CreatePlayerObject(playerid,19649,200.3770,3278.3325,29.3538,0.0000,-0.0000,-0.0000,999.0);
+	
+	TempObjectNumber = CreatePlayerObject(playerid,19652,175.3770,3294.2480,39.3538,0.0000,0.0000,0.0000,999.0);
+	SetPlayerObjectMaterial(playerid, TempObjectNumber, 0, 19659, "MatTubes", "GreenDirt1", 0);
+	
+	TempObjectNumber = CreatePlayerObject(playerid,19652,175.3770,3294.2480,59.3538,0.0000,0.0000,0.0000,999.0);
+	SetPlayerObjectMaterial(playerid, TempObjectNumber, 0, 19659, "MatTubes", "GreenDirt1", 0);
+	
+	TempObjectNumber = CreatePlayerObject(playerid,19652,175.3769,3294.2480,79.3538,0.0000,0.0000,0.0000,999.0);
+	SetPlayerObjectMaterial(playerid, TempObjectNumber, 0, 19659, "MatTubes", "GreenDirt1", 0);
+	
+	TempObjectNumber = CreatePlayerObject(playerid,19652,175.3770,3294.2480,44.8538,180.0000,0.0000,-180.0000,999.0);
+	SetPlayerObjectMaterial(playerid, TempObjectNumber, 0, 19659, "MatTubes", "GreenDirt1", 0);
+	
+	TempObjectNumber = CreatePlayerObject(playerid,19652,175.3769,3294.2480,99.3538,0.0000,0.0000,0.0000,999.0);
+	SetPlayerObjectMaterial(playerid, TempObjectNumber, 0, 19659, "MatTubes", "GreenDirt1", 0);
+	
+	CreatePlayerObject(playerid,19670,185.3770,3278.3325,-20.6709,0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19661,164.7110,3283.5820,109.3538,0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19649,159.4614,3319.2480,109.3538,0.0000,-0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19649,159.4614,3369.2480,109.3538,0.0000,-0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19670,159.4614,3364.2480,59.3291,0.0000,0.0000,90.0000,999.0);
+	
+	TempObjectNumber = CreatePlayerObject(playerid,19666,159.4614,3487.1279,85.3316,0.0000,0.0000,90.0000,999.0);
+	SetPlayerObjectMaterial(playerid, TempObjectNumber, 0, 19659, "MatTubes", "YellowDirt1", 0);
+	
+	TempObjectNumber = CreatePlayerObject(playerid,19666,159.4614,3560.7900,61.6717,0.0000,0.0000,90.0000,999.0);
+	SetPlayerObjectMaterial(playerid, TempObjectNumber, 0, 19659, "MatTubes", "YellowDirt1", 0);
+	
+	CreatePlayerObject(playerid,19670,119.1004,3385.7981,-1.9767,0.0000,0.0000,90.0000,999.0);
+	
+	TempObjectNumber = CreatePlayerObject(playerid,19649,159.4614,3442.9102,85.6940,0.0000,-0.0000,-90.0000,999.0);
+	SetPlayerObjectMaterial(playerid, TempObjectNumber, 0, 19659, "MatTubes", "YellowDirt1", 0);
+	
+	CreatePlayerObject(playerid,19684,159.4614,3667.4851,81.6925,0.0000,-30.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19649,159.4614,3634.6316,63.6678,0.0000,30.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19684,159.4614,3691.5645,88.1445,0.0000,-15.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19661,164.7109,3734.6946,88.9614,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19670,159.4614,3714.0286,38.9367,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19661,283.7699,3734.6946,69.5128,0.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19684,187.8412,3739.9441,88.1445,0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19649,224.2404,3739.9441,79.2371,0.0000,-15.0000,180.0000,999.0);
+	CreatePlayerObject(playerid,19670,273.1040,3739.9441,19.4881,0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19646,289.0194,3719.0288,69.5128,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19661,283.7699,3734.6946,75.0128,180.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19682,286.5965,3701.8474,69.5128,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19681,237.4409,3645.8386,69.5129,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19649,262.0187,3673.8430,69.5129,0.0000,0.0000,45.0000,999.0);
+	CreatePlayerObject(playerid,19649,235.0180,3608.6575,69.5129,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19649,235.0180,3558.6575,69.5129,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19682,232.5950,3521.4763,69.5129,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19649,130.2005,3429.9766,59.7885,0.0000,-15.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19682,208.2971,3497.1785,69.5129,0.0000,0.0000,45.0000,999.0);
+	CreatePlayerObject(playerid,19649,171.1159,3494.7554,69.5129,0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19646,222.1594,3507.6140,69.5129,0.0000,0.0000,45.0000,999.0);
+	CreatePlayerObject(playerid,19662,135.4500,3489.5059,69.5129,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19684,130.2004,3466.3757,68.6959,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19670,258.4832,3670.3076,19.4881,0.0000,0.0000,45.0000,999.0);
+	CreatePlayerObject(playerid,19686,108.0004,3345.2810,37.9402,0.0000,0.0000,-90.0000,999.0);
+	
+	TempObjectNumber = CreatePlayerObject(playerid,19649,119.1004,3381.6802,46.8476,0.0000,-15.0000,90.0000,999.0);
+	SetPlayerObjectMaterial(playerid, TempObjectNumber, 0, 19659, "MatTubes", "BlueDirt1", 0);
+	
+	TempObjectNumber = CreatePlayerObject(playerid,19668,113.5504,3349.2935,71.1235,0.0000,15.0000,-90.0000,999.0);
+	SetPlayerObjectMaterial(playerid, TempObjectNumber, 0, 19659, "MatTubes", "BlueDirt1", 0);
+	
+	CreatePlayerObject(playerid,19663,108.0004,3257.8167,34.8733,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19670,130.2004,3473.6985,19.3535,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19670,108.0003,3332.8167,-12.9014,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19672,216.7155,3422.5000,35.9592,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19672,275.3560,3419.4604,50.1579,0.0000,0.0000,-36.0000,999.0);
+	CreatePlayerObject(playerid,19672,281.1376,3401.6663,54.0688,0.0000,0.0000,72.0000,999.0);
+	CreatePlayerObject(playerid,19672,266.0011,3390.6689,58.0268,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19672,250.8645,3401.6663,61.8254,0.0000,0.0000,-72.0000,999.0);
+	CreatePlayerObject(playerid,19672,256.6462,3419.4604,65.9731,0.0000,0.0000,-144.0000,999.0);
+	CreatePlayerObject(playerid,19672,256.6462,3419.4604,85.7634,0.0000,0.0000,-144.0000,999.0);
+	CreatePlayerObject(playerid,19672,275.3560,3419.4604,69.9482,0.0000,0.0000,-36.0000,999.0);
+	CreatePlayerObject(playerid,19672,281.1376,3401.6663,73.8591,0.0000,0.0000,72.0000,999.0);
+	CreatePlayerObject(playerid,19672,266.0011,3390.6689,77.8171,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19672,250.8645,3401.6663,81.6157,0.0000,0.0000,-72.0000,999.0);
+	CreatePlayerObject(playerid,19672,276.0011,3422.5000,88.0673,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19672,305.9753,3422.5000,88.0673,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19672,327.3069,3417.8904,87.9516,0.0000,0.0000,-45.0000,999.0);
+	CreatePlayerObject(playerid,19550,7.5000,3710.0000,4.3077,0.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19672,331.9166,3366.5771,85.9599,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,331.9166,3316.5845,85.9599,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,331.9166,3346.5918,85.9599,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,331.9166,3266.5923,85.9599,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,331.9166,3296.5999,85.9599,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,327.3070,3245.2786,88.2336,0.0000,0.0000,-135.0000,999.0);
+	CreatePlayerObject(playerid,19672,304.6953,3245.2788,88.1757,0.0000,0.0000,135.0000,999.0);
+	CreatePlayerObject(playerid,19672,297.0461,3285.9395,86.1250,0.0000,0.0000,126.0000,999.0);
+	CreatePlayerObject(playerid,19672,279.2520,3291.7209,82.0771,0.0000,0.0000,16.0000,999.0);
+	CreatePlayerObject(playerid,19672,268.2546,3276.5845,78.2285,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19672,279.2520,3261.4480,73.9912,0.0000,0.0000,-20.0000,999.0);
+	CreatePlayerObject(playerid,19672,297.0460,3267.2297,70.2106,0.0000,0.0000,54.0000,999.0);
+	CreatePlayerObject(playerid,19672,300.0856,3286.5845,68.0976,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,300.0856,3316.5479,68.0976,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,300.0001,3336.5508,68.3325,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,300.0001,3366.5588,68.3325,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,300.0001,3386.5305,68.3325,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,300.0001,3416.5354,68.3325,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,311.1857,3436.5845,68.1464,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,311.1857,3466.5889,68.1464,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,311.1857,3486.5654,68.1464,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,311.1857,3516.5720,68.1464,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,311.1857,3531.8862,91.8754,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,311.1857,3560.2422,91.8754,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,311.1857,3590.2336,91.8754,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,311.1858,3610.2466,89.8444,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,311.1858,3640.2439,89.8444,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,315.7955,3661.5525,91.7584,0.0000,0.0000,45.0000,999.0);
+	CreatePlayerObject(playerid,19540,85.0000,3257.5000,4.3077,0.0000,0.0000,180.0000,999.0);
+	CreatePlayerObject(playerid,19540,-210.0000,3165.0000,4.3077,0.0000,0.0000,180.0000,999.0);
+	CreatePlayerObject(playerid,19540,-210.0000,3710.0000,4.3077,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19672,338.4071,3670.7717,91.8683,0.0000,0.0000,45.0000,999.0);
+	CreatePlayerObject(playerid,19672,346.0564,3691.4324,93.9506,0.0000,0.0000,54.0000,999.0);
+	CreatePlayerObject(playerid,19672,363.8504,3697.2141,97.8625,0.0000,0.0000,-18.0000,999.0);
+	CreatePlayerObject(playerid,19672,374.8478,3682.0776,101.8288,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19672,363.8505,3666.9409,105.8737,0.0000,0.0000,18.0000,999.0);
+	CreatePlayerObject(playerid,19672,346.0564,3672.7227,109.8370,0.0000,0.0000,-54.0000,999.0);
+	CreatePlayerObject(playerid,19672,346.0564,3672.7227,129.7860,0.0000,0.0000,-54.0000,999.0);
+	CreatePlayerObject(playerid,19672,363.8505,3666.9409,125.8226,0.0000,0.0000,18.0000,999.0);
+	CreatePlayerObject(playerid,19672,374.8478,3682.0776,121.7777,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19672,363.8504,3697.2141,117.8115,0.0000,0.0000,-18.0000,999.0);
+	CreatePlayerObject(playerid,19672,346.0564,3691.4324,113.8996,0.0000,0.0000,54.0000,999.0);
+	CreatePlayerObject(playerid,19672,338.4071,3693.3833,131.7450,0.0000,0.0000,-45.0000,999.0);
+	CreatePlayerObject(playerid,19672,311.7588,3697.9929,130.6222,0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19672,287.1232,3697.9929,123.3002,0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19672,269.3201,3697.9929,113.6222,0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19672,243.3627,3697.9929,98.6212,0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19672,226.0258,3697.9929,88.6012,0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19672,200.0598,3697.9929,73.6839,0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19672,178.2511,3697.9929,62.4286,0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19672,154.6358,3697.9929,56.6647,0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19672,35.0058,3697.9932,34.0287,0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19672,5.0128,3697.9932,34.0287,0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19672,5.0128,3666.1621,34.0287,0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19672,35.0058,3666.1621,34.0287,0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19672,55.0236,3666.1621,36.0365,0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19672,85.0416,3666.1621,36.0365,0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19672,105.0083,3666.1621,34.0287,0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19672,134.9800,3666.1621,34.0287,0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19672,159.4567,3669.6313,34.0726,0.0000,0.0000,27.0000,999.0);
+	CreatePlayerObject(playerid,19672,174.5848,3682.5562,34.1170,0.0000,0.0000,45.0000,999.0);
+	CreatePlayerObject(playerid,19672,195.7980,3703.7695,34.1170,0.0000,0.0000,45.0000,999.0);
+	CreatePlayerObject(playerid,19672,215.5406,3718.6057,33.9744,0.0000,0.0000,18.0000,999.0);
+	CreatePlayerObject(playerid,19672,234.7318,3717.1240,34.0809,0.0000,0.0000,-36.0000,999.0);
+	CreatePlayerObject(playerid,19672,241.2924,3694.2480,36.0042,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,241.2924,3664.2678,36.0042,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,241.2924,3504.2703,36.0042,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,241.2924,3474.2324,36.0042,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,241.2924,3434.2769,32.0711,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,241.2924,3404.2515,32.0711,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,241.2924,3384.2493,36.0140,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,241.2924,3354.2383,36.0140,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,241.2924,3334.2317,32.0321,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,241.2924,3304.2390,31.9984,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,215.3770,3278.3325,33.8870,0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19672,185.3680,3278.3325,33.8870,0.0000,0.0000,-0.0000,999.0);
+	
+	TempObjectNumber = CreatePlayerObject(playerid,19652,175.3770,3294.2480,64.8538,180.0000,0.0000,-180.0000,999.0);
+	SetPlayerObjectMaterial(playerid, TempObjectNumber, 0, 19659, "MatTubes", "GreenDirt1", 0);
+	
+	TempObjectNumber = CreatePlayerObject(playerid,19652,175.3769,3294.2480,84.8538,180.0000,0.0000,-180.0000,999.0);
+	SetPlayerObjectMaterial(playerid, TempObjectNumber, 0, 19659, "MatTubes", "GreenDirt1", 0);
+	
+	CreatePlayerObject(playerid,19672,159.4614,3304.2480,114.0335,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,164.0711,3282.9424,113.9617,0.0000,0.0000,-45.0000,999.0);
+	CreatePlayerObject(playerid,19672,184.7318,3281.3721,112.0262,0.0000,0.0000,36.0000,999.0);
+	CreatePlayerObject(playerid,19672,190.5135,3299.1663,107.8524,0.0000,0.0000,-72.0000,999.0);
+	CreatePlayerObject(playerid,19672,175.3769,3310.1636,103.8580,0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19672,160.2404,3299.1663,100.0933,0.0000,0.0000,72.0000,999.0);
+	CreatePlayerObject(playerid,19672,166.0220,3281.3721,95.9705,0.0000,0.0000,-36.0000,999.0);
+	CreatePlayerObject(playerid,19672,159.4614,3334.2378,114.0335,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,159.4614,3354.2266,114.0335,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,159.4614,3384.2668,114.0335,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,159.4614,3412.5928,114.0335,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,159.4614,3486.2449,90.4535,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,159.4614,3559.9297,66.7921,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,159.4614,3579.7673,44.2265,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,159.4615,3427.9221,90.4296,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,159.4615,3457.8840,90.4296,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,159.4613,3620.2524,60.4987,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,159.4613,3646.2703,75.5153,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,159.4613,3668.8413,87.1338,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,159.4613,3693.7808,93.1308,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,190.6684,3739.9441,92.3369,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19672,210.4541,3739.9441,87.6401,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19672,239.4345,3739.9441,79.8874,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19672,263.4093,3739.9441,74.7607,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19672,285.5501,3699.5776,74.1313,-0.0000,0.0000,63.0000,999.0);
+	CreatePlayerObject(playerid,19672,272.6253,3684.4497,74.1723,-0.0000,0.0000,45.0000,999.0);
+	CreatePlayerObject(playerid,19672,251.4121,3663.2366,74.1261,-0.0000,0.0000,45.0000,999.0);
+	CreatePlayerObject(playerid,19672,236.5759,3643.4939,74.1149,-0.0000,0.0000,72.0000,999.0);
+	CreatePlayerObject(playerid,19672,235.0180,3623.6575,74.2145,-0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19672,235.0180,3593.5452,74.2145,-0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19672,235.0180,3573.5925,74.2145,-0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19672,235.0180,3543.6985,74.2145,-0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19672,231.5486,3519.2065,74.1295,-0.0000,0.0000,63.0000,999.0);
+	CreatePlayerObject(playerid,19672,205.9522,3496.3135,74.1754,-0.0000,0.0000,18.0000,999.0);
+	CreatePlayerObject(playerid,19672,186.1409,3494.8167,74.1754,-0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19672,156.0972,3494.8167,74.1754,-0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19672,134.8101,3490.1458,74.2067,-0.0000,0.0000,45.0000,999.0);
+	CreatePlayerObject(playerid,19672,130.2005,3463.4688,72.9750,-0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19672,130.2005,3443.7839,68.1349,-0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19672,130.2005,3414.7671,60.4308,-0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19672,129.9005,3396.0225,56.9608,-0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19672,119.1004,3395.4226,55.3437,-0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19672,119.1004,3366.4854,47.5958,-0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19672,118.8004,3347.7910,44.0340,-0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19672,108.0004,3342.5022,42.2326,-0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19672,108.0004,3272.8323,39.8413,-0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19672,108.0004,3242.8140,39.7832,-0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19649,241.2924,3629.2480,29.3538,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19649,241.2925,3539.2480,29.3539,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19642,241.2924,3589.2480,29.3539,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19642,241.2924,3579.2480,29.3539,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19670,241.7848,3542.6001,-22.0166,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19670,241.2924,3624.2480,-20.6709,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19672,241.2924,3524.2693,34.0474,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,241.2924,3554.2651,34.0474,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,241.2924,3614.2158,34.0474,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,241.2924,3644.2666,34.0474,0.0000,0.0000,-90.0000,999.0);
+	
+	TempObjectNumber = CreatePlayerObject(playerid,19649,159.4614,3516.5723,62.0340,0.0000,-0.0000,-90.0000,999.0);
+	SetPlayerObjectMaterial(playerid, TempObjectNumber, 0, 19659, "MatTubes", "YellowDirt1", 0);
+	
+	CreatePlayerObject(playerid,19672,159.4615,3501.5842,66.7697,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19672,159.4615,3531.5461,66.7697,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19685,159.4614,3577.6987,39.1911,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19685,159.4614,3601.7781,45.6431,0.0000,15.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19646,159.4614,3709.0286,88.9614,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19646,159.4614,3719.0286,88.9614,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19670,235.0180,3533.6575,19.4881,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19670,235.0180,3613.6575,19.4881,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19670,159.4614,3447.9102,35.6692,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19670,159.4614,3521.5723,12.0093,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19670,159.4614,3570.0881,-11.5234,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19661,164.7110,3734.6946,94.4614,-180.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19670,316.0011,3240.6689,33.4567,0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19550,272.4998,3570.0000,4.3080,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19550,147.4997,3570.0000,4.3080,0.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19550,272.4998,3445.0000,4.3080,0.0000,0.0000,180.0000,999.0);
+	CreatePlayerObject(playerid,19550,272.4998,3320.0000,4.3080,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19549,85.0002,3273.7500,4.3077,0.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19542,334.9997,3445.0000,4.3077,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19542,334.9997,3320.0000,4.3077,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19550,147.4997,3445.0000,4.3080,0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19550,147.4997,3320.0000,4.3080,0.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,762,159.2296,3364.1545,8.0631,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,621,172.3828,3530.9956,4.1185,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,621,210.9594,3632.0981,4.1185,0.0000,0.0000,-81.0000,999.0);
+	CreatePlayerObject(playerid,621,216.5798,3372.2180,4.1185,0.0000,0.0000,-55.0000,999.0);
+	CreatePlayerObject(playerid,621,169.0373,3244.0442,4.1185,0.0000,0.0000,21.0000,999.0);
+	CreatePlayerObject(playerid,621,348.5469,3253.4072,4.1185,0.0000,0.0000,71.0000,999.0);
+	CreatePlayerObject(playerid,762,159.7794,3569.8127,8.0631,0.0000,0.0000,40.0000,999.0);
+	CreatePlayerObject(playerid,762,311.5156,3624.8386,8.0631,0.0000,0.0000,78.0000,999.0);
+	CreatePlayerObject(playerid,762,298.8590,3306.5583,8.0631,0.0000,0.0000,126.0000,999.0);
+	CreatePlayerObject(playerid,762,24.2674,3664.7112,8.0631,0.0000,0.0000,169.0000,999.0);
+	CreatePlayerObject(playerid,762,159.5200,3713.7891,8.0631,0.0000,0.0000,-140.0000,999.0);
+	CreatePlayerObject(playerid,762,290.4150,3422.7559,8.0631,0.0000,0.0000,-175.0000,999.0);
+	CreatePlayerObject(playerid,762,240.0694,3678.5208,8.0631,0.0000,0.0000,122.0000,999.0);
+	CreatePlayerObject(playerid,762,107.5217,3293.8779,9.0631,0.0000,0.0000,50.0000,999.0);
+	CreatePlayerObject(playerid,621,60.2490,3681.9932,4.1185,0.0000,0.0000,36.0000,999.0);
+	CreatePlayerObject(playerid,621,313.2220,3679.3630,4.1185,0.0000,0.0000,82.0000,999.0);
+	CreatePlayerObject(playerid,621,267.0584,3501.8621,4.1185,0.0000,0.0000,27.0000,999.0);
+	CreatePlayerObject(playerid,621,263.6267,3280.8892,4.1185,0.0000,0.0000,-52.0000,999.0);
+	CreatePlayerObject(playerid,621,318.7102,3387.3503,4.1185,0.0000,0.0000,42.0000,999.0);
+	CreatePlayerObject(playerid,621,131.9952,3640.5090,4.1185,0.0000,0.0000,121.0000,999.0);
+	CreatePlayerObject(playerid,3509,87.8005,3438.1350,4.1266,0.0000,0.0000,-45.0000,999.0);
+	CreatePlayerObject(playerid,3509,87.8005,3407.0583,4.1266,0.0000,0.0000,62.0000,999.0);
+	CreatePlayerObject(playerid,19649,108.0004,3307.8167,37.1233,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19684,139.8314,3245.2810,36.3063,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19649,139.8315,3281.6802,27.3989,0.0000,-15.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19686,139.8315,3318.0793,18.4916,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19661,145.0810,3451.2097,17.6746,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19649,139.8315,3355.5437,17.6746,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19649,139.8315,3405.5437,17.6746,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19646,139.8315,3435.5437,17.6746,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19649,180.7469,3456.4592,17.6746,0.0000,0.0000,180.0000,999.0);
+	CreatePlayerObject(playerid,19662,216.4129,3461.7087,17.6746,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19662,216.4129,3493.0408,17.6746,0.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19646,221.6624,3477.3748,17.6746,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19649,170.8531,3498.2903,14.6323,0.0000,-5.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19648,130.4799,3498.2903,11.5691,0.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,19642,120.4800,3498.2903,11.5691,0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19650,93.7424,3498.2903,6.9995,0.0000,-19.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19534,77.5000,3500.0000,4.3077,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,3509,87.8005,3513.5872,4.1266,0.0000,0.0000,-45.0000,999.0);
+	CreatePlayerObject(playerid,3509,87.8005,3482.5103,4.1266,0.0000,0.0000,62.0000,999.0);
+	CreatePlayerObject(playerid,19672,108.0004,3322.8167,41.8230,-0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19672,108.0004,3292.8167,41.8230,-0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19672,112.6100,3221.5107,41.8151,0.0000,0.0000,135.0000,999.0);
+	CreatePlayerObject(playerid,19672,135.2216,3221.5107,41.8151,0.0000,0.0000,-135.0000,999.0);
+	CreatePlayerObject(playerid,19672,139.8314,3244.9832,40.9682,-0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19672,139.8314,3267.9055,35.9077,-0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19672,139.8314,3296.8618,28.1914,-0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19672,139.8314,3317.8293,23.2563,-0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19672,139.8314,3340.5437,22.4207,-0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19672,139.8314,3370.5759,22.4207,-0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19672,139.8314,3390.5437,22.4207,-0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19672,139.8314,3420.5437,22.4207,-0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19672,144.4411,3451.8496,22.4207,-0.0000,0.0000,45.0000,999.0);
+	CreatePlayerObject(playerid,19672,165.7469,3456.4592,22.4207,-0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19672,195.7418,3456.4592,22.4207,-0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19672,217.0527,3461.0688,22.4207,-0.0000,0.0000,45.0000,999.0);
+	CreatePlayerObject(playerid,19672,217.0528,3493.6804,22.4207,-0.0000,0.0000,-45.0000,999.0);
+	CreatePlayerObject(playerid,19672,185.5585,3498.2903,20.4852,-0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19672,155.6512,3498.2903,17.9867,-0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19670,108.0004,3257.8167,-17.4014,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19670,139.8314,3232.8167,-12.9015,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19670,139.8315,3330.5437,-32.3501,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19670,139.8315,3410.5437,-32.3501,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19670,185.7469,3456.4592,-32.3501,0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19670,175.5944,3498.2903,-34.9671,0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19659,123.9158,3222.1506,37.1233,0.0000,0.0000,90.0000,999.0);
+	CreatePlayerObject(playerid,19542,147.4997,3257.5000,4.3080,0.0000,0.0000,-90.0000,999.0);
+	CreatePlayerObject(playerid,19543,77.5002,3383.7500,4.3077,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19536,7.5000,3461.2500,4.3077,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19536,7.5000,3803.7500,4.3077,0.0000,0.0000,0.0000,999.0);
+	CreatePlayerObject(playerid,19550,147.4997,3695.0000,4.3080,0.0000,0.0000,-0.0000,999.0);
+	CreatePlayerObject(playerid,19550,272.4998,3695.0000,4.3080,0.0000,0.0000,-180.0000,999.0);
+	CreatePlayerObject(playerid,621,236.0952,3742.8730,4.1185,0.0000,0.0000,125.0000,999.0);
+	CreatePlayerObject(playerid,19536,7.5000,3383.7500,4.3077,0.0000,0.0000,0.0000,999.0);
+
+	// Exit here
+	return 1;
+}
+
+public SIAutoFix()
+{
+	// AutoFix Timer
+	// -------------
+
+	// Loop
+	for (new playerid = 0; playerid < MAX_PLAYERS; playerid++)
+	{
+	    // Check if the player is connected, is not a NPC and has AutoFix enabled
+	    if (IsPlayerConnected(playerid) && !IsPlayerNPC(playerid) && SIAutoFixDisabled[playerid] == 0)
+	    {
+	        // Check if player is the driver of the vehicle
+            if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
+            {
+				// Get vehicle health
+				new Float:CurVehicleHealth;
+				new playervid = GetPlayerVehicleID(playerid);
+				GetVehicleHealth(playervid, CurVehicleHealth);
+
+				// Check if the vehicles health is less than 990... if so repair the vehicle
+				// (repairs bodywork and sets vehicle health to 1000)
+				if (CurVehicleHealth < 990) RepairVehicle(playervid);
+			}
+	    }
+	}
+
+	// Exit here
+	return 1;
+}
+
+// return true if provide vehicleid is an infernus created by this script
+IsSIInfernus(vehicleid)
+{
+	for (new i = 0; i < NUM_SI_VEHICLES; i++)
+	{
+	    if(SIInfernus[i] == vehicleid) return true;
+	}
+	return false;
+}
+

BIN
samp03/filterscripts/test_cmds.amx


+ 1952 - 0
samp03/filterscripts/test_cmds.pwn

@@ -0,0 +1,1952 @@
+//-------------------------------------------------
+//
+//  SA-MP 0.3+ commands for internal testing.
+//  These were left in the distribution in case
+//  anyone found the snippets useful for their
+//  own scripts.
+//  Don't load this script on a public server
+//  as it could break your existing scripts.
+//  Kye 2009-2015
+//
+//-------------------------------------------------
+
+#pragma tabsize 0
+
+#include <a_samp>
+#include <core>
+#include <float>
+
+#include "../include/gl_common.inc"
+
+new Text3D:textid;
+new PlayerText3D:player3dtextid;
+
+new savanna=0;
+new blade=0;
+new fence=0;
+
+new unfreezeplayer=0;
+new testlbplayer=0;
+
+new edit_objectid = INVALID_OBJECT_ID;
+new vehicleid_tokill = 0;
+
+// For testing text material/texture replacements
+new test_tex_objects[128];
+new text_counter = 0;
+new text_update_timer = -1;
+new text_update_player = INVALID_PLAYER_ID;
+
+forward UnFreezeMe();
+forward ShowTestDialog();
+forward TimedVehicleDeath();
+forward UpdateTextTimer();
+
+#define     AMMUNATION_SMGS_DIALOG      "\
+Weapon\tAmount\tPrice\n\
+{FFFFFF}MP5\t90\t{FF0000}$3500\
+"
+
+new Text:txtSpriteTest[5];
+
+new test_actor_id = INVALID_ACTOR_ID;
+
+//-------------------------------------------------
+
+SpawnVehicle_InfrontOfPlayer(playerid, vehiclemodel, color1, color2)
+{
+	new Float:x,Float:y,Float:z;
+	new Float:facing;
+	new Float:distance;
+
+    GetPlayerPos(playerid, x, y, z);
+    GetPlayerFacingAngle(playerid, facing);
+
+    new Float:size_x,Float:size_y,Float:size_z;
+	GetVehicleModelInfo(vehiclemodel, VEHICLE_MODEL_INFO_SIZE, size_x, size_y, size_z);
+
+	distance = size_x + 0.5;
+
+  	x += (distance * floatsin(-facing, degrees));
+    y += (distance * floatcos(-facing, degrees));
+
+	facing += 90.0;
+	if(facing > 360.0) facing -= 360.0;
+
+	return CreateVehicle(vehiclemodel, x, y, z + (size_z * 0.25), facing, color1, color2, -1);
+}
+
+//-------------------------------------------------
+
+stock CreateExplosionEx(Float:X, Float:Y, Float:Z, type, Float:Radius, virtualworld)
+{
+	new x;
+	while(x != MAX_PLAYERS) {
+		if(IsPlayerConnected(x)) {
+   			if(virtualworld == -1 || virtualworld == GetPlayerVirtualWorld(x)) {
+				CreateExplosionForPlayer(x, X, Y, Z, type, Radius);
+			}
+		}
+		x++;
+	}
+}
+
+//-------------------------------------------------
+
+public UnFreezeMe()
+{
+	TogglePlayerControllable(unfreezeplayer,1);
+}
+
+//-------------------------------------------------
+
+public ShowTestDialog()
+{
+      new listitems[] = "{FFFFFF}1\t{55EE55}Deagle\n{FFFFFF}2\t{55EE55}Sawnoff\n{FFFFFF}3\t{55EE55}Pistol\n{FFFFFF}4\t{55EE55}Grenade\n{FFFFFF}5\t{55EE55}Parachute\n6\t{55EE55}Lorikeet";
+	  ShowPlayerDialog(testlbplayer,2,DIALOG_STYLE_LIST,"{448844}List of weapons:",listitems,"Select","Cancel");
+}
+
+//-------------------------------------------------
+
+TabListDialogTest(playerid)
+{
+      new listitems[] =
+  	  "Deagle\t$5000\t100\n" \
+	  "Sawnoff\t$5000\t100\n" \
+	  "Pistol\t$1000\t50\n" \
+	  "M4\t$10000\t100\n" \
+	  "MP5\t$7500\t200\n" \
+	  "Grenade\t$500\t1\n" \
+	  "Parachute\t$10000\t1\n" \
+	  "Lorikeet\t$50000\t500\n";
+
+	  ShowPlayerDialog(playerid,2,DIALOG_STYLE_TABLIST,"Buy Weapon",listitems,"Select","Cancel");
+}
+
+//-------------------------------------------------
+
+TabListHeadersDialogTest(playerid)
+{
+      new listitems[] =
+      "Weapon\tPrice\tAmmo\n" \
+  	  "Deagle\t$5000\t100\n" \
+	  "Sawnoff\t$5000\t100\n" \
+	  "Pistol\t$1000\t50\n" \
+	  "M4\t$10000\t100\n" \
+	  "MP5\t$7500\t200\n" \
+	  "Grenade\t$500\t1\n" \
+	  "Parachute\t$10000\t1\n" \
+	  "Lorikeet\t$50000\t500\n";
+
+	  ShowPlayerDialog(playerid,2,DIALOG_STYLE_TABLIST_HEADERS,"Buy Weapon",listitems,"Select","Cancel");
+}
+
+//-------------------------------------------------
+
+public TimedVehicleDeath()
+{
+	if(vehicleid_tokill > 0) {
+	    DestroyVehicle(vehicleid_tokill);
+	}
+}
+
+//-------------------------------------------------
+
+public UpdateTextTimer()
+{
+	new textdisp[256+1];
+	format(textdisp,256,"Dynamic Update (%d)", text_counter);
+	text_counter++;
+	
+	SetPlayerObjectMaterialText(text_update_player, test_tex_objects[0], textdisp, 0, OBJECT_MATERIAL_SIZE_512x128, "Courier New", 48, 1, 0xFF000000, 0, 0);
+}
+
+//-------------------------------------------------
+
+public OnPlayerCommandText(playerid, cmdtext[])
+{
+	new cmd[256+1];
+	new idx;
+	cmd = strtok(cmdtext, idx);
+	new engine,lights,alarm,doors,bonnet,boot,objective;
+	
+	//if(!IsPlayerAdmin(playerid)) return 0; // this is an admin only script
+
+	if(strcmp(cmd, "/player2v", true) == 0)
+	{
+  		new tmp[256];
+	  	new tmp2[256];
+		tmp = strtok(cmdtext,idx);
+		tmp2 = strtok(cmdtext,idx);
+		PutPlayerInVehicle(strval(tmp),strval(tmp2),0);
+	    return 1;
+	}
+
+	if(strcmp( cmd, "/vc", true ) == 0 )
+	{
+		new tmp[256];
+		new created_vehicle_id;
+		tmp = strtok( cmdtext, idx );
+		
+		created_vehicle_id = SpawnVehicle_InfrontOfPlayer(playerid, strval(tmp), -1, -1);
+
+		new msg[128+1];
+		format(msg,128,"Created vehicle: %d",created_vehicle_id);
+		SendClientMessage(playerid,0xAAAAAAAA,msg);
+
+		return 1;
+	}
+	
+
+	if(strcmp( cmd, "/weap", true ) == 0 )
+	{
+		new tmp[256];
+		tmp = strtok( cmdtext, idx );
+		GivePlayerWeapon(playerid, strval(tmp), 9999);
+		return 1;
+	}
+
+	if(strcmp( cmd, "/dvehicle", true ) == 0 )
+	{
+		new tmp[256];
+		tmp = strtok( cmdtext, idx );
+
+		DestroyVehicle( strval(tmp) );
+
+		new msg[256];
+		format(msg,256,"Destroyed vehicle: %d",strval(tmp));
+		SendClientMessage(playerid,0xAAAAAAAA,msg);
+
+		return 1;
+	}
+
+	if(strcmp( cmd, "/goto", true ) == 0)
+	{
+	    new tmp[256];
+
+	    tmp = strtok(cmdtext,idx);
+	    if(!strlen(tmp)) { return 1; }
+
+	    new Float:X, Float:Y, Float:Z;
+
+	    if(GetPlayerVehicleID(playerid))
+	    {
+		    GetPlayerPos( strval(tmp), X, Y, Z );
+		    SetVehiclePos( GetPlayerVehicleID(playerid), X+2, Y+2, Z );
+	    } else {
+		    GetPlayerPos( strval(tmp), X, Y, Z );
+		    SetPlayerPos( playerid, X+2, Y+2, Z );
+	    }
+
+	    return 1;
+	}
+
+	if(strcmp(cmd, "/bring", true) == 0)
+	{
+	    new tmp[256];
+
+	    tmp = strtok(cmdtext, idx);
+
+	    if(!strlen(tmp)) { return 1; }
+
+	    new Float:X, Float:Y, Float:Z;
+
+	    if(GetPlayerVehicleID(strval(tmp)))
+	    {
+		    GetPlayerPos(playerid, X, Y, Z);
+		    SetVehiclePos(GetPlayerVehicleID(strval(tmp)), X+2, Y+2, Z);
+	    } else {
+		    GetPlayerPos(playerid, X, Y, Z);
+		    SetPlayerPos(strval(tmp), X+2, Y+2, Z);
+	    }
+	    
+	    return 1;
+	}
+
+	if(strcmp(cmd, "/me2v", true) == 0)
+	{
+	  	new tmp[256];
+		tmp = strtok(cmdtext,idx);
+		PutPlayerInVehicle(playerid,strval(tmp),0);
+	    return 1;
+	}
+
+	if(strcmp(cmd, "/tpzero", true) == 0)
+	{
+	  	new vid = GetPlayerVehicleID(playerid);
+	  	if(vid != INVALID_VEHICLE_ID) {
+			SetVehiclePos(vid,0.0,0.0,10.0);
+		}
+	    return 1;
+	}
+
+	if(strcmp(cmd, "/myvw", true) == 0)
+	{
+        new tmp[256];
+		tmp = strtok(cmdtext,idx);
+		SetPlayerVirtualWorld(playerid,strval(tmp));
+	    return 1;
+	}
+
+	if(strcmp( cmd, "/fight", true ) == 0)
+	{
+		new tmp[256];
+		new name[128];
+
+		tmp = strtok(cmdtext, idx);
+		new style = strval(tmp);
+		SetPlayerFightingStyle(playerid, style);
+		GetPlayerName(playerid,name,128);
+		format(tmp, 256, "(%s) fighting style changed to %d", name, style);
+		SendClientMessageToAll(0x4499CCFF,tmp);
+		return 1;
+	}
+
+	if(strcmp( cmd, "/myfacingangle", true ) == 0)
+	{
+	    new Float:angle;
+	    new tmp[256];
+	    GetPlayerFacingAngle(playerid,angle);
+		format(tmp, 256, "Facing: %f",angle);
+		SendClientMessage(playerid,0x4499CCFF,tmp);
+		return 1;
+	}
+
+	if(strcmp(cmd, "/crime", true) == 0) {
+	    new tmp[256];
+	  	new tmp2[256];
+		tmp = strtok(cmdtext,idx);
+		tmp2 = strtok(cmdtext,idx);
+		PlayCrimeReportForPlayer(playerid, strval(tmp), strval(tmp2));
+		return 1;
+	}
+
+	if(strcmp(cmd, "/repairmycar", true) == 0) {
+	    new vid = GetPlayerVehicleID(playerid);
+	    if (vid) RepairVehicle(vid);
+		return 1;
+	}
+
+    if(strcmp(cmd, "/bv", true) == 0)
+	{
+		new tmp[128], iCar, string[128];
+
+		tmp = strtok(cmdtext, idx);
+
+		if(strlen(tmp) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "DO: /bv [vehicleid]");
+
+		iCar = strval(tmp);
+
+		new File:file = fopen("badvehicles.txt",io_append);
+		format(string,sizeof(string),"%d\r\n", iCar);
+		fwrite(file,string);
+		fclose(file);
+
+		GetPlayerName(playerid,tmp,128);
+		format(string, sizeof(string), "Veh ID %i marked as bad vehicle by %s", iCar, tmp);
+		SendClientMessageToAll(0xFFFFFFFF, string);
+		return 1;
+	}
+
+	if(strcmp(cmd, "/weapskill", true) == 0) {
+	    new tmp[256];
+	  	new tmp2[256];
+		tmp = strtok(cmdtext,idx);
+		tmp2 = strtok(cmdtext,idx);
+		SetPlayerSkillLevel(playerid, strval(tmp), strval(tmp2));
+		return 1;
+	}
+
+	if(strcmp(cmd, "/labelonvehicle", true) == 0) {
+	    new vid = GetPlayerVehicleID(playerid);
+	    textid = Create3DTextLabel("My Vehicle\nOwned by me\nNo Fuel\nRunning on vapour",0xEEEEEE50,0.0,0.0,0.0,15.0,0);
+	    Attach3DTextLabelToVehicle(textid, vid, 0.0, -1.6, -0.35); // tail of the vehicle toward the ground
+		return 1;
+	}
+
+	if(strcmp(cmd, "/labelonplayer", true) == 0) {
+		new tmp[256];
+		tmp = strtok(cmdtext,idx);
+ 		textid = Create3DTextLabel("Player Label",0xFFFFFFFF,0.0,0.0,0.0,40.0,0);
+	    Attach3DTextLabelToPlayer(textid, strval(tmp), 0.0, 0.0, -0.4);
+		return 1;
+	}
+
+	if(strcmp(cmd, "/manylabels", true) == 0) {
+	    new Float:X, Float:Y, Float:Z;
+	    GetPlayerPos(playerid, X, Y, Z);
+	    new x=0;
+	    while(x!=50) {
+ 			Create3DTextLabel("Mah Labels",0xFFFFFFFF,X,Y,Z,100.0,0);
+ 			Z = Z + 0.1;
+ 			x++;
+		}
+		return 1;
+	}
+
+    if(strcmp(cmd, "/dellabel", true) == 0) {
+	    Delete3DTextLabel(textid);
+		return 1;
+	}
+
+	if(strcmp(cmd, "/playerlabel", true) == 0) {
+	    new Float:X, Float:Y, Float:Z;
+	    GetPlayerPos( playerid, X, Y, Z );
+	    player3dtextid = CreatePlayer3DTextLabel(playerid,"Hello\nI'm at your position",0x008080FF,X,Y,Z,40.0);
+	    SendClientMessage(playerid, 0xFFFFFFFF, "I created a player label at your position.");
+		return 1;
+	}
+
+	if(strcmp(cmd, "/playerlabelveh", true) == 0) {
+	    new vid = GetPlayerVehicleID(playerid);
+	    player3dtextid = CreatePlayer3DTextLabel(playerid,"im in your vehicles\nand hiding behind the walls",0x008080FF,0.0,-1.6,-0.35,20.0,INVALID_PLAYER_ID,vid,1);
+		return 1;
+	}
+
+	if(strcmp(cmd, "/playerlabelpl", true) == 0) {
+	    new tmp[256];
+		tmp = strtok(cmdtext,idx);
+	    player3dtextid = CreatePlayer3DTextLabel(playerid,"Hello Testing",0x008080FF,0.0,0.0,0.0,30.0,strval(tmp));
+		return 1;
+	}
+
+    if(strcmp(cmd, "/delplayerlabel", true) == 0) {
+	    DeletePlayer3DTextLabel(playerid, player3dtextid);
+		return 1;
+	}
+
+	if(strcmp(cmd, "/updateplayerlabel", true) == 0) {
+	    UpdatePlayer3DTextLabelText(playerid, player3dtextid, 0xFFFFFFFF, "");
+		return 1;
+	}
+
+	if(strcmp(cmd, "/carmodtest", true) == 0) {
+	    // spawns a couple of cars in Grove with mods applied
+	   	savanna = CreateVehicle(567,2509.1343,-1686.2330,13.2296,47.3679,16,16,10000);
+		AddVehicleComponent(savanna,1189); //Front Bumper
+		AddVehicleComponent(savanna,1187); //Rear Bumper
+		AddVehicleComponent(savanna,1129); //Exhaust
+		AddVehicleComponent(savanna,1102); //Left Side Skirt
+		AddVehicleComponent(savanna,1133); //Right Side Skirt
+		AddVehicleComponent(savanna,1078); //Wheels
+		AddVehicleComponent(savanna,1010); //Nitro 10x
+		AddVehicleComponent(savanna,1087); //Hydrolics
+
+		blade = CreateVehicle(536,2509.8462,-1671.8666,13.1510,348.3512,16,16,10000);
+		AddVehicleComponent(blade,1182); //Front Bumper
+		AddVehicleComponent(blade,1184); //Rear Bumper
+		AddVehicleComponent(blade,1104); //Exhaust
+		AddVehicleComponent(blade,1108); //Left Side Skirt
+		AddVehicleComponent(blade,1107); //Right Side Skirt
+		AddVehicleComponent(blade,1078); //Wheels
+		AddVehicleComponent(blade,1010); //Nitro 10x
+		AddVehicleComponent(blade,1087); //Hydrolics
+  		return 1;
+	}
+
+	if(strcmp(cmd, "/addnitro", true) == 0) {
+	    new vid = GetPlayerVehicleID(playerid);
+	    AddVehicleComponent(vid, 1010);
+	    return 1;
+	}
+
+
+	if(strcmp(cmd, "/remnitro", true) == 0) {
+        new vid = GetPlayerVehicleID(playerid);
+	    RemoveVehicleComponent(vid, 1010);
+	    return 1;
+	}
+
+	if(strcmp(cmd, "/paintjob", true) == 0) {
+	    new tmp[256];
+		tmp = strtok(cmdtext,idx);
+	    new vid = GetPlayerVehicleID(playerid);
+		ChangeVehiclePaintjob(vid,strval(tmp));
+		return 1;
+	}
+
+	if(strcmp(cmd, "/longtd", true) == 0) {
+  		new st4[256];
+  		new st5[256];
+		new st6[256];
+		new st7[1024];
+
+		format(st4,sizeof(st4),"0123456789012345678901234567890123456789~n~012345678901234567890123456789~n~01234567890123456789~n~0123456789~n~0123456789012345678901234567890123456789~n~01234567890123456789~n~01234567890123456789~n~01234567890123456789~n~");
+		format(st5,sizeof(st5),"0123456789012345678901234567890123456789~n~012345678901234567890123456789~n~01234567890123456789~n~0123456789~n~0123456789012345678901234567890123456789~n~01234567890123456789~n~01234567890123456789~n~01234567890123456789~n~");
+		format(st6,sizeof(st6),"0123456789012345678901234567890123456789~n~012345678901234567890123456789~n~01234567890123456789~n~0123456789~n~0123456789012345678901234567890123456789~n~01234567890123456789~n~01234567890123456789~n~01234567890123456789");
+		format(st7,sizeof(st7),"%s %s %s~n~LEN(%d)",st4,st5,st6,strlen(st4)+strlen(st5)+strlen(st6));
+
+        new Text:Stats = TextDrawCreate(10.0, 10.0, st7);
+		TextDrawTextSize(Stats, 400.0, 400.0);
+		TextDrawUseBox(Stats,0);
+		TextDrawBoxColor(Stats,0xFFFFFFFF);
+		TextDrawFont(Stats,1);
+		TextDrawLetterSize(Stats,0.5,0.5);
+		TextDrawShowForPlayer(playerid,Stats);
+		return 1;
+	}
+	
+	if(strcmp(cmd, "/testmsgbox", true) == 0) {
+		ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"Welcome","Welcome to the SA-MP 0.3 server. This is test_cmds.pwn /testmsgbox\nHope it's useful to you.","OK","");
+        return 1;
+	}
+	
+	if(strcmp(cmd, "/testmsgbox2", true) == 0) {
+		ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"Welcome","Welcome:\tInfo\nTest:\t\tTabulated\nLine:\t\tHello","OK","Cancel");
+        return 1;
+	}
+
+	if(strcmp(cmd, "/testinputbox", true) == 0) {
+	    new loginmsg[256+1];
+	    new loginname[MAX_PLAYER_NAME+1];
+	    GetPlayerName(playerid,loginname,MAX_PLAYER_NAME);
+	    format(loginmsg,256,"Welcome to the SA-MP 0.3 server.\n\n{EEEE88}Account:\t{FFFFFF}%s\n\n{FFFFFF}Please enter your password below:",loginname);
+		ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"{EE7777}Login to SA-MP",loginmsg,"Login","Cancel");
+        return 1;
+	}
+
+	if(strcmp(cmd, "/testpassbox", true) == 0) {
+	    new loginmsg[256+1];
+	    new loginname[MAX_PLAYER_NAME+1];
+	    GetPlayerName(playerid,loginname,MAX_PLAYER_NAME);
+	    format(loginmsg,256,"Welcome to the SA-MP 0.3 server.\n\n{EEEE88}Account:\t{FFFFFF}%s\n\n{FFFFFF}Please enter your password below:",loginname);
+		ShowPlayerDialog(playerid,1,DIALOG_STYLE_PASSWORD,"{EE7777}Login to SA-MP",loginmsg,"Login","Cancel");
+        return 1;
+	}
+	
+	if(strcmp(cmd, "/testlistbox", true) == 0) {
+	    new listitems[] = "{FFFFFF}1\t{55EE55}Deagle\n{FFFFFF}2\t{55EE55}Sawnoff\n{FFFFFF}3\t{55EE55}Pistol\n{FFFFFF}4\t{55EE55}Grenade\n{FFFFFF}5\t{55EE55}Parachute\n6\t{55EE55}Lorikeet";
+	    ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST,"{448844}List of weapons:",listitems,"Select","Cancel");
+        return 1;
+	}
+	
+	if(strcmp(cmd, "/testtablist", true) == 0) {
+	    TabListDialogTest(playerid);
+        return 1;
+	}
+	
+	if(strcmp(cmd, "/testtablistheaders", true) == 0) {
+	    TabListHeadersDialogTest(playerid);
+        return 1;
+	}
+
+	if(strcmp(cmd, "/testtablistcrash", true) == 0) {
+		//ShowPlayerDialog(playerid,2,DIALOG_STYLE_TABLIST_HEADERS,"{FFFF00}SMGs", "Weapon\tAmount\tPrice\n{FFFFFF}MP5\t90\t{FF0000}$3500","Buy", "Go Back");
+        ShowPlayerDialog(playerid,2,DIALOG_STYLE_TABLIST_HEADERS,"{FFFF00}SMGs", AMMUNATION_SMGS_DIALOG, "Buy", "Go Back");
+		return 1;
+	}
+	
+    if(strcmp(cmd, "/testclosebox", true) == 0) {
+	    ShowPlayerDialog(playerid,-1,0,"","","","");
+        return 1;
+	}
+
+    if(strcmp(cmd, "/setfacingzero", true) == 0) {
+	    SetPlayerFacingAngle(playerid, 0.0);
+        return 1;
+	}
+
+    if(strcmp(cmd, "/detachtrailer", true) == 0) {
+        new vid = GetPlayerVehicleID(playerid);
+	    DetachTrailerFromVehicle(vid);
+        return 1;
+	}
+	
+	if(strcmp(cmd, "/testformat", true) == 0) {
+	    new strtest[256];
+	    new File:f = fopen("test.txt",io_write);
+	    format(strtest,256,"[chat] %d %s\r\n",24,"þÿÿþ");
+	    SendClientMessage(playerid,0xFFFFFFFF,strtest);
+	    fwrite(f,strtest);
+	    format(strtest,256,"[chat] %d %s\r\n",34," þÿÿþ");
+	    SendClientMessage(playerid,0xFFFFFFFF,strtest);
+	    fwrite(f,strtest);
+	    fclose(f);
+	    return 1;
+	}
+
+	if(strcmp(cmd, "/setskin", true) == 0) {
+        new tmp[256];
+		tmp = strtok(cmdtext,idx);
+		SetPlayerSkin(playerid,strval(tmp));
+	    return 1;
+	}
+	
+	if(strcmp(cmd, "/setvars", true) == 0) {
+		SetPVarInt(playerid,"num_test",7001);
+		SetPVarString(playerid,"additional_tag","Hello World");
+		SetPVarFloat(playerid,"some_float",1001.0);
+		SendClientMessage(playerid,0xFFFFFFFF, "Vars set");
+	    return 1;
+	}
+	
+	if(strcmp(cmd, "/modvars", true) == 0) {
+		SetPVarInt(playerid,"num_test",8001);
+		SetPVarString(playerid,"additional_tag","World Hello");
+		SetPVarFloat(playerid,"some_float",6901.0);
+		SendClientMessage(playerid,0xFFFFFFFF, "Vars modded");
+	    return 1;
+	}
+	
+	if(strcmp(cmd, "/getvars", true) == 0) {
+	
+		new tst_IntRet;
+		new Float:tst_FloatRet;
+		new tst_StrRet[256];
+		new tst_DispStr[256];
+		
+		tst_IntRet = GetPVarInt(playerid,"num_test");
+		tst_FloatRet = GetPVarFloat(playerid,"some_float");
+ 		GetPVarString(playerid,"additional_tag",tst_StrRet,256);
+ 		
+		format(tst_DispStr,256,"num_test: %d some_float: %f additional_tag: %s",tst_IntRet,tst_FloatRet,tst_StrRet);
+		SendClientMessage(playerid,0xFFFFFFFF, tst_DispStr);
+		
+	    return 1;
+	}
+	
+	if(strcmp(cmd, "/delvars", true) == 0) {
+		DeletePVar(playerid,"num_test");
+		DeletePVar(playerid,"additional_tag");
+		DeletePVar(playerid,"some_float");
+		SendClientMessage(playerid,0xFFFFFFFF, "Vars deleted");
+	    return 1;
+	}
+
+	if(strcmp(cmd, "/pvarlist", true) == 0) {
+		SendPVarListToPlayer(playerid);
+	    return 1;
+	}
+
+	if(strcmp(cmd, "/kill",true) == 0) {
+	    SetPlayerHealth(playerid,0.0);
+	    return 1;
+	}
+	
+	if(strcmp(cmd, "/kickallnpc",true) == 0) {
+		new p=0;
+		while(p!=MAX_PLAYERS) {
+			if(IsPlayerConnected(p) && IsPlayerNPC(p)) Kick(p);
+			p++;
+		}
+	    return 1;
+	}
+	
+	if(strcmp(cmd, "/startengine",true) == 0) {
+        new vid = GetPlayerVehicleID(playerid);
+	  	if(vid != INVALID_VEHICLE_ID) {
+	  	    GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
+	  	    SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
+		}
+	    return 1;
+	}
+	if(strcmp(cmd, "/stopengine",true) == 0) {
+        new vid = GetPlayerVehicleID(playerid);
+	  	if(vid != INVALID_VEHICLE_ID) {
+	  	    GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
+	  	    SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
+		}
+	    return 1;
+	}
+	
+	if(strcmp(cmd, "/openboot",true) == 0) {
+        new vid = GetPlayerVehicleID(playerid);
+	  	if(vid != INVALID_VEHICLE_ID) {
+	  	    GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
+	  	    SetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_ON,objective);
+		}
+	    return 1;
+	}
+	if(strcmp(cmd, "/closeboot",true) == 0) {
+        new vid = GetPlayerVehicleID(playerid);
+	  	if(vid != INVALID_VEHICLE_ID) {
+	  	    GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
+	  	    SetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_OFF,objective);
+		}
+	    return 1;
+	}
+	if(strcmp(cmd, "/openbonnet",true) == 0) {
+        new vid = GetPlayerVehicleID(playerid);
+	  	if(vid != INVALID_VEHICLE_ID) {
+	  	    GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
+	  	    SetVehicleParamsEx(vid,engine,lights,alarm,doors,VEHICLE_PARAMS_ON,boot,objective);
+		}
+	    return 1;
+	}
+	if(strcmp(cmd, "/closebonnet",true) == 0) {
+        new vid = GetPlayerVehicleID(playerid);
+	  	if(vid != INVALID_VEHICLE_ID) {
+	  	    GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
+	  	    SetVehicleParamsEx(vid,engine,lights,alarm,doors,VEHICLE_PARAMS_OFF,boot,objective);
+		}
+	    return 1;
+	}
+	if(strcmp(cmd, "/alarmon",true) == 0) {
+        new vid = GetPlayerVehicleID(playerid);
+	  	if(vid != INVALID_VEHICLE_ID) {
+	  	    GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
+	  	    SetVehicleParamsEx(vid,engine,lights,VEHICLE_PARAMS_ON,doors,bonnet,boot,objective);
+		}
+	    return 1;
+	}
+	if(strcmp(cmd, "/alarmoff",true) == 0) {
+        new vid = GetPlayerVehicleID(playerid);
+	  	if(vid != INVALID_VEHICLE_ID) {
+	  	    GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
+	  	    SetVehicleParamsEx(vid,engine,lights,VEHICLE_PARAMS_OFF,doors,bonnet,boot,objective);
+		}
+	    return 1;
+	}
+	if(strcmp(cmd, "/lightson",true) == 0) {
+        new vid = GetPlayerVehicleID(playerid);
+	  	if(vid != INVALID_VEHICLE_ID) {
+	  	    GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
+	  	    SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,objective);
+		}
+	    return 1;
+	}
+	if(strcmp(cmd, "/lightsoff",true) == 0) {
+        new vid = GetPlayerVehicleID(playerid);
+	  	if(vid != INVALID_VEHICLE_ID) {
+	  	    GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
+	  	    SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
+		}
+	    return 1;
+	}
+
+	if(strcmp(cmd, "/holdobjectid",true) == 0) {
+	    new tmp[256];
+		tmp = strtok(cmdtext,idx);
+		SetPlayerAttachedObject(playerid,0,strval(tmp),6);
+		SetPlayerAttachedObject(playerid,1,strval(tmp),5);
+		//SetPlayerAttachedObject(playerid, 0, 1254,2, 0.1,0.05,0,0,90,0);
+	    return 1;
+	}
+
+	if(strcmp(cmd, "/removeheld",true) == 0) {
+		new zz=0;
+		while(zz!=MAX_PLAYER_ATTACHED_OBJECTS) {
+		    if(IsPlayerAttachedObjectSlotUsed(playerid, zz)) {
+		        RemovePlayerAttachedObject(playerid, zz);
+			}
+			zz++;
+		}
+	    return 1;
+	}
+
+	if(strcmp(cmd, "/attachobj",true) == 0) {
+	    new tmp[256];
+		tmp = strtok(cmdtext,idx);
+		new obj = CreateObject(strval(tmp),0.0,0.0,0.0,0.0,0.0,0.0,200.0);
+		AttachObjectToVehicle(obj,GetPlayerVehicleID(playerid),0.0,0.0,1.0,0.0,0.0,0.0);
+		return 1;
+	}
+	
+	if(strcmp(cmd, "/attachtome",true) == 0) {
+	    new tmp[256];
+		tmp = strtok(cmdtext,idx);
+		new obj = CreateObject(strval(tmp),0.0,0.0,0.0,0.0,0.0,0.0,200.0);
+		AttachObjectToPlayer(obj,playerid,0.0,0.0,2.0,0.0,0.0,0.0);
+		return 1;
+	}
+
+	if(strcmp(cmd, "/mapicontest",true) == 0) {
+	    new Float:X, Float:Y, Float:Z;
+ 		GetPlayerPos(playerid, X, Y, Z);
+ 		SetPlayerCheckpoint(playerid,X,Y,Z,5.0);
+	   	SetPlayerMapIcon(playerid, 1, X+50.0, Y, Z, 52, 0, MAPICON_LOCAL_CHECKPOINT);
+	   	SetPlayerMapIcon(playerid, 2, X+100.0, Y, Z, 53, 0, MAPICON_LOCAL_CHECKPOINT);
+	   	SetPlayerMapIcon(playerid, 3, X+150.0, Y, Z, 54, 0, MAPICON_LOCAL_CHECKPOINT);
+	   	SetPlayerMapIcon(playerid, 4, X+200.0, Y, Z, 55, 0, MAPICON_LOCAL_CHECKPOINT);
+	   	SetPlayerMapIcon(playerid, 5, X+250.0, Y, Z, 0, 0x00FF00FF);
+		return 1;
+	}
+	
+	if(strcmp(cmd, "/mapicondel",true) == 0) {
+        RemovePlayerMapIcon(playerid, 1);
+        RemovePlayerMapIcon(playerid, 2);
+        RemovePlayerMapIcon(playerid, 3);
+        RemovePlayerMapIcon(playerid, 4);
+        RemovePlayerMapIcon(playerid, 5);
+     	return 1;
+	}
+	
+	if(strcmp(cmd, "/mapicontest2",true) == 0) {
+	    new Float:X, Float:Y, Float:Z;
+ 		GetPlayerPos(playerid, X, Y, Z);
+		RemovePlayerMapIcon(playerid, 0);
+		SetPlayerMapIcon(playerid, 0, X, Y, Z, 33, 0, MAPICON_GLOBAL);
+		RemovePlayerMapIcon(playerid, 2);
+		SetPlayerMapIcon(playerid, 2, X+100.0, Y, Z, 55, 0, MAPICON_LOCAL);
+  		return 1;
+	}
+	
+	if(strcmp(cmd, "/setweap",true) == 0) {
+	    new tmp[256];
+		tmp = strtok(cmdtext,idx);
+		SetPlayerArmedWeapon(playerid,strval(tmp));
+  		return 1;
+	}
+
+	if(strcmp(cmd, "/jetpack",true) == 0) {
+	    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USEJETPACK);
+		return 1;
+	}
+	
+	if(strcmp(cmd, "/crobj",true) == 0) {
+	    new Float:X, Float:Y, Float:Z;
+	   	new tmp[256];
+ 		GetPlayerPos(playerid, X, Y, Z);
+ 		tmp = strtok(cmdtext,idx);
+		CreateObject(strval(tmp),X+1.0,Y+1.0,Z+0.5,0.0,0.0,0.0,200.0);
+		return 1;
+	}
+
+	if(strcmp(cmd, "/dropaudio",true) == 0) {
+	    new Float:X, Float:Y, Float:Z;
+ 		GetPlayerPos(playerid, X, Y, Z);
+		PlayAudioStreamForPlayer(playerid, "http://somafm.com/tags.pls", X, Y, Z, 40.0, true);
+		return 1;
+	}
+	
+	if(strcmp(cmd, "/officefloor",true) == 0) {
+ 		SetPlayerPos(playerid,1786.0645,-1298.7510,104.2);
+		return 1;
+	}
+	
+	if(strcmp(cmd, "/lvpd",true) == 0) {
+	    SetPlayerInterior(playerid, 3);
+ 		SetPlayerPos(playerid,237.5571,148.7559,1005.4703);
+		return 1;
+	}
+
+	if(strcmp(cmd, "/kill",true) == 0) {
+ 		SetPlayerHealth(playerid,0.0);
+		return 1;
+	}
+	
+	if(strcmp(cmd, "/atrailer",true) == 0) {
+ 		new tmp[256];
+ 		tmp = strtok(cmdtext,idx);
+		AttachTrailerToVehicle(strval(tmp),GetPlayerVehicleID(playerid));
+		return 1;
+	}
+	
+	if(strcmp(cmd, "/dtrailer",true) == 0) {
+		if(GetVehicleTrailer(GetPlayerVehicleID(playerid)) != 0) {
+		    DetachTrailerFromVehicle(GetPlayerVehicleID(playerid));
+		}
+		return 1;
+	}
+	
+	if(strcmp(cmd, "/cfence",true) == 0) {
+		SetPlayerPos(playerid,2496.40, -1664.84, 13.19);
+		if(!fence) fence = CreateObject(1410, 2496.80, -1661.88, 13.4, 0.00, 0.00, 0.00);
+		return 1;
+	}
+	
+	if(strcmp(cmd, "/mfence1",true) == 0) {
+	    MoveObject(fence, 2494.56, -1664.12, 13.4, 1.0, 0.00, 0.00, -90.0);
+		return 1;
+	}
+	
+	if(strcmp(cmd, "/mfence2",true) == 0) {
+	    MoveObject(fence, 2496.80, -1661.88, 13.4, 1.0, 0.00, 0.00, 0.00);
+		return 1;
+	}
+
+	if(strcmp(cmd, "/usecell",true) == 0) {
+	    SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USECELLPHONE);
+	    //SetPlayerAttachedObject(playerid, 4, 330, 6); // 4 = attachment slot, 330 = cellphone model, 6 = right hand
+		return 1;
+	}
+	
+	if(strcmp(cmd, "/stopcell",true) == 0) {
+	    SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
+	    RemovePlayerAttachedObject(playerid, 4);
+		return 1;
+	}
+	
+	if(strcmp(cmd, "/objvehst",true) == 0) {
+	    new objveh;
+		new objatt;
+		new Float:X, Float:Y, Float:Z;
+ 		GetPlayerPos(playerid, X, Y, Z);
+		objveh = CreateVehicle(563, X+2.0, Y+2.0, Z, 0.0, 0, 0, -1);
+		objatt = CreateObject(19277, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 200.0);
+		AttachObjectToVehicle(objatt, objveh, 2.0, 0.15, 0.0, 0.0, 0.0, 90.0);
+		return 1;
+	}
+
+	if(strcmp(cmd, "/uncontrol", true) == 0) {
+	    TogglePlayerControllable(playerid, 0);
+	    unfreezeplayer = playerid;
+	    //SetTimer("UnFreezeMe",5000,0);
+	    return 1;
+	}
+	
+	if(strcmp(cmd, "/recontrol", true) == 0) {
+	    TogglePlayerControllable(playerid, 1);
+	    return 1;
+	}
+
+	if(strcmp(cmd, "/objlim1", true) == 0) {
+	    new Float:X, Float:Y, Float:Z;
+	    new lp=0;
+ 		GetPlayerPos(playerid, X, Y, Z);
+ 		while(lp != 999) {
+	    	CreateObject(1656, X, Y, Z, 0.00, 0.00, 0.00, 1000.0);
+	    	Y += 0.25;
+	    	lp++;
+		}
+	    return 1;
+	}
+
+	if(strcmp(cmd, "/kkeys", true) == 0) {
+		new message[256+1];
+		format(message, 256, "{FFFFFF}Left Key: {FFFF00}~k~~GO_LEFT~ {FFFFFF}Right Key: {FFFF00}~k~~GO_RIGHT~ {FFFFFF}Fire Key: {FFFF00}~k~~PED_FIREWEAPON~");
+		SendClientMessage(playerid, 0xFFFFFFFF, message);
+		return 1;
+	}
+	
+	if(strcmp(cmd, "/timeddlg", true) == 0) {
+	    testlbplayer = playerid;
+	    SetTimer("ShowTestDialog",5000,0);
+	    return 1;
+	}
+	
+	if(strcmp(cmd, "/editattach",true) == 0) {
+	    if(!IsPlayerAttachedObjectSlotUsed(playerid, 0)) {
+			SetPlayerAttachedObject(playerid,0,19006,2); // red sunglasses to head bone
+		}
+		SendClientMessage(playerid, 0xFFFFFFFF, "Hint: Use {FFFF00}~k~~PED_SPRINT~{FFFFFF} to look around.");
+		EditAttachedObject(playerid, 0);
+	    return 1;
+	}
+	
+	if(strcmp(cmd, "/editobject",true) == 0) {
+		if(edit_objectid == INVALID_OBJECT_ID) {
+		    new Float:X, Float:Y, Float:Z;
+			GetPlayerPos(playerid, X, Y, Z);
+			edit_objectid = CreateObject(1656,X+1.0,Y+1.0,Z+0.5,0.0,0.0,0.0,200.0);
+		}
+		SendClientMessage(playerid, 0xFFFFFFFF, "Hint: Use {FFFF00}~k~~PED_SPRINT~{FFFFFF} to look around.");
+		EditObject(playerid, edit_objectid);
+	    return 1;
+	}
+	
+	if(strcmp(cmd, "/selobj",true) == 0) {
+		SendClientMessage(playerid, 0xFFFFFFFF, "Hint: Use {FFFF00}~k~~PED_SPRINT~{FFFFFF} to look around.");
+		SelectObject(playerid);
+	    return 1;
+	}
+	
+	if(strcmp(cmd, "/canceledit",true) == 0) {
+		CancelEdit(playerid);
+	    return 1;
+	}
+	
+	if(strcmp(cmd, "/editpobject",true) == 0) {
+		if(edit_objectid == INVALID_OBJECT_ID) {
+		    new Float:X, Float:Y, Float:Z;
+			GetPlayerPos(playerid, X, Y, Z);
+			edit_objectid = CreatePlayerObject(playerid,19522,X+1.0,Y+1.0,Z+0.5,0.0,0.0,0.0,200.0);
+		}
+		SendClientMessage(playerid, 0xFFFFFFFF, "Hint: Use {FFFF00}~k~~PED_SPRINT~{FFFFFF} to look around.");
+		EditPlayerObject(playerid, edit_objectid);
+	    return 1;
+	}
+	
+	if(strcmp(cmd, "/cam_on_obj",true) == 0) {
+	  	new Float:X, Float:Y, Float:Z;
+		GetPlayerPos(playerid, X, Y, Z);
+		if(edit_objectid == INVALID_OBJECT_ID) {
+			edit_objectid = CreateObject(19320,X+1.0,Y+1.0,Z+0.5,0.0,0.0,0.0,200.0);
+		}
+		//TogglePlayerSpectating(playerid, 1);
+	    AttachCameraToObject(playerid, edit_objectid);
+	    MoveObject(edit_objectid, X, Y + 2000.0, Z + 400.0, 20.0);
+	    return 1;
+	}
+	
+	if(strcmp(cmd, "/cam_on_train",true) == 0) {
+	  	new Float:X, Float:Y, Float:Z;
+		GetPlayerPos(playerid, X, Y, Z);
+		if(edit_objectid == INVALID_OBJECT_ID) {
+			edit_objectid = CreateObject(19320,X+1.0,Y+1.0,Z+0.5,0.0,0.0,0.0,200.0);
+		}
+		TogglePlayerSpectating(playerid, 1);
+		AttachObjectToVehicle(edit_objectid, 9, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0);
+		PlayerSpectateVehicle(playerid, 9);
+	    AttachCameraToObject(playerid, edit_objectid);
+	    return 1;
+	}
+	
+	if(strcmp(cmd, "/cam_interp",true) == 0) {
+	  	new Float:X, Float:Y, Float:Z;
+		GetPlayerPos(playerid, X, Y, Z);
+		InterpolateCameraPos(playerid, X, Y, Z, X + 100.0, Y + 100.0, Z + 20.0, 10000);
+	    return 1;
+	}
+	
+	if(strcmp(cmd, "/cam_interp_look",true) == 0) {
+	  	new Float:X, Float:Y, Float:Z;
+		GetPlayerPos(playerid, X, Y, Z);
+		InterpolateCameraPos(playerid, X, Y, Z, X + 100.0, Y + 100.0, Z + 20.0, 10000);
+		InterpolateCameraLookAt(playerid, X, Y, Z, 0.0, 0.0, 0.0, 10000);
+	    return 1;
+	}
+
+	if(strcmp(cmd, "/cam_behind",true) == 0) {
+	    SetCameraBehindPlayer(playerid);
+	    return 1;
+	}
+	
+	if(strcmp(cmd, "/respawn_veh",true) == 0) {
+	  	new tmp[256];
+		tmp = strtok(cmdtext,idx);
+		SetVehicleToRespawn(strval(tmp));
+		return 1;
+	}
+	
+	if(strcmp(cmd, "/crplain", true) == 0) {
+        CreateObject(19003, 416.54, 1655.75, 700.00, 0.00, 0.00, 0.00, 200.0);
+        CreateObject(4561, -26.98, 1639.33, 98.03, 0.00, 0.00, 0.00, 1000.0);
+	    return 1;
+	}
+
+	if(strcmp(cmd, "/testplain", true) == 0) {
+        CreateObject(19003, 416.54, 1655.75, 700.00, 0.00, 0.00, 0.00);
+                    
+	    if(GetPlayerVehicleID(playerid)) {
+		    SetVehiclePos(GetPlayerVehicleID(playerid), 416.54, 1655.75, 705.00);
+	    }
+		else {
+		    SetPlayerPos(playerid, 416.54, 1655.75, 710.00);
+	    }
+	    return 1;
+	}
+	
+	if(strcmp(cmd, "/testplain2", true) == 0) {
+ 		CreateObject(10766, 168.86, 1686.77, 44.86, 0.00, 0.00, 0.00, 1000.0);
+		CreateObject(10766, 168.86, 1532.52, 44.86, 0.00, 0.00, 0.00, 1000.0);
+
+	    if(GetPlayerVehicleID(playerid)) {
+		    SetVehiclePos(GetPlayerVehicleID(playerid), 162.9956, 1606.2555, 55.3197);
+	    }
+		else {
+		    SetPlayerPos(playerid, 162.9956, 1606.2555, 55.3197);
+	    }
+	    return 1;
+	}
+
+	if(strcmp(cmd, "/clicktd",true) == 0) {
+		new Text:txtTestText1;
+
+    	txtTestText1 = TextDrawCreate(320.0, 100.0, "Test Text 1");
+    	TextDrawUseBox(txtTestText1, 1);
+    	TextDrawBoxColor(txtTestText1, 0x00000044);
+		TextDrawFont(txtTestText1, 3);
+		TextDrawSetShadow(txtTestText1,0); // no shadow
+    	TextDrawSetOutline(txtTestText1,2); // thickness 1
+    	TextDrawBackgroundColor(txtTestText1,0x000000FF);
+    	TextDrawColor(txtTestText1,0xFFFFFFFF);
+    	TextDrawAlignment(txtTestText1,2); // centered
+		TextDrawLetterSize(txtTestText1,0.5,1.5);
+		TextDrawTextSize(txtTestText1, 20.0, 200.0); // reverse width and height for rockstar (only for centered td's)
+		TextDrawSetSelectable(txtTestText1, 1);
+		TextDrawShowForPlayer(playerid,txtTestText1);
+
+    	new Text:txtSprite1;
+    	txtSprite1 = TextDrawCreate(200.0, 220.0, "samaps:map"); // Text is txdfile:texture
+    	TextDrawFont(txtSprite1, 4); // Font ID 4 is the sprite draw font
+    	TextDrawColor(txtSprite1,0xFFFFFFFF);
+    	TextDrawTextSize(txtSprite1,200.0,200.0); // Text size is the Width:Height
+    	TextDrawSetSelectable(txtSprite1, 1);
+    	TextDrawShowForPlayer(playerid,txtSprite1);
+    	
+    	SelectTextDraw(playerid, 0x9999BBBB);
+    	return 1;
+	}
+	
+	if(strcmp(cmd, "/playertd",true) == 0) {
+		/*
+		new PlayerText:PlayerTestText1;
+    	PlayerTestText1 = CreatePlayerTextDraw(playerid, 320.0, 100.0, "Test Text 1");
+    	PlayerTextDrawUseBox(playerid,PlayerTestText1, 1);
+    	PlayerTextDrawBoxColor(playerid,PlayerTestText1, 0x00000044);
+		PlayerTextDrawFont(playerid,PlayerTestText1, 3);
+		PlayerTextDrawSetShadow(playerid,PlayerTestText1,0); // no shadow
+    	PlayerTextDrawSetOutline(playerid,PlayerTestText1,2); // thickness 1
+    	PlayerTextDrawBackgroundColor(playerid, PlayerTestText1,0x000000FF);
+    	PlayerTextDrawColor(playerid,PlayerTestText1,0xFFFFFFFF);
+    	//PlayerTextDrawAlignment(playerid,PlayerTestText1,2); // centered
+		PlayerTextDrawLetterSize(playerid,PlayerTestText1,0.5,1.5);
+		PlayerTextDrawTextSize(playerid,PlayerTestText1, 50.0, 200.0); // reverse width and height for rockstar (only for centered td's)
+		PlayerTextDrawSetSelectable(playerid,PlayerTestText1,1);
+		PlayerTextDrawShow(playerid,PlayerTestText1);*/
+
+    	//SelectTextDraw(playerid, 0x9999BBBB);
+    	return 1;
+	}
+	
+	if(strcmp(cmd, "/canceltd",true) == 0) {
+	    CancelSelectTextDraw(playerid);
+	    return 1;
+	}
+
+	if(strcmp(cmd, "/timed_vd", true) == 0) {
+	    vehicleid_tokill = GetPlayerVehicleID(playerid);
+	    SetTimer("TimedVehicleDeath",3000,0);
+	    return 1;
+	}
+	
+	if(strcmp(cmd, "/vmodelsize", true) == 0) {
+	    new Float:X, Float:Y, Float:Z;
+	    new VehicleId = GetPlayerVehicleID(playerid);
+		new message[256+1];
+		if(!VehicleId || VehicleId == INVALID_VEHICLE_ID) {
+		    SendClientMessage(playerid, 0xFFFFFFFF, "/vmodelsize : Be in a vehicle to use this command." );
+			return 1;
+		}
+		new VehicleModel = GetVehicleModel(VehicleId);
+		GetVehicleModelInfo(VehicleModel, VEHICLE_MODEL_INFO_SIZE, X, Y, Z);
+		format(message, 256, "Vehicle(%d) Size: %.4f, %.4f, %.4f", VehicleModel, X, Y, Z);
+		SendClientMessage(playerid, 0xFFFFFFFF, message);
+	    return 1;
+	}
+	
+
+	if(strcmp(cmd, "/crptex",true) == 0) {
+	    new lp=0;
+		new Float:X, Float:Y, Float:Z;
+		GetPlayerPos(playerid, X, Y, Z);
+		X+=1.0;
+		while(lp != 128) {
+			test_tex_objects[lp] = CreatePlayerObject(playerid,19372,X,Y,Z+0.5,0.0,0.0,0.0,0.0);
+			//SetPlayerObjectMaterial(playerid, test_tex_objects[lp], 0, 0, "null", "null", 0);
+			
+			if(lp % 2 == 0) {
+				SetPlayerObjectMaterial(playerid, test_tex_objects[lp], 0, 19325, "all_walls", "stormdrain3_nt", 0xFF00FF00);
+			} else {
+			    SetPlayerObjectMaterial(playerid, test_tex_objects[lp], 0, 19371, "all_walls", "stormdrain3_nt", 0xFF551155);
+			}
+			
+			X+=2.0;
+			lp++;
+		}
+	}
+
+    if(strcmp(cmd, "/crpmix",true) == 0) {
+	    new lp=0;
+		new Float:X, Float:Y, Float:Z;
+		GetPlayerPos(playerid, X, Y, Z);
+		X+=1.0;
+		new szId[256+1];
+		while(lp != 128) {
+			test_tex_objects[lp] = CreatePlayerObject(playerid,19371,X,Y,Z+0.5,0.0,0.0,0.0,300.0);
+			//format(szId, 256, "Text Here: {00FF00}%d", lp);
+			//SetPlayerObjectMaterialText(playerid, test_tex_objects[lp], szId, 0, OBJECT_MATERIAL_SIZE_512x512, "Verdana", 60, 1, 0xFF5555FF, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
+			if(lp % 2 == 0) {
+			    SetPlayerObjectMaterial(playerid, test_tex_objects[lp], 0, 19371, "all_walls", "stormdrain3_nt", 0xFF55AA55);
+			} else {
+			    format(szId, 256, "Text: {00FF00}%d", lp);
+			    SetPlayerObjectMaterialText(playerid, test_tex_objects[lp], szId, 0, OBJECT_MATERIAL_SIZE_512x256, "Verdana", 60, 1, 0xFF5555FF, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
+			}
+			X+=2.0;
+			lp++;
+		}
+		return 1;
+	}
+
+	if(strcmp(cmd, "/crptext",true) == 0) {
+		new Float:X, Float:Y, Float:Z;
+		GetPlayerPos(playerid, X, Y, Z);
+		X+=1.0;
+		
+		test_tex_objects[0] = CreatePlayerObject(playerid,19479,X,Y,Z+0.5,0.0,0.0,0.0,300.0);
+		SetObjectMaterialText(test_tex_objects[0], "Dynamic Update (0)", 0, OBJECT_MATERIAL_SIZE_512x128, "Courier New", 48, 1, 0xFF000000, 0, 0);
+		X+=3.0;
+		
+		// This is a dynamic update material text
+		if(text_update_timer == -1) {
+			text_update_timer = SetTimer("UpdateTextTimer", 1000, 1);
+			text_update_player = playerid;
+		}
+
+		test_tex_objects[1] = CreatePlayerObject(playerid,19479,X,Y,Z+4.0,0.0,0.0,0.0,300.0);
+		SetPlayerObjectMaterialText(playerid, test_tex_objects[1], "ABDSJFUEGI\nABDRJCFEGI\n{DDDDDD}Center", 0, OBJECT_MATERIAL_SIZE_512x256, "GTAWEAPON3", 70, 0, 0xFF00FF00, 0xFF444477, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
+		X+=3.0;
+		
+		test_tex_objects[2] = CreatePlayerObject(playerid,19480,X,Y,Z+4.0,0.0,0.0,0.0,300.0);
+		SetPlayerObjectMaterialText(playerid, test_tex_objects[2], "Blue Text\nVerdana\nAlpha BG\n{DDDDDD}Center", 0, OBJECT_MATERIAL_SIZE_512x256, "Verdana", 60, 1, 0xFF000000, 0xFFFFFFFF, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
+		X+=3.0;
+
+		test_tex_objects[3] = CreatePlayerObject(playerid,19481,X,Y,Z+4.0,0.0,0.0,0.0,300.0);
+		SetPlayerObjectMaterialText(playerid, test_tex_objects[3], "Blue Text\nArial\nAlpha BG\n{DDDDDD}Center", 0, OBJECT_MATERIAL_SIZE_512x256, "Arial", 60, 1, 0xFF000000, 0xFFCDD704, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
+		X+=3.0;
+
+		test_tex_objects[4] = CreatePlayerObject(playerid,19482,X,Y,Z+4.0,0.0,0.0,0.0,300.0);
+		SetPlayerObjectMaterialText(playerid, test_tex_objects[4], "Blue Text\nVerdana\nAlpha BG\n{DDDDDD}Center", 0, OBJECT_MATERIAL_SIZE_512x256, "Verdana", 60, 1, 0xFF000000, 0xFFCDD704, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
+		X+=3.0;
+
+		test_tex_objects[5] = CreatePlayerObject(playerid,19483,X,Y,Z+4.0,0.0,0.0,0.0,300.0);
+		SetPlayerObjectMaterialText(playerid, test_tex_objects[5], "Blue Text\nArial\nAlpha BG\n{DDDDDD}Center", 0, OBJECT_MATERIAL_SIZE_512x256, "Arial", 60, 1, 0xFF000000, 0, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
+		X+=3.0;
+
+		//EditPlayerObject(playerid, test_tex_objects[0]);
+	    return 1;
+	}
+	
+	if(strcmp(cmd, "/delptex",true) == 0) {
+	    new lp=0;
+		while(lp != 128) {
+			if(IsValidPlayerObject(playerid, test_tex_objects[lp])) {
+				DestroyPlayerObject(playerid, test_tex_objects[lp]);
+			}
+			lp++;
+		}
+		if(text_update_timer >= 0) {
+			KillTimer(text_update_timer);
+			text_update_timer = -1;
+		}
+	    return 1;
+	}
+
+	// Damian's bed that crashed because material object id and original object id were the same
+	if(strcmp(cmd, "/crashbed",true) == 0) {
+	    new objbed1=0;
+	    new objbed2=0;
+		new Float:X, Float:Y, Float:Z;
+		GetPlayerPos(playerid, X, Y, Z);
+		
+		// 14446
+		//0:18028:cj_bar2:CJ_nastybar_D2:000000;
+		//2:18646:matcolours:blue:000fff;
+		objbed1 = CreatePlayerObject(playerid,14446,X,Y,Z+0.1,0.0,0.0,0.0,300.0);
+		SetPlayerObjectMaterial(playerid, objbed1, 0, 18028, "cj_bar2", "CJ_nastybar_D2", 0xFF000000);
+	    SetPlayerObjectMaterial(playerid, objbed1, 2, 18646, "matcolours", "blue", 0xFF000fff);
+
+	   	// 14446
+		//0:0:none:none:000000;
+		//1:0:none:none:0000ff;
+		//2:14446:carter_block:zebra_skin:000000;
+	    objbed2 = CreatePlayerObject(playerid,14446,X,Y+2.0,Z+0.1,0.0,0.0,0.0,300.0);
+        SetPlayerObjectMaterial(playerid, objbed2, 0, 0, "none", "none", 0xFF000000);
+        SetPlayerObjectMaterial(playerid, objbed2, 1, 0, "none", "none", 0xFF0000FF);
+        //SetPlayerObjectMaterial(playerid, objbed2, 2, 18646, "matcolours", "blue", 0xFFFFFFFF);
+	    SetPlayerObjectMaterial(playerid, objbed2, 2, 14446, "carter_block", "mp_carter_wall", 0xFFFFFFFF);
+	    
+	    return 1;
+	}
+	
+	// Damian's house object that is crashing in 0.3x
+	if(strcmp(cmd, "/crash_hobj",true) == 0) {
+	    new objcab=0;
+		new Float:X, Float:Y, Float:Z;
+		GetPlayerPos(playerid, X, Y, Z);
+
+		//2385
+		//;index_id:model_id:txd_name:txd_txt:txd_color(0 if no color);
+		//;0:2748:pizza_furn:CJ_WOOD6:0;
+		//;1:2748:pizza_furn:CJ_WOOD6:A78D84;
+		//;2:2748:pizza_furn:CJ_WOOD6:A78D84;
+		objcab = CreatePlayerObject(playerid,2385,X,Y,Z+0.1,0.0,0.0,0.0,0.0);
+		
+		SetPlayerObjectMaterial(playerid, objcab, 0, 2748, "pizza_furn", "CJ_WOOD6", 0);
+	    SetPlayerObjectMaterial(playerid, objcab, 1, 2748, "pizza_furn", "CJ_WOOD6", 0xFFA78D84);
+	    SetPlayerObjectMaterial(playerid, objcab, 2, 2748, "pizza_furn", "CJ_WOOD6", 0xFFA78D84);
+	    
+	    /*
+	    SetPlayerObjectMaterial(playerid, objcab, 0, -1, "none", "none", 0xFF00AA00);
+	    SetPlayerObjectMaterial(playerid, objcab, 1, -1, "none", "none", 0xFF00AA00);
+	    SetPlayerObjectMaterial(playerid, objcab, 2, -1, "none", "none", 0xFF00AA00);*/
+
+	    return 1;
+	}
+	
+	if(strcmp(cmd, "/kickmessage", true) == 0) {
+        KickWithMessage(playerid, "Bye!");
+        return 1;
+	}
+
+	if(strcmp(cmd, "/animindex", true) == 0) {
+	    new msg[256+1];
+		new animlib[64+1];
+		new animname[64+1];
+	    new tmp[256+1];
+		tmp = strtok(cmdtext,idx);
+		GetAnimationName(strval(tmp), animlib, 64, animname, 64);
+		format(msg,sizeof(msg),"AnimIndex: %d is %s:%s", strval(tmp), animlib, animname);
+		SendClientMessage(playerid, 0xFFFFFFFF, msg);
+		return 1;
+	}
+	
+	if(strcmp(cmd, "/weapdata", true) == 0) {
+	    new msg[256+1];
+	    new x=0;
+	    new weaponret;
+	    new ammoret;
+	    while(x!=13) {
+	        GetPlayerWeaponData(playerid, x, weaponret, ammoret);
+			format(msg,sizeof(msg),"WeapSlot(%d) %d:%d", x, weaponret, ammoret);
+			SendClientMessage(playerid, 0xFFFFFFFF, msg);
+			x++;
+		}
+		return 1;
+	}
+	
+	if(strcmp(cmd, "/explosion", true) == 0) {
+		new tmp[256];
+		tmp = strtok(cmdtext,idx);
+	    new Float:X, Float:Y, Float:Z;
+		GetPlayerPos(playerid, X, Y, Z);
+		CreateExplosionEx(X+10.0, Y+10.0, Z+10.0, 1, 2.0, strval(tmp));
+		return 1;
+	}
+	
+	if(strcmp(cmd, "/flatbedcontainer",true) == 0) {
+		new create_flatbed = SpawnVehicle_InfrontOfPlayer(playerid, 578, -1, -1);
+		new obj = CreateObject(19321,0.0,0.0,0.0,0.0,0.0,0.0);
+		AttachObjectToVehicle(obj,create_flatbed,-0.0165,-2.0660,1.2442,0.0,0.0,0.0);
+		return 1;
+	}
+	
+	if(strcmp(cmd, "/disablevcol",true) == 0) {
+	    DisableRemoteVehicleCollisions(playerid, 1);
+		return 1;
+	}
+	
+	if(strcmp(cmd, "/enablevcol",true) == 0) {
+        DisableRemoteVehicleCollisions(playerid, 0);
+		return 1;
+	}
+
+	if(strcmp(cmd, "/disablecamtarget",true) == 0) {
+	    EnablePlayerCameraTarget(playerid, 0);
+		return 1;
+	}
+
+	if(strcmp(cmd, "/enablecamtarget",true) == 0) {
+        EnablePlayerCameraTarget(playerid, 1);
+		return 1;
+	}
+
+	if(strcmp(cmd, "/poolsize", true) == 0) {
+	    new msg[256+1];
+	    new HigestPlayerId = GetPlayerPoolSize();
+	    new HigestVehicleId = GetVehiclePoolSize();
+	 	format(msg,sizeof(msg),"PlayerPoolSize: %d", HigestPlayerId);
+		SendClientMessage(playerid, 0xFFFFFFFF, msg);
+        format(msg,sizeof(msg),"VehiclePoolSize: %d", HigestVehicleId);
+		SendClientMessage(playerid, 0xFFFFFFFF, msg);
+		return 1;
+	}
+	
+	if(strcmp(cmd, "/sirenstate", true ) == 0)
+	{
+	    if( GetPlayerVehicleID(playerid) && GetPlayerVehicleID(playerid) != INVALID_VEHICLE_ID &&
+		    GetVehicleParamsSirenState(GetPlayerVehicleID(playerid)) == VEHICLE_PARAMS_ON )
+		{
+		   SendClientMessage(playerid, 0xFFFFFFFF, "Siren is ON");
+	    }
+		else {
+		   SendClientMessage(playerid, 0xFFFFFFFF, "Siren is OFF");
+	    }
+
+	    return 1;
+	}
+
+	if(strcmp(cmd, "/opencardoors", true ) == 0)
+	{
+        if(GetPlayerVehicleID(playerid) && GetPlayerVehicleID(playerid) != INVALID_VEHICLE_ID)
+		{
+			SetVehicleParamsCarDoors(GetPlayerVehicleID(playerid), VEHICLE_PARAMS_ON, VEHICLE_PARAMS_ON, VEHICLE_PARAMS_ON, VEHICLE_PARAMS_ON);
+	    }
+	    /*
+   		if(GetPlayerCameraTargetVehicle(playerid) != INVALID_VEHICLE_ID)
+		{
+			SetVehicleParamsCarDoors(GetPlayerCameraTargetVehicle(playerid), VEHICLE_PARAMS_ON, VEHICLE_PARAMS_ON, VEHICLE_PARAMS_ON, VEHICLE_PARAMS_ON);
+	    }*/
+	    return 1;
+	}
+
+	if(strcmp(cmd, "/closecardoors", true ) == 0)
+	{
+	    if(GetPlayerVehicleID(playerid) && GetPlayerVehicleID(playerid) != INVALID_VEHICLE_ID)
+		{
+			SetVehicleParamsCarDoors(GetPlayerVehicleID(playerid), VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF);
+	    }
+	    /*
+	    if(GetPlayerCameraTargetVehicle(playerid) != INVALID_VEHICLE_ID)
+		{
+			SetVehicleParamsCarDoors(GetPlayerCameraTargetVehicle(playerid), VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF);
+	    }*/
+ 	    return 1;
+	}
+	
+	if(strcmp(cmd, "/opencarwindows", true ) == 0)
+	{
+	    if(GetPlayerVehicleID(playerid) && GetPlayerVehicleID(playerid) != INVALID_VEHICLE_ID)
+		{
+			SetVehicleParamsCarWindows(GetPlayerVehicleID(playerid), VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF);
+	    }
+	    return 1;
+	}
+	
+	if(strcmp(cmd, "/closecarwindows", true ) == 0)
+	{
+	    if(GetPlayerVehicleID(playerid) && GetPlayerVehicleID(playerid) != INVALID_VEHICLE_ID)
+		{
+			SetVehicleParamsCarWindows(GetPlayerVehicleID(playerid), VEHICLE_PARAMS_ON, VEHICLE_PARAMS_ON, VEHICLE_PARAMS_ON, VEHICLE_PARAMS_ON);
+	    }
+	    return 1;
+	}
+
+	if(strcmp(cmd, "/spritetest", true ) == 0)
+	{
+    	txtSpriteTest[0] = TextDrawCreate(100.0, 100.0, "ld_grav:timer"); // Text is txdfile:texture
+    	TextDrawFont(txtSpriteTest[0], 4); // Font ID 4 is the sprite draw font
+    	TextDrawColor(txtSpriteTest[0],0xFFFFFFFF);
+    	TextDrawTextSize(txtSpriteTest[0],100.0,100.0); // Text size is the Width:Height
+    	TextDrawShowForPlayer(playerid,txtSpriteTest[0]);
+    	
+    	txtSpriteTest[1] = TextDrawCreate(200.0, 100.0, "ld_grav:bee2"); // Text is txdfile:texture
+    	TextDrawFont(txtSpriteTest[1], 4); // Font ID 4 is the sprite draw font
+    	TextDrawColor(txtSpriteTest[1],0xFFFFFFFF);
+    	TextDrawTextSize(txtSpriteTest[1],100.0,100.0); // Text size is the Width:Height
+    	TextDrawShowForPlayer(playerid,txtSpriteTest[1]);
+    	
+    	txtSpriteTest[2] = TextDrawCreate(100.0, 200.0, "ld_slot:r_69"); // Text is txdfile:texture
+    	TextDrawFont(txtSpriteTest[2], 4); // Font ID 4 is the sprite draw font
+    	TextDrawColor(txtSpriteTest[2],0xFFFFFFFF);
+    	TextDrawTextSize(txtSpriteTest[2],100.0,100.0); // Text size is the Width:Height
+    	TextDrawShowForPlayer(playerid,txtSpriteTest[2]);
+
+		txtSpriteTest[3] = TextDrawCreate(200.0, 200.0, "ld_slot:cherry"); // Text is txdfile:texture
+    	TextDrawFont(txtSpriteTest[3], 4); // Font ID 4 is the sprite draw font
+    	TextDrawColor(txtSpriteTest[3],0xFFFFFFFF);
+    	TextDrawTextSize(txtSpriteTest[3],100.0,100.0); // Text size is the Width:Height
+    	TextDrawShowForPlayer(playerid,txtSpriteTest[3]);
+    	
+    	txtSpriteTest[4] = TextDrawCreate(100.0, 300.0, "ld_card:cd9d"); // Text is txdfile:texture
+    	TextDrawFont(txtSpriteTest[4], 4); // Font ID 4 is the sprite draw font
+    	TextDrawColor(txtSpriteTest[4],0xFFFFFFFF);
+    	TextDrawTextSize(txtSpriteTest[4],100.0,100.0); // Text size is the Width:Height
+    	TextDrawShowForPlayer(playerid,txtSpriteTest[4]);
+    	
+    	return 1;
+	}
+	
+	if(strcmp(cmd, "/delspritetest", true ) == 0)
+	{
+		TextDrawDestroy(txtSpriteTest[0]);
+		TextDrawDestroy(txtSpriteTest[1]);
+		TextDrawDestroy(txtSpriteTest[2]);
+		TextDrawDestroy(txtSpriteTest[3]);
+		TextDrawDestroy(txtSpriteTest[4]);
+		return 1;
+	}
+
+	if(strcmp(cmd, "/removeallbuilding", true ) == 0)
+	{
+		RemoveBuildingForPlayer(playerid, -1, 0.0, 0.0, 0.0, 6000.0);
+		return 1;
+	}
+
+	if(strcmp(cmd, "/actoratme", true ) == 0)
+	{
+	  	new Float:X, Float:Y, Float:Z, Float:fang;
+	    GetPlayerPos(playerid, X, Y, Z);
+	    GetPlayerFacingAngle(playerid, fang);
+		test_actor_id = CreateActor(305, X+1.0, Y+1.0, Z+0.5, fang);
+		//SetActorInvulnerable(test_actor_id);
+		SetActorVirtualWorld(test_actor_id, GetPlayerVirtualWorld(playerid));
+		return 1;
+	}
+
+	if(strcmp(cmd, "/actorground", true) == 0) {
+	    ApplyActorAnimation(test_actor_id, "BEACH", "ParkSit_M_loop", 4.0, 1, 1, 1, 1, -1);
+		return 1;
+	}
+
+	if(strcmp(cmd, "/actorclear", true) == 0) {
+	    ClearActorAnimations(test_actor_id);
+		return 1;
+	}
+
+	if(strcmp(cmd, "/actorface", true) == 0) {
+	    new Float:fang;
+	    GetPlayerFacingAngle(playerid, fang);
+	    SetActorFacingAngle(test_actor_id, fang);
+		return 1;
+	}
+
+	if(strcmp(cmd, "/actorpos", true) == 0) {
+	   	new Float:X, Float:Y, Float:Z;
+	    GetPlayerPos(playerid, X, Y, Z);
+	    SetActorPos(test_actor_id, X+1.0, Y+1.0, Z);
+		return 1;
+	}
+
+  	return 0;
+}
+
+//-------------------------------------------
+
+forward KickPublic(playerid);
+public KickPublic(playerid) { Kick(playerid); }
+
+//-------------------------------------------
+
+KickWithMessage(playerid, message[])
+{
+	SendClientMessage(playerid, 0xFF4444FF, message);
+	SetTimerEx("KickPublic", 1000, 0, "d", playerid);
+}
+
+//-------------------------------------------
+
+public OnPlayerClickTextDraw(playerid, Text:clickedid)
+{
+	new msg[256+1];
+	format(msg,sizeof(msg),"(TextDraw) You selected: %d", int:clickedid);
+	SendClientMessage(playerid, 0xFFFFFFFF, msg);
+}
+
+//-------------------------------------------
+
+public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
+{
+	new msg[256+1];
+	format(msg,sizeof(msg),"(PlayerTextDraw) You selected: %d", int:playertextid);
+	SendClientMessage(playerid, 0xFFFFFFFF, msg);
+}
+
+//-------------------------------------------
+// Sends a list of all PVars to the player as
+// client messages.
+
+SendPVarListToPlayer(playerid)
+{
+    new ubound = GetPVarsUpperIndex(playerid);
+	new x=0;
+	new name[40+1];
+	new line[128+1];
+	
+    SendClientMessage(playerid,0xF000F0F0, "---Player Vars List---");
+	while(x != ubound) {
+		if(GetPVarNameAtIndex(playerid,x,name,40)) {
+			if(Util_GetPVarEntryAsString(playerid,name,line,128)) {
+                 SendClientMessage(playerid,0xFFFFFFFF,line);
+			}
+		}
+		x++;
+	}
+}
+
+//-------------------------------------------
+// return PVar entry as 'name'='value' string
+
+stock Util_GetPVarEntryAsString(playerid, name[], ret[], len)
+{
+	new Float:fValue;
+	new iValue;
+	new szStrValue[1024+1]; // this might require greater size if you store large strings in PVars
+	new type;
+    ret[0] = EOS;
+    
+  	type = GetPVarType(playerid, name);
+	if(type != PLAYER_VARTYPE_NONE) {
+		switch(type)
+		{
+			case PLAYER_VARTYPE_STRING:
+			{
+				GetPVarString(playerid,name,szStrValue,1024);
+				format(ret,len,"%s=%s",name,szStrValue);
+			}
+			case PLAYER_VARTYPE_INT:
+			{
+				iValue = GetPVarInt(playerid,name);
+				format(ret,len,"%s=%d",name,iValue);
+			}
+			case PLAYER_VARTYPE_FLOAT:
+			{
+			    fValue = GetPVarFloat(playerid,name);
+				format(ret,len,"%s=%f",name,fValue);
+			}
+		}
+		return 1;
+	}
+	return 0;
+}
+
+//-------------------------------------------
+// Fills the provided string with all the player's PVars
+// seperated by the specified 'delimiter'
+
+stock Util_CreatePVarList(playerid, retstr[], len, delimiter[])
+{
+	if(!IsPlayerConnected(playerid)) return 0;
+	
+	new x=0;
+	new remaining_string=len;
+	new line[2048+1];
+	new name[40+1];
+	retstr[0] = EOS;
+
+	new ubound = GetPVarsUpperIndex(playerid);
+	
+	while(x != ubound) {
+		if(GetPVarNameAtIndex(playerid,x,name,40)) {
+			if(Util_GetPVarEntryAsString(playerid,name,line,2048)) {
+				// if there is enough space, concat this line to the return string
+				if(remaining_string > (strlen(line) + strlen(delimiter))) {
+			    	strcat(retstr,line);
+			    	strcat(retstr,delimiter);
+					remaining_string -= (strlen(line) + strlen(delimiter));
+				}
+			}
+		}
+		x++;
+	}
+	
+	return 1;
+}
+
+//-------------------------------------------
+// Test reapplying vehicle mods on respawn
+
+public OnVehicleSpawn(vehicleid)
+{
+	if(vehicleid == savanna) {
+	    AddVehicleComponent(savanna,1189); //Front Bumper
+		AddVehicleComponent(savanna,1187); //Rear Bumper
+		AddVehicleComponent(savanna,1129); //Exhaust
+		AddVehicleComponent(savanna,1102); //Left Side Skirt
+		AddVehicleComponent(savanna,1133); //Right Side Skirt
+		AddVehicleComponent(savanna,1078); //Wheels
+		AddVehicleComponent(savanna,1010); //Nitro 10x
+		AddVehicleComponent(savanna,1087); //Hydraulics
+	}
+	else if(vehicleid == blade) {
+	    AddVehicleComponent(blade,1182); //Front Bumper
+		AddVehicleComponent(blade,1184); //Rear Bumper
+		AddVehicleComponent(blade,1104); //Exhaust
+		AddVehicleComponent(blade,1108); //Left Side Skirt
+		AddVehicleComponent(blade,1107); //Right Side Skirt
+		AddVehicleComponent(blade,1078); //Wheels
+		AddVehicleComponent(blade,1010); //Nitro 10x
+		AddVehicleComponent(blade,1087); //Hydraulics
+	}
+}
+
+//-------------------------------------------
+// Example of handling dialog responses.
+
+public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
+{
+    if(!IsPlayerAdmin(playerid)) return 0; // this is an admin only script
+    
+	if(dialogid == 0) { // Our example msgbox
+		if(response) {
+		    SendClientMessage(playerid,0xFFFFFFFF,"You selected OK");
+		} else {
+		    SendClientMessage(playerid,0xFFFFFFFF,"You selected Cancel");
+		}
+		return 1; // we processed this. no need for other filterscripts to process it.
+	}
+	
+	if(dialogid == 1) { // Our example inputbox
+		if(response) {
+			new message[256+1];
+			format(message, 256, "You replied: %s", inputtext);
+		    SendClientMessage(playerid, 0xFFFFFFFF, message);
+		} else {
+		    SendClientMessage(playerid, 0xFFFFFFFF, "You selected Cancel");
+		}
+		return 1; // we processed it.
+	}
+	
+	if(dialogid == 2) { // Our example listbox
+		if(response) {
+			new message[256+1];
+			format(message, 256, "You selected item %d:", listitem);
+		    SendClientMessage(playerid, 0xFFFFFFFF, message);
+		    SendClientMessage(playerid, 0xFFFFFFFF, inputtext);
+		} else {
+		    SendClientMessage(playerid, 0xFFFFFFFF, "You selected Cancel");
+		}
+		return 1; // we processed it.
+	}
+	
+	return 0; // we didn't handle anything.
+}
+
+//-------------------------------------------
+// Example of handling scoreboard click.
+
+public OnPlayerClickPlayer(playerid, clickedplayerid, source)
+{
+	if(!IsPlayerAdmin(playerid)) return 0; // this is an admin only script
+	
+    new message[256+1];
+	format(message, 256, "You clicked on player %d", clickedplayerid);
+	SendClientMessage(playerid, 0xFFFFFFFF, message);
+	return 1;
+}
+
+//-------------------------------------------
+
+public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
+{
+ 	new message[256+1];
+	format(message, 256, "You place marker at point: %f %f %f", fX, fY, fZ);
+	SendClientMessage(playerid, 0xFFFFFFFF, message);
+	SetPlayerPos(playerid, fX, fY, fZ);
+}
+
+//-------------------------------------------
+/*
+public OnPlayerEditAttachedObject( playerid, response, index, modelid, boneid,
+								   Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ,
+								   Float:fRotX, Float:fRotY, Float:fRotZ,
+  								   Float:fScaleX, Float:fScaleY, Float:fScaleZ )
+{
+	SendClientMessage(playerid, 0xFFFFFFFF, "You finished editing an attached object");
+	SetPlayerAttachedObject(playerid,index,modelid,boneid,fOffsetX,fOffsetY,fOffsetZ,fRotX,fRotY,fRotZ,fScaleX,fScaleY,fScaleZ);
+	return 1;
+}*/
+
+//-------------------------------------------
+
+public OnPlayerEditObject( playerid, playerobject, objectid, response,
+Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ )
+{
+	if(!playerobject) {
+	    if(!IsValidObject(objectid)) return;
+		MoveObject(objectid, fX, fY, fZ, 10.0, fRotX, fRotY, fRotZ);
+	} else {
+	    if(!IsValidPlayerObject(playerid, objectid)) return;
+	    MovePlayerObject(playerid, objectid, fX, fY, fZ, 10.0, fRotX, fRotY, fRotZ);
+	}
+	
+	if(response == EDIT_RESPONSE_FINAL || response == EDIT_RESPONSE_CANCEL) {
+	    // put them back in selection mode after they click save
+	    SelectObject(playerid);
+	}
+}
+
+//-------------------------------------------
+
+public OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ)
+{
+    new message[256+1];
+    
+    if(type == SELECT_OBJECT_GLOBAL_OBJECT) {
+        if(!IsValidObject(objectid)) return 0;
+        format(message,sizeof(message),"(Object) You selected: %d model: %d Pos: %.4f,%.4f,%.4f", objectid, modelid, fX, fY, fZ);
+        SendClientMessage(playerid, 0xFFFFFFFF, message);
+        EditObject(playerid, objectid);
+        return 1;
+	}
+	
+	if(type == SELECT_OBJECT_PLAYER_OBJECT) {
+        if(!IsValidPlayerObject(playerid, objectid)) return 0;
+        format(message,sizeof(message),"(Player Object) You selected: %d model: %d Pos: %.4f,%.4f,%.4f", objectid, modelid, fX, fY, fZ);
+        SendClientMessage(playerid, 0xFFFFFFFF, message);
+        EditPlayerObject(playerid, objectid);
+        return 1;
+	}
+	
+	return 0;
+}
+
+//-------------------------------------------
+/*
+public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
+{
+    new message[256+1];
+    new weaponname[64+1];
+	new File:file = fopen("playershots.txt",io_append);
+	
+	GetWeaponName(weaponid, weaponname, 64);
+
+	if(hittype == BULLET_HIT_TYPE_PLAYER) {
+		format(message,256,"Shooter(%d) hit Player(%d) PlayerAnim: %d Using: %s [%.2f, %.2f, %.2f]\r\n", playerid, hitid,
+			   GetPlayerAnimationIndex(hitid), weaponname, fX, fY, fZ);
+	}
+	else if(hittype == BULLET_HIT_TYPE_VEHICLE) {
+	    format(message,256,"Shooter(%d) hit Vehicle(%d) Using: %s [%.2f, %.2f, %.2f]\r\n",playerid, hitid, weaponname, fX, fY, fZ);
+	}
+	else if(hittype == BULLET_HIT_TYPE_NONE) {
+	    format(message,256,"Shooter(%d) hit World Using: %s [%.2f, %.2f, %.2f]\r\n",playerid,weaponname,fX,fY,fZ);
+	}
+	else {
+	    format(message,256,"Shooter(%d) hit Object(%d) Using: %s [%.2f, %.2f, %.2f]\r\n",playerid, hitid, weaponname, fX, fY, fZ);
+	}
+	
+	fwrite(file, message);
+	fclose(file);
+	
+	//new LastVectors[128+1];
+	//new Float:OriginX, Float:OriginY, Float:OriginZ;
+	//new Float:HitX, Float:HitY, Float:HitZ;
+	//GetPlayerLastShotVectors(playerid, OriginX, OriginY, OriginZ, HitX, HitY, HitZ);
+	//format(LastVectors, 128, "Last Vectors: [%.2f, %.2f, %.2f] [%.2f, %.2f, %.2f]", OriginX, OriginY, OriginZ, HitX, HitY, HitZ);
+	//SendClientMessage(playerid, 0xFFFFFFFF, LastVectors);
+	
+	SendClientMessage(playerid, 0xFFFFFFFF, message);
+ 	return 1;
+}*/
+
+//-------------------------------------------
+/*
+new LastShotTime = 0;
+new LastShotWeapon = 0;
+
+public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
+{
+	new message[128+1];
+	
+	if(!LastShotTime) {
+	    LastShotTime = GetTickCount();
+	    return 1;
+	}
+	
+	if(weaponid == LastShotWeapon) {
+		 format(message, 128, "WeaponId: %d LastShotDelta: %d", weaponid, GetTickCount() - LastShotTime);
+		 SendClientMessage(playerid, 0xFFFFFFFF, message);
+	     printf("%s", message);
+	}
+	
+	LastShotWeapon = weaponid;
+	LastShotTime = GetTickCount();
+	
+ 	return 1;
+}*/
+
+//-------------------------------------------
+// Example of TakeDamage
+/*
+public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
+{
+	new File:file = fopen("playershots.txt",io_append);
+ 	new message[256+1];
+ 	new weapname[64+1];
+	
+	if(issuerid != INVALID_PLAYER_ID) {
+	    GetWeaponName(weaponid, weapname, 64);
+		format(message, 256, "PlayerTakeDamage(%d) from Player(%d) (%f) weapon: (%s) bodypart: %d\r\n", playerid, issuerid, amount, weapname, bodypart);
+		SendClientMessageToAll(0xFFFFFFFF, message);
+	}
+	else {
+		format(message, 256, "PlayerTakeDamage(%d) (%f) from: %d\r\n", playerid, amount, weaponid);
+		SendClientMessageToAll(0xFFFFFFFF, message);
+	}
+	
+	fwrite(file, message);
+	fclose(file);
+}*/
+
+//-------------------------------------------
+// Example of GiveDamage
+/*
+public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart)
+{
+	new File:file = fopen("playershots.txt",io_append);
+ 	new message[256+1];
+ 	new weapname[64+1];
+ 	
+    GetWeaponName(weaponid, weapname, 64);
+	format(message, 256, "PlayerGiveDamage(%d) to Player(%d) (%f) weapon: (%s) bodypart: %d\r\n", playerid, damagedid, amount, weapname, bodypart);
+	
+	fwrite(file, message);
+	fclose(file);
+	SendClientMessageToAll(0xFFFFFFFF, message);
+}*/
+
+
+//-------------------------------------------
+/*
+public OnPlayerGiveDamageActor(playerid, damaged_actorid, Float:amount, weaponid, bodypart)
+{
+    new message[256+1];
+    new weapname[64+1];
+    
+    GetWeaponName(weaponid, weapname, 64);
+    format(message, 256, "PlayerGiveDamageActor(%d) to Actor(%d) (%f) weapon: (%s) bodypart: %d\r\n", playerid, damaged_actorid, amount, weapname, bodypart);
+    SendClientMessageToAll(0xFFFFFFFF, message);
+    
+	if(IsValidActor(damaged_actorid)) {
+	    new Float:fActorHealth;
+	    GetActorHealth(damaged_actorid, fActorHealth);
+	    fActorHealth -= amount;
+		if(fActorHealth < 0.0) fActorHealth = 0.0;
+		SetActorHealth(damaged_actorid, fActorHealth);
+	}
+}
+*/
+//-------------------------------------------
+
+/*
+public OnPlayerDeath(playerid, killerid, reason)
+{
+    SendDeathMessage(killerid, playerid, reason);
+    return 1;
+}*/
+
+//-------------------------------------------
+/*
+public OnEnterExitModShop(playerid, enterexit, interiorid)
+{
+    new message[256+1];
+    if(enterexit) {
+		format(message, 256, "You entered modshop at interior %d", interiorid);
+		SendClientMessage(playerid, 0xFFFFFFFF, message);
+	} else {
+	   	format(message, 256, "You exited the modshop");
+		SendClientMessage(playerid, 0xFFFFFFFF, message);
+	}
+	return 1;
+}
+*/
+//-------------------------------------------
+
+/*
+public OnVehicleDamageStatusUpdate(vehicleid, playerid)
+{
+	new panel, doors, lights, tires;
+	new update_msg[128+1];
+	
+	if(!IsPlayerAdmin(playerid)) return 0;
+	
+	GetVehicleDamageStatus(vehicleid,panel,doors,lights,tires);
+	format(update_msg,128,"VehicleDamage[ID:%d PN:0x%x DR:0x%x LT:0x%x TR:0x%x]",vehicleid,panel,doors,lights,tires);
+	SendClientMessage(playerid,0xFFFFFFFF,update_msg);
+	
+	return 1;
+}*/
+
+//-------------------------------------------
+
+/*
+public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z)
+{
+    new update_msg[128+1];
+    new Float:X, Float:Y, Float:Z;
+    
+    //if(!IsPlayerAdmin(playerid)) return 0;
+    
+    GetVehiclePos(vehicleid, X, Y, Z);
+
+    format(update_msg,128,"NoDriverVehicleUpdate(playerid=%d vehicle=%d passenger=%d cur_pos: %.2f %.2f %.2f new_pos: %.2f %.2f %.2f)",
+		playerid, vehicleid, passenger_seat, X, Y, Z, new_x, new_y, new_z);
+			
+	SendClientMessageToAll(0xFFFFFFFF,update_msg);
+	
+	return 1;
+}*/
+
+//-------------------------------------------
+

BIN
samp03/filterscripts/vspawner.amx


+ 387 - 0
samp03/filterscripts/vspawner.pwn

@@ -0,0 +1,387 @@
+//
+// Admin vehicle spawner using previews. For SA-MP 0.3x and above.
+// - Kye 2012
+//
+
+#include <a_samp>
+#include "../include/gl_common.inc"
+
+#define TOTAL_ITEMS         207
+#define SELECTION_ITEMS 	21
+#define ITEMS_PER_LINE  	7
+
+#define HEADER_TEXT "Vehicles"
+#define NEXT_TEXT   "Next"
+#define PREV_TEXT   "Prev"
+
+#define DIALOG_BASE_X   	75.0
+#define DIALOG_BASE_Y   	130.0
+#define DIALOG_WIDTH    	550.0
+#define DIALOG_HEIGHT   	180.0
+#define SPRITE_DIM_X    	60.0
+#define SPRITE_DIM_Y    	70.0
+
+new gTotalItems = TOTAL_ITEMS;
+new PlayerText:gCurrentPageTextDrawId[MAX_PLAYERS];
+new PlayerText:gHeaderTextDrawId[MAX_PLAYERS];
+new PlayerText:gBackgroundTextDrawId[MAX_PLAYERS];
+new PlayerText:gNextButtonTextDrawId[MAX_PLAYERS];
+new PlayerText:gPrevButtonTextDrawId[MAX_PLAYERS];
+new PlayerText:gSelectionItems[MAX_PLAYERS][SELECTION_ITEMS];
+new gSelectionItemsTag[MAX_PLAYERS][SELECTION_ITEMS];
+new gItemAt[MAX_PLAYERS];
+
+new gItemList[TOTAL_ITEMS] = {
+400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,
+431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,450,451,452,453,454,455,456,457,458,459,460,461,
+462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,490,491,492,
+493,494,495,496,497,498,499,500,501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520,521,522,523,
+524,525,526,527,528,529,530,531,532,533,534,535,536,539,540,541,542,543,544,545,546,547,548,549,550,551,552,553,554,
+555,556,557,558,559,560,561,562,563,564,565,566,567,568,571,572,573,574,575,576,577,578,579,580,581,582,583,584,585,
+586,587,588,589,590,591,592,593,594,595,596,597,598,599,600,601,602,603,604,605,606,607,608,609,610,611
+};
+
+//------------------------------------------------
+
+public OnFilterScriptInit()
+{
+	print("\n--Admin Vehicle Spawner Loaded\n");
+	return 1;
+}
+
+//------------------------------------------------
+
+GetNumberOfPages()
+{
+	if((gTotalItems >= SELECTION_ITEMS) && (gTotalItems % SELECTION_ITEMS) == 0)
+	{
+		return (gTotalItems / SELECTION_ITEMS);
+	}
+	else return (gTotalItems / SELECTION_ITEMS) + 1;
+}
+
+//------------------------------------------------
+
+PlayerText:CreateCurrentPageTextDraw(playerid, Float:Xpos, Float:Ypos)
+{
+	new PlayerText:txtInit;
+   	txtInit = CreatePlayerTextDraw(playerid, Xpos, Ypos, "0/0");
+   	PlayerTextDrawUseBox(playerid, txtInit, 0);
+	PlayerTextDrawLetterSize(playerid, txtInit, 0.4, 1.1);
+	PlayerTextDrawFont(playerid, txtInit, 1);
+	PlayerTextDrawSetShadow(playerid, txtInit, 0);
+    PlayerTextDrawSetOutline(playerid, txtInit, 1);
+    PlayerTextDrawColor(playerid, txtInit, 0xACCBF1FF);
+    PlayerTextDrawShow(playerid, txtInit);
+    return txtInit;
+}
+
+//------------------------------------------------
+// Creates a button textdraw and returns the textdraw ID.
+
+PlayerText:CreatePlayerDialogButton(playerid, Float:Xpos, Float:Ypos, Float:Width, Float:Height, button_text[])
+{
+ 	new PlayerText:txtInit;
+   	txtInit = CreatePlayerTextDraw(playerid, Xpos, Ypos, button_text);
+   	PlayerTextDrawUseBox(playerid, txtInit, 1);
+   	PlayerTextDrawBoxColor(playerid, txtInit, 0x000000FF);
+   	PlayerTextDrawBackgroundColor(playerid, txtInit, 0x000000FF);
+	PlayerTextDrawLetterSize(playerid, txtInit, 0.4, 1.1);
+	PlayerTextDrawFont(playerid, txtInit, 1);
+	PlayerTextDrawSetShadow(playerid, txtInit, 0); // no shadow
+    PlayerTextDrawSetOutline(playerid, txtInit, 0);
+    PlayerTextDrawColor(playerid, txtInit, 0x4A5A6BFF);
+    PlayerTextDrawSetSelectable(playerid, txtInit, 1);
+    PlayerTextDrawAlignment(playerid, txtInit, 2);
+    PlayerTextDrawTextSize(playerid, txtInit, Height, Width); // The width and height are reversed for centering.. something the game does <g>
+    PlayerTextDrawShow(playerid, txtInit);
+    return txtInit;
+}
+ 
+//------------------------------------------------
+
+PlayerText:CreatePlayerHeaderTextDraw(playerid, Float:Xpos, Float:Ypos, header_text[])
+{
+	new PlayerText:txtInit;
+   	txtInit = CreatePlayerTextDraw(playerid, Xpos, Ypos, header_text);
+   	PlayerTextDrawUseBox(playerid, txtInit, 0);
+	PlayerTextDrawLetterSize(playerid, txtInit, 1.25, 3.0);
+	PlayerTextDrawFont(playerid, txtInit, 0);
+	PlayerTextDrawSetShadow(playerid, txtInit, 0);
+    PlayerTextDrawSetOutline(playerid, txtInit, 1);
+    PlayerTextDrawColor(playerid, txtInit, 0xACCBF1FF);
+    PlayerTextDrawShow(playerid, txtInit);
+    return txtInit;
+}
+
+//------------------------------------------------
+
+PlayerText:CreatePlayerBackgroundTextDraw(playerid, Float:Xpos, Float:Ypos, Float:Width, Float:Height)
+{
+	new PlayerText:txtBackground = CreatePlayerTextDraw(playerid, Xpos, Ypos,
+	"                                            ~n~"); // enough space for everyone
+    PlayerTextDrawUseBox(playerid, txtBackground, 1);
+    PlayerTextDrawBoxColor(playerid, txtBackground, 0x00000099);
+	PlayerTextDrawLetterSize(playerid, txtBackground, 5.0, 5.0);
+	PlayerTextDrawFont(playerid, txtBackground, 0);
+	PlayerTextDrawSetShadow(playerid, txtBackground, 0);
+    PlayerTextDrawSetOutline(playerid, txtBackground, 0);
+    PlayerTextDrawColor(playerid, txtBackground,0x000000FF);
+    PlayerTextDrawTextSize(playerid, txtBackground, Width, Height);
+   	PlayerTextDrawBackgroundColor(playerid, txtBackground, 0x00000099);
+    PlayerTextDrawShow(playerid, txtBackground);
+    return txtBackground;
+}
+
+//------------------------------------------------
+// Creates a model preview sprite
+
+PlayerText:CreateModelPreviewTextDraw(playerid, modelindex, Float:Xpos, Float:Ypos, Float:width, Float:height)
+{
+    new PlayerText:txtPlayerSprite = CreatePlayerTextDraw(playerid, Xpos, Ypos, ""); // it has to be set with SetText later
+    PlayerTextDrawFont(playerid, txtPlayerSprite, TEXT_DRAW_FONT_MODEL_PREVIEW);
+    PlayerTextDrawColor(playerid, txtPlayerSprite, 0xFFFFFFFF);
+    PlayerTextDrawBackgroundColor(playerid, txtPlayerSprite, 0x000000EE);
+    PlayerTextDrawTextSize(playerid, txtPlayerSprite, width, height); // Text size is the Width:Height
+    PlayerTextDrawSetPreviewModel(playerid, txtPlayerSprite, modelindex);
+    PlayerTextDrawSetPreviewRot(playerid,txtPlayerSprite, -16.0, 0.0, -55.0);
+    PlayerTextDrawSetSelectable(playerid, txtPlayerSprite, 1);
+    PlayerTextDrawShow(playerid,txtPlayerSprite);
+    return txtPlayerSprite;
+}
+
+//------------------------------------------------
+
+DestroyPlayerModelPreviews(playerid)
+{
+	new x=0;
+	while(x != SELECTION_ITEMS) {
+	    if(gSelectionItems[playerid][x] != PlayerText:INVALID_TEXT_DRAW) {
+			PlayerTextDrawDestroy(playerid, gSelectionItems[playerid][x]);
+			gSelectionItems[playerid][x] = PlayerText:INVALID_TEXT_DRAW;
+		}
+		x++;
+	}
+}
+
+//------------------------------------------------
+
+ShowPlayerModelPreviews(playerid)
+{
+    new x=0;
+	new Float:BaseX = DIALOG_BASE_X;
+	new Float:BaseY = DIALOG_BASE_Y - (SPRITE_DIM_Y * 0.33); // down a bit
+	new linetracker = 0;
+	
+	new itemat = GetPVarInt(playerid, "vspawner_page") * SELECTION_ITEMS;
+	
+	// Destroy any previous ones created
+	DestroyPlayerModelPreviews(playerid);
+
+	while(x != SELECTION_ITEMS && itemat < gTotalItems) {
+	    if(linetracker == 0) {
+	        BaseX = DIALOG_BASE_X + 25.0; // in a bit from the box
+	        BaseY += SPRITE_DIM_Y + 1.0; // move on the Y for the next line
+		}
+  		gSelectionItems[playerid][x] = CreateModelPreviewTextDraw(playerid, gItemList[itemat], BaseX, BaseY, SPRITE_DIM_X, SPRITE_DIM_Y);
+  		gSelectionItemsTag[playerid][x] = gItemList[itemat];
+		BaseX += SPRITE_DIM_X + 1.0; // move on the X for the next sprite
+		linetracker++;
+		if(linetracker == ITEMS_PER_LINE) linetracker = 0;
+		itemat++;
+		x++;
+	}
+}
+
+//------------------------------------------------
+
+UpdatePageTextDraw(playerid)
+{
+	new PageText[64+1];
+	format(PageText, 64, "%d/%d", GetPVarInt(playerid,"vspawner_page") + 1, GetNumberOfPages());
+	PlayerTextDrawSetString(playerid, gCurrentPageTextDrawId[playerid], PageText);
+}
+
+//------------------------------------------------
+
+CreateSelectionMenu(playerid)
+{
+    gBackgroundTextDrawId[playerid] = CreatePlayerBackgroundTextDraw(playerid, DIALOG_BASE_X, DIALOG_BASE_Y + 20.0, DIALOG_WIDTH, DIALOG_HEIGHT);
+    gHeaderTextDrawId[playerid] = CreatePlayerHeaderTextDraw(playerid, DIALOG_BASE_X, DIALOG_BASE_Y, HEADER_TEXT);
+    gCurrentPageTextDrawId[playerid] = CreateCurrentPageTextDraw(playerid, DIALOG_WIDTH - 30.0, DIALOG_BASE_Y + 15.0);
+    gNextButtonTextDrawId[playerid] = CreatePlayerDialogButton(playerid, DIALOG_WIDTH - 30.0, DIALOG_BASE_Y+DIALOG_HEIGHT+100.0, 50.0, 16.0, NEXT_TEXT);
+    gPrevButtonTextDrawId[playerid] = CreatePlayerDialogButton(playerid, DIALOG_WIDTH - 90.0, DIALOG_BASE_Y+DIALOG_HEIGHT+100.0, 50.0, 16.0, PREV_TEXT);
+
+    ShowPlayerModelPreviews(playerid);
+    UpdatePageTextDraw(playerid);
+}
+
+//------------------------------------------------
+
+DestroySelectionMenu(playerid)
+{
+	DestroyPlayerModelPreviews(playerid);
+
+	PlayerTextDrawDestroy(playerid, gHeaderTextDrawId[playerid]);
+	PlayerTextDrawDestroy(playerid, gBackgroundTextDrawId[playerid]);
+	PlayerTextDrawDestroy(playerid, gCurrentPageTextDrawId[playerid]);
+	PlayerTextDrawDestroy(playerid, gNextButtonTextDrawId[playerid]);
+	PlayerTextDrawDestroy(playerid, gPrevButtonTextDrawId[playerid]);
+
+	gHeaderTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
+    gBackgroundTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
+    gCurrentPageTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
+    gNextButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
+    gPrevButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
+}
+
+//------------------------------------------------
+
+SpawnVehicle_InfrontOfPlayer(playerid, vehiclemodel, color1, color2)
+{
+	new Float:x,Float:y,Float:z;
+	new Float:facing;
+	new Float:distance;
+
+    GetPlayerPos(playerid, x, y, z);
+    GetPlayerFacingAngle(playerid, facing);
+
+    new Float:size_x,Float:size_y,Float:size_z;
+	GetVehicleModelInfo(vehiclemodel, VEHICLE_MODEL_INFO_SIZE, size_x, size_y, size_z);
+	
+	distance = size_x + 0.5;
+
+  	x += (distance * floatsin(-facing, degrees));
+    y += (distance * floatcos(-facing, degrees));
+
+	facing += 90.0;
+	if(facing > 360.0) facing -= 360.0;
+
+	return CreateVehicle(vehiclemodel, x, y, z + (size_z * 0.25), facing, color1, color2, -1);
+}
+
+//------------------------------------------------
+
+HandlePlayerItemSelection(playerid, selecteditem)
+{
+ 	// In this case we're spawning a vehicle for them
+    SpawnVehicle_InfrontOfPlayer(playerid, gSelectionItemsTag[playerid][selecteditem], -1, -1);
+}
+
+//------------------------------------------------
+
+public OnPlayerConnect(playerid)
+{
+	// Init all of the textdraw related globals
+    gHeaderTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
+    gBackgroundTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
+    gCurrentPageTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
+    gNextButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
+    gPrevButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
+    
+    for(new x=0; x < SELECTION_ITEMS; x++) {
+        gSelectionItems[playerid][x] = PlayerText:INVALID_TEXT_DRAW;
+	}
+	
+	gItemAt[playerid] = 0;
+	
+	return 1; // Allow other scripts to keep processing OnPlayerConnect
+}
+
+//-------------------------------------------
+// Even though only Player* textdraws are used in this script,
+// OnPlayerClickTextDraw is still required to handle ESC
+
+public OnPlayerClickTextDraw(playerid, Text:clickedid)
+{
+   	if(GetPVarInt(playerid, "vspawner_active") == 0) return 0;
+
+	// Handle: They cancelled (with ESC)
+	if(clickedid == Text:INVALID_TEXT_DRAW) {
+        DestroySelectionMenu(playerid);
+        SetPVarInt(playerid, "vspawner_active", 0);
+        PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
+        return 1;
+	}
+	
+	return 0;
+}
+
+//------------------------------------------------
+
+public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
+{
+	if(GetPVarInt(playerid, "vspawner_active") == 0) return 0;
+
+	new curpage = GetPVarInt(playerid, "vspawner_page");
+	
+	// Handle: next button
+	if(playertextid == gNextButtonTextDrawId[playerid]) {
+	    if(curpage < (GetNumberOfPages() - 1)) {
+	        SetPVarInt(playerid, "vspawner_page", curpage + 1);
+	        ShowPlayerModelPreviews(playerid);
+         	UpdatePageTextDraw(playerid);
+         	PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
+		} else {
+		    PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
+		}
+		return 1;
+	}
+	
+	// Handle: previous button
+	if(playertextid == gPrevButtonTextDrawId[playerid]) {
+	    if(curpage > 0) {
+	    	SetPVarInt(playerid, "vspawner_page", curpage - 1);
+	    	ShowPlayerModelPreviews(playerid);
+	    	UpdatePageTextDraw(playerid);
+	    	PlayerPlaySound(playerid, 1084, 0.0, 0.0, 0.0);
+		} else {
+		    PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
+		}
+		return 1;
+	}
+	
+	// Search in the array of textdraws used for the items
+	new x=0;
+	while(x != SELECTION_ITEMS) {
+	    if(playertextid == gSelectionItems[playerid][x]) {
+	        HandlePlayerItemSelection(playerid, x);
+	        PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
+	        DestroySelectionMenu(playerid);
+	        CancelSelectTextDraw(playerid);
+        	SetPVarInt(playerid, "vspawner_active", 0);
+        	return 1;
+		}
+		x++;
+	}
+	
+	return 0;
+}
+
+//------------------------------------------------
+
+public OnPlayerCommandText(playerid, cmdtext[])
+{
+	new cmd[256+1];
+	new	idx;
+
+	if(!IsPlayerAdmin(playerid)) return 0;
+	
+	cmd = strtok(cmdtext, idx);
+
+	if(strcmp("/vspawner", cmd, true) == 0)
+	{
+ 		// If there was a previously created selection menu, destroy it
+		DestroySelectionMenu(playerid);
+		
+	    SetPVarInt(playerid, "vspawner_active", 1);
+	    //SetPVarInt(playerid, "vspawner_page", 0); // will reset the page back to the first
+	    
+	    CreateSelectionMenu(playerid);
+	    SelectTextDraw(playerid, 0xACCBF1FF);
+	    return 1;
+	}
+	
+	return 0;
+}
+//------------------------------------------------

+ 10 - 0
samp03/filterscripts/y_php.pwn

@@ -0,0 +1,10 @@
+// This is a comment
+// uncomment the line below if you want to write a filterscript
+//#define FILTERSCRIPT
+
+#define _DEBUG 1
+#define PHP_ADDRESS "dedi.y-less.com/YSI_transfer.php"
+
+#include <a_samp>
+#include <YSI\y_php>
+

+ 1169 - 0
samp03/gamemodes/Interior.pwn

@@ -0,0 +1,1169 @@
+// Credits Ada West
+
+x = 2003.1178;
+y = 1015.1948;
+z = 33.008;
+world = GetPlayerVirtualWorld(playerid);
+interior = 11;
+angle = 351.5789;
+name = Four Dragons' Managerial Suite;
+
+x = 770.8033;
+y = -0.7033;
+z = 1000.7267;
+world = GetPlayerVirtualWorld(playerid);
+interior =  5;
+angle = 22.8599;
+name = Ganton Gym;
+
+x = 974.0177;
+y = -9.5937;
+z = 1001.1484;
+world = GetPlayerVirtualWorld(playerid);
+interior = 3;
+angle = 22.6045;
+name = Brothel;
+
+x = 961.9308;
+y = -51.9071;
+z = 1001.1172;
+world = GetPlayerVirtualWorld(playerid);
+interior = 3;
+angle = 95.5381;
+name = Brothel2;
+
+x = 830.6016;
+y = 5.9404;
+z = 1004.1797;
+world = GetPlayerVirtualWorld(playerid);
+interior = 3;
+angle = 125.8149;
+name = Inside Track Betting;
+
+x = 1037.8276;
+y = 0.397;
+z = 1001.2845;
+world = GetPlayerVirtualWorld(playerid);
+interior = 3;
+angle = 353.9335;
+name = Blastin' Fools Records;
+
+x = 1212.1489;
+y = -28.5388;
+z = 1000.9531;
+world = GetPlayerVirtualWorld(playerid);
+interior = 3;
+angle = 170.5692;
+name = The Big Spread Ranch;
+
+x = 1290.4106;
+y = 1.9512;
+z = 1001.0201;
+world = GetPlayerVirtualWorld(playerid);
+interior = 18;
+angle = 179.9419;
+name = Warehouse 1;
+
+x = 1412.1472;
+y = -2.2836;
+z = 1000.9241;
+world = GetPlayerVirtualWorld(playerid);
+interior = 1;
+angle = 114.661;
+name = Warehouse 2;
+
+x = 1527.0468;
+y = -12.0236;
+z = 1002.0971;
+world = GetPlayerVirtualWorld(playerid);
+interior = 3;
+angle = 350.0013;
+name = B Dup's Apartment;
+
+x = 1523.5098;
+y = -47.8211;
+z = 1002.2699;
+world = GetPlayerVirtualWorld(playerid);
+interior = 2;
+angle = 262.7038;
+name = B Dup's Crack Palace;
+
+x = 612.2191;
+y = -123.9028;
+z = 997.9922;
+world = GetPlayerVirtualWorld(playerid);
+interior = 3;
+angle = 266.5704;
+name = Wheel Arch Angels;
+
+x = 512.9291;
+y = -11.6929;
+z = 1001.5653;
+world = GetPlayerVirtualWorld(playerid);
+interior = 3;
+angle = 198.7669
+name = OG Loc's House;
+
+x = 418.4666;
+y = -80.4595;
+z = 1001.8047;
+world = GetPlayerVirtualWorld(playerid);
+interior = 3;
+angle = 343.2358;
+name = Barber Shop;
+
+x = 386.5259;
+y = 173.6381;
+z = 1008.3828;
+world = GetPlayerVirtualWorld(playerid);
+interior = 3;
+angle = 63.7399;
+name = Planning Department;
+
+x = 288.4723;
+y = 170.0647;
+z = 1007.1794;
+world = GetPlayerVirtualWorld(playerid);
+interior = 3;
+angle = 22.0477;
+name = Las Venturas Police Department;
+
+x = 206.4627;
+y = -137.7076;
+z = 1003.0938;
+world = GetPlayerVirtualWorld(playerid);
+interior = 3;
+angle = 10.9347;
+name = Pro-Laps;
+
+x = -100.2674;
+y = -22.9376;
+z = 1000.7188;
+world = GetPlayerVirtualWorld(playerid);
+interior = 3;
+angle = 17.285;
+name = Sex Shop;
+
+x = -201.2236;
+y = -43.2465;
+z = 1002.2734;
+world = GetPlayerVirtualWorld(playerid);
+interior = 3;
+angle = 45.8613;
+name = Las Venturas Tattoo parlor;
+
+x = -202.9381;
+y = -6.7006;
+z = 1002.2734;
+world = GetPlayerVirtualWorld(playerid);
+interior = 17;
+angle = 204.2693;
+name = Lost San Fierro Tattoo parlor;
+
+x = -25.7220;
+y = -187.8216;
+z = 1003.5469;
+world = GetPlayerVirtualWorld(playerid);
+interior = 17;
+angle = 5.0760;
+name = 24/7 (version 1);
+
+x = 454.9853;
+y = -107.2548;
+z = 999.4376;
+world = GetPlayerVirtualWorld(playerid);
+interior = 5;
+angle = 309.0195;
+name = Diner 1;
+
+x = 372.5565;
+y = -131.3607;
+z = 1001.4922;
+world = GetPlayerVirtualWorld(playerid);
+interior = 5;
+angle = 354.2285;
+name = Pizza Stack;
+
+x = 378.026;
+y = -190.5155;
+z = 1000.6328;
+world = GetPlayerVirtualWorld(playerid);
+interior = 17;
+angle = 141.0245;
+name = Rusty Brown's Donuts;
+
+x = 315.244;
+y = -140.8858;
+z = 999.6016;
+world = GetPlayerVirtualWorld(playerid);
+interior = 7;
+angle = 7.4226;
+name = Ammu-nation;
+
+x = 225.0306;
+y = -9.1838;
+z = 1002.218;
+world = GetPlayerVirtualWorld(playerid);
+interior = 5;
+angle = 85.5322;
+name = Victim;
+
+x = 611.3536;
+y = -77.5574;
+z = 997.9995;
+world = GetPlayerVirtualWorld(playerid);
+interior = 2;
+angle = 320.9263;
+name = Loco Low Co;
+
+x = 246.0688;
+y = 108.9703;
+z = 1003.2188;
+world = GetPlayerVirtualWorld(playerid);
+interior = 10;
+angle = 0.2922;
+name = San Fierro Police Department;
+
+x = 6.0856;
+y = -28.8966;
+z = 1003.5494;
+world = GetPlayerVirtualWorld(playerid);
+interior = 10;
+angle = 5.0365;
+name = 24/7 (version 2 - large);
+
+x = 773.7318;
+y = -74.6957;
+z = 1000.6542;
+world = GetPlayerVirtualWorld(playerid);
+interior = 7;
+angle = 5.2304;
+name = Below The Belt Gym (Las Venturas);
+
+x = 621.4528;
+y = -23.7289;
+z = 1000.9219;
+world = GetPlayerVirtualWorld(playerid);
+interior = 1;
+angle = 15.6789;
+name = Transfenders;
+
+x = 445.6003;
+y = -6.9823;
+z = 1000.7344;
+world = GetPlayerVirtualWorld(playerid);
+interior = 1;
+angle = 172.2105;
+name = World of Coq;
+
+x = 285.8361;
+y = -39.0166;
+z = 1001.5156;
+world = GetPlayerVirtualWorld(playerid);
+interior = 1;
+angle = 0.7529;
+name = Ammu-nation (version 2);
+
+x = 204.1174;
+y = -46.8047;
+z = 1001.8047;
+world = GetPlayerVirtualWorld(playerid);
+interior = 1;
+angle = 357.5777;
+name = SubUrban;
+
+x = 245.2307;
+y = 304.7632;
+z = 999.1484;
+world = GetPlayerVirtualWorld(playerid);
+interior = 1;
+angle = 273.4364;
+name = Denise's Bedroom;
+
+x = 290.623;
+y = 309.0622;
+z = 999.1484;
+world = GetPlayerVirtualWorld(playerid);
+interior = 3;
+angle = 89.9164;
+name = Helena's Barn;
+
+x = 322.5014;
+y = 303.6906;
+z = 999.1484;
+world = GetPlayerVirtualWorld(playerid);
+interior = 5;
+angle = 8.1747;
+name = Barbara's Love nest;
+
+x = -2041.2334;
+y = 178.3969;
+z = 28.8465;
+world = GetPlayerVirtualWorld(playerid);
+interior = 1;
+angle = 156.2153;
+name = San Fierro Garage;
+
+x = -1402.6613;
+y = 106.3897;
+z = 1032.2734;
+world = GetPlayerVirtualWorld(playerid);
+interior = 1;
+angle = 105.1356;
+name = Oval Stadium;
+
+x = -1403.0116;
+y = -250.4526;
+z = 1043.5341;
+world = GetPlayerVirtualWorld(playerid);
+interior = 7;
+angle = 355.8576;
+name = 8-Track Stadium;
+
+x = 1204.6689;
+y = -13.5429;
+z = 1000.9219;
+world = GetPlayerVirtualWorld(playerid);
+interior = 2;
+angle = 350.0204;
+name = The Pig Pen (strip club 2);
+
+x = 2016.1156;
+y = 1017.1541;
+z = 996.875;
+world = GetPlayerVirtualWorld(playerid);
+interior = 10;
+angle = 88.0055;
+name = Four Dragons;
+
+x = -741.8495;
+y = 493.0036;
+z = 1371.9766;
+world = GetPlayerVirtualWorld(playerid);
+interior = 1;
+angle = 71.7782;
+name = Liberty City;
+
+x = 2447.8704;
+y = -1704.4509;
+z = 1013.5078;
+world = GetPlayerVirtualWorld(playerid);
+interior = 2;
+angle = 314.5253;
+name = Ryder's house;
+
+x = 2527.0176;
+y = -1679.2076;
+z = 1015.4986;
+world = GetPlayerVirtualWorld(playerid);
+interior = 1;
+angle = 260.9709;
+name = Sweet's House;
+
+x = -1129.8909;
+y = 1057.5424;
+z = 1346.4141;
+world = GetPlayerVirtualWorld(playerid);
+interior = 10;
+angle = 274.5268;
+name = RC Battlefield;
+
+x = 2496.0549;
+y = -1695.1749;
+z = 1014.7422;
+world = GetPlayerVirtualWorld(playerid);
+interior = 3;
+angle = 179.2174;
+name = The Johnson House;
+
+x = 366.0248;
+y = -73.3478;
+z = 1001.5078;
+world = GetPlayerVirtualWorld(playerid);
+interior = 10;
+angle = 292.0084;
+name = Burger shot;
+
+x = 2233.9363;
+y = 1711.8038;
+z = 1011.6312;
+world = GetPlayerVirtualWorld(playerid);
+interior = 1;
+angle = 184.3891;
+name = Caligula's Casino;
+
+x = 269.6405;
+y = 305.9512;
+z = 999.1484;
+world = GetPlayerVirtualWorld(playerid);
+interior = 2;
+angle = 215.6625;
+name = Katie's Lovenest;
+
+x = 414.2987;
+y = -18.8044;
+z = 1001.8047;
+world = GetPlayerVirtualWorld(playerid);
+interior = 2;
+angle = 41.4265;
+name = Barber Shop 2 (Reece's);
+
+x = 1.1853;
+y = -3.2387;
+z = 999.4284;
+world = GetPlayerVirtualWorld(playerid);
+interior = 2;
+angle = 87.5718;
+name = Angel Pine Trailer;
+
+x = -30.9875;
+y = -89.6806;
+z = 1003.5469;
+world = GetPlayerVirtualWorld(playerid);
+interior = 18;
+angle = 359.8401;
+name = 24/7 (version 3);
+
+x = 161.4048;
+y = -94.2416;
+z = 1001.8047;
+world = GetPlayerVirtualWorld(playerid);
+interior = 18;
+angle = 0.7938;
+name = Zip;
+
+x = -2638.8232;
+y = 1407.3395;
+z = 906.4609;
+world = GetPlayerVirtualWorld(playerid);
+interior = 3;
+angle = 94.6794;
+name = The Pleasure Domes;
+
+x = 1267.8407;
+y = -776.9587;
+z = 1091.9063;
+world = GetPlayerVirtualWorld(playerid);
+interior = 5;
+angle = 231.3418;
+name = Madd Dogg's Mansion;
+
+x = 2536.5322;
+y = -1294.8425;
+z = 1044.125;
+world = GetPlayerVirtualWorld(playerid);
+interior = 2;
+angle = 254.9548;
+name = Big Smoke's Crack Palace;
+
+x = 2350.1597;
+y = -1181.0658;
+z = 1027.9766;
+world = GetPlayerVirtualWorld(playerid);
+interior = 5;
+angle = 99.1864;
+name = Burning Desire Building;
+
+x = -2158.6731;
+y = 642.09;
+z = 1052.375;
+world = GetPlayerVirtualWorld(playerid);
+interior = 1;
+angle = 86.5402;
+name = Wu-Zi Mu's;
+
+x = 419.8936;
+y = 2537.1155;
+z = 10;
+world = GetPlayerVirtualWorld(playerid);
+interior = 10;
+angle = 67.6537;
+name = Abandoned AC tower;
+
+x = 256.9047;
+y = -41.6537;
+z = 1002.0234;
+world = GetPlayerVirtualWorld(playerid);
+interior = 14;
+angle = 85.8774;
+name = Wardrobe/Changing room;
+
+x = 204.1658;
+y = -165.7678;
+z = 1000.5234;
+world = GetPlayerVirtualWorld(playerid);
+interior = 14;
+angle = 181.7583;
+name = Didier Sachs;
+
+x = 1133.35;
+y = -7.8462;
+z = 1000.6797;
+world = GetPlayerVirtualWorld(playerid);
+interior = 12;
+angle = 165.8482;
+name = Casino (Redsands West);
+
+x = -1420.4277;
+y = 1616.9221;
+z = 1052.5313;
+world = GetPlayerVirtualWorld(playerid);
+interior = 14;
+angle = 159.1255;
+name = Kickstart Stadium;
+
+x = 493.1443;
+y = -24.2607;
+z = 1000.6797;
+world = GetPlayerVirtualWorld(playerid);
+interior = 17;
+angle = 356.9864;
+name = Club;
+
+x = 1727.2853;
+y = -1642.9451;
+z = 20.2254;
+world = GetPlayerVirtualWorld(playerid);
+interior = 18;
+angle = 172.4193;
+name = Atrium;
+
+x = -202.842;
+y = -24.0325;
+z = 1002.2734;
+world = GetPlayerVirtualWorld(playerid);
+interior = 16;
+252.8154;
+name = Los Santos Tattoo Parlor;
+
+x = 2233.6919;
+y = -1112.8107;
+z = 1050.8828;
+world = GetPlayerVirtualWorld(playerid);
+interior = 5;
+angle = 8.6483;
+name = Safe House group 1;
+
+x = 1211.2484;
+y = 1049.0234;
+z = 359.941;
+world = GetPlayerVirtualWorld(playerid);
+interior = 6;
+angle = 170.9341;
+name = Safe House group 2;
+
+x = 2319.1272;
+y = -1023.9562;
+z = 1050.2109;
+world = GetPlayerVirtualWorld(playerid);
+interior = 9;
+angle = 167.3959;
+name = Safe House group 3;
+
+x = 2261.0977;
+y = -1137.8833;
+z = 1050.6328;
+world = GetPlayerVirtualWorld(playerid);
+interior = 10;
+angle = 266.88;
+name = Safe House group 4;
+
+x = -944.2402;
+y = 1886.1536;
+z = 5.0051;
+world = GetPlayerVirtualWorld(playerid);
+interior = 17;
+angle = 179.8548;
+name = Sherman Dam;
+
+x = -26.1856;
+y = -140.9164;
+z = 1003.5469;
+world = GetPlayerVirtualWorld(playerid);
+interior = 16;
+angle = 2.9087;
+name = 24/7 (version 4);
+
+x = 2217.281;
+y = -1150.5349;
+z = 1025.7969;
+world = GetPlayerVirtualWorld(playerid);
+interior = 15;
+angle = 273.7328;
+name = Jefferson Motel;
+
+x = 1.5491;
+y = 23.3183;
+z = 1199.5938;
+world = GetPlayerVirtualWorld(playerid);
+interior = 1;
+angle = 359.9054;
+name = Jet Interior;
+
+x = 681.6216;
+y = -451.8933;
+z = -25.6172;
+world = GetPlayerVirtualWorld(playerid);
+interior = 1;
+angle = 166.166;
+name = The Welcome Pump;
+
+x = 234.6087;
+y = 1187.8195;
+z = 1080.2578;
+world = GetPlayerVirtualWorld(playerid);
+interior = 3;
+angle = 349.4844;
+name = Burglary House X1;
+
+x = 225.5707;
+y = 1240.0643;
+z = 1082.1406;
+world = GetPlayerVirtualWorld(playerid);
+interior = 2;
+angle = 96.2852;
+name = Burglary House X2;
+
+x = 224.288;
+y = 1289.1907;
+z = 1082.1406;
+world = GetPlayerVirtualWorld(playerid);
+interior = 1;
+angle = 359.868;
+name = Burglary House X3;
+
+x = 239.2819;
+y = 1114.1991;
+z = 1080.9922;
+world = GetPlayerVirtualWorld(playerid);
+interior = 5;
+angle = 270.2654;
+name = Burglary House X4;
+
+x = 207.5219;
+y = -109.7448;
+z = 1005.1328;
+world = GetPlayerVirtualWorld(playerid);
+interior = 15;
+angle = 358.62;
+name = Binco;
+
+x = 295.1391;
+y = 1473.3719;
+z = 1080.2578;
+world = GetPlayerVirtualWorld(playerid);
+interior = 15;
+angle = 352.9526;
+name = 4 Burglary houses;
+
+x = -1417.8927;
+y = 932.4482;
+z = 1041.5313;
+world = GetPlayerVirtualWorld(playerid);
+interior = 15;
+angle = 0.7013;
+name = Blood Bowl Stadium;
+
+x = 446.3247;
+y = 509.9662;
+z = 1001.4195;
+world = GetPlayerVirtualWorld(playerid);
+interior = 12;
+angle = 330.5671;
+name = Budget Inn Motel Room;
+
+x = 2306.3826;
+y = -15.2365;
+z = 26.7496;
+world = GetPlayerVirtualWorld(playerid);
+interior = 0;
+angle = 274.49;
+name = Palamino Bank;
+
+x = 2331.8984;
+y = 6.7816;
+z = 26.5032;
+world = GetPlayerVirtualWorld(playerid);
+interior = 0;
+angle = 100.2357;
+name = Palamino Diner;
+
+x = 663.0588;
+y = -573.6274;
+z = 16.3359;
+world = GetPlayerVirtualWorld(playerid);
+interior = 0;
+angle = 264.9829;
+name = Dillimore Gas Station;
+
+x = -227.5703;
+y = 1401.5544;
+z = 27.7656;
+world = GetPlayerVirtualWorld(playerid);
+interior = 18;
+angle = 269.2978;
+name = Lil' Probe Inn;
+
+x = -688.1496;
+y = 942.0826;
+z = 13.6328;
+world = GetPlayerVirtualWorld(playerid);
+interior = 0;
+angle = 177.6574;
+name = Torreno's Ranch;
+
+x = -1916.1268;
+y = 714.8617;
+z = 46.5625;
+world = GetPlayerVirtualWorld(playerid);
+interior = 0;
+angle = 152.2839;
+name = Zombotech - lobby area;
+
+x = 818.7714;
+y = -1102.8689;
+z = 25.794;
+world = GetPlayerVirtualWorld(playerid);
+interior = 0;
+angle = 91.1439;
+name = Crypt in LS cemetery (temple);
+
+x = 255.2083;
+y = -59.6753;
+z = 1.5703;
+world = GetPlayerVirtualWorld(playerid);
+interior = 0;
+angle = 1.4645;
+name = Blueberry Liquor Store;
+
+x = 446.626;
+y = 1397.738;
+z = 1084.3047;
+world = GetPlayerVirtualWorld(playerid);
+interior = 2;
+angle = 343.9647;
+name = Pair of Burglary Houses;
+
+x = 227.3922;
+y = 1114.6572;
+z = 1080.9985;
+world = GetPlayerVirtualWorld(playerid);
+interior = 5;
+angle = 267.459;
+name = Crack Den;
+
+x = 227.7559;
+y = 1114.3844;
+z = 1080.9922;
+world = GetPlayerVirtualWorld(playerid);
+interior = 5;
+angle = 266.2624;
+name = Burglary House X11;
+
+x = 261.1165;
+y = 1287.2197;
+world = GetPlayerVirtualWorld(playerid);
+interior = 4;
+z = 1080.2578;
+angle = 178.9149;
+name = Burglary House X12;
+
+x = 291.7626;
+y = -80.1306;
+z = 1001.5156;
+world = GetPlayerVirtualWorld(playerid);
+interior = 4;
+angle = 290.2195;
+name = Ammu-nation (version 3);
+
+x = 449.0172;
+y = -88.9894;
+z = 999.5547;
+world = GetPlayerVirtualWorld(playerid);
+interior = 4;
+angle = 89.6608;
+name = Jay's Diner;
+
+x = -27.844;
+y = -26.6737;
+z = 1003.5573;
+world = GetPlayerVirtualWorld(playerid);
+interior = 4;
+angle = 184.3118;
+name = 24/7 (version 5);
+
+x = 2135.2004;
+y = -2276.2815;
+z = 20.6719;
+world = GetPlayerVirtualWorld(playerid);
+interior = 0;
+angle = 318.59;
+name = Warehouse 3;
+
+x = 306.1966;
+y = 307.819;
+z = 1003.3047;
+world = GetPlayerVirtualWorld(playerid);
+interior = 4;
+angle = 203.1354;
+name = Michelle's Love Nest*;
+
+x = 24.3769;
+y = 1341.1829;
+z = 1084.375;
+world = GetPlayerVirtualWorld(playerid);
+interior = 10;
+angle = 8.3305;
+name = Burglary House X14;
+
+x = 963.0586;
+y = 2159.7563;
+z = 1011.0303;
+world = GetPlayerVirtualWorld(playerid);
+interior = 1;
+angle = 175.313;
+name = Sindacco Abatoir;
+
+x = 2548.4807;
+y = 2823.7429;
+z = 10.8203;
+world = GetPlayerVirtualWorld(playerid);
+interior = 0;
+angle = 270.6003;
+name = K.A.C.C. Military Fuels Depot;
+
+x = 215.1515;
+y = 1874.0579;
+z = 13.1406;
+world = GetPlayerVirtualWorld(playerid);
+interior = 0;
+angle = 177.553; 
+name = Area 69;
+
+x = 221.6766;
+y = 1142.4962;
+z = 1082.6094;
+world = GetPlayerVirtualWorld(playerid);
+interior = 4;
+angle = 184.9618;
+name = Burglary House X13;
+
+x = 2323.7063;
+y = -1147.6509;
+z = 1050.7101;
+world = GetPlayerVirtualWorld(playerid);
+interior = 12;
+angle = 206.5352;
+name = Unused Safe House;
+
+x = 344.9984;
+y = 307.1824;
+z = 999.1557;
+world = GetPlayerVirtualWorld(playerid);
+interior = 6;
+angle = 193.643;
+name = Millie's Bedroom;
+
+x = 411.9707;
+y = -51.9217;
+z = 1001.8984;
+world = GetPlayerVirtualWorld(playerid);
+interior = 12;
+angle = 173.3449;
+name = Barber Shop;
+
+x = -1421.5618;
+y = -663.8262;
+z = 1059.5569;
+world = GetPlayerVirtualWorld(playerid);
+interior = 4
+angle = 170.9341;
+name = Dirtbike Stadium;
+
+x = 773.8887;
+y = -47.7698;
+z = 1000.5859;
+world = GetPlayerVirtualWorld(playerid);
+interior = 6;
+angle = 10.7161;
+name = Cobra Gym;
+
+x = 246.6695;
+y = 65.8039;
+z = 1003.6406;
+world = GetPlayerVirtualWorld(playerid);
+interior = 6;
+angle = 7.9562;
+name = Los Santos Police Department;
+
+x = -1864.9434;
+y = 55.7325;
+z = 1055.5276;
+world = GetPlayerVirtualWorld(playerid);
+interior = 14;
+angle = 85.8541;
+name = Los Santos Airport;
+
+x = -262.1759;
+y = 1456.6158;
+z = 1084.3672;
+world = GetPlayerVirtualWorld(playerid);
+interior = 4;
+angle = 82.459;
+name = Burglary House X15;
+
+x = 22.861;
+y = 1404.9165;
+z = 1084.4297;
+world = GetPlayerVirtualWorld(playerid);
+interior = 5;
+angle = 349.6158;
+name = Burglary House X16;
+
+x = 140.3679;
+y = 1367.8837;
+z = 1083.8621;
+world = GetPlayerVirtualWorld(playerid);
+interior = 5;
+angle = 349.2372;
+name = Burglary House X17;
+
+x = 1494.8589;
+y = 1306.48;
+z = 1093.2953;
+world = GetPlayerVirtualWorld(playerid);
+interior = 3;
+angle = 196.065;
+name = Bike School;
+
+x = -1813.213;
+y = -58.012;
+z = 1058.9641;
+world = GetPlayerVirtualWorld(playerid);
+interior = 14;
+angle = 335.3199;
+name = Francis International Airport;
+
+x = -1401.067;
+y = 1265.3706;
+z = 1039.8672;
+world = GetPlayerVirtualWorld(playerid);
+interior = 16;
+angle = 178.6483;
+name = Vice Stadium;
+
+x = 234.2826;
+y = 1065.229;
+z = 1084.2101;
+world = GetPlayerVirtualWorld(playerid);
+interior = 6;
+angle = 4.3864;
+name = Burglary House X18;
+
+x = -68.5145;
+y = 1353.8485;
+z = 1080.2109;
+world = GetPlayerVirtualWorld(playerid);
+interior = 6;
+angle = 3.5742;
+name = Burglary House X19;
+
+x = -2240.1028;
+y = 136.973;
+z = 1035.4141;
+world = GetPlayerVirtualWorld(playerid);
+interior = 6;
+angle = 269.0954;
+name = Zero's RC Shop;
+
+x = 297.144;
+y = -109.8702;
+z = 1001.5156;
+world = GetPlayerVirtualWorld(playerid);
+interior = 6;
+angle = 20.2254;
+name = Ammu-nation (version 4);
+
+x = 316.5025;
+y = -167.6272;
+z = 999.5938;
+world = GetPlayerVirtualWorld(playerid);
+interior = 6;
+angle = 10.3031;
+name = Ammu-nation (version 5);
+
+x = -285.2511;
+y = 1471.197;
+z = 1084.375;
+world = GetPlayerVirtualWorld(playerid);
+interior = 15;
+angle = 85.6547;
+name = Burglary House X20;
+
+x = -26.8339;
+y = -55.5846;
+z = 1003.5469;
+world = GetPlayerVirtualWorld(playerid);
+interior = 6;
+angle = 3.9528;
+name = 24/7 (version 6);
+
+x = 442.1295;
+y = -52.4782;
+z = 999.7167;
+world = GetPlayerVirtualWorld(playerid);
+interior = 6;
+angle = 177.9394;
+name = Secret Valley Diner;
+
+x = 2182.2017;
+y = 1628.5848;
+z = 1043.8723;
+world = GetPlayerVirtualWorld(playerid);
+interior = 2;
+angle = 224.8601;
+name = Rosenberg's Office in Caligulas;
+
+x = 748.4623;
+y = 1438.2378;
+z = 1102.9531;
+world = GetPlayerVirtualWorld(playerid);
+interior = 6;
+angle = 0.6069;
+name = Fanny Batter's Whore House;
+
+x = 2807.3604;
+y = -1171.7048;
+z = 1025.5703;
+world = GetPlayerVirtualWorld(playerid);
+interior = 8;
+angle = 193.7117;
+name = Colonel Furhberger's;
+
+x = 366.0002;
+y = -9.4338;
+z = 1001.8516;
+world = GetPlayerVirtualWorld(playerid);
+interior = 9;
+angle = 160.528;
+name = Cluckin' Bell;
+
+x = 2216.1282;
+y = -1076.3052;
+z = 1050.4844;
+world = GetPlayerVirtualWorld(playerid);
+interior = 1;
+angle = 86.428;
+name = The Camel's Toe Safehouse;
+
+x = 2268.5156;
+y = 1647.7682;
+z = 1084.2344;
+world = GetPlayerVirtualWorld(playerid);
+interior = 1;
+angle = 99.7331;
+name = Caligula's Roof;
+
+x = 2236.6997;
+y = -1078.9478;
+z = 1049.0234;
+world = GetPlayerVirtualWorld(playerid);
+interior = 2;
+angle = 2.5706;
+name = Old Venturas Strip Casino;
+
+x = -2031.1196;
+y = -115.8287;
+z = 1035.1719;
+world = GetPlayerVirtualWorld(playerid);
+interior = 3;
+angle = 190.1877;
+name = Driving School;
+
+x = 2365.1089;
+y = -1133.0795;
+z = 1050.875;
+world = GetPlayerVirtualWorld(playerid);
+interior = 8;
+angle = 177.3947;
+name = Verdant Bluffs Safehouse;
+
+x = 1168.512;
+y = 1360.1145;
+z = 10.9293;
+world = GetPlayerVirtualWorld(playerid);
+interior = 0;
+angle = 196.5933;
+name = Bike School;
+
+x = 315.4544;
+y = 976.5972;
+z = 1960.8511;
+world = GetPlayerVirtualWorld(playerid);
+interior = 9;
+angle = 359.6368;
+name = Andromada;
+
+x = 1893.0731;
+y = 1017.8958;
+z = 31.8828;
+world = GetPlayerVirtualWorld(playerid);
+interior = 10;
+angle = 86.1044;
+name = Four Dragons' Janitor's Office;
+
+x = 501.9578;
+y = -70.5648;
+z = 998.7578;
+world = GetPlayerVirtualWorld(playerid);
+interior = 11;
+angle = 171.5706;
+name = Bar;
+
+x = -42.5267;
+y = 1408.23;
+z = 1084.4297;
+world = GetPlayerVirtualWorld(playerid);
+interior = 8;
+angle = 172.068;
+name = Burglary House X21;
+
+x = 2283.3118;
+y = 1139.307;
+z = 1050.8984;
+world = GetPlayerVirtualWorld(playerid);
+interior = 11;
+angle = 19.7032;
+name = Willowfield Safehouse;
+
+x = 84.9244;
+y = 1324.2983;
+z = 1083.8594;
+world = GetPlayerVirtualWorld(playerid);
+interior = 9;
+angle = 159.5582;
+name = Burglary House X22;
+
+x = 260.7421;
+y = 1238.2261;
+z = 1084.2578;
+world = GetPlayerVirtualWorld(playerid);
+interior = 9;
+angle = 84.3084;
+name = Burglary House X23;
+
+x = -1658.1656;
+y = 1215.0002;
+z = 7.25;
+world = GetPlayerVirtualWorld(playerid);
+interior = 0;
+angle = 103.9074;
+name = Otto's Autos;
+
+x = -1961.6281;
+y = 295.2378;
+z = 35.4688;
+world = GetPlayerVirtualWorld(playerid);
+interior = 0;
+angle = 264.4891;
+name = Wang Cars;

+ 4114 - 0
samp03/gamemodes/RPFW.0.04 Built 9.pwn

@@ -0,0 +1,4114 @@
+// Developers notes
+/* # Coding guideline
+* Add +1 at the end of array declarations to visually account for null bit.
+* Always log first.
+* Always notify discord last.
+* Always wait for other queries to finish before initiating one: "sql_wait(sqlHandle);	// Wait for other queries to finish"
+* Delete GVar strings as soon as possible, but at least before the player quits or the gamemode exits, as per: https://forum.sa-mp.com/showthread.php?t=151076
+*/
+
+/* # Style guide
+* GLOBAL_CONSTANT
+* local_variable
+* someFunction
+* SomeClass
+* playerid  // Variable storing in-game player ID
+* player_id // Variable storing database player ID
+*/
+
+/* # Adding a discord bot to your guild.
+https://discordapp.com/oauth2/authorize?client_id=%CLIENT_ID%&scope=bot&permissions=3072
+Where %CLEINT_ID% is the client id.
+*/
+
+/* # To do:
+* Add geoiplib, to make connect messages fancier, and add a locate command.
+* Show underscores as spaces and convert spaces in changename input to undescores before regex chack.
+* Vip limit on characters.
+* See why sql_insert_id wont work.
+* Add all ADMIN_ECHO_CHANNEL messages to admin chat. (not the real admin chat)
+* Check if timestamps work (implemented on temp ban), before implementing it more.
+* Normalise database column names.
+* Some SMALLINT fields are using SQL_INTERGER_LEGNTH for size and could be smaller.
+*/
+
+
+/// Global definitions
+// Colours
+/*
+#define COLOR_GREEN 0x33AA33AA
+#define COLOR_YELLOW 0xFFFF00AA
+#define COLOR_WHITE 0xFFFFFFAA
+#define COLOR_BLUE 0x0000BBAA
+#define COLOR_LIGHTBLUE 0x33CCFFAA
+#define COLOR_ORANGE 0xFF9900AA
+#define COLOR_RED 0xAA3333AA
+#define COLOR_LIME 0x10F441AA
+#define COLOR_NAVY 0x000080AA
+#define COLOR_AQUA 0xF0F8FFAA
+#define COLOR_CRIMSON 0xDC143CAA
+#define COLOR_BISQUE 0xFFE4C4AA
+#define COLOR_BLACK 0x000000AA
+#define COLOR_CHARTREUSE 0x7FFF00AA
+#define COLOR_BROWN 0XA52A2AAA
+#define COLOR_CORAL 0xFF7F50AA
+#define COLOR_GOLD 0xB8860BAA
+#define COLOR_GREENYELLOW 0xADFF2FAA
+#define COLOR_INDIGO 0x4B00B0AA
+#define COLOR_IVORY 0xFFFF82AA
+#define COLOR_LAWNGREEN 0x7CFC00AA
+#define COLOR_SEAGREEN 0x20B2AAAA
+#define COLOR_SEAGREEN 0x2E8B57AA
+#define COLOR_LIMEGREEN 0x32CD32AA //<--- Dark lime
+#define COLOR_MIDNIGHTBLUE 0X191970AA
+#define COLOR_MAROON 0x800000AA
+#define COLOR_OLIVE 0x808000AA
+#define COLOR_ORANGERED 0xFF4500AA
+#define COLOR_PINK 0xFFC0CBAA // - Light light pink
+#define COLOR_SPRINGGREEN 0x00FF7FAA
+#define COLOR_TOMATO 0xFF6347AA // - Tomato >:/ sounds wrong lol... well... :P
+#define COLOR_YELLOWGREEN 0x9ACD32AA //- like military green
+#define COLOR_MEDIUMAQUA 0x83BFBFAA
+#define COLOR_MEDIUMMAGENTA 0x8B008BAA // dark magenta ^^
+*/
+#define COLOR_ACTIVEBORDER 0xB4B4B4FF
+#define COLOR_ACTIVECAPTION 0x99B4D1FF
+#define COLOR_ACTIVECAPTIONTEXT 0x000000FF
+#define COLOR_ALICEBLUE 0xF0F8FFFF
+#define COLOR_ANTIQUEWHITE 0xFAEBD7FF
+#define COLOR_APPWORKSPACE 0xABABABFF
+#define COLOR_AQUA 0x00FFFFFF
+#define COLOR_AQUAMARINE 0x7FFFD4FF
+#define COLOR_AZURE 0xF0FFFFFF
+#define COLOR_BEIGE 0xF5F5DCFF
+#define COLOR_BISQUE 0xFFE4C4FF
+#define COLOR_BLACK 0x000000FF
+#define COLOR_BLANCHEDALMOND 0xFFEBCDFF
+#define COLOR_BLUE 0x0000FFFF
+#define COLOR_BLUEVIOLET 0x8A2BE2FF
+#define COLOR_BROWN 0xA52A2AFF
+#define COLOR_BURLYWOOD 0xDEB887FF
+#define COLOR_BUTTONFACE 0xF0F0F0FF
+#define COLOR_BUTTONHIGHLIGHT 0xFFFFFFFF
+#define COLOR_BUTTONSHADOW 0xA0A0A0FF
+#define COLOR_CADETBLUE 0x5F9EA0FF
+#define COLOR_CHARTREUSE 0x7FFF00FF
+#define COLOR_CHOCOLATE 0xD2691EFF
+#define COLOR_CONTROL 0xF0F0F0FF
+#define COLOR_CONTROLDARK 0xA0A0A0FF
+#define COLOR_CONTROLDARKDARK 0x696969FF
+#define COLOR_CONTROLLIGHT 0xE3E3E3FF
+#define COLOR_CONTROLLIGHTLIGHT 0xFFFFFFFF
+#define COLOR_CONTROLTEXT 0x000000FF
+#define COLOR_CORAL 0xFF7F50FF
+#define COLOR_CORNFLOWERBLUE 0x6495EDFF
+#define COLOR_CORNSILK 0xFFF8DCFF
+#define COLOR_CRIMSON 0xDC143CFF
+#define COLOR_CYAN 0x00FFFFFF
+#define COLOR_DARKBLUE 0x00008BFF
+#define COLOR_DARKCYAN 0x008B8BFF
+#define COLOR_DARKGOLDENROD 0xB8860BFF
+#define COLOR_DARKGRAY 0xA9A9A9FF
+#define COLOR_DARKGREEN 0x006400FF
+#define COLOR_DARKKHAKI 0xBDB76BFF
+#define COLOR_DARKMAGENTA 0x8B008BFF
+#define COLOR_DARKOLIVEGREEN 0x556B2FFF
+#define COLOR_DARKORANGE 0xFF8C00FF
+#define COLOR_DARKORCHID 0x9932CCFF
+#define COLOR_DARKRED 0x8B0000FF
+#define COLOR_DARKSALMON 0xE9967AFF
+#define COLOR_DARKSEAGREEN 0x8FBC8BFF
+#define COLOR_DARKSLATEBLUE 0x483D8BFF
+#define COLOR_DARKSLATEGRAY 0x2F4F4FFF
+#define COLOR_DARKTURQUOISE 0x00CED1FF
+#define COLOR_DARKVIOLET 0x9400D3FF
+#define COLOR_DEEPPINK 0xFF1493FF
+#define COLOR_DEEPSKYBLUE 0x00BFFFFF
+#define COLOR_DEFAULT_CHAT 0xFFFFFFFF
+#define COLOR_DESKTOP 0x000000FF
+#define COLOR_DIMGRAY 0x696969FF
+#define COLOR_DODGERBLUE 0x1E90FFFF
+#define COLOR_FIREBRICK 0xB22222FF
+#define COLOR_FLBLUE 0x6495EDAA
+#define COLOR_FLORALWHITE 0xFFFAF0FF
+#define COLOR_FORESTGREEN 0x228B22FF
+#define COLOR_GAINSBORO 0xDCDCDCFF
+#define COLOR_GHOSTWHITE 0xF8F8FFFF
+#define COLOR_GOLD 0xFFD700FF
+#define COLOR_GOLDENROD 0xDAA520FF
+#define COLOR_GRADIENTACTIVECAPTION 0xB9D1EAFF
+#define COLOR_GRADIENTINACTIVECAPTION 0xD7E4F2FF
+#define COLOR_GRAY 0x808080FF
+#define COLOR_GRAYTEXT 0x808080FF
+#define COLOR_GREEN 0x008000FF
+#define COLOR_GREENYELLOW 0xADFF2FFF
+#define COLOR_GREY 0xAFAFAFAA
+#define COLOR_HIGHLIGHT 0x3399FFFF
+#define COLOR_HIGHLIGHTTEXT 0xFFFFFFFF
+#define COLOR_HONEYDEW 0xF0FFF0FF
+#define COLOR_HOTPINK 0xFF69B4FF
+#define COLOR_HOTTRACK 0x0066CCFF
+#define COLOR_INACTIVEBORDER 0xF4F7FCFF
+#define COLOR_INACTIVECAPTION 0xBFCDDBFF
+#define COLOR_INACTIVECAPTIONTEXT 0x434E54FF
+#define COLOR_INDIANRED 0xCD5C5CFF
+#define COLOR_INDIGO 0x4B0082FF
+#define COLOR_INFO 0xFFFFE1FF
+#define COLOR_INFOTEXT 0x000000FF
+#define COLOR_IVORY 0xFFFFF0FF
+#define COLOR_KHAKI 0xF0E68CFF
+#define COLOR_LAVENDER 0xE6E6FAFF
+#define COLOR_LAVENDERBLUSH 0xFFF0F5FF
+#define COLOR_LAWNGREEN 0x7CFC00FF
+#define COLOR_LEMONCHIFFON 0xFFFACDFF
+#define COLOR_LIGHTBLUE 0xADD8E6FF
+#define COLOR_LIGHTCORAL 0xF08080FF
+#define COLOR_LIGHTCYAN 0xE0FFFFFF
+#define COLOR_LIGHTGOLDENRODYELLOW 0xFAFAD2FF
+#define COLOR_LIGHTGRAY 0xD3D3D3FF
+#define COLOR_LIGHTGREEN 0x90EE90FF
+#define COLOR_LIGHTPINK 0xFFB6C1FF
+#define COLOR_LIGHTSALMON 0xFFA07AFF
+#define COLOR_LIGHTSEAGREEN 0x20B2AAFF
+#define COLOR_LIGHTSKYBLUE 0x87CEFAFF
+#define COLOR_LIGHTSLATEGRAY 0x778899FF
+#define COLOR_LIGHTSTEELBLUE 0xB0C4DEFF
+#define COLOR_LIGHTYELLOW 0xFFFFE0FF
+#define COLOR_LIME 0x00FF00FF
+#define COLOR_LIMEGREEN 0x32CD32FF
+#define COLOR_LINEN 0xFAF0E6FF
+#define COLOR_MAGENTA 0xFF00FFFF
+#define COLOR_MAROON 0x800000FF
+#define COLOR_MEDIUMAQUAMARINE 0x66CDAAFF
+#define COLOR_MEDIUMBLUE 0x0000CDFF
+#define COLOR_MEDIUMORCHID 0xBA55D3FF
+#define COLOR_MEDIUMPURPLE 0x9370DBFF
+#define COLOR_MEDIUMSEAGREEN 0x3CB371FF
+#define COLOR_MEDIUMSLATEBLUE 0x7B68EEFF
+#define COLOR_MEDIUMSPRINGGREEN 0x00FA9AFF
+#define COLOR_MEDIUMTURQUOISE 0x48D1CCFF
+#define COLOR_MEDIUMVIOLETRED 0xC71585FF
+#define COLOR_MENU 0xF0F0F0FF
+#define COLOR_MENUBAR 0xF0F0F0FF
+#define COLOR_MENUHIGHLIGHT 0x3399FFFF
+#define COLOR_MENUTEXT 0x000000FF
+#define COLOR_MIDNIGHTBLUE 0x191970FF
+#define COLOR_MINTCREAM 0xF5FFFAFF
+#define COLOR_MISTYROSE 0xFFE4E1FF
+#define COLOR_MOCCASIN 0xFFE4B5FF
+#define COLOR_NAVAJOWHITE 0xFFDEADFF
+#define COLOR_NAVY 0x000080FF
+#define COLOR_OLDLACE 0xFDF5E6FF
+#define COLOR_OLIVE 0x808000FF
+#define COLOR_OLIVEDRAB 0x6B8E23FF
+#define COLOR_ORANGE 0xFFA500FF
+#define COLOR_ORANGERED 0xFF4500FF
+#define COLOR_ORCHID 0xDA70D6FF
+#define COLOR_PALEGOLDENROD 0xEEE8AAFF
+#define COLOR_PALEGREEN 0x98FB98FF
+#define COLOR_PALETURQUOISE 0xAFEEEEFF
+#define COLOR_PALEVIOLETRED 0xDB7093FF
+#define COLOR_PAPAYAWHIP 0xFFEFD5FF
+#define COLOR_PEACHPUFF 0xFFDAB9FF
+#define COLOR_PERU 0xCD853FFF
+#define COLOR_PINK 0xFFC0CBFF
+#define COLOR_PLUM 0xDDA0DDFF
+#define COLOR_POWDERBLUE 0xB0E0E6FF
+#define COLOR_PURPLE 0x800080FF
+#define COLOR_RED 0xFF0000FF
+#define COLOR_ROSYBROWN 0xBC8F8FFF
+#define COLOR_ROYALBLUE 0x4169E1FF
+#define COLOR_SADDLEBROWN 0x8B4513FF
+#define COLOR_SALMON 0xFA8072FF
+#define COLOR_SANDYBROWN 0xF4A460FF
+#define COLOR_SCROLLBAR 0xC8C8C8FF
+#define COLOR_SEAGREEN 0x2E8B57FF
+#define COLOR_SEASHELL 0xFFF5EEFF
+#define COLOR_SIENNA 0xA0522DFF
+#define COLOR_SILVER 0xC0C0C0FF
+#define COLOR_SKYBLUE 0x87CEEBFF
+#define COLOR_SLATEBLUE 0x6A5ACDFF
+#define COLOR_SLATEGRAY 0x708090FF
+#define COLOR_SNOW 0xFFFAFAFF
+#define COLOR_SPRINGGREEN 0x00FF7FFF
+#define COLOR_STEELBLUE 0x4682B4FF
+#define COLOR_TAN 0xD2B48CFF
+#define COLOR_TEAL 0x008080FF
+#define COLOR_THISTLE 0xD8BFD8FF
+#define COLOR_TOMATO 0xFF6347FF
+#define COLOR_TRANSPARENT 0xFFFFFF00
+#define COLOR_TURQUOISE 0x40E0D0FF
+#define COLOR_VIOLET 0xEE82EEFF
+#define COLOR_WHEAT 0xF5DEB3FF
+#define COLOR_WHITE 0xFFFFFFFF
+#define COLOR_WHITESMOKE 0xF5F5F5FF
+#define COLOR_WINDOW 0xFFFFFFFF
+#define COLOR_WINDOWFRAME 0x646464FF
+#define COLOR_WINDOWTEXT 0x000000FF
+#define COLOR_YELLOW 0xFFFF00FF
+#define COLOR_YELLOWGREEN 0x9ACD32FF
+#define COLOR_STEALTH_ORANGE 0xFF880000
+#define COLOR_STEALTH_OLIVE 0x66660000
+#define COLOR_STEALTH_GREEN 0x33DD1100
+#define COLOR_STEALTH_PINK 0xFF22EE00
+#define COLOR_STEALTH_BLUE 0x0077BB00
+
+// Color groups
+#define COLOR_COMMAND_OUTPUT 0xFFFFFFFF 			// White
+#define COLOR_NOTICE 0xAFAFAFAA 					// Grey
+#define COLOR_WARNING 0xFFA500FF        			// Orange? (Looks more yellow to me)
+#define COLOR_ERROR 0xFF0000FF        				// Red
+#define COLOR_GLOBAL_CHAT 0xFFFFFFFF        		// White
+#define COLOR_PM_CHAT 0xFFFF00FF        			// Yellow
+#define COLOR_VIP_CHAT 0x800080FF			  		// Purple
+#define COLOR_CREW_CHAT 0xFF9900AA					// Orange
+#define COLOR_ADMIN_CHAT 0xB8860BAA					// Gold
+#define COLOR_POLICE 0x00008BFF                     //
+#define COLOR_MEDIC 0xFFC0CBAA                      // Light pink
+#define COLOR_FIRE 0xAA3333AA           			// Red
+#define COLOR_SHERIFF 0xF5F5DCFF                    // Beige
+#define COLOR_FBI 0x000080AA                        // Navy
+#define COLOR_DMV 0xF0F8FFAA                        // Aqua
+#define COLOR_NEWS 0x808000FF                       // Olive
+
+#define EMBED_COLOR_GREY "{838383}"
+#define EMBED_COLOR_RED "{FF0000}"
+#define EMBED_COLOR_WHITE "{FFFFFF}"
+
+// SQL datatypes
+#define MAX_SQL_INTEGER 10
+#define MAX_SQL_TIMESTAMP 19	// 1999-01-08 04:05:06 [5 + 4 + 2 + 2 +2 + 2 + 2]
+#define MAX_SQL_FLOAT 16
+#define MAX_SQL_HASH 128
+#define MAX_SQL_IP 45
+#define MAX_SQL_REASON 121
+
+// Log levels
+#define LOGLEVEL_CHAT -2
+#define LOGLEVEL_COMMAND -1
+#define LOGLEVEL_DEBUG 0
+#define LOGLEVEL_INFO 1
+#define LOGLEVEL_NOTICE 2
+#define LOGLEVEL_WARNING 3
+#define LOGLEVEL_ERROR 4
+#define LOGLEVEL_CRITICAL 5
+#define LOGLEVEL_PANIC 6
+
+// Userlevels
+enum{   // Noted values as comments, for database reference.
+	UNREGISTERED_PLAYER,		// 0
+	REGISTERED_PLAYER,			// 1
+	REGULAR_PLAYER,				// 2    Spent many hours in and around the comunity.
+	VIP_PLAYER,             	// 3    Donated.
+	MODERATOR_CREW,				// 4
+	VETERAN_CREW,				// 5    Inactive admins and management that are allowed to keep their rights.
+	ADMIN_CREW,					// 6
+	UNDERCOVER_ADMIN_CREW,  	// 7
+	MANAGEMENT_CREW,			// 8
+	UNDRECOVER_MANAGEMENT_CREW, // 9
+	FOUNDER_PLAYER,				// 10
+	UNDERCOVER_FOUNDER_PLAYER,	// 11
+}
+
+// Discord channels
+enum{
+	ECHO_CHANNEL,
+	MAIN_CHANNEL,
+	ADMIN_ECHO_CHANNEL,
+	ADMIN_CHANNEL,
+	MANAGEMENT_CHANNEL,
+}
+
+// Chats
+enum{
+    CHAT_LOCAL, // Has to be 0, else a gVar would have to be created OnJoin, this conserves memory when no chatmode is set (which will be the case most likely)
+	CHAT_WHISPER,
+	CHAT_LOW,
+	CHAT_ACTION,
+	CHAT_SHOUT,
+	CHAT_OC,
+	CHAT_GLOBAL,
+	CHAT_CALL,
+	CHAT_SMS,
+	CHAT_RADIO,
+	CHAT_PM,
+	CHAT_GANG,
+	CHAT_GANG_OC,
+	CHAT_FACTION,
+	CHAT_FACTION_OC,
+	CHAT_VIP,
+	CHAT_CREW,
+	CHAT_ADMIN,
+	CHAT_MANAGEMENT,
+	CHAT_UNDERCOVER,
+}
+
+// Dialogs
+enum{
+	DIALOG_CHANGENAME,
+	DIALOG_REGISTER,
+	DIALOG_ACCOUNT_CREATED,
+	DIALOG_LOGIN,
+	DIALOG_CHANGE_USERNAME,
+	DIALOG_CHARACTERS,
+	DIALOG_LOGIN_FAILED,
+	DIALOG_DELETE_CHARACTER,
+	DIALOG_GOTO,
+	DIALOG_GOTO_INTERIOR,
+	DIALOG_GOTO_PLAYER,
+	DIALOG_GOTO_247,
+	DIALOG_GOTO_AVIATION,
+	DIALOG_GOTO_AMMUNATION,
+	DIALOG_GOTO_BURGLARY,
+    DIALOG_GOTO_MISSION,
+    DIALOG_GOTO_MISSIONEXT,
+    DIALOG_GOTO_MISSIONHOUSE,
+    DIALOG_GOTO_MODDING,
+	DIALOG_GOTO_POLICE,
+	DIALOG_GOTO_HOUSE,
+	DIALOG_GOTO_SHOP,
+	DIALOG_GOTO_STADIA,
+	DIALOG_CREATE_PICKUP,
+	DIALOG_CREATE_FACTION_PICKUP,
+	DIALOG_DUTY_PD,
+	DIALOG_POLICE_SKIN,
+	DIALOG_DUTY_MD,
+	DIALOG_MEDIC_SKIN,
+	DIALOG_DUTY_FD,
+	DIALOG_FIRE_SKIN,
+	DIALOG_DUTY_SD,
+	DIALOG_SHERIFF_SKIN,
+	DIALOG_DUTY_FBI,
+	DIALOG_FBI_SKIN,
+	DIALOG_DUTY_DMV,
+	DIALOG_DMV_SKIN,
+	DIALOG_DUTY_NEWS,
+	DIALOG_NEWS_SKIN,
+}
+
+// Pickups
+enum{
+	PICKUP_FACTION_PD,
+	PICKUP_FACTION_MD,
+	PICKUP_FACTION_FD,
+	PICKUP_FACTION_SD,
+	PICKUP_FACTION_FBI,
+	PICKUP_FACTION_DMV,
+	PICKUP_FACTION_NEWS,
+	PICKUP_PORTAL,  // MUST be last as it's not in the pickup create dialog
+}
+
+// Location categories
+enum{
+	GOTO_CATEGORY_INTERIOR,
+}
+enum{
+	INTERIOR_CATEGORY_247,
+	INTERIOR_CATEGORY_AVIATION,
+	INTERIOR_CATEGORY_AMMUNATION,
+	INTERIOR_CATEGORY_BUGRLARY,
+	INTERIOR_CATEGORY_MISSION,
+	INTERIOR_CATEGORY_MISSIONEXT,
+	INTERIOR_CATEGORY_MISSIONHOUSE,
+	INTERIOR_CATEGORY_MODSHOP,
+	INTERIOR_CATEGORY_POLICE,
+	INTERIOR_CATEGORY_HOUSES,
+	INTERIOR_CATEGORY_SHOPS,
+	INTERIOR_CATEGORY_STADIA,
+}
+enum{INTERIOR_247_LSHAPED, INTERIOR_247_OBLONG, INTERIOR_247_MEDIUM, INTERIOR_247_MEDIUM_NOEXIT, INTERIOR_247_LONG, INTERIOR_247_SQAURE}
+enum{
+    INTERIOR_AVIATION_TICKET,
+    INTERIOR_AVIATION_BAGGAGE,
+    INTERIOR_AVIATION_SHAMAL,
+    INTERIOR_AVIATION_ANDROMADA,
+    INTERIOR_AVIATION_LSAIRPORT
+}
+enum{INTERIOR_AMMU_OCEAN, INTERIOR_AMMU_PALOMINO, INTERIOR_AMMU_ANGEL, INTERIOR_AMMU_QUEBRADOS, INTERIOR_AMMU_2STORIES, INTERIOR_AMMU_BOOTH, INTERIOR_AMMU_RANGE}
+enum{
+	INTERIOR_BURGRLARY_LARGE,
+	INTERIOR_BURGRLARY_MEDIUM,
+	INTERIOR_BURGRLARY_SMALL,
+	INTERIOR_BURGRLARY_VERYLARGE,
+	INTERIOR_BURGRLARY_5,
+	INTERIOR_BURGRLARY_6,
+	INTERIOR_BURGRLARY_NOBATH,
+}
+enum{
+	INTERIOR_MISSION_ATRIUM,
+	INTERIOR_MISSION_BIGSMOKE,
+	INTERIOR_MISSION_JEFFERSON,
+	INTERIOR_MISSION_JIZZY,
+	INTERIOR_MISSION_RC,
+	INTERIOR_MISSION_WUZI,
+}
+enum{
+    INTERIOR_MISSIONEXT_GAS,
+	INTERIOR_MISSIONEXT_LIBERTY,
+	INTERIOR_MISSIONEXT_SFGARAGE,
+}
+enum{
+   	INTERIOR_MISSIONHOUSE_DESIRE,
+	INTERIOR_MISSIONHOUSE_COLONEL,
+	INTERIOR_MISSIONHOUSE_RYDER,
+	INTERIOR_MISSIONHOUSE_SWEET,
+	INTERIOR_MISSIONHOUSE_CRACK,
+}
+enum{INTERIOR_MOD_LOCO, INTERIOR_MOD_WHEEL, INTERIOR_MOD_TRANSFENDER}
+enum{INTERIOR_PD_LV, INTERIOR_PD_LS, INTERIOR_PD_SF, INTERIOR_PD_BARBARA}
+enum{
+    INTERIOR_HOUSE_GOLDEN,
+	INTERIOR_HOUSE_HASHBURY,
+	INTERIOR_HOUSE_JOHNSON,
+	INTERIOR_HOUSE_MADDDOGG,
+	INTERIOR_HOUSE_RED,
+	INTERIOR_HOUSE_VERDANT,
+	INTERIOR_HOUSE_UNUSED,
+}
+enum{
+    INTERIOR_SHOP_TATTOO,
+	INTERIOR_SHOP_BURGER,
+	INTERIOR_SHOP_PIZZA,
+	INTERIOR_SHOP_CLUCKIN,
+	INTERIOR_SHOP_CALIGULAS,
+	INTERIOR_SHOP_CASINO,
+	INTERIOR_SHOP_4DRAGONS,
+	INTERIOR_SHOP_DONUTS,
+	INTERIOR_SHOP_RC,
+	INTERIOR_SHOP_PUMP,
+}
+enum{
+	INTERIOR_STADIUM_BLOODBOWL,
+	INTERIOR_STADIUM_KICKSTART,
+	INTERIOR_STADIUM_8TRACK,
+	INTERIOR_STADIUM_DIRTBIKE,
+}
+
+// Factions
+enum{
+    FACTION_NONE,
+	FACTION_POLICE,
+	FACTION_MEDIC,
+	FACTION_FIRE,
+	FACTION_SHERIFF,
+	FACTION_FBI,
+    FACTION_DMV,
+    FACTION_NEWS,
+}
+
+// Jobs
+enum{
+	JOB_NONE,
+	JOB_POLICE,
+	JOB_MEDIC,
+	JOB_FIRE,
+	JOB_SHERIFF,
+	JOB_FBI,
+	JOB_DMV,
+	JOB_NEWS,
+}
+
+// Environment settings	TODO: THESE SHOULD ALL BE READ FROM A CONFIG FILE!
+static bool:scriptDebug = true;	// Debug setting
+#define MODE_NAME "0.0a Build 9"
+#define SERVER_NAME "Bone County RPG"
+#define PG_HOST "127.0.0.1"
+#define PG_ROLE "rpfw-dev"
+#define PG_PASS "nJd&1k$0fs"
+#define PG_DB "rpfw-dev"
+#define PG_PORT 5432
+#define DISCORD_HOME_GUILD_ID "666077037470941184"			// Emerald City Roleplay
+#define DISCORD_ECHO_CHANNEL_ID "677855051166777344"		// #bcrp-echo
+//#define DISCORD_ECHO_CHANNEL_ID "666078187079598080"		// #ecrp-echo
+#define DISCORD_MAIN_CHANNEL_ID "677855315898793984"		// #bcrp
+//#define DISCORD_MAIN_CHANNEL_ID "667396220402270228"		// #development
+#define DISCORD_ADMIN_ECHO_CHANNEL_ID "672841892169383936"	// #admin-echo
+#define DISCORD_ADMIN_CHANNEL_ID "667396026058932236"		// #admins
+#define DISCORD_MANAGEMENT_CHANNEL_ID "666091376240361492"	// #management
+
+// Game-mode limits
+#define MAX_CHARACTERS_PER_USER 20  // Maximum of MAX_CHARACTERS_PER_USER_DIGITS digits (Due to SQL query string length)
+#define MAX_CHARACTERS_PER_USER_DIGITS 3
+
+// SQL plugin
+new SQL:sqlHandle;
+
+// discord-connector
+//static DCC_Guild:homeGuild;			// Discord guild controlled by game community.
+static DCC_Channel:echoChannel;			// Public echo channel.
+static DCC_Channel:mainChannel;			// Channel for communirty notifications.
+static DCC_Channel:adminEchoChannel;	// Admin echo channel.
+static DCC_Channel:adminChannel;		// Channel for admin notifications.
+static DCC_Channel:managementChannel;	// Channel for management notifications.
+
+DiscordEcho(const message[], messageLevel){ // Write to echo channels.
+	switch(messageLevel)	// Output facilities.
+    {
+        case ECHO_CHANNEL: {                                                                // Public echo message
+			DiscordSendChannelMessage(echoChannel, message);
+			DiscordSendChannelMessage(adminEchoChannel, message);   // Also send to admin echo channel, so admin can see everything in one channel without needing to constantly switch. Also handy as log on conflicts/complaints.
+		}
+		case MAIN_CHANNEL: {DiscordSendChannelMessage(mainChannel, message);}				// Public notification
+        case ADMIN_ECHO_CHANNEL: {DiscordSendChannelMessage(adminEchoChannel, message);}	// Admin echo message
+		case ADMIN_CHANNEL: {DiscordSendChannelMessage(adminChannel, message);}				// Admin notification
+        case MANAGEMENT_CHANNEL: {DiscordSendChannelMessage(managementChannel, message);}	// Management notification
+    }
+
+	return 0;
+}
+
+// Natives
+native WP_Hash(buffer[], len, const str[]);	// https://forum.sa-mp.com/showthread.php?t=570945
+//native Float:loadavg();	// https://forum.sa-mp.com/showthread.php?t=260206	LINUX ONLY
+
+// Includes
+#include <a_samp>	// https://sa-mp.com
+#include <sql>	// https://github.com/udan11/samp-plugin-sql	(Fastest player in town and only one supporting postgreSQL) | Examples: https://pastebin.com/67y2nq2n https://github.com/udan11/samp-plugin-sql/issues/10
+#include <sscanf2>	// Newest version: https://github.com/maddinat0r/sscanf/releases | Better readme: https://github.com/Y-Less/sscanf
+#include <strlib>	// https://github.com/oscar-broman/strlib
+#include <Pawn.Regex>	// https://github.com/urShadow/Pawn.Regex
+#include <Pawn.CMD>	// https://github.com/urShadow/Pawn.CMD	(Fastest player in town)
+#include <gvar>	// https://github.com/samp-incognito/samp-gvar-plugin
+#include <discord-connector>	// https://github.com/maddinat0r/samp-discord-connector	(Only player in town)
+#include <streamer>	// https://github.com/samp-incognisto/samp-streamer-plugin
+
+
+/// Middle-ware
+// Logging
+logger(const log_level, const message[]){	// Write to logging facility
+	// Do not log commands or debug when script debugging is turned off.
+	if(scriptDebug == false){   // Debug is off
+		if(log_level == LOGLEVEL_COMMAND || log_level == LOGLEVEL_DEBUG){   // Command or debug message
+
+			return 0;   // Stop and do not log
+		}
+	}
+	
+	// Messagelevel tag
+	new human_readable_log_level[8 + 1];
+	switch(log_level){	// Assign log level.
+		case LOGLEVEL_CHAT: human_readable_log_level = "chat";
+		case LOGLEVEL_COMMAND: human_readable_log_level = "command";
+        case LOGLEVEL_DEBUG: human_readable_log_level = "debug";
+        case LOGLEVEL_INFO: human_readable_log_level = "info";
+        case LOGLEVEL_NOTICE: human_readable_log_level = "notice";
+		case LOGLEVEL_WARNING: human_readable_log_level = "warning";
+		case LOGLEVEL_ERROR: human_readable_log_level = "error";
+		case LOGLEVEL_CRITICAL: human_readable_log_level = "critical";
+		case LOGLEVEL_PANIC: human_readable_log_level = "panic";
+    }
+    
+	printf("[%s] %s", human_readable_log_level, message);	// Print to STDOUT.
+
+	return 0;
+}
+
+/*// SQL plugin (BROKEN, look at it again after I have more then a week of experience)
+//forward sqlQuery(SQL:handle, query[]);
+//public sqlQuery(SQL:handle, query[]){
+sqlQuery(SQL:handle, query[]){
+	//sql_wait(handle);	// Wait for all queries to finish.
+
+	new Result:result = sql_query(handle, query);
+	if(sql_error(result)){printf("SQL error");}	// Did not work during a test with a faulty statement.
+	return result;
+}*/
+
+// discord-connector
+DiscordSendChannelMessage(DCC_Channel:channel, const message[]){
+	if(scriptDebug){    // Log middle-ware event in debugging mode only
+		new channel_name[100 + 1];	// Default value from tutorial
+		DCC_GetChannelName(channel, channel_name);
+		new logMessage[26 + 100 + 2000 + 1];	// Discord max message length = 2000
+		format(logMessage, sizeof(logMessage), "Send to discord channel %s: %s", channel_name, message);
+
+		logger(LOGLEVEL_DEBUG, logMessage);	// Actually log the message
+	}
+
+	DCC_SendChannelMessage(channel, message);	// Call discord-connector	DISABLE THIS TO STOP ALL OUTGOING DISCORD MESSAGES
+}
+
+
+/// Game-mode
+// Account functions
+forward changeName(playerid, const name[]);
+public changeName(playerid, const name[]){	// Check if name is valid and force change if needed.
+	// Prevent regex error when comparing against null
+	if(isempty(name)){  // No name entered
+	    ShowPlayerDialog(playerid, DIALOG_CHANGENAME, DIALOG_STYLE_INPUT, "Character name", "You must enter a name.\n\nExamples:\n Jo_Bo\n Dingle_P._J._Berry\n Jackson_DeForest_Kelley\n MaryJo_Ann_LaFluer", "Change", "");	// Force RP name.
+	    
+	    return 0;
+	}
+	
+	// Check name
+	new Regex:r = Regex_New("^[A-Z][a-z]{1,}([A-Z][a-z]{1,})?(_([A-Z][a-z]{1,}([A-Z][a-z]{1,})?|[A-Z]\\.(_[A-Z]\\.)?))?_[A-Z][a-z]{1,}([A-Z][a-z]{1,})?$");	// Regex name filter
+	new isValidName = Regex_Check(name, r); // Validate name to filter
+	Regex_Delete(r);
+	if(!isValidName){	// Invalid role-play name
+		ShowPlayerDialog(playerid, DIALOG_CHANGENAME, DIALOG_STYLE_INPUT, "Character name", "Please pick a realistic name, separate first and last name with an underscore.\n\nExamples:\n Jo_Bo\n Dingle_P._J._Berry\n Jackson_DeForest_Kelley\n MaryJo_Ann_LaFluer", "Change", "");	// Force RP name.
+	}
+	else {	// Valid role-play name
+	    // Check for name in use
+		/*new escaped_name[MAX_PLAYER_NAME + 1];  // TODO should be more, to account for escape characters.
+	    sql_escape_string(sqlHandle, name, escaped_name, sizeof(escaped_name));	// Escape player name   BROKEN argument type mismatch on argument 2, but name is a sting...*/
+	    new character_query[40 + MAX_PLAYER_NAME + 1], Result:character_result = sql_query(sqlHandle, character_query);
+		format(character_query, sizeof(character_query), "SELECT id FROM character WHERE name = '%s'", name);
+		
+        if(sql_num_rows(character_result) > 0){  // Name taken
+            ShowPlayerDialog(playerid, DIALOG_CHANGENAME, DIALOG_STYLE_INPUT, "Character name", "Name already taken. Please pick an original name.", "Change", "");	// Force RP name.
+        }
+        else{   // Name free
+            // Notify all players
+			new message[11 + 4 + MAX_PLAYER_NAME + 1];
+
+			format(message, sizeof(message), "* [%i] %s joined.", playerid, getCharacterName(playerid));
+			SendClientMessageToAll(COLOR_NOTICE, message);	// Notify all players
+			DiscordEcho(message, ECHO_CHANNEL);	// Notify discord public echo
+			
+			new client_connect_username[MAX_PLAYER_NAME + 1], admin_message[38 + 4 + MAX_PLAYER_NAME + MAX_PLAYER_NAME + 1];
+            GetGVarString("client_connect_username", client_connect_username, sizeof(client_connect_username), playerid);   // Get client connect name
+		    if(GetPlayerState(playerid) == PLAYER_STATE_NONE){	// Not spawned: character creation (Creating a character without registering)
+		        // Notify admins
+	            
+	            format(admin_message, sizeof(admin_message), "* [%i] %s temporary charcter, created by: %s", playerid, getCharacterName(playerid), client_connect_username);
+				sendToAdmins(COLOR_NOTICE, admin_message);
+				DiscordEcho(admin_message, ADMIN_ECHO_CHANNEL);
+
+	            // Do nothing let continue to spawn, after spawn character will be saved to database.
+		    }
+	    	else{   // Spawnedplayer: Creating permanent or renaming an existing permanent character
+	    	    // Notify admins
+	            format(admin_message, sizeof(admin_message), "* [%i] %s created by: %s", playerid, getCharacterName(playerid), client_connect_username);
+				sendToAdmins(COLOR_NOTICE, admin_message);
+				DiscordEcho(admin_message, ADMIN_ECHO_CHANNEL);
+				
+                // Send to skin selection
+                ForceClassSelection(playerid);
+                TogglePlayerSpectating(playerid, true);
+			    TogglePlayerSpectating(playerid, false);
+			}
+	    
+			// Change name  (No way yet to change name ingame)
+			/*if(GetGVarInt("userlevel", playerid) > 1){	// Registered player.
+				// Get username
+				new username[MAX_PLAYER_NAME + 1], message[75 + MAX_PLAYER_NAME + 1];
+				GetGVarString("username", username, sizeof(username), playerid);
+
+				// Update or create character name in database
+				new callback[1];
+				new Result:result;
+				new query[51 + MAX_PLAYER_NAME + MAX_PLAYER_NAME + 1];
+				format(query, sizeof(query), "UPDATE \"user\"(name) VALUES('%s') WHERE username == '%s'", name, username);
+				sql_wait(sqlHandle);	// Wait for other queries to finish
+				result = sql_query(sqlHandle, query, callback = "", "r");
+				
+				// Inform user
+				format(message, sizeof(message), "SERVER: Your username remains unchanged, next time connect as: %s", client_connect_username);
+				SendClientMessage(playerid, COLOR_WHITE, message);
+			}*/
+
+			SetPlayerName(playerid, name);	// Change name in-game
+		}
+	}
+	
+	return 0;
+}
+
+forward register(playerid);
+public register(playerid){	// Register player in database
+	if(GetPlayerState(playerid) == PLAYER_STATE_NONE){	// Not spawned
+		SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "ERROR: You need to have spawned to register.");
+	}
+	else{	// Spawned player
+		if(GetGVarInt("userlevel", playerid) != UNREGISTERED_PLAYER){	// Registered player.
+			new message[35 + MAX_PLAYER_NAME + 1];
+			format(message, sizeof(message), "ERROR: You are already registered"); //, %s.",
+			SendClientMessage(playerid, COLOR_WHITE, message);
+		}
+		else{	// Unregistered player.
+			ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Password", "Please pick a strong and safe password, that you are able to remember.", "Continue", "Cancel");	// Password prompt
+		}
+	}
+}
+
+forward createCharacterRecord(playerid, id);
+public createCharacterRecord(playerid, id){
+	new character_query[94 + MAX_SQL_INTEGER + MAX_PLAYER_NAME + 3 + 1];
+	format(character_query, sizeof(character_query), "INSERT INTO character(user_id, name, skin_id) VALUES(%i, '%s', %i)", id, getPlayerName(playerid), GetPlayerSkin(playerid));
+	sql_query(sqlHandle, character_query);
+}
+
+forward authenticate(playerid);
+public authenticate(playerid){
+    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Sign in", "Enter your password to log on", "Log in", "Cancel");	// Show password confirmation dialog
+}
+
+forward characterSelection(playerid);
+public characterSelection(playerid){
+	if(GetGVarInt("userlevel", playerid) < REGISTERED_PLAYER){  // Unregistered player (Or worse?)
+	    SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "SERVER: Register first with: /my account register");
+	}
+	else{   // Registered player
+		// If spawned, save current character
+		if(GetPlayerState(playerid) != PLAYER_STATE_NONE){
+		    savePlayerState(playerid);
+		}
+
+		new id = getUserID(playerid);
+		new character_query[75 + MAX_SQL_INTEGER + MAX_CHARACTERS_PER_USER_DIGITS + 1];
+		format(character_query, sizeof(character_query), "SELECT id, name FROM character WHERE user_id = %i LIMIT %i", id, MAX_CHARACTERS_PER_USER);
+		new Result:character_result = sql_query(sqlHandle, character_query);
+
+		new character_string[(MAX_PLAYER_NAME * MAX_CHARACTERS_PER_USER) + 1], character_array[MAX_CHARACTERS_PER_USER + 1];
+		for(new i = 0; i < sql_num_rows(character_result); i++){
+			new name[MAX_PLAYER_NAME + 1];
+			sql_get_field_assoc_ex(character_result, i, "name", name, sizeof(name));
+			format(character_string, sizeof(character_string), "%s%s\n", character_string, name);
+			character_array[i] = sql_get_field_assoc_int_ex(character_result, i, "id");
+			printf("Character ID from array: %i", character_array[i]);
+		}
+		new character_array_string[MAX_CHARACTERS_PER_USER * MAX_SQL_INTEGER + 1];
+		strfrombin(character_array_string, character_array);    // Convert array to string for use with GVar
+		SetGVarString("character_array_string", character_array_string, playerid);
+
+		ShowPlayerDialog(playerid, DIALOG_CHARACTERS, DIALOG_STYLE_LIST, "Characters", character_string, "Spawn", "New");
+	}
+}
+
+forward savePlayerState(playerid);
+public savePlayerState(playerid){
+	new escaped_playername[MAX_PLAYER_NAME + 1], character_query[210 + MAX_SQL_INTEGER + 3 + 3 + 1 + MAX_SQL_FLOAT + MAX_SQL_FLOAT + MAX_SQL_FLOAT + MAX_SQL_FLOAT + MAX_PLAYER_NAME + MAX_SQL_INTEGER + MAX_SQL_INTEGER + 1];    // Should be longer to allow for escaped characters
+	sql_escape_string(sqlHandle, getPlayerName(playerid), escaped_playername, sizeof(escaped_playername));	// Escape player name
+	new Float:health, Float:armour, Float:x, Float:y, Float:z, Float:Angle;
+	// Unrealiable TODO change to gvars
+	GetPlayerHealth(playerid, health);
+	GetPlayerArmour(playerid, armour);
+	GetPlayerPos(playerid, x, y, z);
+	GetPlayerFacingAngle(playerid, Angle);
+	new world_id = GetPlayerVirtualWorld(playerid);
+	new interior_id = GetPlayerInterior(playerid);
+	
+	format(character_query, sizeof(character_query), "UPDATE character SET (cash, health, armour, jailed, pos_x, pos_y, pos_z, rotation, world_id, interior_id) = (%i, '%f', '%f', %i, '%f', '%f', '%f', '%f', %i, %i) WHERE name = '%s'", GetPlayerMoney(playerid), health, armour, 0, x, y, z, Angle, world_id, interior_id, escaped_playername);
+	sql_query(sqlHandle, character_query);
+}
+
+forward kickPlayerDelay(playerid);
+public kickPlayerDelay(playerid){
+    Kick(playerid);
+}
+
+forward kickPlayer(playerid, kickerid, const reason[], banned);
+public kickPlayer(playerid, kickerid, const reason[], banned){	// Kick a player
+    // Issuer of kick
+    new kickername[MAX_PLAYER_NAME + 1], kicker_id[MAX_SQL_INTEGER + 1];
+    if(kickerid == -1){ // Not kicked by in-game player
+        kickername = "SERVER";
+        kicker_id = "NULL";
+	}
+	else{   //  Kicked by in-game player
+	    kickername = getPlayerName(playerid);
+	    kicker_id = "%s", getUserID(kickerid);
+	}
+	strreplace(kickername, "_", " ");
+
+	// Action
+	new action[16 + MAX_SQL_INTEGER + 1];
+	if(banned){
+	    if(banned < 1){   // Permanent ban
+			action = "banned permanently";
+		}
+		else{   // Temporary ban
+	        format(action, sizeof(action), "banned for %i days", banned);
+		}
+    }
+    else{
+        action = "kicked";
+	}
+
+	// Notify all players
+	new playername[MAX_PLAYER_NAME + 1], message[16 + 4 + MAX_PLAYER_NAME + MAX_PLAYER_NAME + 16 + MAX_SQL_REASON + 1], admin_message[23 + 4 + MAX_PLAYER_NAME + 16 + MAX_PLAYER_NAME + MAX_SQL_REASON + 1];	// Max samp chat message length 128 - 8 for "/kick ? ".
+    GetPlayerName(playerid, playername, sizeof(playername));
+	format(message, sizeof(message), "* [%i] %s %s, reason: %s", playerid, getCharacterName(playerid), action, reason);
+	format(admin_message, sizeof(admin_message), "* [%i] %s kicked %s, reason: %s", kickerid, kickername, getCharacterName(playerid), action, reason);
+	logger(LOGLEVEL_INFO, message);	// Log event
+	SendClientMessageToAll(COLOR_NOTICE, message);
+	DiscordEcho(message, ECHO_CHANNEL);
+	sendToAdmins(COLOR_NOTICE, admin_message);
+	DiscordEcho(admin_message, ADMIN_ECHO_CHANNEL);
+
+	// Inform player (Redundant, but some people are blind or stupid)
+	new player_message[30 + 6 + MAX_PLAYER_NAME + MAX_SQL_REASON + 1];	// Max samp chat message length 128 - 8 for "/kick ? ".
+	format(player_message, sizeof(player_message), "SERVER: You have been %s, reason: %s", action, reason);
+	SendClientMessage(playerid, COLOR_ERROR, player_message);	// Notify player
+	if(banned){
+	    SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "You may appeal this ban via the forum or Discord.");
+	}
+
+	new ip_id = getIPID(playerid);
+	// Crearte IP kick record
+	new ip_query[61 + 4 + MAX_SQL_REASON + 4 + 1];
+	format(ip_query, sizeof(ip_query), "INSERT INTO ip_kick(ip_id, reason, kicker_id) VALUES(%i, '%s', %s)", ip_id, reason, kicker_id);
+	sql_query(sqlHandle, ip_query);
+
+	// Get IP kick record
+	new ip_id_query[64 + 4 + MAX_SQL_REASON + 4 + 1];
+	format(ip_id_query, sizeof(ip_id_query), "SELECT id FROM ip_kick WHERE ip_id = %i ORDER BY id DESC LIMIT 1", ip_id);
+	new Result:ip_id_result = sql_query(sqlHandle, ip_id_query);
+	new ip_kick_id = sql_get_field_assoc_int(Result:ip_id_result, "id");
+
+	// User kick record
+	printf("Userlevel: %i", GetGVarInt("userlevel", playerid));
+	if(GetGVarInt("userlevel", playerid) > UNREGISTERED_PLAYER){    // Not logged in to a user account
+		new user_query[79 + 4 + MAX_SQL_REASON + 4 + 1];
+		format(user_query, sizeof(user_query), "INSERT INTO user_kick(user_id, reason, kicker_id, ip_kick_id) VALUES(%i, '%s', %s, %i)", getUserID(playerid), reason, kicker_id, ip_kick_id);
+		sql_query(sqlHandle, user_query);
+	}
+
+	SetTimerEx("kickPlayerDelay", 50, false, "i", playerid);	// Give the message 50 milliseconds to reach the player before kicking.
+}
+
+banExpiration(days);
+banExpiration(days){
+	if(days < 1){   // Permanent ban
+	    new foo[MAX_SQL_TIMESTAMP + 1] = "0";
+	    return foo;
+	}
+	else{   // Temporary ban
+	    new year, month, day, hour, minute, second, expires[MAX_SQL_TIMESTAMP + 1];
+		getdate(year, month, day);
+		gettime(hour, minute, second);
+		day = day + days;
+		format(expires, sizeof(expires), "%i-%i-%i %i:%i:%i", year, month, day, hour, minute, second);
+		
+		return expires;
+		//return year, month, day, hour, minute, second;
+		//return 0;
+	}
+}
+
+forward banPlayer(playerid, bannerid, const reason[], days);
+public banPlayer(playerid, bannerid, const reason[], days){	// Ban & kick a player
+	new ip_id = getIPID(playerid);
+	// Create IP ban record
+    new banner_id, ip_query[72 + MAX_SQL_INTEGER + MAX_SQL_TIMESTAMP + MAX_SQL_REASON + MAX_SQL_INTEGER + 1];
+	if(bannerid < 0){   // Not banned by in-game player
+	    format(ip_query, sizeof(ip_query), "INSERT INTO ip_ban(ip_id, expires, reason) VALUES(%i, '%s', '%s')", ip_id, banExpiration(days), reason);
+	}
+	else{   // Banned by in-game player
+	    banner_id = getUserID(bannerid);
+	    format(ip_query, sizeof(ip_query), "INSERT INTO ip_ban(ip_id, expires, reason, banner_id) VALUES(%i, '%s', '%s', %i)", ip_id, banExpiration(days), reason, banner_id);
+	}
+	sql_query(sqlHandle, ip_query);
+
+	// Get IP ban record ID
+	new ban_id_query[61 + MAX_PLAYER_NAME + 1];
+	format(ban_id_query, sizeof(ban_id_query), "SELECT id FROM ip_ban WHERE ip_id = %i ORDER BY id DESC LIMIT 1", ip_id);
+	new Result:ban_id_result = sql_query(sqlHandle, ban_id_query);
+ 	new ip_ban_id = sql_get_field_assoc_int(ban_id_result, "id");
+
+	// User ban record (As banned players get only kicked, noneed to check for active ban)
+	if(GetGVarInt("userlevel", playerid) > 1){  // Registered player
+		new user_query[97 + MAX_SQL_INTEGER + MAX_SQL_TIMESTAMP + MAX_SQL_REASON + MAX_SQL_INTEGER + MAX_SQL_INTEGER + 1];
+		format(user_query, sizeof(user_query), "INSERT INTO user_ban(user_id, expires, reason, banner_id, ip_ban_id) VALUES(%i, %s, %s, %i, %i) WHERE id = %i", ip_id, banExpiration(days), reason, banner_id, ip_ban_id);
+		sql_query(sqlHandle, user_query);
+	}
+
+	// Kick player
+	kickPlayer(playerid, bannerid, reason, days);
+}
+
+
+// Database functions
+forward getIPID(playerid);
+public getIPID(playerid){
+    new player_ip[MAX_SQL_IP + 1], query[37 + MAX_SQL_IP + 1]; // Create varaibles
+    GetPlayerIp(playerid, player_ip, sizeof(player_ip));    // Polulate player_ip variable
+	format(query, sizeof(query), "SELECT id FROM ip WHERE address = '%s'", player_ip);   // Format query string
+	new Result:result = sql_query(sqlHandle, query);    // Execute query
+	
+	return sql_get_field_assoc_int(result, "id");  // Get id from result
+}
+
+forward getUserID(playerid);
+public getUserID(playerid){
+	// SQL escape username
+    new client_connect_username[MAX_PLAYER_NAME + 1], escaped_username[MAX_PLAYER_NAME + 1]; // TODO escaped_username should be longer to account for escape characters (Also increate database column size!)
+	GetGVarString("client_connect_username", client_connect_username, sizeof(client_connect_username), playerid);   // Get client connect name
+	sql_escape_string(sqlHandle, client_connect_username, escaped_username, sizeof(escaped_username));	// Escape player name
+
+	// Get user ID
+	new userid_query[47 + MAX_PLAYER_NAME + 1];
+	format(userid_query, sizeof(userid_query), "SELECT id FROM \"user\" WHERE name = '%s'", escaped_username);
+	new Result:result = sql_query(sqlHandle, userid_query);
+
+	return sql_get_field_assoc_int(result, "id");
+}
+
+// Player functions
+forward deleteAllGVars(playerid);
+public deleteAllGVars(playerid){    // Delete GVars as per https://forum.sa-mp.com/showthread.php?t=151076
+	DeleteGVar("client_connect_username", playerid);    // From OnPlayerConnect()
+	DeleteGVar("userlevel", playerid);  				// From OnPlayerConnect()
+	DeleteGVar("hash", playerid);       				// From DIALOG_REGISTER
+	DeleteGVar("character_array_string", playerid);		// From OnDialogResponse()
+	DeleteGVar("authentication_count", playerid);       // From DIALOG_LOGIN
+	DeleteGVar("character_id", playerid);                // From DIALOG_CHARACTERS
+	DeleteGVar("chatmode", playerid);                   // From cmd:my()
+	DeleteGVar("disable_pickups", playerid);			// From OnPlayerPickUpDynamicPickup()
+	DeleteGVar("goto_target", playerid);				// From cmd:my() & cmd:p()
+	DeleteGVar("job", playerid);                        // From OnDialogResponse()
+}
+
+getPlayerName(playerid);
+getPlayerName(playerid){
+//	new playername[MAX_PLAYER_NAME + 1];
+	new const playername[MAX_PLAYER_NAME + 1];
+	GetPlayerName(playerid, playername, sizeof(playername));
+
+//	new output[MAX_PLAYER_NAME + 1];
+//	strfromliteral(output, playername);
+	
+	return playername;
+}
+
+forward teleportPlayer(playerid, Float:x, Float:y, Float:z, world, interior, Float:angle, const name[]);
+public teleportPlayer(playerid, Float:x, Float:y, Float:z, world, interior, Float:angle, const name[]){
+    SetPlayerPos(playerid, x, y, z);
+	SetPlayerVirtualWorld(playerid, world);
+	SetPlayerInterior(playerid, interior);
+	SetPlayerFacingAngle(playerid, angle);
+	
+	// Inform admins
+	new admin_message[21 + 4 + MAX_PLAYER_NAME + 5 + 4 + MAX_PLAYER_NAME + 1 + 1];  // 5 + 4 + MAX_PLAYER_NAME + 1 = name
+	format(admin_message, sizeof(admin_message), "* [%i] %s teleported to: %s", playerid, getCharacterName(playerid), name);
+	sendToAdmins(COLOR_NOTICE, admin_message);
+	DiscordEcho(admin_message, ADMIN_ECHO_CHANNEL);
+}
+
+forward setPlayerSkin(playerid, skinid);
+public setPlayerSkin(playerid, skinid){
+	print("Called setPlayerSkin()");
+	new
+	    Float:tmpPos[4],
+		vehicleid = GetPlayerVehicleID(playerid),
+		seatid = GetPlayerVehicleSeat(playerid);
+	GetPlayerPos(playerid, tmpPos[0], tmpPos[1], tmpPos[2]);
+	GetPlayerFacingAngle(playerid, tmpPos[3]);
+	if(skinid < 0 || skinid > 299) return 0;
+	if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DUCK)
+	{
+	    SetPlayerPos(playerid, tmpPos[0], tmpPos[1], tmpPos[2]);
+		SetPlayerFacingAngle(playerid, tmpPos[3]);
+		TogglePlayerControllable(playerid, 1); // preventing any freeze - optional
+		return SetPlayerSkin(playerid, skinid);
+	}
+	else if(IsPlayerInAnyVehicle(playerid))
+	{
+	    new
+	        tmp;
+	    RemovePlayerFromVehicle(playerid);
+	    SetPlayerPos(playerid, tmpPos[0], tmpPos[1], tmpPos[2]);
+		SetPlayerFacingAngle(playerid, tmpPos[3]);
+		TogglePlayerControllable(playerid, 1); // preventing any freeze - important - because of doing animations of exiting vehicle
+		tmp = SetPlayerSkin(playerid, skinid);
+		PutPlayerInVehicle(playerid, vehicleid, (seatid == 128) ? 0 : seatid);
+		return tmp;
+	}
+	else
+	{
+	    return SetPlayerSkin(playerid, skinid);
+	}
+}
+
+// Chat functions
+getCharacterName(playerid);
+getCharacterName(playerid){ // Convert name from player name
+	new playername[MAX_PLAYER_NAME + 1], output[MAX_PLAYER_NAME + 1];
+	GetPlayerName(playerid, playername, sizeof(playername));
+	strfromliteral(output, playername);
+	strreplace(output, "_", " ");
+
+	return output;
+}
+
+forward sendToChat(playerid, target, text[128 + 1], receiver_id, DCC_User:author);
+public sendToChat(playerid, target, text[128 + 1], receiver_id, DCC_User:author){
+    strtrim(text);  // Trim edge whitespaces
+	if(isempty(text)){
+	    return 0;   // Fail if text is empty
+	}
+    new playername[MAX_PLAYER_NAME + 1];
+    if(playerid < 0){
+		DCC_GetUserName(author, playername, sizeof(playername));
+		print("Hit playerid < 0");
+		print(text);
+	}  // Discord messagge
+	else{playername = getCharacterName(playerid);}
+	
+	new chat_format, chat_color, chat_range, chat_userlevel, chat_character[1 + 1], chat_name[13 + 1], discord_channel;
+	switch(target){
+	    case CHAT_WHISPER:{
+			chat_format = 2;
+			chat_range = 3;
+			chat_name = "whispers";
+			chat_color = COLOR_COMMAND_OUTPUT;
+			discord_channel = ADMIN_ECHO_CHANNEL;
+		}
+		case CHAT_LOW:{
+			chat_format = 2;
+			chat_range = 10;
+			chat_name = "speaks softly";
+			chat_color = COLOR_COMMAND_OUTPUT;
+			discord_channel = ADMIN_ECHO_CHANNEL;
+		}
+        case CHAT_LOCAL:{
+            chat_format = 1;
+            chat_range = 20;
+			chat_color = COLOR_COMMAND_OUTPUT;
+			discord_channel = ADMIN_ECHO_CHANNEL;
+		}
+		case CHAT_SHOUT:{
+		    chat_format = 2;
+		    chat_range = 50;
+			chat_name = "shouts";
+			chat_color = COLOR_COMMAND_OUTPUT;
+			discord_channel = ADMIN_ECHO_CHANNEL;
+		}
+		case CHAT_ACTION:{
+		    chat_format = 0;
+		    chat_range = 20;
+			chat_color = COLOR_COMMAND_OUTPUT;
+			discord_channel = ADMIN_ECHO_CHANNEL;
+		}
+        case CHAT_OC:{
+	        chat_format = 3;
+            chat_range = 20;
+            chat_character = "'";
+            chat_name = "OOC";
+			chat_color = COLOR_COMMAND_OUTPUT;
+			discord_channel = ADMIN_ECHO_CHANNEL;
+		}
+  		case CHAT_GLOBAL:{
+	  		chat_format = 3;
+			chat_character = "`";
+			chat_name = "Global";
+			chat_color = COLOR_COMMAND_OUTPUT;
+			discord_channel = ECHO_CHANNEL;
+		}
+		case CHAT_GANG:{
+		    chat_format = 3;
+			chat_character = "~";
+			chat_name = "Gang";
+			chat_color = COLOR_CREW_CHAT;
+			// TODO: Output to gang Discord channel
+			discord_channel = ADMIN_ECHO_CHANNEL;
+		}
+		case CHAT_GANG_OC:{
+		    chat_format = 3;
+			chat_character = "$";
+			chat_name = "Gang OC";
+			chat_color = COLOR_CREW_CHAT;
+			// TODO: Output to gang Discord channel
+			discord_channel = ADMIN_ECHO_CHANNEL;
+		}
+		case CHAT_FACTION:{
+		    chat_format = 3;
+			chat_character = "!";
+			chat_name = "Faction";
+			chat_color = COLOR_CREW_CHAT;
+			// TODO: Output to faction Discord channel
+			discord_channel = ADMIN_ECHO_CHANNEL;
+		}
+		case CHAT_FACTION_OC:{
+		    chat_format = 3;
+			chat_character = "%";
+			chat_name = "Faction OC";
+			chat_color = COLOR_CREW_CHAT;
+			// TODO: Output to faction Discord channel
+			discord_channel = ADMIN_ECHO_CHANNEL;
+		}
+		case CHAT_CREW:{
+		    chat_format = 3;
+			chat_character = "@";
+			chat_name = "Crew";
+			chat_color = COLOR_CREW_CHAT;
+			chat_userlevel = MODERATOR_CREW;
+			discord_channel = ADMIN_ECHO_CHANNEL;
+		}
+		case CHAT_ADMIN:{
+		    chat_format = 3;
+			chat_character = "#";
+			chat_name = "Admin";
+			chat_color = COLOR_ADMIN_CHAT;
+			chat_userlevel = ADMIN_CREW;
+			discord_channel = ADMIN_ECHO_CHANNEL;
+		}
+		case CHAT_MANAGEMENT:{
+		    chat_format = 3;
+			chat_character = "&";
+			chat_name = "Management";
+			chat_color = COLOR_ADMIN_CHAT;
+			chat_userlevel = MANAGEMENT_CREW;
+			discord_channel = MANAGEMENT_CHANNEL;
+		}
+		case CHAT_VIP:{
+		    chat_format = 3;
+			chat_character = "^";
+			chat_name = "VIP";
+			chat_color = COLOR_VIP_CHAT;
+			chat_userlevel = VIP_PLAYER;
+			discord_channel = ADMIN_ECHO_CHANNEL;
+			//TODO: Add VIP discord channel.
+		}
+		case CHAT_UNDERCOVER:{
+		    chat_format = -1;
+			chat_character = "*";
+			chat_color = COLOR_COMMAND_OUTPUT;
+			chat_userlevel = ADMIN_CREW;
+			discord_channel = ECHO_CHANNEL;
+		}
+		case CHAT_PM:{
+		    chat_format = 3;
+		    chat_character = ">";
+		    chat_name = "PM";
+			chat_color = COLOR_PM_CHAT;
+			discord_channel = ADMIN_ECHO_CHANNEL;
+		}
+		case CHAT_CALL:{
+		    chat_format = 3;
+		    chat_character = "+";
+		    chat_name = "Call";
+			chat_color = COLOR_PM_CHAT;
+			discord_channel = ADMIN_ECHO_CHANNEL;
+		}
+		case CHAT_SMS:{
+		    chat_format = 3;
+		    chat_character = "-";
+		    chat_name = "SMS";
+			chat_color = COLOR_PM_CHAT;
+			discord_channel = ADMIN_ECHO_CHANNEL;
+		}
+		case CHAT_RADIO:{
+		    chat_format = 3;
+		    chat_character = "=";
+		    chat_name = "Radio";
+			chat_color = COLOR_PM_CHAT;
+			discord_channel = ADMIN_ECHO_CHANNEL;
+		}
+	}
+	
+	// Format chat message
+	new message[9 + sizeof(chat_character) + (6 * 8) + sizeof(chat_name) + 4 + MAX_PLAYER_NAME + 128 + 1];
+	new discord_message[23 + sizeof(chat_character) + sizeof(chat_name) + sizeof(playerid) + MAX_PLAYER_NAME + 128 + 1];
+	switch(chat_format){
+	    case -1:{
+			format(message, sizeof(message), "%s %s", chat_character, text);
+			format(discord_message, sizeof(discord_message), "```css\n%s %s\n```", chat_character, text);
+		}
+		case 0:{
+			format(message, sizeof(message), EMBED_COLOR_GREY"[{%06x}%i"EMBED_COLOR_GREY"] {%06x}%s{%06x} %s", GetPlayerColor(playerid) >>> 8, playerid, GetPlayerColor(playerid) >>> 8, playername, chat_color >>> 8, text);
+			format(discord_message, sizeof(discord_message), "```css\n[%i] %s %s\n```", playerid, playername, text);
+		}
+		case 1:{
+			format(message, sizeof(message), EMBED_COLOR_GREY"[{%06x}%i"EMBED_COLOR_GREY"] {%06x}%s"EMBED_COLOR_GREY":{%06x} %s", GetPlayerColor(playerid) >>> 8, playerid, GetPlayerColor(playerid) >>> 8, playername, chat_color >>> 8, text);
+			format(discord_message, sizeof(discord_message), "```css\n[%i] %s: %s\n```", playerid, playername, text);
+		}
+		case 2:{
+			format(message, sizeof(message), EMBED_COLOR_GREY"[{%06x}%i"EMBED_COLOR_GREY"] {%06x}%s %s"EMBED_COLOR_GREY":{%06x} %s", GetPlayerColor(playerid) >>> 8, playerid, GetPlayerColor(playerid) >>> 8, playername, chat_name, chat_color >>> 8, text);
+			format(discord_message, sizeof(discord_message), "```css\n[%i] %s %s: %s\n```", playerid, playername, chat_name, text);
+		}
+		case 3:{
+			format(message, sizeof(message), "%s "EMBED_COLOR_GREY"({%06x}%s"EMBED_COLOR_GREY") [{%06x}%i"EMBED_COLOR_GREY"] {%06x}%s"EMBED_COLOR_GREY":{%06x} %s", chat_character, chat_color >>> 8, chat_name, GetPlayerColor(playerid) >>> 8, playerid, GetPlayerColor(playerid) >>> 8, playername, chat_color >>> 8, text);
+			format(discord_message, sizeof(discord_message), "```css\n%s (%s) [%i] %s: %s\n```", chat_character, chat_name, playerid, playername, text);
+		}// Good discord tag options for color effects: yaml, css, moon, elixir, haxe, groovy, brainfuck, accesslog,inform7, c,
+	}
+	
+	// Authorisation
+	if(chat_userlevel && chat_userlevel > GetGVarInt("userlevel", playerid)){    // User not privilged to read chat
+	    if(target == CHAT_CREW){    // Show the user the message was sent to crew chat.
+	        SendClientMessage(playerid, chat_color, message);
+		}
+		else{
+		    SendClientMessage(playerid, COLOR_CREW_CHAT, "ERROR: You are not authorized to speak in this chat.");
+
+		    return 0;   // Fail to send the message
+		}
+	}
+	
+    // Send TODO: Add checks for muted.
+    if(chat_range){ // Ranged chats
+        logger(LOGLEVEL_CHAT, message);	// Log event
+        
+        // Show message to players in range
+        new Float:x, Float:y, Float:z;
+		GetPlayerPos(playerid, x, y, z);
+		for(new recipient_id, a = GetMaxPlayers(); recipient_id < a; recipient_id++){
+			if(IsPlayerConnected(receiver_id)){
+				new Float:distance = GetPlayerDistanceFromPoint(recipient_id, x, y, z);
+				if(distance <= chat_range){  // Player nearby
+		    		sendClientMultiMessage(recipient_id, chat_color, message, Bool:false);
+				}
+			}
+		}
+
+    	DiscordEcho(discord_message, discord_channel);
+	}
+	else{   // Global chats
+	    if(target == CHAT_GLOBAL){  // Public chat
+	        logger(LOGLEVEL_CHAT, message);	// Log event
+     		sendClientMultiMessage(0, chat_color, message, Bool:true);
+     		DiscordEcho(discord_message, discord_channel);
+   		}
+   		else if(target == CHAT_GANG || target == CHAT_GANG_OC || target == CHAT_FACTION || target == CHAT_FACTION_OC || target == CHAT_CALL || target == CHAT_SMS || target == CHAT_RADIO ){
+			// TODO
+			// TODO sendToAdmins();
+			// TODO send to specific discord channel
+			SendClientMessage(playerid, chat_color, "You are not a member of the required entity.");
+		}
+		else if(target == CHAT_PM){
+		    new output[sizeof(message)];
+			strdel(message, 0, 1);
+		    format(output, sizeof(output), "<%s", message);
+			sendClientMultiMessage(receiver_id, chat_color, output, Bool:false);
+			
+			new receipt[12 + 1 + sizeof(chat_name) + 4 + MAX_PLAYER_NAME + 128 + 1];
+			format(receipt, sizeof(receipt), "%s (%s) to [%i] %s: %s", chat_character, chat_name, receiver_id, playername, text);
+			sendClientMultiMessage(playerid, chat_color, receipt, Bool:false);
+
+			new admin_message[15 + 1 + sizeof(chat_name) + 4 + MAX_PLAYER_NAME + 4 + 128 + 1];
+			format(admin_message, sizeof(admin_message), "%s (%s) [%i] %s to [%i]: %s", chat_character, chat_name, playerid, playername, receiver_id, text);
+			logger(LOGLEVEL_CHAT, admin_message);	// Log event
+			
+			sendToAdmins(chat_color, admin_message);
+			DiscordEcho(discord_message, discord_channel);
+		}
+		
+		else{   // Chat with select users
+			for(new recipient_id, a = GetMaxPlayers(); recipient_id < a; recipient_id++){
+				if(IsPlayerConnected(recipient_id)){
+					if(GetGVarInt("userlevel", recipient_id) >= chat_userlevel){    // Privileged
+					    logger(LOGLEVEL_CHAT, message);	// Log event
+						sendClientMultiMessage(recipient_id, chat_color, message, Bool:false);
+						DiscordEcho(discord_message, discord_channel);
+					}
+				}
+			}
+		}
+	}
+	return 1;
+}
+
+forward sendToAdmins(chat_color, const message[]);
+public sendToAdmins(chat_color, const message[]){
+    for(new recipient_id, a = GetMaxPlayers(); recipient_id < a; recipient_id++){
+		if(IsPlayerConnected(recipient_id)){
+			if(GetGVarInt("userlevel", recipient_id) >= ADMIN_CREW){    // Privileged
+				SendClientMessage(recipient_id, chat_color, message);
+			}
+		}
+	}
+}
+
+forward sendPM(playerid, text[128 + 1], recipient_id);
+public sendPM(playerid, text[128 + 1], recipient_id){
+	if (recipient_id == INVALID_PLAYER_ID){
+		SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "ERROR: Player not found.");
+	}
+	else{
+		sendToChat(playerid, CHAT_PM, text, recipient_id, DCC_INVALID_USER);
+		// Todo: Send to admins and admin echo
+	}
+}
+
+forward sendClientMultiMessage(recipient_id, chat_color, const message[], Bool:toall);
+public sendClientMultiMessage(recipient_id, chat_color, const message[], Bool:toall){
+    if(strlen(message) > 144){  // SAMP does not send messages longer than 144 characters
+        new part_1[144 + 1], part_2[144 + 1];
+        strmid(part_1, message, 0, 143);    // TODO see if this can be moved 1 bit
+        strmid(part_2, message, 143, 286);
+		if(toall){
+			SendClientMessageToAll(chat_color, part_1);
+			SendClientMessageToAll(chat_color, part_2);
+		}
+		else{
+	        SendClientMessage(recipient_id, chat_color, part_1);
+    	    SendClientMessage(recipient_id, chat_color, part_2);
+		}
+	}
+	else{
+	    if(toall){SendClientMessageToAll(chat_color, message);}
+	    else{SendClientMessage(recipient_id, chat_color, message);}
+	}
+}
+
+// Pickup functions
+forward createDynamicPickup(object, Float:x, Float:y, Float:z, world, interior, pickup_type);
+public createDynamicPickup(object, Float:x, Float:y, Float:z, world, interior, pickup_type){
+	// Object position corrections
+	if(object == 19902){
+	    z = z - 0.5;
+	}
+	else if(object == 19607){
+	    z = z - 0.5;
+	}
+	
+	// Pickup types
+	new type;
+	switch(pickup_type){
+		case 99999: type = 2;
+		default: type = 1;
+	}
+
+    new pickupid = CreateDynamicPickup(object, type, x, y, z, world, interior);
+    SetGVarInt("pickup_type", pickup_type, pickupid);
+    printf("new pickupid = CreateDynamicPickup(%i, %i, %f, %f, %f, %i, %i);", pickupid, object, type, x, y, z, world, interior);
+    return pickupid;
+}
+
+forward spawnPortal(id, object, Float:pos_x, Float:pos_y, Float:pos_z, world, interior, exit_object, Float:exit_pos_x, Float:exit_pos_y, Float:exit_pos_z, exit_world, exit_interior);
+public spawnPortal(id, object, Float:pos_x, Float:pos_y, Float:pos_z, world, interior, exit_object, Float:exit_pos_x, Float:exit_pos_y, Float:exit_pos_z, exit_world, exit_interior){
+	new pickup_id = createDynamicPickup(object, pos_x, pos_y, pos_z, world, interior, PICKUP_PORTAL);
+	SetGVarFloat("pickup_x", exit_pos_x, pickup_id);
+	SetGVarFloat("pickup_y", exit_pos_y, pickup_id);
+	SetGVarFloat("pickup_z", exit_pos_z, pickup_id);
+	SetGVarInt("pickup_world", exit_world, pickup_id);
+	SetGVarInt("pickup_interior", exit_interior, pickup_id);
+	new exit_pickup_id = createDynamicPickup(exit_object, exit_pos_x, exit_pos_y, exit_pos_z, exit_world, exit_interior, PICKUP_PORTAL);
+	SetGVarFloat("pickup_x", pos_x, exit_pickup_id);
+	SetGVarFloat("pickup_y", pos_y, exit_pickup_id);
+	SetGVarFloat("pickup_z", pos_z, exit_pickup_id);
+	SetGVarInt("pickup_world", world, exit_pickup_id);
+	SetGVarInt("pickup_interior", interior, exit_pickup_id);
+
+	new portal_query[64 + MAX_SQL_INTEGER + MAX_SQL_INTEGER + MAX_SQL_INTEGER + 1];
+	format(portal_query, sizeof(portal_query), "UPDATE portal SET (pickup_id, exit_pickup_id) = (%i, %i) WHERE id = %i", pickup_id, exit_pickup_id, id);
+	sql_query(sqlHandle, portal_query);
+}
+
+forward destroyPortal(id);
+public destroyPortal(id){
+    DestroyDynamicPickup(id);
+	DeleteGVar("pickup_type", id);
+	DeleteGVar("pickup_x", id);
+	DeleteGVar("pickup_y", id);
+	DeleteGVar("pickup_z", id);
+	DeleteGVar("pickup_world", id);
+	DeleteGVar("pickup_interior", id);
+}
+
+// Command functions
+public OnPlayerCommandPerformed(playerid, cmd[], params[], result, flags){
+    if(result == -1){
+        SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "SERVER: Unknown command.");
+
+        return 0;
+    }
+
+    return 1;
+}
+public OnPlayerCommandReceived(playerid, cmd[], params[], flags){
+	new userlevel = GetGVarInt("userlevel", playerid);
+	if(flags){
+	    if(flags > userlevel){
+	        SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "SERVER: Access denied.");
+        	printf("player %d doesn�t have access to command '%s'", playerid, cmd); // TODO decide to send this to a chat or not.
+        	
+        	return 0;
+		}
+	}
+
+    return 1;
+}
+public PC_OnInit(){ // TODO
+    
+	return 1;	// Remove this once stuff is in place.
+}
+
+flags:test(ADMIN_CREW);
+cmd:test(playerid, params[]){
+	SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Executed");
+
+	return 1;
+}
+
+// Command commands
+cmd:help(playerid, params[]){
+    SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "SERVER: Ask questions in the chat, on Discord or the forum.\nTo list all commands: /cmds");
+
+    return 1;
+}
+alias:help("h");
+
+cmd:cmds(playerid, params[]){
+	SendClientMessage(playerid, COLOR_NOTICE, "Command help syntax: \"/\" = start of cmd, \"()\" = cmd aliasses, \"|\" = or, \"<>\" = required parameter, \"[]\" = optional parameter, \",\" = next item.");
+	SendClientMessage(playerid, COLOR_NOTICE, "Command help syntax example: /command (/alias | /other_alias) <parameter> [optional_parameter], /next_command");
+	SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "General commands: /help (/h), /cmds (/cmd | /commands), /my (/myself | /mine), /v (/vehivle | /veh), /p (/player)");
+	SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Chat commands: /me (/emote | /action), /w (/whisper), /low (/soft), /l (/local), /s (/shout | /scream), /o (' | /oc | /ooc)");
+	SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Chat commands: /g (` | /global | /public), /gc (~) /fc (!), /vc (&), /cc (@), /my chatmode <value>");
+	if(GetGVarInt("userlevel", playerid) >= ADMIN_CREW){
+	    SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Admin commands: /property");
+	}
+
+    return 0;
+}
+alias:cmds("commands", "cmd");
+
+// User commands
+cmd:register(playerid, params[]){
+	register(playerid);
+}
+
+cmd:my(playerid, params[]){
+	// No option specified
+	if(strlen(params) < 1){
+		SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Usage: /my <option> <value>");
+		SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Options: account chatmode");
+		if(GetGVarInt("userlevel", playerid) >= ADMIN_CREW){
+		    SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Admin options: goto");
+		}
+		return 0;
+	}
+	
+	// Options
+	if(!strcmp(params, "account", true, 7)){    // /my account
+		strdel(params, 0, 8);	// Remove first 8 characters, "account ", from the string.
+
+		// Values
+		if (isequal(params, "register", .ignorecase = true)){   // /my account register
+			register(playerid);	// Call public register function
+		}
+		else if (isequal(params, "characters", .ignorecase = true)){   // /my account characters
+			characterSelection(playerid);
+		}
+		else if (isequal(params, "deletecharacter", .ignorecase = true)){   // /my account characters
+			ShowPlayerDialog(playerid, DIALOG_DELETE_CHARACTER, DIALOG_STYLE_MSGBOX, "Charater deletion", "You are about to permanently delete this charater and all it's assets.\n This can NOT be undone.", "Destroy", "Abort");
+		}
+		else{   // Invalid value
+			SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Usage: /my account <value>");
+			SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Values: register characters deletecharacter");
+		}
+	}
+	else if(!strcmp(params, "chatmode", true, 8)){    // /my chatmode
+		strdel(params, 0, 9);	// Remove first 9 characters, "account ", from the string.
+
+        // Values
+        if (isequal(params, "whisper", .ignorecase = true)){
+            SetGVarInt("chatmode", CHAT_WHISPER, playerid);
+		}
+		else if (isequal(params, "low", .ignorecase = true)){
+            SetGVarInt("chatmode", CHAT_LOW, playerid);
+		}
+		else if (isequal(params, "local", .ignorecase = true)){
+			SetGVarInt("chatmode", CHAT_LOCAL, playerid);
+		}
+        else if (isequal(params, "shout", .ignorecase = true)){
+            SetGVarInt("chatmode", CHAT_SHOUT, playerid);
+		}
+		else if (isequal(params, "oc", .ignorecase = true)){
+			SetGVarInt("chatmode", CHAT_OC, playerid);
+		}
+		else if (isequal(params, "global", .ignorecase = true)){
+			SetGVarInt("chatmode", CHAT_GLOBAL, playerid);
+		}
+		else if (isequal(params, "gang", .ignorecase = true)){
+		    SetGVarInt("chatmode", CHAT_GANG, playerid);
+		}
+		else if (isequal(params, "faction", .ignorecase = true)){
+		    SetGVarInt("chatmode", CHAT_FACTION, playerid);
+		}
+		else if (isequal(params, "vip", .ignorecase = true)){
+		    SetGVarInt("chatmode", CHAT_VIP, playerid);
+		}
+		else if (isequal(params, "crew", .ignorecase = true)){
+		    SetGVarInt("chatmode", CHAT_CREW, playerid);
+		}
+		else if (isequal(params, "admin", .ignorecase = true)){
+            SetGVarInt("chatmode", CHAT_ADMIN, playerid);
+		}
+        else if (isequal(params, "management", .ignorecase = true)){
+            SetGVarInt("chatmode", CHAT_MANAGEMENT, playerid);
+		}
+		else{   // Invalid value
+			printf("else isequals register");
+			SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Usage: /my chatmode <value>");
+			SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Values: whisper low local shout oc global gang faction vip crew admin management");
+		}
+	}
+	else if(!strcmp(params, "goto", true, 4) || !strcmp(params, "sendto", true, 6) || !strcmp(params, "teleport", true, 8)){
+		if(GetGVarInt("userlevel", playerid) < ADMIN_CREW){
+		    return SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "SERVER: Access denied.");
+		}
+		
+		SetGVarInt("goto_target", playerid, playerid);
+		ShowPlayerDialog(playerid, DIALOG_GOTO, DIALOG_STYLE_LIST, "Categories", "Interiors\nPlayers", "Select", "Cancel");
+	}
+	else{   // Invalid option
+		SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "/my options: account chatmode");
+		if(GetGVarInt("userlevel", playerid) >= ADMIN_CREW){
+		    SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Admin options: goto");
+		}
+	}
+	return 0;
+}
+alias:my("myself", "mine");
+
+// Chat commands
+cmd:w(playerid, params[128 + 1]){
+    sendToChat(playerid, CHAT_WHISPER, params, 0, DCC_INVALID_USER);
+    
+    return 1;
+}
+alias:w("whisper");
+cmd:low(playerid, params[128 + 1]){
+    sendToChat(playerid, CHAT_LOW, params, 0, DCC_INVALID_USER);
+
+    return 1;
+}
+alias:low("soft");
+cmd:l(playerid, params[128 + 1]){
+    sendToChat(playerid, CHAT_LOCAL, params, 0, DCC_INVALID_USER);
+
+    return 1;
+}
+alias:l("local");
+cmd:me(playerid, params[128 + 1]){
+    sendToChat(playerid, CHAT_ACTION, params, 0, DCC_INVALID_USER);
+
+    return 1;
+}
+alias:me("emote", "action");
+cmd:s(playerid, params[128 + 1]){
+	sendToChat(playerid, CHAT_SHOUT, params, 0, DCC_INVALID_USER);
+
+    return 1;
+}
+alias:s("shout", "scream");
+cmd:o(playerid, params[128 + 1]){
+    sendToChat(playerid, CHAT_OC, params, 0, DCC_INVALID_USER);
+
+    return 1;
+}
+alias:o("oc", "ooc");
+cmd:g(playerid, params[128 + 1]){
+    sendToChat(playerid, CHAT_GLOBAL, params, 0, DCC_INVALID_USER);
+
+    return 1;
+}
+alias:g("global", "public");
+cmd:gc(playerid, params[128 + 1]){
+    sendToChat(playerid, CHAT_GANG, params, 0, DCC_INVALID_USER);
+
+    return 1;
+}
+cmd:fc(playerid, params[128 + 1]){
+    sendToChat(playerid, CHAT_FACTION, params, 0, DCC_INVALID_USER);
+
+    return 1;
+}
+cmd:vc(playerid, params[128 + 1]){
+    sendToChat(playerid, CHAT_VIP, params, 0, DCC_INVALID_USER);
+
+    return 1;
+}
+cmd:cc(playerid, params[128 + 1]){
+    sendToChat(playerid, CHAT_CREW, params, 0, DCC_INVALID_USER);
+
+    return 1;
+}
+
+cmd:pm(playerid, params[128 + 1]){
+    new recipient_id, message[128 + 1];
+	if (sscanf(params, "u s", recipient_id, message)){
+		SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Usage: /pm <playerid> <message>");
+	}
+	else{
+		sendPM(playerid, message, recipient_id);
+	}
+
+    return 1;
+}
+alias:pm("msg", "dm");
+
+// Vehicle commands
+cmd:v(playerid, params[]){
+    SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "health/armor [AMOUNT]");
+    return 1;
+}
+alias:v("vehicle", "veh");
+
+// Player commands
+cmd:p(playerid, params[]){
+    // No parameters
+	if(strlen(params) < 1){
+	    SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Usage: /p <ID> option");
+		return SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "/p options: admin, goto");
+	}
+
+	// Syntax
+	new player_id, option[123 + 1];
+	if(sscanf(params, "i s", player_id, option)){
+		SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Usage: /p <ID> <option>");
+		return SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "/p options: admin, goto");
+	}
+	
+	if(!strcmp(option, "admin", true, 5)){
+	    SetGVarInt("userlevel", ADMIN_CREW, player_id);
+	    // TODO take admin if already admin
+	    // TODO notify admins
+	}
+	else if(!strcmp(option, "goto", true, 4) && !strcmp(option, "sendto", true, 6 && !strcmp(option, "teleport", true, 8)) ){
+	    if(GetGVarInt("userlevel", playerid) < ADMIN_CREW){
+	        SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "SERVER: Access denied.");
+	        
+	        SetGVarInt("goto_target", player_id);
+		}
+	}
+	else{
+	    return SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "/p <ID> options: admin, goto");
+	}
+			
+    return 1;
+}
+alias:p("player");
+
+// Admin commands
+flags:property(ADMIN_CREW);
+cmd:property(playerid, params[]){
+    // No option specified
+	if(strlen(params) < 1){
+		return SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "/property options: pickup, portal");
+	}
+
+	// Options
+	if(!strcmp(params, "pickup", true, 6)){    // /property pickup
+		strdel(params, 0, 7);	// Remove first 7 characters, "pickup ", from the string.
+		
+		// No parameters
+		if(strlen(params) < 1){
+		    SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Usage: /property pickup <create | ID <goto | move | delete>>");
+			return SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "/p options: admin, goto");
+		}
+		
+		// Values
+        new pickup_id, option[110 + 1];
+		if(!strcmp(params, "create", true)){   // /property pickup create
+            ShowPlayerDialog(playerid, DIALOG_CREATE_PICKUP, DIALOG_STYLE_LIST, "Pickup caterogy", "Faction", "Select", "Cancel");
+		}
+		else if (!sscanf(params, "i s", pickup_id, option)){
+		    new pickup_query[62 + MAX_SQL_INTEGER + 1];
+			format(pickup_query, sizeof(pickup_query), "SELECT object_id, type_id, pickup_id, pos_x, pos_y, pos_z, world_id, pickup_id FROM pickup WHERE id = %i", pickup_id);
+			new Result:pickup_result = sql_query(sqlHandle, pickup_query);
+			if(sql_num_rows(pickup_result) < 1){   // Invalid pickup ID
+			    return SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Invalid pickup ID");
+			}
+			
+			new pickupid = sql_get_field_assoc_int(pickup_result, "pickup_id");
+			print(option);
+            if(!strcmp(option, "move", true)){
+                print("move");
+                // Destroy old pickup
+                DestroyDynamicPickup(pickupid);
+                
+                // Create new pickup
+                new Float:x, Float:y, Float:z;
+				GetPlayerPos(playerid, x, y, z);
+				new interior = GetPlayerInterior(playerid);
+				new world = GetPlayerVirtualWorld(playerid);
+				
+				new object_id = sql_get_field_assoc_int(Result:pickup_result, "object_id");
+				new type_id = sql_get_field_assoc_int(Result:pickup_result, "type_id");
+				new new_pickupid = createDynamicPickup(object_id, x, y, z, world, interior, type_id);
+
+				// Update pickup record
+				new update_query[109 + MAX_SQL_FLOAT + MAX_SQL_FLOAT + MAX_SQL_FLOAT + MAX_SQL_INTEGER + MAX_SQL_INTEGER + MAX_SQL_INTEGER + 1];
+				format(update_query, sizeof(update_query), "UPDATE pickup SET pos_x = '%f', pos_y = '%f', pos_z = '%f', world_id = %i, interior_id = %i, pickup_id = %i WHERE id = %i", x, y, z, world, interior, new_pickupid, pickup_id);
+				sql_query(sqlHandle, update_query);
+				
+				// Inform admins
+				new admin_message[39 + 4 + MAX_PLAYER_NAME + MAX_SQL_INTEGER + 1];
+				format(admin_message, sizeof(admin_message), "* [%i] %s modified the location of pickup: %i", playerid, getPlayerName(playerid), pickup_id);
+				sendToAdmins(COLOR_NOTICE, admin_message);
+				DiscordEcho(admin_message, ADMIN_ECHO_CHANNEL);
+			}
+            else if(!strcmp(option, "delete", true)){
+                // Destroy pickup
+                DestroyDynamicPickup(pickupid);
+                
+                // Delete pickup record
+				new update_query[95 + MAX_SQL_FLOAT + MAX_SQL_FLOAT + MAX_SQL_FLOAT + MAX_SQL_INTEGER + MAX_SQL_INTEGER + MAX_SQL_INTEGER + 1];
+				format(update_query, sizeof(update_query), "DELETE FROM pickup WHERE id = %i", pickup_id);
+				sql_query(sqlHandle, update_query);
+
+                // Inform admins
+				new admin_message[39 + 4 + MAX_PLAYER_NAME + MAX_SQL_INTEGER + 1];
+				format(admin_message, sizeof(admin_message), "* [%i] %s deleted pickup: %i", playerid, getPlayerName(playerid), pickup_id);
+				sendToAdmins(COLOR_NOTICE, admin_message);
+				DiscordEcho(admin_message, ADMIN_ECHO_CHANNEL);
+			}
+			else if(!strcmp(option, "goto", true)){
+				SetPlayerPos(playerid, sql_get_field_assoc_int(Result:pickup_result, "pos_x"), sql_get_field_assoc_int(Result:pickup_result, "pos_y"), sql_get_field_assoc_int(Result:pickup_result, "pos_z"));
+				SetPlayerVirtualWorld(playerid, sql_get_field_assoc_int(Result:pickup_result, "world_id"));
+				SetPlayerInterior(playerid, sql_get_field_assoc_int(Result:pickup_result, "interior_id"));
+			}
+			else{   // Invalid option.
+				SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "/property pickup <ID> usage: goto, move, delete");
+			}
+		}
+		else{   // Invalid value
+			SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "/property pickup usage: create, <ID> <goto | move | delete>");
+		}
+	}
+	else if(!strcmp(params, "portal", true, 6)){    // /property portal
+		strdel(params, 0, 7);	// Remove first 7 characters, "portal ", from the string.
+
+        // No parameters
+		if(strlen(params) < 1){
+			return SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Usage: /property portal <create | ID <goto | exit | entrance | object | delete>>");
+		}
+		
+        // Values
+        new portal_id, option[116 + 1];
+		if (!strcmp(params, "create", true, 6)){   // /property portal create
+            strdel(params, 0, 7);	// Remove first 7 characters, "create ", from the string.
+
+			// Worlds
+			new world[105 + 1], world_id;
+            if (sscanf(params, "s", world)){
+				SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "For a portal that works in all worlds use: /property portal create all");
+			}
+			if(!strcmp(world, "all", true)){
+			    world_id = -1;
+			}
+			else{
+				world_id = GetPlayerVirtualWorld(playerid);
+				SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Invalid world option, creating default portal.");
+			}
+
+			new Float:x, Float:y, Float:z;
+			GetPlayerPos(playerid, x, y, z);
+			new interior = GetPlayerInterior(playerid);
+			
+			new pickup_id = createDynamicPickup(19902, x, y, z, world_id, interior, PICKUP_PORTAL);
+
+			// Create portal database record
+			new portal_query[111 + MAX_SQL_FLOAT + MAX_SQL_FLOAT + MAX_SQL_FLOAT + MAX_SQL_INTEGER + 1];
+			format(portal_query, sizeof(portal_query), "INSERT INTO portal(object, pos_x, pos_y, pos_z, world, pickup_id, interior_id) VALUES (19902, '%f', '%f', '%f', %i, %i, %i)", x, y, z, world_id, pickup_id, interior);
+			sql_query(sqlHandle, portal_query);
+			
+			// Inform user(s)
+			new portal_id_query[91 + MAX_SQL_FLOAT + MAX_SQL_FLOAT + MAX_SQL_FLOAT + MAX_SQL_INTEGER + 1];
+			format(portal_id_query, sizeof(portal_id_query), "SELECT id FROM portal WHERE pos_x = '%f' AND pos_y = '%f' AND pos_z = '%f' AND world = %i AND interior_id = %i", x, y, z, world_id, interior);
+			new Result:portal_id_result = sql_query(sqlHandle, portal_id_query);
+			portal_id = sql_get_field_assoc_int(Result:portal_id_result, "id");
+			new message[69 + MAX_SQL_INTEGER + MAX_SQL_INTEGER + 1], admin_message[21 + 4 + MAX_PLAYER_NAME + MAX_SQL_INTEGER + 1];
+			format(message, sizeof(message), "Portal %i created. Create the other side with: /property portal %i exit", portal_id, portal_id);
+			format(admin_message, sizeof(admin_message), "* [%i] %s created portal: %i", playerid, getPlayerName(playerid), portal_id);
+			sendToAdmins(COLOR_NOTICE , admin_message);
+			SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, message);
+			DiscordEcho(admin_message, ADMIN_ECHO_CHANNEL);
+		}
+        else if (!sscanf(params, "i s", portal_id, option)){
+            // Get portal record
+   			new portal_query[171 + MAX_SQL_INTEGER + 1];
+   			format(portal_query, sizeof(portal_query), "SELECT object, pos_x, pos_y, pos_z, world, interior_id, pickup_id, exit_pos_x, exit_pos_y, exit_pos_z, exit_world, exit_interior_id, exit_pickup_id FROM portal WHERE id = %i", portal_id);
+   			new Result:portal_result = sql_query(sqlHandle, portal_query);
+   			
+   			// Invalid portal ID
+   			if(sql_num_rows(portal_result) < 1){   // Invalid portal ID
+			    return SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Invalid portal ID");
+			}
+   			
+            if (!strcmp(option, "exit", true, 4)){
+				new Float:pos_x = sql_get_field_assoc_float(portal_result, "pos_x");
+				new Float:pos_y = sql_get_field_assoc_float(portal_result, "pos_y");
+				new Float:pos_z = sql_get_field_assoc_float(portal_result, "pos_z");
+				new world_id = sql_get_field_assoc_int(portal_result, "world");
+				new interior_id = sql_get_field_assoc_int(portal_result, "interior_id");
+				new session_id = sql_get_field_assoc_int(portal_result, "pickup_id");
+				new exit_pickup_id = sql_get_field_assoc_int(portal_result, "exit_pickup_id");
+				
+
+				// World
+				new world;
+				if(world_id != -1){   // Not an all-world portal
+				    world = GetPlayerVirtualWorld(playerid);
+				}
+				else{
+				    world = world_id;
+				}
+
+	            // Location
+				new Float:x, Float:y, Float:z;
+				GetPlayerPos(playerid, x, y, z);
+				new interior = GetPlayerInterior(playerid);
+
+				// Delete old exit if exists
+				if(exit_pickup_id){
+				     destroyPortal(exit_pickup_id);
+				}
+
+	            new pickup_id = createDynamicPickup(19607, x, y, z, world, interior, PICKUP_PORTAL);
+	            SetGVarFloat("pickup_x", pos_x, pickup_id);
+				SetGVarFloat("pickup_y", pos_y, pickup_id);
+				SetGVarFloat("pickup_z", pos_z, pickup_id);
+				SetGVarInt("pickup_world", world_id, pickup_id);
+				SetGVarInt("pickup_interior", interior_id, pickup_id);
+				SetGVarFloat("pickup_x", x, session_id);
+				SetGVarFloat("pickup_y", y, session_id);
+				SetGVarFloat("pickup_z", z, session_id);
+				SetGVarInt("pickup_world", world, session_id);
+				SetGVarInt("pickup_interior", interior, session_id);
+
+				// Update portal record
+				new update_query[155 + MAX_SQL_FLOAT + MAX_SQL_FLOAT + MAX_SQL_FLOAT + MAX_SQL_INTEGER + MAX_SQL_INTEGER + MAX_SQL_INTEGER + 1];
+				format(update_query, sizeof(update_query), "UPDATE portal SET exit_object = 19607, exit_pos_x = '%f', exit_pos_y = '%f', exit_pos_z = '%f', exit_world = %i, exit_interior_id = %i, exit_pickup_id = %i WHERE id = %i", x, y, z, world, interior, pickup_id, portal_id);
+				sql_query(sqlHandle, update_query);
+
+				// Inform admins and Discord
+				new admin_message[61 + 4 + MAX_PLAYER_NAME + MAX_SQL_INTEGER + 1];
+				format(admin_message, sizeof(admin_message), "* [%i] %s modified the exit location of portal: %i", playerid, getPlayerName(playerid), portal_id);
+				sendToAdmins(COLOR_NOTICE , admin_message);
+				DiscordEcho(admin_message, ADMIN_ECHO_CHANNEL);
+			}
+			else if(!strcmp(option, "object", true, 6)){
+			    new object, exit_object;
+				if (sscanf(option, "i i", object, exit_object)){
+				    return SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Invalid syntax, specify two object ID's: /property portal <ID> object <ID> <ID>");
+				}
+
+				new Float:pos_x = sql_get_field_assoc_float(portal_result, "pos_x");
+				new Float:pos_y = sql_get_field_assoc_float(portal_result, "pos_y");
+				new Float:pos_z = sql_get_field_assoc_float(portal_result, "pos_z");
+				new world_id = sql_get_field_assoc_int(portal_result, "world");
+				new interior_id = sql_get_field_assoc_int(portal_result, "interior_id");
+				new pickup_id = sql_get_field_assoc_int(portal_result, "pickup_id");
+				new Float:exit_pos_x = sql_get_field_assoc_float(portal_result, "exit_pos_x");
+				new Float:exit_pos_y = sql_get_field_assoc_float(portal_result, "exit_pos_y");
+				new Float:exit_pos_z = sql_get_field_assoc_float(portal_result, "exit_pos_z");
+				new exit_world_id = sql_get_field_assoc_int(portal_result, "exit_world");
+				new exit_interior_id = sql_get_field_assoc_int(portal_result, "exit_interior_id");
+				new exit_pickup_id = sql_get_field_assoc_int(portal_result, "exit_pickup_id");
+
+	            destroyPortal(exit_pickup_id);
+				destroyPortal(pickup_id);
+				spawnPortal(portal_id, object, pos_x, pos_y, pos_z, world_id, interior_id, exit_object, exit_pos_x, exit_pos_y, exit_pos_z, exit_world_id, exit_interior_id);
+
+				new update_query[57 + MAX_SQL_INTEGER + MAX_SQL_INTEGER + MAX_SQL_INTEGER + 1];
+				format(update_query, sizeof(update_query), "UPDATE portal SET (object, exit_object) = (%i, %i) WHERE id = %i", object, exit_object, portal_id);
+				sql_query(sqlHandle, portal_query);
+
+			}
+			else if(!strcmp(option, "delete", true, 6)){
+				new pickup_id = sql_get_field_assoc_int(portal_result, "pickup_id");
+				new exit_pickup_id = sql_get_field_assoc_int(portal_result, "exit_pickup_id");
+
+	   			// TODO: Confirmation, by spectating the pickup or having to be near.
+
+	   			destroyPortal(exit_pickup_id);
+				destroyPortal(pickup_id);
+
+				// Delete portal record
+				new delete_query[31 + MAX_SQL_INTEGER + 1];
+				format(delete_query, sizeof(delete_query), "DELETE FROM portal WHERE id = %i", portal_id);
+				sql_query(sqlHandle, delete_query);
+			}
+			else if(!strcmp(option, "entrance", true, 8)){
+	   			new object = sql_get_field_assoc_int(portal_result, "object");
+				//new Float:x = sql_get_field_assoc_float(portal_result, "pos_x");
+				//new Float:y = sql_get_field_assoc_float(portal_result, "pos_y");
+				//new Float:z = sql_get_field_assoc_float(portal_result, "pos_z");  todo shorten qeury
+				new world = sql_get_field_assoc_int(portal_result, "world");
+				new pickup_id = sql_get_field_assoc_int(portal_result, "pickup_id");
+				new Float:pos_x = sql_get_field_assoc_float(portal_result, "exit_pos_x");
+				new Float:pos_y = sql_get_field_assoc_float(portal_result, "exit_pos_y");
+				new Float:pos_z = sql_get_field_assoc_float(portal_result, "exit_pos_z");
+				new world_id = sql_get_field_assoc_int(portal_result, "exit_world");
+				new interior_id = sql_get_field_assoc_int(portal_result, "exit_interior");
+				if(sql_num_rows(portal_result) < 1){   // Invalid portal ID
+				    return SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Invalid portal ID");
+				}
+
+				// World
+				if(world_id != -1){   // Not an all-world portal
+				    world = GetPlayerVirtualWorld(playerid);
+				}
+				else{
+				    world = world_id;
+				}
+
+	            // Location
+				new Float:x, Float:y, Float:z;
+				GetPlayerPos(playerid, x, y, z);
+				new interior = GetPlayerInterior(playerid);
+
+	   			destroyPortal(pickup_id);   // Despawn old pickups and remove GVars
+
+	            new pickupid = createDynamicPickup(object, x, y, z, world, interior, PICKUP_PORTAL);
+	            SetGVarFloat("pickup_x", pos_x, pickupid);
+				SetGVarFloat("pickup_y", pos_y, pickupid);
+				SetGVarFloat("pickup_z", pos_z, pickupid);
+				SetGVarInt("pickup_world", world_id, pickupid);
+				SetGVarInt("pickup_interior", interior_id, pickupid);
+
+				// Inform admins and Discord
+				new admin_message[65 + 4 + MAX_PLAYER_NAME + MAX_SQL_INTEGER + 1];
+				format(admin_message, sizeof(admin_message), "* [%i] %s modified the entrance location of portal: %i", playerid, getPlayerName(playerid), portal_id);
+				sendToAdmins(COLOR_NOTICE, admin_message);
+				DiscordEcho(admin_message, ADMIN_ECHO_CHANNEL);
+			}
+			else if(!strcmp(option, "goto", true)){
+				SetPlayerPos(playerid, sql_get_field_assoc_int(Result:portal_result, "exit_pos_x"), sql_get_field_assoc_int(Result:portal_result, "exit_pos_y"), sql_get_field_assoc_int(Result:portal_result, "exit_pos_z"));
+				SetPlayerVirtualWorld(playerid, sql_get_field_assoc_int(Result:portal_result, "exit_world_id"));
+				SetPlayerInterior(playerid, sql_get_field_assoc_int(Result:portal_result, "exit_interior_id"));
+			}
+			else{   // Invalid option
+				SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "/property portal <ID> options: goto, exit, entrance, object, delete");
+			}
+		}
+		else{   // Invalid value
+			SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Usage: /property portal <create | ID <goto | exit | entrance | object | delete>>");
+		}
+
+	}
+	else{   // Invalid option
+		SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "/property options: pickup, portal");
+	}
+    
+    return 1;
+}
+
+// Dialog functions
+forward dialogGotoInterior(playerid);
+public dialogGotoInterior(playerid){
+    ShowPlayerDialog(playerid, DIALOG_GOTO_INTERIOR, DIALOG_STYLE_LIST, "Categories", "24/7's\nAvaition\nAmmunation's\nBurglary houses\nMissions\nMission exteriors\nMission houses\nModding shops\nPolice departments\nSafe houses\nShops & casino's\nStadia", "Select", "Back");
+}
+
+forward dialogGotoPlayer(playerid);
+public dialogGotoPlayer(playerid){
+    for(new targetid, a = GetMaxPlayers(); targetid < a; targetid++){
+		if(IsPlayerConnected(targetid)){
+		    // TODO: Decide to use this or TABplayer list.
+		}
+	}
+
+    ShowPlayerDialog(playerid, DIALOG_GOTO_PLAYER, DIALOG_STYLE_LIST, "Players", "", "Goto", "Back");
+}
+
+// a_samp events
+public OnGameModeInit(){
+	new message[36 + 22 + 1];
+	format(message, sizeof(message), "* Global game-mode initialization: v%s", MODE_NAME);
+	logger(LOGLEVEL_NOTICE, "* Global game-mode initialization.");	// Log event.
+
+	// Player radar blip markers only visible to nearby players.
+	ShowPlayerMarkers(PLAYER_MARKERS_MODE_STREAMED);
+	LimitPlayerMarkerRadius(15);
+	
+
+	// Set mode name
+	SetGameModeText(MODE_NAME);
+
+	// SQL log level
+	if(scriptDebug){
+		sql_debug(LOG_ALL, LOG_ALL);	// Log everything everywhere.
+	}
+	else{
+	    sql_debug(LOG_INFO, LOG_WARNING);    // Loglevel info for file and worning for console.
+	}
+
+	// Connect to database
+	sqlHandle = SQL:sql_connect(SQL_HANDLER_POSTGRESQL, PG_HOST, PG_ROLE, PG_PASS, PG_DB, PG_PORT);
+	printf("sqlconnection = %d", _:sqlHandle);
+	if(!sql_ping(sqlHandle)){
+		print( " + Database connection" );
+	}
+    else{
+		print( "Database connection failed" );
+	}
+
+    // Initialize Discord
+	//homeGuild = DCC_GetGuildId(DISCORD_HOME_GUILD_ID);	// Set home guild ID.	NOT NEEDED FOR NOW AND BROKEN
+	echoChannel = DCC_FindChannelById(DISCORD_ECHO_CHANNEL_ID);	// Set main echo channel ID.
+	mainChannel = DCC_FindChannelById(DISCORD_MAIN_CHANNEL_ID);	// Set main notification channel ID.
+	adminEchoChannel = DCC_FindChannelById(DISCORD_ADMIN_ECHO_CHANNEL_ID);	// Set admin echo channel ID.
+	adminChannel = DCC_FindChannelById(DISCORD_ADMIN_CHANNEL_ID);	// Set admin notification channel ID.
+	managementChannel = DCC_FindChannelById(DISCORD_MANAGEMENT_CHANNEL_ID);	// Set management notification channel ID.
+	
+	DiscordEcho(message, ECHO_CHANNEL); // Notify Discord
+	//DiscordEcho(message, MAIN_CHANNEL);   // TODO Enable after we are stable
+	
+	// Portals
+   	new Result:portal_result = sql_query(sqlHandle, "SELECT id, object, pos_x, pos_y, pos_z, world, interior_id, exit_object, exit_pos_x, exit_pos_y, exit_pos_z, exit_world, exit_interior_id FROM portal");
+   	for(new i = 0; i < sql_num_rows(portal_result); i++){
+	   	new id = sql_get_field_assoc_int_ex(portal_result, i, "id");
+		new object = sql_get_field_assoc_int_ex(portal_result, i, "object");
+   	    new Float:pos_x = sql_get_field_assoc_float_ex(portal_result, i, "pos_x");
+		new Float:pos_y = sql_get_field_assoc_float_ex(portal_result, i, "pos_y");
+		new Float:pos_z = sql_get_field_assoc_float_ex(portal_result, i, "pos_z");
+		new world = sql_get_field_assoc_int_ex(portal_result, i, "world");
+		new interior = sql_get_field_assoc_int_ex(portal_result, i, "interior_id");
+		new exit_object = sql_get_field_assoc_int_ex(portal_result, i, "exit_object");
+		new Float:exit_pos_x = sql_get_field_assoc_float_ex(portal_result, i, "exit_pos_x");
+		new Float:exit_pos_y = sql_get_field_assoc_float_ex(portal_result, i, "exit_pos_y");
+		new Float:exit_pos_z = sql_get_field_assoc_float_ex(portal_result, i, "exit_pos_z");
+		new exit_world = sql_get_field_assoc_int_ex(portal_result, i, "exit_world");
+		new exit_interior = sql_get_field_assoc_int_ex(portal_result, i, "exit_interior_id");
+		
+		spawnPortal(id, object, pos_x, pos_y, pos_z, world, interior, exit_object, exit_pos_x, exit_pos_y, exit_pos_z, exit_world, exit_interior);
+   	}
+   	
+   	// Pickups
+   	new Result:pickup_result = sql_query(sqlHandle, "SELECT id, object_id, pos_x, pos_y, pos_z, world_id, interior_id, type_id FROM pickup");
+   	for(new i = 0; i < sql_num_rows(pickup_result); i++){
+   	    new id = sql_get_field_assoc_int(pickup_result, "id");
+		new object_id = sql_get_field_assoc_int_ex(pickup_result, i, "object_id");
+   	    new Float:pos_x = sql_get_field_assoc_float_ex(pickup_result, i, "pos_x");
+		new Float:pos_y = sql_get_field_assoc_float_ex(pickup_result, i, "pos_y");
+		new Float:pos_z = sql_get_field_assoc_float_ex(pickup_result, i, "pos_z");
+		new world_id = sql_get_field_assoc_int_ex(pickup_result, i, "world_id");
+		new interior_id = sql_get_field_assoc_int_ex(pickup_result, i, "interior_id");
+		new type_id = sql_get_field_assoc_int_ex(pickup_result, i, "type_id");
+		
+		new pickupid = createDynamicPickup(object_id, pos_x, pos_y, pos_z, world_id, interior_id, type_id);
+		printf("On connect pickupid: %i", pickupid);
+
+		// Update pickup record
+		new pickup_query[44 + MAX_SQL_INTEGER + MAX_SQL_INTEGER + 1];
+		format(pickup_query, sizeof(pickup_query), "UPDATE pickup SET pickup_id = %i WHERE id = %i", pickupid, id);
+		sql_query(sqlHandle, pickup_query);
+   	}
+	
+
+	// Hobo's with a cane (0 ammo value makes them lose the cane as soon as they switch weapon)
+	// Only homeless skins, as players should slowly class up in society.
+	AddPlayerClass(134, -184.7607, 950.5010, 16.7740, 358.3032, 15, 0, 0, 0, 0, false);		// Fort Carson West boulevard right curb.
+	AddPlayerClass(10, -184.7607, 950.5010, 16.7740, 358.3032, 15, 0, 0, 0, 0, false);		// Fort Carson West boulevard right curb.
+	AddPlayerClass(78, 111.0115, 1189.2029, 18.1627, 89.0095, 15, 0, 0, 0, 0, false);		// Fort Carson South boulevard left curb.
+	AddPlayerClass(129, 111.0115, 1189.2029, 18.1627, 89.0095, 15, 0, 0, 0, 0, false);		// Fort Carson South boulevard left curb.
+	AddPlayerClass(162, -109.4227, 1242.4860, 16.8223, 183.5798, 15, 0, 0, 0, 0, false);	// Fort Carson East boulevard left curb.
+	AddPlayerClass(77, -109.4227, 1242.4860, 16.8223, 183.5798, 15, 0, 0, 0, 0, false);		// Fort Carson East boulevard left curb.
+	AddPlayerClass(79, -201.5379, 948.1683, 15.9131, 359.9720, 15, 0, 0, 0, 0, false); 		// Fort Carson West boulevard left curb.
+	AddPlayerClass(196, -201.5379, 948.1683, 15.9131, 359.9720, 15, 0, 0, 0, 0, false); 	// Fort Carson West boulevard left curb.
+	AddPlayerClass(239, 62.4694, 1205.0531, 18.8153, 89.9380, 15, 0, 0, 0, 0, false); 		// Fort Carson South boulevard right curb.
+	AddPlayerClass(89, 62.4694, 1205.0531, 18.8153, 89.9380, 15, 0, 0, 0, 0, false); 		// Fort Carson South boulevard right curb.
+	AddPlayerClass(135, -126.0831, 1242.5745, 18.6138, 183.2986, 15, 0, 0, 0, 0, false); 	// Fort Carson East boulevard right curb.
+	AddPlayerClass(197, -126.0831, 1242.5745, 18.6138, 183.2986, 15, 0, 0, 0, 0, false); 	// Fort Carson East boulevard right curb.
+
+	return 1;
+}
+
+public OnGameModeExit(){
+	// Cycle every player
+	for(new playerid, a = GetMaxPlayers(); playerid < a; playerid++){
+		if(IsPlayerConnected(playerid)){
+			// Set name back to username
+			//new client_connect_username[MAX_PLAYER_NAME + 1];
+			//GetGVarString("client_connect_username", client_connect_username, sizeof(client_connect_username), playerid);
+			//SetPlayerName(playerid, client_connect_username);	// Change name in-game back to username, for login after restart  PROBLEM: Crashses the server on GMX.
+
+			deleteAllGVars(playerid);   // Delete GVars as per https://forum.sa-mp.com/showthread.php?t=151076
+			// TODO think of somthing for the usernames, kickign every player, or accapting character names as usersnames.
+        }
+	}
+
+    logger(LOGLEVEL_NOTICE, "* Global game-mode termination.");	// Log event
+	sql_wait(sqlHandle);	// Wait for queries to finish.
+	sql_disconnect(sqlHandle);	// Disconnect from database.
+	DiscordEcho("* Global game-mode termination.", ECHO_CHANNEL);	// Notify discord
+	//DiscordEcho("* Global game-mode termination.", MAIN_CHANNEL);	// Enable when stable
+	
+	return 1;
+}
+
+public OnPlayerRequestClass(playerid, classid){	// Skin selection before spawn.
+	if(scriptDebug){
+	    new message[23 + 4 + MAX_PLAYER_NAME + 1];
+		format(message, sizeof(message), "* [%i] %s Class selection.", playerid, getCharacterName(playerid));
+
+		logger(LOGLEVEL_DEBUG, message);	// Log event.
+	}
+
+	SetPlayerPos(playerid, -185.5514, 944.2042, 15.9337);	// In front of Fort Carson city limits sign.
+	SetPlayerFacingAngle(playerid, 182.7345);	// Charater looks toward the camera.
+	SetPlayerCameraPos(playerid, -185.5514, 939.0957, 15.6594);	// Further in front of the Fort Carson city limits sign.
+	SetPlayerCameraLookAt(playerid, -185.5514, 944.2042, 15.9337);	// In front of Fort Carson city limits sign.
+
+	return 1;   // Must return one, or skin selection breaks
+}
+
+public OnPlayerConnect(playerid){
+	SetPlayerColor(playerid, COLOR_BLACK);
+	
+	// Create & populate variables
+	new playername[MAX_PLAYER_NAME + 1], playerip[MAX_SQL_IP + 1];
+	playername = getPlayerName(playerid);
+	GetPlayerIp(playerid, playerip, sizeof(playerip));
+
+	// Global connection notification
+	new admin_message[23 + MAX_PLAYER_NAME + MAX_SQL_IP + 1];
+	format(admin_message, sizeof(admin_message), "* [%d] %s (IP: %s) connected.", playerid, getCharacterName(playerid), playerip);
+	logger(LOGLEVEL_INFO, admin_message);	// Log event
+    sendToAdmins(COLOR_NOTICE, admin_message);	// Notify all admins.
+	DiscordEcho(admin_message, ADMIN_ECHO_CHANNEL);	// Notify Discord admin echo.
+
+	// Create IP record or update connection attempts
+	new ip_query[109 + MAX_SQL_IP + 1];
+	format(ip_query, sizeof(ip_query), "INSERT INTO ip(address) VALUES('%s') ON CONFLICT (address) DO UPDATE SET connections = ip.connections+1", playerip);
+	sql_query(sqlHandle, ip_query);
+	
+	// Check if IP is banned
+	new ip_id = getIPID(playerid);
+	
+	new ban_query[75 + MAX_SQL_INTEGER + 1];
+	format(ban_query, sizeof(ban_query), "SELECT id, reason FROM ip_ban WHERE ip_id = %i AND expires > NOW()::timestamp", ip_id);
+	new Result:ban_result = sql_query(sqlHandle, ban_query);
+	if(sql_num_rows(ban_result) > 0){  // Banned
+	    new kick_message[8 + MAX_SQL_REASON + 1];
+	    format(kick_message, sizeof(kick_message), "Banned: %s", sql_get_field_assoc_int(ban_result, "reason"));
+	    kickPlayer(playerid, -1, kick_message, 1);
+	}
+
+    // Get user record
+	new escaped_username[MAX_PLAYER_NAME + 1], user_query[47 + MAX_PLAYER_NAME + 1];    // Should be longer to allow for escaped characters
+	sql_escape_string(sqlHandle, playername, escaped_username, sizeof(escaped_username));	// Escape player name
+	format(user_query, sizeof(user_query), "SELECT id FROM \"user\" WHERE name = '%s'", escaped_username);
+	//new Result:result = sqlQuery(sqlHandle, user_query);  // Middleware broken.
+	new Result:result = sql_query(sqlHandle, user_query);
+	
+	SetGVarString("client_connect_username", playername, playerid); // Used by register, DIALOG_LOGIN, getUserID & OnGameModeExit
+	
+	if(sql_num_rows(result) == 0){  // Unkown user
+		SetGVarInt("userlevel", UNREGISTERED_PLAYER, playerid);	// Set userlevel unregistered
+		changeName(playerid, playername);	// Check, force and set role-play name
+	}
+	else{   // Known user
+		ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Sign in", "Enter your password to log on", "Log in", "Cancel");	// Show password confirmation dialog
+	}
+
+	//return 1;
+}
+
+public OnPlayerDisconnect(playerid, reason){
+    if(GetPlayerState(playerid) != PLAYER_STATE_NONE){  // Only save character if spawned
+		savePlayerState(playerid);  // Save character
+	}
+	deleteAllGVars(playerid);   // Delete GVars as per https://forum.sa-mp.com/showthread.php?t=151076
+	
+	new playername[MAX_PLAYER_NAME + 1], message[40 + 4 + MAX_PLAYER_NAME + 1];
+	playername = getPlayerName(playerid);
+    switch(reason){
+		case 0: format(message, sizeof(message), "* [%i] %s disconnected. (Lost Connection)", playerid, getCharacterName(playerid));
+		case 1: format(message, sizeof(message), "* [%i] %s disconnected. (Leaving)", playerid, getCharacterName(playerid));
+		case 2: format(message, sizeof(message), "* [%i] %s disconnected. (Kicked)", playerid, getCharacterName(playerid)); // Leave this in place for RCON kicks.
+	}
+
+ 	logger(LOGLEVEL_INFO, message);	// Log event
+	SendClientMessageToAll(COLOR_NOTICE, message);	// Notify all players.
+	DiscordEcho(message, ECHO_CHANNEL);	// Notify discord.
+	
+	return 1;
+}
+
+public OnPlayerSpawn(playerid){
+	if(scriptDebug){	// Log event in case of debugging.
+		new message[MAX_PLAYER_NAME + 14 + 1];
+		format(message, sizeof(message), "* [%i] %s spawned.", playerid, getCharacterName(playerid));
+
+		logger(LOGLEVEL_DEBUG, message);	// Log event.
+	}
+
+	if(GetGVarInt("userlevel", playerid) == UNREGISTERED_PLAYER){	// Unregistered player.
+		SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "SERVER: To reserve your name, save your character, statistics and money, type: /register");
+	}
+
+	return 1;
+}
+
+public OnPlayerDeath(playerid, killerid, reason){
+	new message[15 + MAX_PLAYER_NAME + 1];
+	format(message, sizeof(message), "* [%d] %s died.", playerid, getCharacterName(playerid));	// TODO Add killerid & reason.
+
+	logger(LOGLEVEL_DEBUG, message);	// Log event
+	DiscordEcho(message, ADMIN_ECHO_CHANNEL);	// Notify Discord admin echo.
+	
+	//ResetPlayerMoney(playerid);   TODO test if required
+	//SpawnPlayer(playerid);
+
+	return 1;
+}
+
+public OnVehicleSpawn(vehicleid)	// TODO for 0.0a
+{
+	return 1;
+}
+
+public OnVehicleDeath(vehicleid, killerid)	// TODO for 0.0a
+{
+	return 1;
+}
+
+public OnPlayerText(playerid, text[]){
+	new shortcut_message[128 + 1];
+	strfromliteral(shortcut_message, text);
+	strdel(shortcut_message, 0, 1); // Remove chat character from text
+	switch(strgetfirstc(text)){
+		case '`': {
+		    if(GetGVarInt("chatmode", playerid) == CHAT_LOCAL){
+		        sendToChat(playerid, CHAT_GLOBAL, shortcut_message, 0, DCC_INVALID_USER);
+			}
+			else if (GetGVarInt("chatmode", playerid) == CHAT_GLOBAL){
+				sendToChat(playerid, CHAT_LOCAL, shortcut_message, 0, DCC_INVALID_USER);
+			}
+			else{
+			    sendToChat(playerid, CHAT_GLOBAL, shortcut_message, 0, DCC_INVALID_USER);
+			}
+		}
+		case '~': {sendToChat(playerid, CHAT_GANG, shortcut_message, 0, DCC_INVALID_USER);}
+		case '!': {sendToChat(playerid, CHAT_FACTION, shortcut_message, 0, DCC_INVALID_USER);}
+		case '@': {sendToChat(playerid, CHAT_CREW, shortcut_message, 0, DCC_INVALID_USER);}
+		case '#': {sendToChat(playerid, CHAT_ADMIN, shortcut_message, 0, DCC_INVALID_USER);}
+		case '$': {sendToChat(playerid, CHAT_GANG_OC, shortcut_message, 0, DCC_INVALID_USER);}
+		case '%': {sendToChat(playerid, CHAT_FACTION_OC, shortcut_message, 0, DCC_INVALID_USER);}
+		case '^': {sendToChat(playerid, CHAT_MANAGEMENT, shortcut_message, 0, DCC_INVALID_USER);}
+		//case '$': {sendToChat(playerid, CHAT_MANAGEMENT, shortcut_message[]);}
+		case '&': {sendToChat(playerid, CHAT_VIP, shortcut_message, 0, DCC_INVALID_USER);}
+		case '*': {sendToChat(playerid, CHAT_UNDERCOVER, shortcut_message, 0, DCC_INVALID_USER);}
+		case '+': {sendToChat(playerid, CHAT_CALL, shortcut_message, 0, DCC_INVALID_USER);}
+		case '-': {sendToChat(playerid, CHAT_SMS, shortcut_message, 0, DCC_INVALID_USER);}
+		case '=': {sendToChat(playerid, CHAT_RADIO, shortcut_message, 0, DCC_INVALID_USER);}
+		case '>': {
+		    new recipient_id, message[128 + 1];
+    		if (sscanf(shortcut_message, "u s", recipient_id, message)){
+				SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Usage: > <playerid> <message>");
+			}
+			else{
+				sendPM(playerid, message, recipient_id);
+			}
+		}
+		default:{
+			new	chatmode = GetGVarInt("chatmode", playerid), message[128 + 1];
+			strmid(message, text, 0, 128);
+//			message = text;
+			if(!chatmode){  // Default is local chat
+				sendToChat(playerid, CHAT_LOCAL, message, 0, DCC_INVALID_USER);
+			}
+			else{   // Send to preferred chat
+			    printf("chatmode: %i", chatmode);
+			    sendToChat(playerid, chatmode, message, 0, DCC_INVALID_USER);
+			}
+		}
+ 	}
+
+	return 0;   // Return 1 for default behavior, return 0 to disable default output.
+}
+
+public OnPlayerCommandText(playerid, cmdtext[]){
+	if(scriptDebug){	// Log event in case of debugging.
+		new message[5 + 4 + MAX_PLAYER_NAME + 128 + 1]; // 128 = samp text input limit.
+		format(message, sizeof(message), "[%d] %s: %s", playerid, getCharacterName(playerid), cmdtext);
+
+		logger(LOGLEVEL_COMMAND, message);	// Log event
+	}
+
+	return 0;
+}
+
+public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)	// TODO for 0.0a
+{
+	return 1;
+}
+
+public OnPlayerExitVehicle(playerid, vehicleid)	// TODO for 0.0a
+{
+	return 1;
+}
+
+public OnPlayerStateChange(playerid, newstate, oldstate) // TODO for 0.0a
+{
+	return 1;
+}
+
+public OnPlayerEnterCheckpoint(playerid)	// TODO for 0.0a
+{
+	return 1;
+}
+
+public OnPlayerLeaveCheckpoint(playerid)	// TODO for 0.0a
+{
+	return 1;
+}
+
+public OnPlayerEnterRaceCheckpoint(playerid)	// TODO for 0.0a
+{
+	return 1;
+}
+
+public OnPlayerLeaveRaceCheckpoint(playerid)	// TODO for 0.0a
+{
+	return 1;
+}
+
+public OnRconCommand(cmd[]){    // The website and some cronjobs do RCON commands. TODO create filter not to show some commands to preven spam
+	new message[8 + 128 + 1];	// Max samp message legnth = 128.
+	format(message, sizeof(message), "* RCON: %s", cmd);
+
+	logger(LOGLEVEL_NOTICE, message);	// Log event
+	DiscordEcho(message, MANAGEMENT_CHANNEL);
+
+	return 1;
+}
+
+public OnPlayerRequestSpawn(playerid){  // After picking a skin in class selection.
+    SetPlayerColor(playerid, COLOR_WHITE);
+    
+	new playername[MAX_PLAYER_NAME + 1], message[14 + MAX_PLAYER_NAME + 1];
+	playername = getPlayerName(playerid);
+
+	if(scriptDebug){	// Only log spawns when debuggins script.
+		format(message, sizeof(message), "* [%d] %s Chose a character.", playerid, getCharacterName(playerid));
+		logger(LOGLEVEL_DEBUG, message);	// Log event
+	}
+
+	if(GetGVarInt("userlevel", playerid) > UNREGISTERED_PLAYER){    // Registered player
+	    createCharacterRecord(playerid, getUserID(playerid));	// Save character
+	    
+	    new client_connect_username[MAX_PLAYER_NAME + 1], admin_message[25 + 4 + MAX_PLAYER_NAME + MAX_PLAYER_NAME + 1];
+	    GetGVarString("client_connect_username", client_connect_username, sizeof(client_connect_username), playerid);   // Get client connect name
+	    format(admin_message, sizeof(admin_message), "[%i] %s has been created by %s.", playerid, getCharacterName(playerid), client_connect_username);
+	    DiscordEcho(admin_message, ADMIN_ECHO_CHANNEL);
+	}
+
+	return 1;
+}
+
+public OnObjectMoved(objectid)	// TODO for 0.0a
+{
+	return 1;
+}
+
+public OnPlayerObjectMoved(playerid, objectid)	// TODO for 0.0a
+{
+	return 1;
+}
+
+//public OnPlayerPickUpPickup(playerid, pickupid){} // Replaced byOnPlayerPickUpDynamicPickup() streamer.inc
+
+public OnPlayerPickUpDynamicPickup(playerid, pickupid){ // Requires streamer
+
+	new type = GetGVarInt("pickup_type", pickupid);
+	// Special pickup types first, rugular in the else{} conditional statement
+	if(type == PICKUP_PORTAL){
+   		// Do nothing if the player just used a pickup
+		if(GetGVarInt("disable_pickups", playerid)){
+            return 0;
+		}
+
+		new Float:x = GetGVarFloat("pickup_x", pickupid);
+		new Float:y = GetGVarFloat("pickup_y", pickupid);
+		new Float:z = GetGVarFloat("pickup_z", pickupid);
+		new world = GetGVarInt("pickup_world", pickupid);
+		new interior = GetGVarInt("pickup_interior", pickupid);
+		// Don't releport when the exit is not set
+		if(x == 0 && y == 0 && z == 0){
+		    return 0;
+		}
+
+		// Create dynamic area and temporarily disable pickups for player
+		new area = CreateDynamicCircle(x, y, 1.7, world, -1, playerid);
+		SetGVarInt("disable_pickups", area, playerid);
+
+		// Teleport player
+		SetPlayerPos(playerid, x, y, z);
+		if(world != -1){SetPlayerVirtualWorld(playerid, world);}
+		SetPlayerInterior(playerid, interior);
+	}
+	else{
+        // Do nothing if the player just used a pickup
+		if(GetGVarInt("disable_pickups", playerid)){
+            return 0;
+		}
+		
+		// Create dynamic area and temporarily disable pickups for player
+		new Float:x, Float:y, Float:z;
+		GetPlayerPos(playerid, x, y, z);
+		new area = CreateDynamicCircle(x, y, 1, GetPlayerVirtualWorld(playerid), -1, playerid);
+		SetGVarInt("disable_pickups", area, playerid);
+		
+		// Regular pickup types
+		switch(type){
+	        case PICKUP_FACTION_PD: {
+				switch(GetGVarInt("job", playerid)){
+				    case JOB_NONE:{ShowPlayerDialog(playerid, DIALOG_DUTY_PD, DIALOG_STYLE_MSGBOX, "Active police duty", "Go on police duty as a rookie cop?", "Yes", "No");}
+				    case JOB_POLICE:{ShowPlayerDialog(playerid, DIALOG_DUTY_PD, DIALOG_STYLE_MSGBOX, "Active police duty", "Go off police duty?", "Yes", "No");}
+				    default:{SendClientMessage(playerid, COLOR_ERROR, "SERVER: You can not use this pickup as long as you are on another job.");}
+				}
+
+			}
+			case PICKUP_FACTION_MD:{
+			    switch(GetGVarInt("job", playerid)){
+				    case JOB_NONE:{ShowPlayerDialog(playerid, DIALOG_DUTY_MD, DIALOG_STYLE_MSGBOX, "Active medic duty", "Go on medic duty as a rookie paramedic?", "Yes", "No");}
+				    case JOB_MEDIC:{ShowPlayerDialog(playerid, DIALOG_DUTY_MD, DIALOG_STYLE_MSGBOX, "Active medic duty", "Go off paramedic duty?", "Yes", "No");}
+				    default:{SendClientMessage(playerid, COLOR_ERROR, "SERVER: You can not use this pickup as long as you have another job.");}
+				}
+			}
+			case PICKUP_FACTION_FD:{
+			    printf("jobid: %i", GetGVarInt("job", playerid));
+			    switch(GetGVarInt("job", playerid)){
+				    case JOB_NONE:{ShowPlayerDialog(playerid, DIALOG_DUTY_FD, DIALOG_STYLE_MSGBOX, "Active fire duty", "Go on fire duty as a rookie firefighter?", "Yes", "No");}
+				    case JOB_FIRE:{ShowPlayerDialog(playerid, DIALOG_DUTY_FD, DIALOG_STYLE_MSGBOX, "Active firefighter duty", "Go off firefighter duty?", "Yes", "No");}
+				    default:{SendClientMessage(playerid, COLOR_ERROR, "SERVER: You can not use this pickup as long as you have another job.");}
+				}
+			}
+			case PICKUP_FACTION_FBI:{
+			    switch(GetGVarInt("job", playerid)){
+				    case JOB_NONE:{ShowPlayerDialog(playerid, DIALOG_DUTY_FBI, DIALOG_STYLE_MSGBOX, "Active FBI duty", "Go on FBI duty as a rookie agent?", "Yes", "No");}
+				    case JOB_FBI:{ShowPlayerDialog(playerid, DIALOG_DUTY_FBI, DIALOG_STYLE_MSGBOX, "Active medic duty", "Go off FBI duty?", "Yes", "No");}
+				    default:{SendClientMessage(playerid, COLOR_ERROR, "SERVER: You can not use this pickup as long as you have another job.");}
+				}
+			}
+			case PICKUP_FACTION_DMV:{
+			    switch(GetGVarInt("job", playerid)){
+				    case JOB_NONE:{ShowPlayerDialog(playerid, DIALOG_DUTY_DMV, DIALOG_STYLE_MSGBOX, "Active DMV duty", "Go on DMV duty as a rookie service officer?", "Yes", "No");}
+				    case JOB_DMV:{ShowPlayerDialog(playerid, DIALOG_DUTY_DMV, DIALOG_STYLE_MSGBOX, "Active DMV duty", "Go off DMV duty?", "Yes", "No");}
+				    default:{SendClientMessage(playerid, COLOR_ERROR, "SERVER: You can not use this pickup as long as you have another job.");}
+				}
+			}
+			case PICKUP_FACTION_NEWS:{
+			    switch(GetGVarInt("job", playerid)){
+				    case JOB_NONE:{ShowPlayerDialog(playerid, DIALOG_DUTY_NEWS, DIALOG_STYLE_MSGBOX, "Active broadcasting duty", "Go on network duty as a rookie reporter?", "Yes", "No");}
+				    case JOB_NEWS:{ShowPlayerDialog(playerid, DIALOG_DUTY_NEWS, DIALOG_STYLE_MSGBOX, "Active broadcasting duty", "Go off network duty?", "Yes", "No");}
+				    default:{SendClientMessage(playerid, COLOR_ERROR, "SERVER: You can not use this pickup as long as you have another job.");}
+				}
+			}
+		}
+	
+	}
+
+	return 1;
+}
+
+public OnPlayerLeaveDynamicArea(playerid, areaid){  // Requires streamer
+	// Reactivate pickup after player leaves it
+	new area = GetGVarInt("disable_pickups", playerid);
+	if(area == 0 && areaid != 0){   // Stop if player had not had this area disabled (With the exception of areaid 0 as GetVarInt() returns 0 on null)
+	    return;
+	}
+	else if(area == 0){ // Player has not had picks disabled
+		return;
+	}
+	if(area == areaid){ // Player had this pickup disabled
+		DestroyDynamicArea(GetGVarInt("disable_pickups", playerid));
+		DeleteGVar("disable_pickups", playerid);
+	}
+}
+
+public OnVehicleMod(playerid, vehicleid, componentid)	// TODO for 0.0a
+{
+	return 1;
+}
+
+public OnVehiclePaintjob(playerid, vehicleid, paintjobid)	// TODO for 0.0a
+{
+	return 1;
+}
+
+public OnVehicleRespray(playerid, vehicleid, color1, color2)	// TODO for 0.0a
+{
+	return 1;
+}
+
+public OnPlayerSelectedMenuRow(playerid, row)	// TODO for 0.0a
+{
+	return 1;
+}
+
+public OnPlayerExitedMenu(playerid)	// TODO for 0.0a
+{
+	return 1;
+}
+
+public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)	// TODO for 0.0a
+{
+	return 1;
+}
+
+public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)	// TODO for 0.0a
+{
+	return 1;
+}
+
+public OnRconLoginAttempt(ip[], password[], success){
+	new message[30 + MAX_SQL_IP + 1];
+	if(success){
+		format(message, sizeof(message), "* [%s] authenticated via RCON.", ip);
+	}
+	else{
+		format(message, sizeof(message), "* [%s] invalid RCON authentication.", ip);
+	}
+
+	logger(LOGLEVEL_NOTICE, message);	// Log event
+	DiscordEcho(message, MANAGEMENT_CHANNEL);	// Notify Discord management.
+
+	return 1;
+}
+
+public OnPlayerUpdate(playerid)	// Don't use for now.
+{
+	return 1;
+}
+
+public OnPlayerStreamIn(playerid, forplayerid){
+
+	return 1;
+}
+
+public OnPlayerStreamOut(playerid, forplayerid)	// TODO for 0.0a
+{
+	return 1;
+}
+
+public OnVehicleStreamIn(vehicleid, forplayerid)	// TODO for 0.0a
+{
+	return 1;
+}
+
+public OnVehicleStreamOut(vehicleid, forplayerid)	// TODO for 0.0a
+{
+	return 1;
+}
+
+public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]){
+	switch(dialogid){
+
+		case DIALOG_CHANGENAME:{
+			if(GetGVarInt("userlevel", playerid) > UNREGISTERED_PLAYER){ // Registered player
+			    if(!response){  // User aborted
+			        return 0;   // Allow escaping dialogm without forcing to continue
+				}
+			}
+			
+			changeName(playerid, inputtext);    // Forced name check and change
+		}
+
+		case DIALOG_REGISTER:{
+			if(response){ // If they clicked 'Yes' or pressed enter
+				// Check password complexity
+				new Regex:r = Regex_New("^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[0-9!@#\\$%\\^&\\*\\(\\)\\-\\_=+[{\\]}\\\\|;:'\",<.>\\/?]).{8,}$");	// Regex password filter
+				new isSecurePassword = Regex_Check(inputtext, r); // Validate name to filter
+				Regex_Delete(r);
+				if(!isSecurePassword){   // Insecure password
+				    ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Insecure password", "Enter a secure password, containg at least:\n\n * A lowercase letter (a-z)\n * A capiral letter (A-Z)\n * A number (0-9).\n * A character that is not a letter (0-9!@#$%^&*()-_=+[{]}\\|;:'\",<.>/?).\n * 8 characters.", "Register", "Cancel");	// Show password requirements.
+				}
+				else {  // Secure password
+					// Hash password
+					new buffer[MAX_SQL_HASH + 1], hash[MAX_SQL_HASH + 1];
+					WP_Hash(buffer, sizeof(buffer), inputtext);
+					GetGVarString("hash", hash, sizeof(hash), playerid);
+
+					if(isempty(hash)){	// First password dialog
+						SetGVarString("hash", buffer, playerid);	// Save password has a GVar
+						ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Password confirmation", "Repeat your password to confirm.", "Register", "Cancel");	// Show password confirmation dialog
+					}
+					else{	// Password confirmation
+						if(!isequal(hash, buffer)){	// Password does not match confirmation
+					    	DeleteGVar("hash", playerid);
+					    
+							SendClientMessage(playerid, COLOR_RED, "ERROR: Password does not match password confirmation.");
+							ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Password", "Enter the same password twice.", "Continue", "Cancel");	// Password prompt
+						}
+						else{	// Password matches confirmation
+						 	DeleteGVar("hash", playerid);
+					 	
+							new client_connect_username[MAX_PLAYER_NAME + 1], playerIP[MAX_SQL_IP + 1], escaped_username[MAX_PLAYER_NAME + 1];
+							GetGVarString("client_connect_username", client_connect_username, sizeof(client_connect_username), playerid);
+							GetPlayerIp(playerid, playerIP, sizeof(playerIP));
+							sql_escape_string(sqlHandle, client_connect_username, escaped_username, sizeof(escaped_username));
+
+							// Create user record
+							new user_query[61 + MAX_PLAYER_NAME + MAX_SQL_HASH + 1 + MAX_SQL_IP + 1];
+							format(user_query, sizeof(user_query), "INSERT INTO \"user\"(name, password) VALUES('%s', '%s')", escaped_username, hash);
+							/*new Result:user_result = sql_query(sqlHandle, user_query);
+							//new id = sql_insert_id(user_result);   // Broken, always returns 0.
+							// sql_insert_id workaround*/
+							sql_query(sqlHandle, user_query);
+							
+							new id = getUserID(playerid);  // Get ID user user record
+							
+							SetGVarInt("userlevel", REGISTERED_PLAYER, playerid);
+
+							// Create user_ip relation table record
+							new user_ip_query[50 + MAX_SQL_INTEGER + MAX_SQL_INTEGER + 1 ];
+							format(user_ip_query, sizeof(user_ip_query), "INSERT INTO user_ip(id, id) VALUES(%i, %i)", getIPID(playerid), id);
+							sql_query(sqlHandle, user_ip_query);
+
+							createCharacterRecord(playerid, id);	// Save character
+							
+							// Inform user
+							new dialogMessage[135 + MAX_PLAYER_NAME + 1], message[31 + MAX_PLAYER_NAME + 1];
+							format(dialogMessage, sizeof(dialogMessage), "To login as any of your characters, connect as: \nRemember your username carefully, as you have to use it to connect with SA-MP client!", client_connect_username);
+							ShowPlayerDialog(playerid, DIALOG_ACCOUNT_CREATED, DIALOG_STYLE_MSGBOX, "Account created", dialogMessage, "Play", "");
+							format(message, sizeof(message), "SERVER: Remember your username, %s!", client_connect_username);
+							SendClientMessage(playerid, COLOR_WARNING, message);
+							
+							// send discord admin echo
+							new admin_message[30 + 4 + MAX_PLAYER_NAME + 1];
+							format(admin_message, sizeof(admin_message), "[%i] %s has registered an account.", playerid, client_connect_username);
+							DiscordEcho(admin_message, ADMIN_ECHO_CHANNEL);
+						}
+					}
+				}
+			}
+			else{ // Pressed ESC or clicked cancel
+				DeleteGVar("hash", playerid);
+			}
+		}
+		case DIALOG_LOGIN:{
+			if(response){ // If they clicked 'Yes' or pressed enter
+				// Escape username
+				new client_connect_username[MAX_PLAYER_NAME + 1], escaped_username[MAX_PLAYER_NAME + 1];
+				GetGVarString("client_connect_username", client_connect_username, sizeof(client_connect_username), playerid);
+				sql_escape_string(sqlHandle, client_connect_username, escaped_username, sizeof(escaped_username));
+
+				// Get account
+				new user_query[82 + MAX_PLAYER_NAME + 1], hash[MAX_SQL_HASH + 1];
+				format(user_query, sizeof(user_query), "SELECT id, password, level FROM \"user\" WHERE name = '%s'", escaped_username);
+				new Result:user_result = sql_query(sqlHandle, user_query);
+				sql_get_field_assoc_ex(user_result, 0, "password", hash, sizeof(hash));
+
+				// Compare hashes
+				new buffer[MAX_SQL_HASH + 1];
+				WP_Hash(buffer, sizeof(buffer), inputtext);
+				if (!isequal(buffer, hash)){ //	Hashes don't match
+					// Brute-force protection
+						new authentication_count = GetGVarInt("authentication_count", playerid);
+						authentication_count++;
+						SetGVarInt("authentication_count", authentication_count, playerid);
+						ShowPlayerDialog(playerid, DIALOG_LOGIN_FAILED, DIALOG_STYLE_MSGBOX, "Authenticaion failed", "Invalid password.", "Wait", "");
+						switch(authentication_count){
+							case 0: SetTimerEx("authenticate", 3000, false, "i", playerid);	// Return to authentication workflow in 3 second.
+							case 1: SetTimerEx("authenticate", 5000, false, "i", playerid);	// Return to authentication workflow in 5 seconds.
+							case 2: SetTimerEx("authenticate", 7000, false, "i", playerid);	// Return to authentication workflow in 7 seconds.
+							default: ShowPlayerDialog(playerid, DIALOG_CHANGE_USERNAME, DIALOG_STYLE_INPUT, "Username", "Pick an unregistered username.", "Change", "");  // After 4 failed authentication attempts
+						}
+				}
+				else{	// Hashes match
+				    // Set userlevel    (This has to be done before banning, else the user ban record won't save)
+        			new userlevel = sql_get_field_assoc_int(user_result, "level");
+        			printf("Setting userlevel: %i", userlevel);
+					SetGVarInt("userlevel", userlevel, playerid);
+					
+					// Check bans
+					new ban_query[76 + MAX_SQL_INTEGER + 1];
+					format(ban_query, sizeof(ban_query), "SELECT user_id FROM user_ban WHERE user_id = %i AND expires > NOW()::timestamp", getUserID(playerid));
+					new Result:ban_result = sql_query(sqlHandle, ban_query);
+					if(sql_num_rows(ban_result) > 0){  // Banned
+					    new reason[121 + 1];
+						format(reason, sizeof(reason), "Logged in with banned account: %i", sql_get_field_assoc_int(ban_result, "user_id"));
+					    banPlayer(playerid, -1, reason, 10);
+					}
+					
+					// Get character names
+					characterSelection(playerid);
+				}
+			}
+			else{	// Pressed ESC or clicked cancel
+				ShowPlayerDialog(playerid, DIALOG_CHANGE_USERNAME, DIALOG_STYLE_INPUT, "Username", "Pick an unregistered username.", "Change", "");
+			}
+		}
+		case DIALOG_CHANGE_USERNAME:{
+			if(response){ // If they clicked 'Yes' or pressed enter
+				new Regex:r = Regex_New("^[0-9a-zA-Z\\[\\]\\(\\)\\$@._=]{1,}$");	// Regex name filter
+				new isValidName = Regex_Check(inputtext, r);
+				Regex_Delete(r);
+				if(isValidName){	// Valid name
+				    // Get user record
+					new escaped_username[MAX_PLAYER_NAME + 1], user_query[36 + MAX_PLAYER_NAME + 1];
+					sql_escape_string(sqlHandle, inputtext, escaped_username, sizeof(escaped_username));	// Escape player name
+					format(user_query, sizeof(user_query), "SELECT id FROM \"user\" WHERE name = '%s'", escaped_username);
+					//new Result:result = sqlQuery(sqlHandle, user_query);  // Middleware broken.
+					new Result:result = sql_query(sqlHandle, user_query);
+					
+					if(sql_num_rows(result) > 0){  // Username taken
+					    ShowPlayerDialog(playerid, DIALOG_CHANGE_USERNAME, DIALOG_STYLE_INPUT, "Username", "Pick an unregistered username.", "Change", "");
+					}
+					else{   // Username free
+					    SetGVarString("client_connect_username", inputtext, playerid); // Used by register and DIALOG_LOGIN
+					    SetPlayerName(playerid, inputtext);	// Change name in-game
+
+						return 1;   // Do nothing to let player continue class selection
+					}
+				}
+				else{	// Invalid name
+					ShowPlayerDialog(playerid, DIALOG_CHANGE_USERNAME, DIALOG_STYLE_INPUT, "Username", "Invalid name. Names may only contain numbers (0-9), letters (a-z) & (A-Z) and special characters ([]()$@._=)", "Change", "");
+				}
+			}
+			else{	// Pick another username
+			    ShowPlayerDialog(playerid, DIALOG_CHANGE_USERNAME, DIALOG_STYLE_INPUT, "Username", "Pick an unregistered username.", "Change", "");
+			}
+		}
+		case DIALOG_CHARACTERS:{    // TODO set color & skin in case of job
+			if(response){ // Spawn as character
+			    new character_array_string[MAX_CHARACTERS_PER_USER * MAX_SQL_INTEGER + 1], character_array[MAX_CHARACTERS_PER_USER + 1];
+       			GetGVarString("character_array_string", character_array_string, sizeof(character_array_string), playerid);
+       			DeleteGVar("character_array_string");
+       			
+       			strtobin(character_array, character_array_string);
+			    
+				new character_query[124 + MAX_PLAYER_NAME + 1], name[24 + 1];
+				format(character_query, sizeof(character_query), "SELECT name, skin_id, cash, armour, health, pos_x, pos_y, pos_z, rotation, world_id, interior_id FROM character WHERE id = %i", character_array[listitem]);
+				new Result:character_result = sql_query(sqlHandle, character_query);
+				sql_get_field_assoc(character_result, "name", name, sizeof(name));
+				new skin_id = sql_get_field_assoc_int(character_result, "skin_id");
+				new cash = sql_get_field_assoc_int(character_result, "cash");
+				new Float:armour = sql_get_field_assoc_int(character_result, "armour");
+				new Float:health = sql_get_field_assoc_int(character_result, "health");
+				new Float:pos_x = sql_get_field_assoc_int(character_result, "pos_x");
+				new Float:pos_y = sql_get_field_assoc_int(character_result, "pos_y");
+				new Float:pos_z = sql_get_field_assoc_int(character_result, "pos_z");
+				new Float:rotation = sql_get_field_assoc_int(character_result, "rotation");
+				new world_id = sql_get_field_assoc_int(character_result, "world_id");
+				new interior_id = sql_get_field_assoc_int(character_result, "interior_id");
+				
+				// Temporary bug workaround TODO find cause
+				if(pos_x == 0 && pos_y == 0 && pos_z == 0){ // Sometimes this happens. Due to unreliable OnPlayerDisconnect() & OnGamemodeExit(), due to character creation, or due to (forgot the other possiblity, but had a strong hunch)?
+				    pos_x = -144.0328;
+					pos_y = 1225.0564;
+					pos_z = 19.8992;
+					rotation = 175.5507;
+				}
+				SetSpawnInfo(playerid, 0, skin_id, pos_x, pos_y, pos_z, rotation, 0, 0, 0, 0, 0, 0);
+                SetGVarInt("character_id", character_array[listitem], playerid);
+                
+                SetPlayerName(playerid, name);	// Change name in-game
+                SetPlayerColor(playerid, COLOR_WHITE);
+                SpawnPlayer(playerid);
+                ResetPlayerMoney(playerid);
+                GivePlayerMoney(playerid, cash);
+                SetPlayerHealth(playerid, health);
+                SetPlayerArmour(playerid, armour);
+                SetPlayerVirtualWorld(playerid, world_id);
+				SetPlayerInterior(playerid, interior_id);
+                
+                // Notify all players
+				new message[16 + 4 + MAX_PLAYER_NAME + 1];
+				format(message, sizeof(message), "* [%i] %s joined.", playerid, getCharacterName(playerid));
+				SendClientMessageToAll(COLOR_NOTICE, message);	// Notify all players.
+				DiscordEcho(message, ECHO_CHANNEL);	// Notify discord public echo
+                
+			}
+			else{	// New character
+			    // character cap
+			    new id = getUserID(playerid);
+				new character_query[60 + MAX_SQL_INTEGER + 1];
+				format(character_query, sizeof(character_query), "SELECT id FROM character WHERE character_id = %i", id);
+				new Result:character_result = sql_query(sqlHandle, character_query);
+				printf("%i", sql_num_rows(character_result));
+				if(sql_num_rows(character_result) >= MAX_CHARACTERS_PER_USER){  // At or over character limit
+				    SendClientMessage(playerid, COLOR_WARNING, "SERVER: Maximum characters reached, can not create another.");
+				    characterSelection(playerid);
+				}
+			    else{
+			        ShowPlayerDialog(playerid, DIALOG_CHANGENAME, DIALOG_STYLE_INPUT, "Character name", "Pick a name.\n\nExamples:\n Jo_Bo\n Dingle_P._J._Berry\n Jackson_DeForest_Kelley\n MaryJo_Ann_LaFluer", "Change", "");	// Force RP name.
+			        // changeName(playerid, "");	// Pick name and save character ANNOYING this forces new character creation, no way out.
+				}
+                
+			}
+		}
+        case DIALOG_LOGIN_FAILED:{
+			ShowPlayerDialog(playerid, DIALOG_LOGIN_FAILED, DIALOG_STYLE_MSGBOX, "Authenticaion failed", "Take some time to think about your password...", "Wait", "Longer");
+		}
+		case DIALOG_DELETE_CHARACTER:{
+			if(response){ // Delete character
+				new playername[MAX_PLAYER_NAME + 1];
+				playername = getPlayerName(playerid);
+				
+				// Checkcharacter amount
+				new id = getUserID(playerid), character_query[75 + MAX_SQL_INTEGER + MAX_CHARACTERS_PER_USER_DIGITS + 1];
+				format(character_query, sizeof(character_query), "SELECT id, name FROM character WHERE user_id = %i LIMIT %i", id, MAX_CHARACTERS_PER_USER);
+				new Result:character_result = sql_query(sqlHandle, character_query);
+                if(sql_num_rows(character_result) < 2){  // 1 character or less
+                    SendClientMessage(playerid, COLOR_WARNING, "SERVER: You can not have less then one character.\nCreate another character,before deleting this one.");
+                
+				}
+			    else{   // More then 1 character
+					// delete character record
+					new delete_query[50 + MAX_PLAYER_NAME + MAX_SQL_INTEGER + 1];
+					format(delete_query, sizeof(delete_query), "DELETE FROM character WHERE name = '%s' AND user_id = %i", playername, getUserID(playerid));
+					sql_query(sqlHandle, delete_query);
+			
+					// infordm admin echo
+					new client_connect_username[MAX_PLAYER_NAME + 1], message[28 + 4 + MAX_PLAYER_NAME + MAX_PLAYER_NAME + 1];
+					GetGVarString("client_connect_username", client_connect_username, sizeof(client_connect_username), playerid);   // Get client connect name
+					format(message, sizeof(message), "* [%i] %s has been deleted by it's user: %s", playerid, getCharacterName(playerid), client_connect_username);
+					DiscordEcho(message, ADMIN_ECHO_CHANNEL);
+					sendToAdmins(COLOR_COMMAND_OUTPUT, message);
+					
+					// Player must not be spawned or will be able to esacpe the character menu and continue with character without dartabase record
+					ForceClassSelection(playerid);
+					TogglePlayerSpectating(playerid, true);
+				    TogglePlayerSpectating(playerid, false);
+				    
+					characterSelection(playerid);
+				}
+			}
+		}
+		case DIALOG_GOTO:{
+		    if(response){
+				switch(listitem){
+				    case GOTO_CATEGORY_INTERIOR:{
+				        dialogGotoInterior(playerid);
+					}
+					/*case GOTO_CATEGORY_PLAYER:{
+				        dialogGotoPlayer(playerid);
+					}*/
+				}
+			}
+		}
+        case DIALOG_GOTO_INTERIOR:{
+		    if(response){
+				switch(listitem){
+				    case INTERIOR_CATEGORY_247:{
+						ShowPlayerDialog(playerid, DIALOG_GOTO_247, DIALOG_STYLE_TABLIST, "24/7's", "L-shaped\tBig\tNO EXIT\nOblong\tBig\tNO EXIT\nSquare\tMedium\tCreek, LV\nSquare\tMedium\tNO EXIT\nLong\tSmall\tMulholland\nSquare\tSmall\tWhetstone", "Goto", "Cancel");
+					}
+					case INTERIOR_CATEGORY_AVIATION:{
+						ShowPlayerDialog(playerid, DIALOG_GOTO_AVIATION, DIALOG_STYLE_TABLIST, "Aviation interiors", "Francis Intn'l Airport - Ticket sales\tStarting Cutscene\nFrancis Intn'l Airport - Baggage claim\tStarting Cutscene\nShamal cabin\tMission \"Free Fall\"\nAndromada cargo hold\tMission \"Stowaway\"\nLS Airport, Baggage Reclaim\tCutscene in \"Opening Mission\"", "Goto", "Cancel");
+					}
+					case INTERIOR_CATEGORY_AMMUNATION:{
+						ShowPlayerDialog(playerid, DIALOG_GOTO_AMMUNATION, DIALOG_STYLE_TABLIST, "Ammunation's", "Ocean Flats\tSF\nPalomino Creek\tLV\nAngel Pine\tSF\nEl Quebrados\tLV\n2 Stories/t with Booth and Range\n Booth\n Range", "Goto", "Cancel");
+					}
+					case INTERIOR_CATEGORY_BUGRLARY:{
+						ShowPlayerDialog(playerid, DIALOG_GOTO_BURGLARY, DIALOG_STYLE_TABLIST, "Burglary houses", "Large\t2 story\t3 bedroom clone of house 9\t\nMedium\t1 story\t1 bedroom\tEast LS\nSmall\t1 story\t1 bedroom\tCalton Heights, SF\nVery large\t2 story\t4 bedrooms\nSmall\t1 story\t2 bedrooms\tJefferson LS\nSmall\t1 story\t2 bedrooms\tEast LS\nSmall\t1 story\t 1 bedroom (NO BATHROOM!)", "Goto", "Cancel");
+					}
+					case INTERIOR_CATEGORY_MISSION:{
+						ShowPlayerDialog(playerid, DIALOG_GOTO_MISSION, DIALOG_STYLE_TABLIST, "Mission interiors", "Atrium\tMission \"Just Business\"\tLS\nBig Smoke's Crack Palace\tMission \"End of the Line\"\nJefferson Motel\tMission \"Reuniting the Families\"\tLS\nPleasure Domes/Jizzy's\tMission \"Ice Cold Killa\"\tSF\nRC Battlefield\tMission \"New Model Army\"\nWoozies Apartment/Wu-Zi Mu's\t\tSF\n", "Goto", "Cancel");
+					}
+					case INTERIOR_CATEGORY_MISSIONEXT:{
+					    ShowPlayerDialog(playerid, DIALOG_GOTO_MISSIONEXT, DIALOG_STYLE_TABLIST, "Mission exteriors", "Dillimore Gas Station\tMission \"Tanker Commander\"\nLiberty City\tMission \"Saint Marks Bistro\"\nSan Fierro Garage\tDoherty (Locked Camera Position}", "Goto", "Cancel");
+					}
+					case INTERIOR_CATEGORY_MISSIONHOUSE:{
+                        ShowPlayerDialog(playerid, DIALOG_GOTO_MISSIONHOUSE, DIALOG_STYLE_TABLIST, "Mission houses", "Burning Desire house\t\tEast LS\nColonel Furhberger's\tMission \"Home Invasion\"\t Los Flores, LS\nRyder's house\nSweet's house\tCutscene in \"First Date\"\nCrack Den\tMission \"Cleaning The Hood\"", "Goto", "Cancel");
+					}
+					case INTERIOR_CATEGORY_MODSHOP:{
+						ShowPlayerDialog(playerid, DIALOG_GOTO_MODDING, DIALOG_STYLE_TABLIST, "Modding shops", "Loco Low Co\tLos Santos\nWheel Arch Angels\tSan Fierro\nTransfender", "Goto", "Cancel");
+					}
+					case INTERIOR_CATEGORY_POLICE:{
+						ShowPlayerDialog(playerid, DIALOG_GOTO_POLICE, DIALOG_STYLE_LIST, "Police departments", "Las Venturas\nLos Santos\nSan Fierro\nBarbara's love nest", "Goto", "Cancel");
+					}
+					case INTERIOR_CATEGORY_HOUSES:{
+						ShowPlayerDialog(playerid, DIALOG_GOTO_HOUSE, DIALOG_STYLE_TABLIST, "Safe houses", "Golden Bed motel room\t\t\nHashbury house\tHashburry\tSF\nThe Johnson house\tGanton\tLS\nMadd Doggs mansion\tMulholland\tLS\nRed Bed motel Room\nVerdant Bluffs safehouse\tVerdant Bluffs\t LV\nUnused safehouse\tLarge modern safehouse", "Goto", "Cancel");
+					}
+					case INTERIOR_CATEGORY_SHOPS:{
+						ShowPlayerDialog(playerid, DIALOG_GOTO_SHOP, DIALOG_STYLE_TABLIST, "Shops & casino's", "Tattoos\tIdlewood\tLS\nBurger Shot\tWhitewood Estates\nWell Stacked Pizza\tBlueberry\nCluckin' Bell\nCaligulas casino\tThe Strip\tLV\nCasino (Redsands West)\tThe Strip\tLV\n4 Dragons casino\tThe Strip\tLV\nRusty Brown's donuts\tMission \"Burning Desire\"\nZero's RC shop\tGarcia\tSF\nThe Welcome Pump", "Goto", "Cancel");
+					}
+					case INTERIOR_CATEGORY_STADIA:{
+					    ShowPlayerDialog(playerid, DIALOG_GOTO_STADIA, DIALOG_STYLE_TABLIST, "Stadia", "Bloodbowl stadium\nKickstart stadium\n8 Track stadium\nDirtbike stadium\n", "Goto", "Cancel");
+					}
+				}
+        	}
+			else{
+			    ShowPlayerDialog(playerid, DIALOG_GOTO, DIALOG_STYLE_LIST, "Categories", "Interiors", "Select", "Cancel");
+			}
+		}
+		case DIALOG_GOTO_247:{
+		    if(response){
+		        new Float:x, Float:y, Float:z, world, interior, Float:angle, name[25 + 1];
+				switch(listitem){
+					case INTERIOR_247_LSHAPED:{
+						x = -25.7220;
+						y = -187.8216;
+						z = 1003.5469;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 17;
+						angle = 5.0760;
+						name = "L-shaped ammunation";
+					}
+					case INTERIOR_247_OBLONG:{
+						x = 6.0856;
+						y = -28.8966;
+						z = 1003.5494;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 10;
+						angle = 5.0365;
+	                    name = "Oblong ammunation";
+					}
+					case INTERIOR_247_MEDIUM:{
+						x = -30.9875;
+						y = -89.6806;
+						z = 1003.5469;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 18;
+						angle = 359.8401;
+	                    name = "Medium ammunation";
+					}
+					case INTERIOR_247_MEDIUM_NOEXIT:{
+						x = -26.1856;
+						y = -140.9164;
+						z = 1003.5469;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 16;
+						angle = 2.9087;
+					    name = "Medium no exit ammunation";
+					}
+					case INTERIOR_247_LONG:{
+						x = -27.844;
+						y = 26.6737;
+						z = 1003.5573;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 4;
+						angle = 184.3118;
+					    name = "Small long ammunation";
+					}
+					case INTERIOR_247_SQAURE:{
+						x = -26.8339,
+						y = -55.5846,
+						z = 1003.5469,
+						world = GetPlayerVirtualWorld(playerid),
+						interior = 6,
+						angle = 3.9528;
+						name = "Small square ammunation";
+					}
+				}
+				new target_player = GetGVarInt("goto_target", playerid);
+				DeleteGVar("goto_target", playerid);
+				teleportPlayer(target_player, x, y, z, world, interior, angle, name);
+			}
+			else{dialogGotoInterior(playerid);}
+		}
+		case DIALOG_GOTO_AVIATION:{
+		    if(response){
+		        new Float:x, Float:y, Float:z, world, interior, Float:angle, name[39 + 1];
+				switch(listitem){
+					case INTERIOR_AVIATION_TICKET:{
+						x = -1827.147338;
+						y = 7.207418;
+						z = 1061.143554;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 14;
+						angle = 335.3199;
+						name = "Francis Intn'l Airport - Ticket sales";
+					}
+					case INTERIOR_AVIATION_BAGGAGE:{
+						x = -1855.568725;
+						y = 41.263156;
+						z = 1061.143554;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 14;
+						angle = 335.3199;
+	                    name = "Francis Intn'l Airport - Baggage claim";
+					}
+					case INTERIOR_AVIATION_SHAMAL:{
+						x = 2.384830;
+						y = 33.103397;
+						z = 1199.849976 ;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 1;
+						angle = 359.8401;
+	                    name = "Shamal cabin";
+					}
+					case INTERIOR_AVIATION_ANDROMADA:{
+						x = 315.856170;
+						y = 1024.496459;
+						z = 1949.797363;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 9;
+						angle = 359.6368;
+					    name = "Andromada cargo hold";
+					}
+					case INTERIOR_AVIATION_LSAIRPORT:{
+						x = -1870.80;
+						y = 59.81;
+						z = 1056.25;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 14;
+						angle = 85.8541;
+						name = "LS Airport, Baggage Reclaim";
+					}
+				}
+
+				new target_player = GetGVarInt("goto_target", playerid);
+				DeleteGVar("goto_target", playerid);
+				teleportPlayer(target_player, x, y, z, world, interior, angle, name);
+			}
+			else{dialogGotoInterior(playerid);}
+		}
+		case DIALOG_GOTO_AMMUNATION:{   // TODO there are more ammunations that deserve a booth and range teleport
+		    if(response){
+		        new Float:x, Float:y, Float:z, world, interior, Float:angle, name[31 + 1];
+				switch(listitem){
+					case INTERIOR_AMMU_OCEAN:{
+						x = 286.148987;
+						y = -40.644398 ;
+						z = 1001.569946;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 1;
+						angle = 0.7529;
+						name = "Ocean Flats, SF";
+					}
+					case INTERIOR_AMMU_PALOMINO:{
+						x = 286.800995;
+						y = -82.547600;
+						z = 1001.539978;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 4;
+						angle = 290.2195;
+	                    name = "Palomino Creek, LV";
+					}
+					case INTERIOR_AMMU_ANGEL:{
+						x = 296.919983;
+						y = -108.071999;
+						z = 1001.569946;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 6;
+						angle = 290.2195;
+	                    name = "Angel Pine, SF";
+					}
+					case INTERIOR_AMMU_QUEBRADOS:{
+						x = 316.524994;
+						y = -167.706985;
+						z = 999.661987;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 6;
+						angle = 10.3031;
+	                    name = "El Quebrados, LV";
+					}
+					case INTERIOR_AMMU_2STORIES:{
+						x = 314.820984;
+						y = -141.431992;
+						z = 999.661987;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 7;
+						angle = 20.2254;
+	                    name = "2 Stories, with booth and range";
+					}
+					case INTERIOR_AMMU_BOOTH:{
+						x = 302.292877;
+						y = -143.139099;
+						z = 1004.062500;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 7;
+						angle = 20.2254;
+	                    name = "Booth";
+					}
+					case INTERIOR_AMMU_RANGE:{
+						x = 280.795104;
+						y = -135.203353;
+						z = 1004.062500;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 7;
+						angle = 20.2254;
+	                    name = "Range";
+					}
+				}
+
+				new target_player = GetGVarInt("goto_target", playerid);
+				DeleteGVar("goto_target", playerid);
+				teleportPlayer(target_player, x, y, z, world, interior, angle, name);
+			}
+			else{dialogGotoInterior(playerid);}
+		}
+        case DIALOG_GOTO_BURGLARY:{
+			if(response){
+		        new Float:x, Float:y, Float:z, world, interior, Float:angle, name[45 + 1];
+				switch(listitem){
+					case INTERIOR_BURGRLARY_LARGE:{
+						x = 235.508994;
+						y = 1189.169897;
+						z = 1080.339966;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 3;
+						angle = 349.4844;
+						name = "Large: 2 story, 3 bedroom clone of house 9";
+					}
+					case INTERIOR_BURGRLARY_MEDIUM:{
+						x = 225.756989;
+						y = 1240.000000;
+						z = 1082.149902;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 2;
+						angle = 96.2852;
+						name = "Medium: 1 story, 1 bedroom";
+					}
+					case INTERIOR_BURGRLARY_SMALL:{
+						x = 223.043991;
+						y = 1289.259888;
+						z = 1082.199951;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 1;
+						angle = 359.868;
+						name = "Small: 1 story, 1 bedroom";
+					}
+                    case INTERIOR_BURGRLARY_VERYLARGE:{
+						x = 225.630997;
+						y = 1022.479980;
+						z = 1084.069946;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 7;
+						angle = 270.2654;
+						name = "VERY Large: 2 story, 4 bedrooms";
+					}
+					case INTERIOR_BURGRLARY_5:{
+						x = 295.138977;
+						y = 1474.469971;
+						z = 1080.519897;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 15;
+						angle = 0;
+						name = "Small: 1 story, 2 bedrooms";
+					}
+					case INTERIOR_BURGRLARY_6:{
+						x = 328.493988;
+						y = 1480.589966;
+						z = 1084.449951;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 15;
+						angle = 0;
+						name = "Small: 1 story, 2 bedrooms";
+					}
+					case INTERIOR_BURGRLARY_NOBATH:{
+						x = 385.803986;
+						y = 1471.769897;
+						z = 1080.209961;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 15;
+						angle = 0;
+						name = "Small: 1 story, 1 bedroom (NO BATHROOM!)";
+					}
+				}
+
+				new target_player = GetGVarInt("goto_target", playerid);
+				DeleteGVar("goto_target", playerid);
+				teleportPlayer(target_player, x, y, z, world, interior, angle, name);
+			}
+			else{dialogGotoInterior(playerid);}
+		}
+		case DIALOG_GOTO_MISSION:{
+			if(response){
+		        new Float:x, Float:y, Float:z, world, interior, Float:angle, name[30 + 1];
+				switch(listitem){
+					case INTERIOR_MISSION_ATRIUM:{
+						x = 1726.18;
+						y = -1641.00;
+						z = 20.23;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 18;
+						angle = 172.4193;
+						name = "Atrium";
+					}
+					case INTERIOR_MISSION_BIGSMOKE:{
+						x = 2567.52;
+						y = -1294.59;
+						z = 1063.25 ;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 2;
+						angle = 254.9548;
+						name = "Big Smoke's Crack Palace";
+					}
+					case INTERIOR_MISSION_JEFFERSON:{
+						x = 2220.26;
+						y = -1148.01;
+						z = 1025.80;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 15;
+						angle = 273.7328;
+						name = "Jefferson Motel";
+					}
+					case INTERIOR_MISSION_JIZZY:{
+						x = -2637.69;
+						y = 1404.24;
+						z = 906.46;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 3;
+						angle = 94.6794;
+						name = "Pleasure Domes/Jizzy's";
+					}
+					case INTERIOR_MISSION_RC:{
+						x = -1079.99;
+						y = 1061.58;
+						z = 1343.04;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 10;
+						angle = 274.5268;
+						name = "RC Battlefield";
+					}
+					case INTERIOR_MISSION_WUZI:{
+						x = -2158.72;
+						y = 641.29;
+						z = 1052.38;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 1;
+						angle = 86.5402;
+						name = "Woozies Apartment/Wu-Zi Mu's";
+					}
+				}
+
+				new target_player = GetGVarInt("goto_target", playerid);
+				DeleteGVar("goto_target", playerid);
+				teleportPlayer(target_player, x, y, z, world, interior, angle, name);
+			}
+			else{dialogGotoInterior(playerid);}
+		}
+		case DIALOG_GOTO_MISSIONEXT:{
+			if(response){
+		        new Float:x, Float:y, Float:z, world, interior, Float:angle, name[30 + 1];
+				switch(listitem){
+		            case INTERIOR_MISSIONEXT_GAS:{
+						x = 664.19;
+						y = -570.73;
+						z = 16.34;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 0;
+						angle = 264.9829;
+						name = "Dillimore Gas Station";
+					}
+					case INTERIOR_MISSIONEXT_LIBERTY:{ // TODO Create extra interior inside the shop
+						x = -750.80;
+						y = 491.00;
+						z = 1371.70;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 1;
+						angle = 71.7782;
+						name = "Liberty City";
+					}
+					case INTERIOR_MISSIONEXT_SFGARAGE:{    // TODO Create extra interior of area that does not capture the camera & see about the camera camera capturing (Use it for broadcast? & In other world or interior place more usable?)
+						x = -2042.42;
+						y = 178.59;
+						z = 28.84;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 1;
+						angle = 156.2153;
+						name = "San Fierro Garage Interior";
+					}
+                }
+
+				new target_player = GetGVarInt("goto_target", playerid);
+				DeleteGVar("goto_target", playerid);
+				teleportPlayer(target_player, x, y, z, world, interior, angle, name);
+			}
+			else{dialogGotoInterior(playerid);}
+		}
+		case DIALOG_GOTO_MISSIONHOUSE:{
+			if(response){
+		        new Float:x, Float:y, Float:z, world, interior, Float:angle, name[30 + 1];
+				switch(listitem){
+		            case INTERIOR_MISSIONHOUSE_DESIRE:{
+						x = 2338.32;
+						y = -1180.61;
+						z = 1027.98;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 5;
+						angle = 99.1864;
+						name = "Burning Desire House";
+					}
+					case INTERIOR_MISSIONHOUSE_COLONEL:{
+						x = 2807.63;
+						y = -1170.15;
+						z = 1025.57;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 8;
+						angle = 193.7117;
+						name = "Colonel Furhberger's";
+					}
+					case INTERIOR_MISSIONHOUSE_RYDER:{
+						x = 2451.77;
+						y = -1699.80;
+						z = 1013.51;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 2;
+						angle = 314.5253;
+						name = "Ryder's House";
+					}
+					case INTERIOR_MISSIONHOUSE_SWEET:{
+						x = 2535.83;
+						y = -1674.32;
+						z = 1015.50;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 1;
+						angle = 260.9709;
+						name = "Sweet's House";
+					}
+					case INTERIOR_MISSIONHOUSE_CRACK:{
+						x = 318.565;
+						y = 1115.210;
+						z = 1082.98;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 5;
+						angle = 267.459;
+						name = "Crack den";
+					}
+				}
+
+                new target_player = GetGVarInt("goto_target", playerid);
+                DeleteGVar("goto_target", playerid);
+				teleportPlayer(target_player, x, y, z, world, interior, angle, name);
+			}
+			else{dialogGotoInterior(playerid);}
+		}
+		case DIALOG_GOTO_MODDING:{
+			if(response){
+		        new Float:x, Float:y, Float:z, world, interior, Float:angle, name[25 + 1];
+				switch(listitem){
+					case INTERIOR_MOD_LOCO:{
+						x = 616.7820;
+						y = -74.8151;
+						z = 997.6350;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 2;
+						angle = 320.9263;
+						name = "Loco Low Co";
+					}
+					case INTERIOR_MOD_WHEEL:{
+						x = 615.2851;
+						y = -124.2390;
+						z = 997.6350;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 3;
+						angle = 266.5704;
+						name = "Wheel Arch Angels";
+					}
+					case INTERIOR_MOD_TRANSFENDER:{
+						x = 617.5380;
+						y = -1.9900;
+						z = 1000.6829;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 1;
+						angle = 15.6789;
+						name = "Transfender";
+					}
+				}
+				
+				new target_player = GetGVarInt("goto_target", playerid);
+				DeleteGVar("goto_target", playerid);
+				teleportPlayer(target_player, x, y, z, world, interior, angle, name);
+			}
+			else{dialogGotoInterior(playerid);}
+		}
+		case DIALOG_GOTO_POLICE:{
+			if(response){
+		        new Float:x, Float:y, Float:z, world, interior, Float:angle, name[30 + 1];
+				switch(listitem){
+					case INTERIOR_PD_LV:{
+						x = 288.4723;
+						y = 170.0647;
+						z = 1007.1794;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 3;
+						angle = 22.0477;
+						name = "Las Venturas police deparment";
+					}
+					case INTERIOR_PD_LS:{
+						x = 246.6695;
+						y = 65.8039;
+						z = 1003.6406;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 6;
+						angle = 7.9562;
+						name = "Los Santos police deparment";
+					}
+					case INTERIOR_PD_SF:{
+						x = 246.0688;
+						y = 108.9703;
+						z = 1003.2188;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 10;
+						angle = 0.2922;
+						name = "San Fierro police deparment";
+					}
+					case INTERIOR_PD_BARBARA:{
+						x = 322.5014;
+						y = 303.6906;
+						z = 999.1484;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 5;
+						angle = 8.1747;
+						name = "Barbara's Love nest";
+					}
+				}
+				
+				new target_player = GetGVarInt("goto_target", playerid);
+				DeleteGVar("goto_target", playerid);
+				teleportPlayer(target_player, x, y, z, world, interior, angle, name);
+			}
+			else{dialogGotoInterior(playerid);}
+		}
+		case DIALOG_GOTO_HOUSE:{
+			if(response){
+		        new Float:x, Float:y, Float:z, world, interior, Float:angle, name[25 + 1];
+				switch(listitem){
+					case INTERIOR_HOUSE_GOLDEN:{
+						x = 2251.85;
+						y = -1138.16;
+						z = 1050.63;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 9;
+						angle = 167.3959;
+						name = "Golden Bed motel room";
+					}
+					case INTERIOR_HOUSE_HASHBURY:{
+						x = 2260.76;
+						y = -1210.45;
+						z = 1049.02;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 10;
+						angle = 266.88;
+						name = "Hashbury house";
+					}
+					case INTERIOR_HOUSE_JOHNSON:{
+						x = 2496.65;
+						y = -1696.55;
+						z = 1014.74;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 3;
+						angle = 179.2174;
+						name = "The Johnson house";
+					}
+					case INTERIOR_HOUSE_MADDDOGG:{
+						x = 1299.14;
+						y = -794.77;
+						z = 1084.00;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 5;
+						angle = 231.3418;
+						name = "Madd Doggs mansion";
+					}
+                    case INTERIOR_HOUSE_RED:{
+						x = 2262.83;
+						y = -1137.71;
+						z = 1050.63;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 10;
+						angle = 266.88;
+						name = "Red Bed motel room";
+					}
+                    case INTERIOR_HOUSE_VERDANT:{
+						x = 2365.42;
+						y = -1131.85;
+						z = 1050.88;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 8;
+						angle = 177.3947;
+						name = "Verdant Bluffs safehouse";
+					}
+					case INTERIOR_HOUSE_UNUSED:{
+						x = 2324.33;
+						y = -1144.79;
+						z = 1050.71;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 12;
+						angle = 269.0954;
+						name = "Unused safe house";
+					}
+				}
+
+				new target_player = GetGVarInt("goto_target", playerid);
+				DeleteGVar("goto_target", playerid);
+				teleportPlayer(target_player, x, y, z, world, interior, angle, name);
+			}
+			else{dialogGotoInterior(playerid);}
+		}
+		case DIALOG_GOTO_SHOP:{
+			if(response){
+		        new Float:x, Float:y, Float:z, world, interior, Float:angle, name[25 + 1];
+				switch(listitem){
+					case INTERIOR_SHOP_TATTOO:{
+						x = -203.0764;
+						y = -24.1658;
+						z = 1002.2734;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 16;
+						angle = 252.8154;
+						name = "Tattoos";
+					}
+					case INTERIOR_SHOP_BURGER:{
+						x = 366.0248;
+						y = -73.3478;
+						z = 1001.5078;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 10;
+						angle = 292.0084;
+						name = "Burger Shot";
+					}
+                    case INTERIOR_SHOP_PIZZA:{
+						x = 372.3520;
+						y = -131.6510;
+						z = 1001.4922;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 5;
+						angle = 354.2285;
+						name = "Well Stacked Pizza";
+					}
+                    case INTERIOR_SHOP_CLUCKIN:{
+						x = 365.7158;
+						y = -9.8873;
+						z = 1001.8516;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 9;
+						angle = 160.528;
+						name = "Cluckin' Bell";
+					}
+                    case INTERIOR_SHOP_CALIGULAS:{
+						x = 2233.8032;
+						y = 1712.2303;
+						z = 1011.7632;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 1;
+						angle = 184.3891;
+						name = "Caligulas Casino";
+					}
+                    case INTERIOR_SHOP_CASINO:{
+						x = 1118.8878;
+						y = -10.2737;
+						z = 1002.0859;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 12;
+						angle = 165.8482;
+						name = "Casino (Redsands West)";
+					}
+                    case INTERIOR_SHOP_4DRAGONS:{
+						x = 2016.2699;
+						y = 1017.7790;
+						z = 996.8750;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 10;
+						angle = 88.0055;
+						name = "4 Dragons Casino";
+					}
+                    case INTERIOR_SHOP_DONUTS:{
+      					x = 376.99;
+						y = -191.21;
+						z = 1000.63;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 17;
+						angle = 141.0245;
+						name = "Rusty Brown's donuts";
+					}
+					case INTERIOR_SHOP_RC:{
+						x = -2240.00;
+						y = 131.00;
+						z = 1035.40;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 6;
+						angle = 269.0954;
+						name = "Zero's RC shop";
+					}
+					case INTERIOR_SHOP_PUMP:{
+						x = 681.66;
+						y = -453.32;
+						z = -25.61;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 1;
+						angle = 166.166;
+						name = "The Welcome Pump";
+					}
+				}
+				
+				new target_player = GetGVarInt("goto_target", playerid);
+				DeleteGVar("goto_target", playerid);
+				teleportPlayer(target_player, x, y, z, world, interior, angle, name);
+			}
+			else{dialogGotoInterior(playerid);}
+		}
+		case DIALOG_GOTO_STADIA:{
+			if(response){
+		        new Float:x, Float:y, Float:z, world, interior, Float:angle, name[25 + 1];
+				switch(listitem){
+				    case INTERIOR_STADIUM_BLOODBOWL:{
+						x = -1394.20;
+						y = 987.62;
+						z = 1023.96;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 15;
+						angle = 0.7013;
+						name = "Bloodbowl Stadium";
+					}
+					case INTERIOR_STADIUM_KICKSTART:{
+						x = -1410.72;
+						y = 1591.16;
+						z = 1052.53;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 14;
+						angle = 159.1255;
+						name = "Kickstart Stadium";
+					}
+					case INTERIOR_STADIUM_8TRACK:{
+						x = -1395.958;
+						y = -208.197;
+						z = 1051.170;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 7;
+						angle = 355.8576;
+						name = "8 Track Stadium";
+					}
+					case INTERIOR_STADIUM_DIRTBIKE:{
+						x = -1424.9319;
+						y = -664.5869;
+						z = 1059.8585;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 4;
+						angle = 170.9341;
+						name = "Dirtbike Stadium";
+					}
+				}
+
+				new target_player = GetGVarInt("goto_target", playerid);
+				DeleteGVar("goto_target", playerid);
+				teleportPlayer(target_player, x, y, z, world, interior, angle, name);
+			}
+			else{dialogGotoInterior(playerid);}
+		}
+				
+		case DIALOG_CREATE_PICKUP:{
+			if(response){
+                switch(listitem){
+                    case 0: ShowPlayerDialog(playerid, DIALOG_CREATE_FACTION_PICKUP, DIALOG_STYLE_LIST, "Faction types", "Police\nMedic\nFire fighter\nFederal Bureau of Investigation\nDepeartment of motorvehicles\nBroadcasting", "Select", "Cancel");				}
+			}
+		}
+		case DIALOG_CREATE_FACTION_PICKUP:{
+			if(response){
+			    printf("Listitem: % i", listitem);
+			    new Float:x, Float:y, Float:z;
+				GetPlayerPos(playerid, x, y, z);
+				new world = GetPlayerVirtualWorld(playerid);
+				new interior = GetPlayerInterior(playerid);
+				
+				new pickupid = createDynamicPickup(1247, x, y, z, world, interior, listitem);
+
+				// Create pickup record
+				new pickup_query[127 + MAX_SQL_FLOAT + MAX_SQL_FLOAT + MAX_SQL_FLOAT + MAX_SQL_INTEGER + MAX_SQL_INTEGER + MAX_SQL_INTEGER + MAX_SQL_INTEGER + 1];
+				format(pickup_query, sizeof(pickup_query), "INSERT INTO pickup(object_id, pos_x, pos_y, pos_z, world_id, interior_id, type_id, pickup_id) VALUES (1247, '%f', '%f', '%f', %i, %i, %i, %i)", x, y, z, world, interior, listitem, pickupid);
+				sql_query(sqlHandle, pickup_query);
+
+				// Get pickup record ID
+				new id_query[44 + 1];
+				format(id_query, sizeof(id_query), "SELECT id FROM pickup WHERE pickup_id = %i", pickupid);
+				new Result:id_result = sql_query(sqlHandle, id_query);
+				new pickup_id = sql_get_field_assoc_int(id_result, "id");
+						
+				new admin_message[21 + 4 + MAX_PLAYER_NAME + MAX_SQL_INTEGER + 1];
+				
+				// Inform admins
+				listitem++;  // To account for FACTION_NONE
+				printf("Listitem: % i", listitem);
+                switch(listitem){
+                    case FACTION_POLICE: format(admin_message, sizeof(admin_message), "* [%i] %s created police faction pickup: %i", playerid, getPlayerName(playerid), pickup_id);
+					case FACTION_MEDIC: format(admin_message, sizeof(admin_message), "* [%i] %s created medic faction pickup: %i", playerid, getPlayerName(playerid), pickup_id);
+					case FACTION_FIRE: format(admin_message, sizeof(admin_message), "* [%i] %s created firefighter faction pickup: %i", playerid, getPlayerName(playerid), pickup_id);
+					case FACTION_SHERIFF: format(admin_message, sizeof(admin_message), "* [%i] %s created shariff faction pickup: %i", playerid, getPlayerName(playerid), pickup_id);
+					case FACTION_FBI: format(admin_message, sizeof(admin_message), "* [%i] %s created FBI faction pickup: %i", playerid, getPlayerName(playerid), pickup_id);
+    				case FACTION_DMV: format(admin_message, sizeof(admin_message), "* [%i] %s created DMV faction pickup: %i", playerid, getPlayerName(playerid), pickup_id);
+    				case FACTION_NEWS: format(admin_message, sizeof(admin_message), "* [%i] %s created broadcasting faction pickup: %i", playerid, getPlayerName(playerid), pickup_id);
+					default: return 0;
+				}
+				sendToAdmins(COLOR_NOTICE, admin_message);
+				DiscordEcho(admin_message, ADMIN_ECHO_CHANNEL);
+			}
+		}
+		
+		case DIALOG_DUTY_PD:{       // TODO: Make DRY DUTY_ & _SKIN
+		    if(response){
+		        // TODO: Check if has passport
+		        switch(GetGVarInt("job", playerid)){
+				    case JOB_NONE:{
+						
+				        // TODO: Check for crimes, warrents, etc
+
+				        ShowPlayerDialog(playerid, DIALOG_POLICE_SKIN, DIALOG_STYLE_TABLIST, "Police skins", "Police Officer\tMale\tLS\nPolice Officer\tMale\tSF\nMotorbike Cop\tMale\tLS\nPolice Officer (Without gun holster)\tMale\tLS\nPolice Officer (Without gun holster)\tMale\tSF\nPolice Officer\tFemale\tLS\nPolice Officer\tFemale\tSF", "Duty", "Cancel");
+					}
+				    case JOB_POLICE:{
+						// Get skin from character record
+						new character_query[42 + MAX_SQL_INTEGER + 1];
+				        format(character_query, sizeof(character_query), "SELECT skin_id FROM character WHERE id = %i", GetGVarInt("character_id", playerid));
+				        new Result:id_result = sql_query(sqlHandle, character_query);
+				        new skin_id = sql_get_field_assoc_int(id_result, "skin_id");
+				        setPlayerSkin(playerid, skin_id);
+						SetGVarInt("job", JOB_NONE, playerid);
+				        SetPlayerColor(playerid, COLOR_WHITE);
+				        ResetPlayerWeapons(playerid);
+				        // TODO: get weaponskill fromddatabase and set it to player.
+					}
+				    default:{SendClientMessage(playerid, COLOR_ERROR, "SERVER: You can not use this pickup as long as you are on another job.");}
+				}
+			}
+		}
+		case DIALOG_POLICE_SKIN:{
+		    if(response){
+		        new skin;
+		        switch(listitem){
+					case 0:{skin = 280;}
+					case 1:{skin = 281;}
+					case 2:{skin = 284;}
+					case 3:{skin = 300;}
+					case 4:{skin = 301;}
+					case 5:{skin = 306;}
+					case 6:{skin = 307;}
+				}
+				setPlayerSkin(playerid, skin);
+				SetGVarInt("job", JOB_POLICE, playerid);
+		        SetPlayerColor(playerid, COLOR_POLICE);
+		        SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 1);
+				GivePlayerWeapon(playerid, 3, 1);   	// Baton
+				GivePlayerWeapon(playerid, 17, 10);		// Teargas
+				GivePlayerWeapon(playerid, 22, 170);    // 10 clips and a 9mm
+			}
+		}
+		case DIALOG_DUTY_MD:{
+		    if(response){
+		        // TODO: Check if has passport
+		        switch(GetGVarInt("job", playerid)){
+				    case JOB_NONE:{
+
+				        // TODO: Check for crimes, warrents, etc
+
+				        ShowPlayerDialog(playerid, DIALOG_MEDIC_SKIN, DIALOG_STYLE_TABLIST, "Paramedic skins", "Los Santos white\tMale\nLas Venturas blue\tMale\nSan Fierro green\tMale\nSan Fierro green\tFemale", "Duty", "Cancel");
+					}
+				    case JOB_MEDIC:{
+						// Get skin from character record
+						new character_query[42 + MAX_SQL_INTEGER + 1];
+				        format(character_query, sizeof(character_query), "SELECT skin_id FROM character WHERE id = %i", GetGVarInt("character_id", playerid));
+				        new Result:id_result = sql_query(sqlHandle, character_query);
+				        new skin_id = sql_get_field_assoc_int(id_result, "skin_id");
+
+				        setPlayerSkin(playerid, skin_id);
+						SetGVarInt("job", JOB_NONE, playerid);
+				        SetPlayerColor(playerid, COLOR_WHITE);
+					}
+				    default:{SendClientMessage(playerid, COLOR_ERROR, "SERVER: You can not use this pickup as long as you are on another job.");}
+				}
+			}
+		}
+		case DIALOG_MEDIC_SKIN:{
+		    if(response){
+		        new skin;
+		        switch(listitem){
+					case 0:{skin = 274;}
+					case 1:{skin = 275;}
+					case 2:{skin = 276;}
+					case 3:{skin = 308;}
+				}
+				setPlayerSkin(playerid, skin);
+				SetGVarInt("job", JOB_MEDIC, playerid);
+		        SetPlayerColor(playerid, COLOR_MEDIC);
+
+			}
+		}
+		case DIALOG_DUTY_FD:{
+		    if(response){
+		        // TODO: Check if has passport
+		        switch(GetGVarInt("job", playerid)){
+				    case JOB_NONE:{
+
+				        // TODO: Check for crimes, warrents, etc
+
+				        ShowPlayerDialog(playerid, DIALOG_FIRE_SKIN, DIALOG_STYLE_TABLIST, "Firefighter skins", "Los Santos green\tMale\nLas Venturas yellow\tMale\nSan Fierro black\tMale", "Duty", "Cancel");
+					}
+				    case JOB_FIRE:{
+						// Get skin from character record
+						new character_query[42 + MAX_SQL_INTEGER + 1];
+				        format(character_query, sizeof(character_query), "SELECT skin_id FROM character WHERE id = %i", GetGVarInt("character_id", playerid));
+				        new Result:id_result = sql_query(sqlHandle, character_query);
+				        new skin_id = sql_get_field_assoc_int(id_result, "skin_id");
+
+				        setPlayerSkin(playerid, skin_id);
+						SetGVarInt("job", JOB_NONE, playerid);
+				        SetPlayerColor(playerid, COLOR_WHITE);
+
+				        ResetPlayerWeapons(playerid);
+					}
+				    default:{SendClientMessage(playerid, COLOR_ERROR, "SERVER: You can not use this pickup as long as you are on another job.");}
+				}
+			}
+		}
+		case DIALOG_FIRE_SKIN:{
+		    if(response){
+		        new skin;
+		        switch(listitem){
+					case 0:{skin = 277;}
+					case 1:{skin = 278;}
+					case 2:{skin = 279;}
+				}
+				setPlayerSkin(playerid, skin);
+				SetGVarInt("job", JOB_FIRE, playerid);
+		        SetPlayerColor(playerid, COLOR_FIRE);
+		        GivePlayerWeapon(playerid, 42, 1);   	// Fire extinguisher
+			}
+		}
+		case DIALOG_DUTY_SD:{
+		    if(response){
+		        // TODO: Check if has passport
+		        switch(GetGVarInt("job", playerid)){
+				    case JOB_NONE:{
+
+				        // TODO: Check for crimes, warrents, etc
+
+				        ShowPlayerDialog(playerid, DIALOG_SHERIFF_SKIN, DIALOG_STYLE_TABLIST, "Sheriff skins", "Officer\tMale\tLV\nCounty sheriff\tMale\tCountryside\nDesert sheriff\tMale\tDesert\nOfficer (Without gun holster)\tMale\nOfficer\tFemale\nCounty sheriff (Without hat)\tMale\nDesert sheriff\tMale", "Duty", "Cancel");
+					}
+				    case JOB_SHERIFF:{
+						// Get skin from character record
+						new character_query[42 + MAX_SQL_INTEGER + 1];
+				        format(character_query, sizeof(character_query), "SELECT skin_id FROM character WHERE id = %i", GetGVarInt("character_id", playerid));
+				        new Result:id_result = sql_query(sqlHandle, character_query);
+				        new skin_id = sql_get_field_assoc_int(id_result, "skin_id");
+
+				        setPlayerSkin(playerid, skin_id);
+						SetGVarInt("job", JOB_NONE, playerid);
+				        SetPlayerColor(playerid, COLOR_WHITE);
+						// TODO restore weaponskill
+				        ResetPlayerWeapons(playerid);
+					}
+				    default:{SendClientMessage(playerid, COLOR_ERROR, "SERVER: You can not use this pickup as long as you are on another job.");}
+				}
+			}
+		}
+		case DIALOG_SHERIFF_SKIN:{
+		    if(response){
+		        new skin;
+		        switch(listitem){
+					case 0:{skin = 282;}
+					case 1:{skin = 283;}
+					case 2:{skin = 288;}
+					case 3:{skin = 302;}
+					case 4:{skin = 309;}
+					case 5:{skin = 310;}
+					case 6:{skin = 311;}
+				}
+				setPlayerSkin(playerid, skin);
+				SetGVarInt("job", JOB_SHERIFF, playerid);
+		        SetPlayerColor(playerid, COLOR_SHERIFF);
+		        SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 1);
+				GivePlayerWeapon(playerid, 3, 1);   	// Baton
+				GivePlayerWeapon(playerid, 17, 10);		// Teargas
+				GivePlayerWeapon(playerid, 22, 170);    // 10 clips and a 9mm
+			}
+		}
+		case DIALOG_DUTY_FBI:{
+		    if(response){
+		        // TODO: Check if has passport
+		        switch(GetGVarInt("job", playerid)){
+				    case JOB_NONE:{
+
+				        // TODO: Check for crimes, warrents, etc
+
+				        ShowPlayerDialog(playerid, DIALOG_FBI_SKIN, DIALOG_STYLE_TABLIST, "Agent skins", "Caucasian MIB agent\tMale\nAfro-American MIB agent\tMale\nSWAT special forces\tMale\nFBI agent\tMale\nAfro-American bouncer\tMale\nCaucasian Bouncer\tMale\nOriental businesswoman\tFemale\nCaucasian businesswoman\tFemale", "Duty", "Cancel");
+					}
+				    case JOB_FBI:{
+						// Get skin from character record
+						new character_query[42 + MAX_SQL_INTEGER + 1];
+				        format(character_query, sizeof(character_query), "SELECT skin_id FROM character WHERE id = %i", GetGVarInt("character_id", playerid));
+				        new Result:id_result = sql_query(sqlHandle, character_query);
+				        new skin_id = sql_get_field_assoc_int(id_result, "skin_id");
+
+				        setPlayerSkin(playerid, skin_id);
+						SetGVarInt("job", JOB_NONE, playerid);
+				        SetPlayerColor(playerid, COLOR_WHITE);
+
+				        ResetPlayerWeapons(playerid);
+					}
+				    default:{SendClientMessage(playerid, COLOR_ERROR, "SERVER: You can not use this pickup as long as you are on another job.");}
+				}
+			}
+		}
+		case DIALOG_FBI_SKIN:{
+		    if(response){
+		        new skin;
+		        switch(listitem){
+					case 0:{skin = 165;}
+					case 1:{skin = 166;}
+					case 2:{skin = 258;}
+					case 3:{skin = 286;}
+					case 4:{skin = 163;}
+					case 5:{skin = 164;}
+					case 7:{skin = 141;}
+					case 8:{skin = 150;}
+				}
+				setPlayerSkin(playerid, skin);
+				SetGVarInt("job", JOB_FBI, playerid);
+		        SetPlayerColor(playerid, COLOR_FBI);
+				GivePlayerWeapon(playerid, 23, 170);    // 10 clips and a silenced 9mm
+				
+			}
+		}
+		case DIALOG_DUTY_DMV:{
+		    if(response){
+		        // TODO: Check if has passport
+		        switch(GetGVarInt("job", playerid)){
+				    case JOB_NONE:{
+
+				        // TODO: Check for crimes, warrents, etc
+
+				        ShowPlayerDialog(playerid, DIALOG_DMV_SKIN, DIALOG_STYLE_TABLIST, "DMV skins", "Airport ground worker\tMale\nSecurity guard\tMale", "Duty", "Cancel");
+					}
+				    case JOB_DMV:{
+						// Get skin from character record
+						new character_query[42 + MAX_SQL_INTEGER + 1];
+				        format(character_query, sizeof(character_query), "SELECT skin_id FROM character WHERE id = %i", GetGVarInt("character_id", playerid));
+				        new Result:id_result = sql_query(sqlHandle, character_query);
+				        new skin_id = sql_get_field_assoc_int(id_result, "skin_id");
+
+				        setPlayerSkin(playerid, skin_id);
+						SetGVarInt("job", JOB_NONE, playerid);
+				        SetPlayerColor(playerid, COLOR_WHITE);
+				        ResetPlayerWeapons(playerid);
+
+					}
+				    default:{SendClientMessage(playerid, COLOR_ERROR, "SERVER: You can not use this pickup as long as you are on another job.");}
+				}
+			}
+		}
+		case DIALOG_DMV_SKIN:{
+		    if(response){
+		        new skin;
+		        switch(listitem){
+					case 0:{skin = 16;}
+					case 1:{skin = 71;}
+				}
+				setPlayerSkin(playerid, skin);
+				SetGVarInt("job", JOB_DMV, playerid);
+		        SetPlayerColor(playerid, COLOR_DMV);
+		        GivePlayerWeapon(playerid, 17, 10);		// Teargas
+			}
+		}
+		case DIALOG_DUTY_NEWS:{
+		    if(response){
+		        // TODO: Check if has passport
+		        switch(GetGVarInt("job", playerid)){
+				    case JOB_NONE:{
+
+				        // TODO: Check for crimes, warrents, etc
+
+				        ShowPlayerDialog(playerid, DIALOG_DMV_SKIN, DIALOG_STYLE_TABLIST, "Network skins", "Hispanic businesswoman\nCaucasian Businesswoman\nBusinessman\nRich woman", "Duty", "Cancel");
+					}
+				    case JOB_NEWS:{
+						// Get skin from character record
+						new character_query[42 + MAX_SQL_INTEGER + 1];
+				        format(character_query, sizeof(character_query), "SELECT skin_id FROM character WHERE id = %i", GetGVarInt("character_id", playerid));
+				        new Result:id_result = sql_query(sqlHandle, character_query);
+				        new skin_id = sql_get_field_assoc_int(id_result, "skin_id");
+
+				        setPlayerSkin(playerid, skin_id);
+						SetGVarInt("job", JOB_NONE, playerid);
+				        SetPlayerColor(playerid, COLOR_WHITE);
+				        ResetPlayerWeapons(playerid);
+
+					}
+				    default:{SendClientMessage(playerid, COLOR_ERROR, "SERVER: You can not use this pickup as long as you are on another job.");}
+				}
+			}
+		}
+		case DIALOG_NEWS_SKIN:{
+		    if(response){
+		        new skin;
+		        switch(listitem){
+					case 0:{skin = 148;}
+					case 1:{skin = 150;}
+					case 2:{skin = 187;}
+					case 3:{skin = 219;}
+				}
+				setPlayerSkin(playerid, skin);
+				SetGVarInt("job", JOB_NEWS, playerid);
+		        SetPlayerColor(playerid, COLOR_NEWS);
+		        GivePlayerWeapon(playerid, 43, 1);		// Camera
+			}
+		}
+	}
+	
+	return 0; // MUST return 0 here, just like OnPlayerCommandText.
+}
+
+
+public OnPlayerClickPlayer(playerid, clickedplayerid, source)	// TODO for 0.0a
+{
+	return 1;
+}
+public OnEnterExitModShop(playerid, enterexit, interiorid)	// TODO for 0.0a
+{
+	return 1;
+}
+
+public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)	// TODO for 0.0a
+{
+	return 1;
+}
+
+public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)	// TODO for 0.0a
+{
+	return 1;
+}
+
+
+// discord-connector events
+public DCC_OnMessageCreate(DCC_Message:message){
+
+	// Originating Discord channel
+	new DCC_Channel:channel;
+	DCC_GetMessageChannel(message, channel);
+
+	// Originating Discord user
+	new DCC_User:author;
+	DCC_GetMessageAuthor(message, author);
+
+	// Message content
+	new str[128 + 1];   // Orignal was 256
+	new command[32 + 1], params[128 + 1];
+	DCC_GetMessageContent(message, str);
+	sscanf(str, "s[32]s[128]", command, params);    // This string is to small some times, and throws an error BROKEN TODO
+
+	// Ignore bots
+	new bool:isBot;
+	DCC_IsUserBot(author, isBot);
+	if(isBot){
+
+		return 1;
+	}
+	if(!strcmp(command, "!players")){
+        new players_string[14 + (2 * MAX_PLAYERS) + (MAX_PLAYER_NAME * MAX_PLAYERS) + 1] = "Online players:";
+        for(new playerid, a = GetMaxPlayers(); playerid < a; playerid++){
+			if(IsPlayerConnected(playerid)){
+			    format(players_string, sizeof(players_string), "%s %s,", players_string, getPlayerName(playerid));
+			}
+		}
+		strdel(players_string, strlen(players_string), strlen(players_string));  // Delete trailing comma
+        DiscordSendChannelMessage(channel, players_string);
+        print("Should be sending players");
+	}
+	else if(!strcmp(command, "!ip")){
+		DiscordSendChannelMessage(channel, "ecrp.h0v1n8.nl:6666");
+	}
+	else{
+	    if(channel == echoChannel){
+			sendToChat(-1, CHAT_GLOBAL, str, 0, author);
+		}
+	}
+
+	/*// Beyond this point, don't respond to commands on foreign guilds.
+	if(guild != homeGuild){
+
+		return 1;
+	}*/
+
+	// Beyond this point, only respond to privilaged channels.
+	if(channel != adminEchoChannel && channel != adminChannel && channel != managementChannel){
+
+		return 1;
+	}
+
+
+	//  Test command.
+	if(!strcmp(command, "!test", true)){
+		DiscordSendChannelMessage(channel, "Works.");
+		print("Some said !test in the echo channel.");
+	}
+
+	return 1;
+}
+
+
+// Entrypoint
+main(){
+	// Credits
+	print("\n*----------------------------------*");
+	print(" RPFW by tBKwtWS.");
+	new message[21 + 20 + 1];
+	format(message, sizeof(message), " Role-play framework v%s", MODE_NAME);
+	print(message);
+	//printf("System load average: %f",loadavg());	// Linux only   TODO: test
+	print("*----------------------------------*\n");
+}

+ 5510 - 0
samp03/gamemodes/RPFW.0.0a Build 10.pwn

@@ -0,0 +1,5510 @@
+// Developers notes
+/* # Coding guideline
+* Add +1 at the end of array declarations to visually account for null bit.
+* Always log first.
+* Always notify discord last.
+* Always wait for other queries to finish before initiating one: "sql_wait(sqlHandle);	// Wait for other queries to finish"
+* Delete GVar strings as soon as possible, but at least before the player quits or the gamemode exits, as per: https://forum.sa-mp.com/showthread.php?t=151076
+* Read all the function before the OnGameModeInit(), to be able to follow the DRY principle. Repeating code will NOT BE ACCEPTED!
+*/
+
+/* # Style guide
+* GLOBAL_CONSTANT
+* local_variable
+* someFunction
+* SomeClass
+* playerid  // Variable storing in-game player ID
+* player_id // Variable storing database player ID
+*/
+
+/* # Adding a discord bot to your guild.
+https://discordapp.com/oauth2/authorize?client_id=%CLIENT_ID%&scope=bot&permissions=3072
+Where %CLEINT_ID% is the client id.
+*/
+
+/* # Todo:
+* Add geoiplib, to make connect messages fancier, and add a locate command.
+* Show underscores as spaces and convert spaces in changename input to undescores before regex check.
+* Vip limit on characters.
+* See why sql_insert_id wont work. (Try it via a callback)
+* Check if timestamps work (implemented on temp ban), before implementing it more.
+* Normalise database column names.
+* Some SMALLINT fields are using SQL_INTERGER_LEGNTH for size and could be smaller.
+*/
+
+
+/// Global definitions
+// Colours
+/*
+#define COLOR_GREEN 0x33AA33AA
+#define COLOR_YELLOW 0xFFFF00AA
+#define COLOR_WHITE 0xFFFFFFAA
+#define COLOR_BLUE 0x0000BBAA
+#define COLOR_LIGHTBLUE 0x33CCFFAA
+#define COLOR_ORANGE 0xFF9900AA
+#define COLOR_RED 0xAA3333AA
+#define COLOR_LIME 0x10F441AA
+#define COLOR_NAVY 0x000080AA
+#define COLOR_AQUA 0xF0F8FFAA
+#define COLOR_CRIMSON 0xDC143CAA
+#define COLOR_BISQUE 0xFFE4C4AA
+#define COLOR_BLACK 0x000000AA
+#define COLOR_CHARTREUSE 0x7FFF00AA
+#define COLOR_BROWN 0XA52A2AAA
+#define COLOR_CORAL 0xFF7F50AA
+#define COLOR_GOLD 0xB8860BAA
+#define COLOR_GREENYELLOW 0xADFF2FAA
+#define COLOR_INDIGO 0x4B00B0AA
+#define COLOR_IVORY 0xFFFF82AA
+#define COLOR_LAWNGREEN 0x7CFC00AA
+#define COLOR_SEAGREEN 0x20B2AAAA
+#define COLOR_SEAGREEN 0x2E8B57AA
+#define COLOR_LIMEGREEN 0x32CD32AA //<--- Dark lime
+#define COLOR_MIDNIGHTBLUE 0X191970AA
+#define COLOR_MAROON 0x800000AA
+#define COLOR_OLIVE 0x808000AA
+#define COLOR_ORANGERED 0xFF4500AA
+#define COLOR_PINK 0xFFC0CBAA // - Light light pink
+#define COLOR_SPRINGGREEN 0x00FF7FAA
+#define COLOR_TOMATO 0xFF6347AA // - Tomato >:/ sounds wrong lol... well... :P
+#define COLOR_YELLOWGREEN 0x9ACD32AA //- like military green
+#define COLOR_MEDIUMAQUA 0x83BFBFAA
+#define COLOR_MEDIUMMAGENTA 0x8B008BAA // dark magenta ^^
+*/
+#define COLOR_ACTIVEBORDER 0xB4B4B4FF
+#define COLOR_ACTIVECAPTION 0x99B4D1FF
+#define COLOR_ACTIVECAPTIONTEXT 0x000000FF
+#define COLOR_ALICEBLUE 0xF0F8FFFF
+#define COLOR_ANTIQUEWHITE 0xFAEBD7FF
+#define COLOR_APPWORKSPACE 0xABABABFF
+#define COLOR_AQUA 0x00FFFFFF
+#define COLOR_AQUAMARINE 0x7FFFD4FF
+#define COLOR_AZURE 0xF0FFFFFF
+#define COLOR_BEIGE 0xF5F5DCFF
+#define COLOR_BISQUE 0xFFE4C4FF
+#define COLOR_BLACK 0x000000FF
+#define COLOR_BLANCHEDALMOND 0xFFEBCDFF
+#define COLOR_BLUE 0x0000FFFF
+#define COLOR_BLUEVIOLET 0x8A2BE2FF
+#define COLOR_BROWN 0xA52A2AFF
+#define COLOR_BURLYWOOD 0xDEB887FF
+#define COLOR_BUTTONFACE 0xF0F0F0FF
+#define COLOR_BUTTONHIGHLIGHT 0xFFFFFFFF
+#define COLOR_BUTTONSHADOW 0xA0A0A0FF
+#define COLOR_CADETBLUE 0x5F9EA0FF
+#define COLOR_CHARTREUSE 0x7FFF00FF
+#define COLOR_CHOCOLATE 0xD2691EFF
+#define COLOR_CONTROL 0xF0F0F0FF
+#define COLOR_CONTROLDARK 0xA0A0A0FF
+#define COLOR_CONTROLDARKDARK 0x696969FF
+#define COLOR_CONTROLLIGHT 0xE3E3E3FF
+#define COLOR_CONTROLLIGHTLIGHT 0xFFFFFFFF
+#define COLOR_CONTROLTEXT 0x000000FF
+#define COLOR_CORAL 0xFF7F50FF
+#define COLOR_CORNFLOWERBLUE 0x6495EDFF
+#define COLOR_CORNSILK 0xFFF8DCFF
+#define COLOR_CRIMSON 0xDC143CFF
+#define COLOR_CYAN 0x00FFFFFF
+#define COLOR_DARKBLUE 0x00008BFF
+#define COLOR_DARKCYAN 0x008B8BFF
+#define COLOR_DARKGOLDENROD 0xB8860BFF
+#define COLOR_DARKGRAY 0xA9A9A9FF
+#define COLOR_DARKGREEN 0x006400FF
+#define COLOR_DARKKHAKI 0xBDB76BFF
+#define COLOR_DARKMAGENTA 0x8B008BFF
+#define COLOR_DARKOLIVEGREEN 0x556B2FFF
+#define COLOR_DARKORANGE 0xFF8C00FF
+#define COLOR_DARKORCHID 0x9932CCFF
+#define COLOR_DARKRED 0x8B0000FF
+#define COLOR_DARKSALMON 0xE9967AFF
+#define COLOR_DARKSEAGREEN 0x8FBC8BFF
+#define COLOR_DARKSLATEBLUE 0x483D8BFF
+#define COLOR_DARKSLATEGRAY 0x2F4F4FFF
+#define COLOR_DARKTURQUOISE 0x00CED1FF
+#define COLOR_DARKVIOLET 0x9400D3FF
+#define COLOR_DEEPPINK 0xFF1493FF
+#define COLOR_DEEPSKYBLUE 0x00BFFFFF
+#define COLOR_DEFAULT_CHAT 0xFFFFFFFF
+#define COLOR_DESKTOP 0x000000FF
+#define COLOR_DIMGRAY 0x696969FF
+#define COLOR_DODGERBLUE 0x1E90FFFF
+#define COLOR_FIREBRICK 0xB22222FF
+#define COLOR_FLBLUE 0x6495EDAA
+#define COLOR_FLORALWHITE 0xFFFAF0FF
+#define COLOR_FORESTGREEN 0x228B22FF
+#define COLOR_GAINSBORO 0xDCDCDCFF
+#define COLOR_GHOSTWHITE 0xF8F8FFFF
+#define COLOR_GOLD 0xFFD700FF
+#define COLOR_GOLDENROD 0xDAA520FF
+#define COLOR_GRADIENTACTIVECAPTION 0xB9D1EAFF
+#define COLOR_GRADIENTINACTIVECAPTION 0xD7E4F2FF
+#define COLOR_GRAY 0x808080FF
+#define COLOR_GRAYTEXT 0x808080FF
+#define COLOR_GREEN 0x008000FF
+#define COLOR_GREENYELLOW 0xADFF2FFF
+#define COLOR_GREY 0xAFAFAFAA
+#define COLOR_HIGHLIGHT 0x3399FFFF
+#define COLOR_HIGHLIGHTTEXT 0xFFFFFFFF
+#define COLOR_HONEYDEW 0xF0FFF0FF
+#define COLOR_HOTPINK 0xFF69B4FF
+#define COLOR_HOTTRACK 0x0066CCFF
+#define COLOR_INACTIVEBORDER 0xF4F7FCFF
+#define COLOR_INACTIVECAPTION 0xBFCDDBFF
+#define COLOR_INACTIVECAPTIONTEXT 0x434E54FF
+#define COLOR_INDIANRED 0xCD5C5CFF
+#define COLOR_INDIGO 0x4B0082FF
+#define COLOR_INFO 0xFFFFE1FF
+#define COLOR_INFOTEXT 0x000000FF
+#define COLOR_IVORY 0xFFFFF0FF
+#define COLOR_KHAKI 0xF0E68CFF
+#define COLOR_LAVENDER 0xE6E6FAFF
+#define COLOR_LAVENDERBLUSH 0xFFF0F5FF
+#define COLOR_LAWNGREEN 0x7CFC00FF
+#define COLOR_LEMONCHIFFON 0xFFFACDFF
+#define COLOR_LIGHTBLUE 0xADD8E6FF
+#define COLOR_LIGHTCORAL 0xF08080FF
+#define COLOR_LIGHTCYAN 0xE0FFFFFF
+#define COLOR_LIGHTGOLDENRODYELLOW 0xFAFAD2FF
+#define COLOR_LIGHTGRAY 0xD3D3D3FF
+#define COLOR_LIGHTGREEN 0x90EE90FF
+#define COLOR_LIGHTPINK 0xFFB6C1FF
+#define COLOR_LIGHTSALMON 0xFFA07AFF
+#define COLOR_LIGHTSEAGREEN 0x20B2AAFF
+#define COLOR_LIGHTSKYBLUE 0x87CEFAFF
+#define COLOR_LIGHTSLATEGRAY 0x778899FF
+#define COLOR_LIGHTSTEELBLUE 0xB0C4DEFF
+#define COLOR_LIGHTYELLOW 0xFFFFE0FF
+#define COLOR_LIME 0x00FF00FF
+#define COLOR_LIMEGREEN 0x32CD32FF
+#define COLOR_LINEN 0xFAF0E6FF
+#define COLOR_MAGENTA 0xFF00FFFF
+#define COLOR_MAROON 0x800000FF
+#define COLOR_MEDIUMAQUAMARINE 0x66CDAAFF
+#define COLOR_MEDIUMBLUE 0x0000CDFF
+#define COLOR_MEDIUMORCHID 0xBA55D3FF
+#define COLOR_MEDIUMPURPLE 0x9370DBFF
+#define COLOR_MEDIUMSEAGREEN 0x3CB371FF
+#define COLOR_MEDIUMSLATEBLUE 0x7B68EEFF
+#define COLOR_MEDIUMSPRINGGREEN 0x00FA9AFF
+#define COLOR_MEDIUMTURQUOISE 0x48D1CCFF
+#define COLOR_MEDIUMVIOLETRED 0xC71585FF
+#define COLOR_MENU 0xF0F0F0FF
+#define COLOR_MENUBAR 0xF0F0F0FF
+#define COLOR_MENUHIGHLIGHT 0x3399FFFF
+#define COLOR_MENUTEXT 0x000000FF
+#define COLOR_MIDNIGHTBLUE 0x191970FF
+#define COLOR_MINTCREAM 0xF5FFFAFF
+#define COLOR_MISTYROSE 0xFFE4E1FF
+#define COLOR_MOCCASIN 0xFFE4B5FF
+#define COLOR_NAVAJOWHITE 0xFFDEADFF
+#define COLOR_NAVY 0x000080FF
+#define COLOR_OLDLACE 0xFDF5E6FF
+#define COLOR_OLIVE 0x808000FF
+#define COLOR_OLIVEDRAB 0x6B8E23FF
+#define COLOR_ORANGE 0xFFA500FF
+#define COLOR_ORANGERED 0xFF4500FF
+#define COLOR_ORCHID 0xDA70D6FF
+#define COLOR_PALEGOLDENROD 0xEEE8AAFF
+#define COLOR_PALEGREEN 0x98FB98FF
+#define COLOR_PALETURQUOISE 0xAFEEEEFF
+#define COLOR_PALEVIOLETRED 0xDB7093FF
+#define COLOR_PAPAYAWHIP 0xFFEFD5FF
+#define COLOR_PEACHPUFF 0xFFDAB9FF
+#define COLOR_PERU 0xCD853FFF
+#define COLOR_PINK 0xFFC0CBFF
+#define COLOR_PLUM 0xDDA0DDFF
+#define COLOR_POWDERBLUE 0xB0E0E6FF
+#define COLOR_PURPLE 0x800080FF
+#define COLOR_RED 0xFF0000FF
+#define COLOR_ROSYBROWN 0xBC8F8FFF
+#define COLOR_ROYALBLUE 0x4169E1FF
+#define COLOR_SADDLEBROWN 0x8B4513FF
+#define COLOR_SALMON 0xFA8072FF
+#define COLOR_SANDYBROWN 0xF4A460FF
+#define COLOR_SCROLLBAR 0xC8C8C8FF
+#define COLOR_SEAGREEN 0x2E8B57FF
+#define COLOR_SEASHELL 0xFFF5EEFF
+#define COLOR_SIENNA 0xA0522DFF
+#define COLOR_SILVER 0xC0C0C0FF
+#define COLOR_SKYBLUE 0x87CEEBFF
+#define COLOR_SLATEBLUE 0x6A5ACDFF
+#define COLOR_SLATEGRAY 0x708090FF
+#define COLOR_SNOW 0xFFFAFAFF
+#define COLOR_SPRINGGREEN 0x00FF7FFF
+#define COLOR_STEELBLUE 0x4682B4FF
+#define COLOR_TAN 0xD2B48CFF
+#define COLOR_TEAL 0x008080FF
+#define COLOR_THISTLE 0xD8BFD8FF
+#define COLOR_TOMATO 0xFF6347FF
+#define COLOR_TRANSPARENT 0xFFFFFF00
+#define COLOR_TURQUOISE 0x40E0D0FF
+#define COLOR_VIOLET 0xEE82EEFF
+#define COLOR_WHEAT 0xF5DEB3FF
+#define COLOR_WHITE 0xFFFFFFFF
+#define COLOR_WHITESMOKE 0xF5F5F5FF
+#define COLOR_WINDOW 0xFFFFFFFF
+#define COLOR_WINDOWFRAME 0x646464FF
+#define COLOR_WINDOWTEXT 0x000000FF
+#define COLOR_YELLOW 0xFFFF00FF
+#define COLOR_YELLOWGREEN 0x9ACD32FF
+#define COLOR_STEALTH_ORANGE 0xFF880000
+#define COLOR_STEALTH_OLIVE 0x66660000
+#define COLOR_STEALTH_GREEN 0x33DD1100
+#define COLOR_STEALTH_PINK 0xFF22EE00
+#define COLOR_STEALTH_BLUE 0x0077BB00
+
+// Color groups
+#define COLOR_COMMAND_OUTPUT 0xFFFFFFFF 			// White
+#define COLOR_NOTICE 0xAFAFAFAA 					// Grey
+#define COLOR_WARNING 0xFFA500FF        			// Orange? (Looks more yellow to me)
+#define COLOR_ERROR 0xFF0000FF        				// Red
+#define COLOR_GLOBAL_CHAT 0xFFFFFFFF        		// White
+#define COLOR_PM_CHAT 0xFFFF00FF        			// Yellow
+#define COLOR_VIP_CHAT 0x800080FF			  		// Purple
+#define COLOR_CREW_CHAT 0xFF9900AA					// Orange
+#define COLOR_ADMIN_CHAT 0xB8860BAA					// Gold
+#define COLOR_POLICE 0x00008BFF                     //
+#define COLOR_MEDIC 0xFFC0CBAA                      // Light pink
+#define COLOR_FIRE 0xAA3333AA           			// Red
+#define COLOR_SHERIFF 0xF5F5DCFF                    // Beige
+#define COLOR_FBI 0x000080AA                        // Navy
+#define COLOR_DMV 0xF0F8FFAA                        // Aqua
+#define COLOR_NEWS 0x808000FF                       // Olive
+
+#define EMBED_COLOR_GREY "{838383}"
+#define EMBED_COLOR_RED "{FF0000}"
+#define EMBED_COLOR_WHITE "{FFFFFF}"
+
+// SQL datatypes
+#define MAX_SQL_INTEGER 10
+#define MAX_SQL_TIMESTAMP 19	// 1999-01-08 04:05:06 [5 + 4 + 2 + 2 +2 + 2 + 2]
+#define MAX_SQL_FLOAT 16
+#define MAX_SQL_HASH 128
+#define MAX_SQL_IP 45
+#define MAX_SQL_REASON 121
+
+// Log levels
+#define LOGLEVEL_CHAT -2
+#define LOGLEVEL_COMMAND -1
+#define LOGLEVEL_DEBUG 0
+#define LOGLEVEL_INFO 1
+#define LOGLEVEL_NOTICE 2
+#define LOGLEVEL_WARNING 3
+#define LOGLEVEL_ERROR 4
+#define LOGLEVEL_CRITICAL 5
+#define LOGLEVEL_PANIC 6
+
+// Userlevels
+enum{   // Noted values as comments, for database reference.
+	UNREGISTERED_PLAYER,		// 0
+	REGISTERED_PLAYER,			// 1
+	REGULAR_PLAYER,				// 2    Spent many hours in and around the comunity.
+	VIP_PLAYER,             	// 3    Donated.
+	MODERATOR_CREW,				// 4
+	VETERAN_CREW,				// 5    Inactive admins and management that are allowed to keep their rights.
+	ADMIN_CREW,					// 6
+	UNDERCOVER_ADMIN_CREW,  	// 7
+	MANAGEMENT_CREW,			// 8
+	UNDRECOVER_MANAGEMENT_CREW, // 9
+	FOUNDER_PLAYER,				// 10
+	UNDERCOVER_FOUNDER_PLAYER,	// 11
+}
+
+// Discord channels
+enum{
+	ECHO_CHANNEL,
+	MAIN_CHANNEL,
+	ADMIN_ECHO_CHANNEL,
+	ADMIN_CHANNEL,
+	MANAGEMENT_CHANNEL,
+}
+
+// Chats
+enum{
+    CHAT_LOCAL, // Has to be 0, else a gVar would have to be created OnJoin, this conserves memory when no chatmode is set (which will be the case most likely)
+	CHAT_WHISPER,
+	CHAT_LOW,
+	CHAT_ACTION,
+	CHAT_SHOUT,
+	CHAT_OC,
+	CHAT_GLOBAL,
+	CHAT_CALL,
+	CHAT_SMS,
+	CHAT_RADIO,
+	CHAT_PM,
+	CHAT_GANG,
+	CHAT_GANG_OC,
+	CHAT_FACTION,
+	CHAT_FACTION_OC,
+	CHAT_VIP,
+	CHAT_CREW,
+	CHAT_ADMIN,
+	CHAT_MANAGEMENT,
+	CHAT_UNDERCOVER,
+}
+
+// Dialogs
+enum{
+	DIALOG_CHANGENAME,
+	DIALOG_REGISTER,
+	DIALOG_ACCOUNT_CREATED,
+	DIALOG_LOGIN,
+	DIALOG_CHANGE_USERNAME,
+	DIALOG_CHARACTERS,
+	DIALOG_LOGIN_FAILED,
+	DIALOG_DELETE_CHARACTER,
+	DIALOG_GOTO,
+	DIALOG_GOTO_INTERIOR,
+	DIALOG_GOTO_PLAYER,
+	DIALOG_GOTO_247,
+	DIALOG_GOTO_AVIATION,
+    DIALOG_GOTO_AMMUNATION,
+    DIALOG_GOTO_BURGLARYHOUSE,
+    DIALOG_GOTO_CASINO,
+    DIALOG_GOTO_MISSION,
+    DIALOG_GOTO_MISSIONEXT,
+    DIALOG_GOTO_MISSIONHOUSE,
+    DIALOG_GOTO_MODDING,
+	DIALOG_GOTO_POLICE,
+	DIALOG_GOTO_HOUSES,
+	DIALOG_GOTO_SAFEHOUSE,
+	DIALOG_GOTO_SHOPS,
+	DIALOG_GOTO_SHOP,
+	DIALOG_GOTO_STADIA,
+	DIALOG_GOTO_UHOUSE,
+	DIALOG_GOTO_SEXWORK,
+	DIALOG_GOTO_UNCATAGORIZED,
+	DIALOG_CREATE_PICKUP,
+	DIALOG_CREATE_FACTION_PICKUP,
+	DIALOG_DUTY_PD,
+	DIALOG_POLICE_SKIN,
+	DIALOG_DUTY_MD,
+	DIALOG_MEDIC_SKIN,
+	DIALOG_DUTY_FD,
+	DIALOG_FIRE_SKIN,
+	DIALOG_DUTY_SD,
+	DIALOG_SHERIFF_SKIN,
+	DIALOG_DUTY_FBI,
+	DIALOG_FBI_SKIN,
+	DIALOG_DUTY_DMV,
+	DIALOG_DMV_SKIN,
+	DIALOG_DUTY_NEWS,
+	DIALOG_NEWS_SKIN,
+}
+
+// Pickups
+enum{
+	PICKUP_FACTION_PD,
+	PICKUP_FACTION_MD,
+	PICKUP_FACTION_FD,
+	PICKUP_FACTION_SD,
+	PICKUP_FACTION_FBI,
+	PICKUP_FACTION_DMV,
+	PICKUP_FACTION_NEWS,
+	PICKUP_PORTAL,  // MUST be last as it's not in the pickup create dialog
+}
+
+// Location categories
+enum{
+	GOTO_CATEGORY_INTERIOR,
+}
+enum{
+	INTERIOR_CATEGORY_AVIATION,
+	INTERIOR_CATEGORY_HOUSES,
+	INTERIOR_CATEGORY_MISSION,
+	INTERIOR_CATEGORY_MISSIONEXT,
+	INTERIOR_CATEGORY_POLICE,
+	INTERIOR_CATEGORY_SEXWORK,
+	INTERIOR_CATEGORY_SHOPS,
+	INTERIOR_CATEGORY_STADIA,
+}
+enum{
+	INTERIOR_HOUSE_CAT_BURGLARY,
+	INTERIOR_HOUSE_CAT_MISSION,
+	INTERIOR_HOUSE_CAT_SAFE,
+	INTERIOR_HOUSE_CAT_U,
+}
+enum{
+    INTERIOR_SHOP_CAT_247,
+    INTERIOR_SHOP_CAT_AMMUNATION,
+    INTERIOR_SHOP_CAT_CASINO,
+    INTERIOR_SHOP_CAT_MODSHOP,
+    INTERIOR_SHOP_CAT_SHOP,
+}
+enum{INTERIOR_247_LSHAPED, INTERIOR_247_OBLONG, INTERIOR_247_MEDIUM, INTERIOR_247_MEDIUM_NOEXIT, INTERIOR_247_LONG, INTERIOR_247_SQAURE}
+enum{
+    INTERIOR_AVIATION_TICKET,
+    INTERIOR_AVIATION_BAGGAGE,
+    INTERIOR_AVIATION_SHAMAL,
+    INTERIOR_AVIATION_ANDROMADA,
+    INTERIOR_AVIATION_LSAIRPORT
+}
+enum{INTERIOR_AMMU_OCEAN, INTERIOR_AMMU_PALOMINO, INTERIOR_AMMU_ANGEL, INTERIOR_AMMU_QUEBRADOS, INTERIOR_AMMU_2STORIES, INTERIOR_AMMU_BOOTH, INTERIOR_AMMU_RANGE}
+enum{
+	INTERIOR_BURGRLARY_LARGE,
+	INTERIOR_BURGRLARY_MEDIUM,
+	INTERIOR_BURGRLARY_SMALL,
+	INTERIOR_BURGRLARY_VERYLARGE,
+	INTERIOR_BURGRLARY_5,
+	INTERIOR_BURGRLARY_6,
+	INTERIOR_BURGRLARY_NOBATH,
+}
+enum{
+	INTERIOR_CASINO_CALIGULAS,
+	INTERIOR_CASINO_REDLAND,
+	INTERIOR_CASINO_4DRAGONS,
+	INTERIOR_CASINO_4DRAGONSUITE,
+}
+enum{
+	INTERIOR_MISSION_ATRIUM,
+	INTERIOR_MISSION_BIGSMOKE,
+	INTERIOR_MISSION_JEFFERSON,
+	INTERIOR_MISSION_JIZZY,
+	INTERIOR_MISSION_RC,
+	INTERIOR_MISSION_WUZI,
+}
+enum{
+    INTERIOR_MISSIONEXT_GAS,
+	INTERIOR_MISSIONEXT_LIBERTY,
+	INTERIOR_MISSIONEXT_SFGARAGE,
+}
+enum{
+   	INTERIOR_MISSIONHOUSE_DESIRE,
+	INTERIOR_MISSIONHOUSE_COLONEL,
+	INTERIOR_MISSIONHOUSE_RYDER,
+	INTERIOR_MISSIONHOUSE_SWEET,
+	INTERIOR_MISSIONHOUSE_CRACK,
+}
+enum{INTERIOR_MOD_LOCO, INTERIOR_MOD_WHEEL, INTERIOR_MOD_TRANSFENDER}
+enum{INTERIOR_PD_LV, INTERIOR_PD_LS, INTERIOR_PD_SF, INTERIOR_PD_BARBARA}
+enum{
+    INTERIOR_HOUSE_GOLDEN,
+	INTERIOR_HOUSE_HASHBURY,
+	INTERIOR_HOUSE_JOHNSON,
+	INTERIOR_HOUSE_MADDDOGG,
+	INTERIOR_HOUSE_RED,
+	INTERIOR_HOUSE_VERDANT,
+	INTERIOR_HOUSE_UNUSED,
+}
+enum{
+	INTERIOR_SEXWORK_BROTHEL,
+	INTERIOR_SEXWORK_BROTHEL2,
+	INTERIOR_SEXWORK_BIGSPREAD,
+}
+enum{
+    INTERIOR_SHOP_TATTOO,
+	INTERIOR_SHOP_BURGER,
+	INTERIOR_SHOP_PIZZA,
+	INTERIOR_SHOP_CLUCKIN,
+	INTERIOR_SHOP_CALIGULAS,
+	INTERIOR_SHOP_CASINO,
+	INTERIOR_SHOP_4DRAGONS,
+	INTERIOR_SHOP_4DRAGONSUITE,
+	INTERIOR_SHOP_DONUTS,
+	INTERIOR_SHOP_RC,
+	INTERIOR_SHOP_PUMP,
+	INTERIOR_SHOP_GYM,
+	INTERIOR_SHOP_BETTING,
+	INTERIOR_SHOP_RECORDS,
+}
+enum{
+	INTERIOR_STADIUM_BLOODBOWL,
+	INTERIOR_STADIUM_KICKSTART,
+	INTERIOR_STADIUM_8TRACK,
+	INTERIOR_STADIUM_DIRTBIKE,
+}
+enum{
+	INTERIOR_
+}
+
+// Factions
+enum{
+    FACTION_NONE,
+	FACTION_POLICE,
+	FACTION_MEDIC,
+	FACTION_FIRE,
+	FACTION_SHERIFF,
+	FACTION_FBI,
+    FACTION_DMV,
+    FACTION_NEWS,
+}
+
+// Jobs
+enum{
+	JOB_NONE,
+	JOB_POLICE,
+	JOB_MEDIC,
+	JOB_FIRE,
+	JOB_SHERIFF,
+	JOB_FBI,
+	JOB_DMV,
+	JOB_NEWS,
+}
+
+// Vehicles
+enum{
+	EDITVEHICLE_PARK,
+	EDITVEHICLE_COLOR,
+	EDITVEHICLE_RESPAWN,
+	EDITVEHICLE_SIREN,
+}
+
+new vehicleNameArray[212][] = {
+	{"Landstalker"},
+	{"Bravura"},
+	{"Buffalo"},
+	{"Linerunner"},
+	{"Perrenial"},
+	{"Sentinel"},
+	{"Dumper"},
+	{"Firetruck"},
+	{"Trashmaster"},
+	{"Stretch"},
+	{"Manana"},
+	{"Infernus"},
+	{"Voodoo"},
+	{"Pony"},
+	{"Mule"},
+	{"Cheetah"},
+	{"Ambulance"},
+	{"Leviathan"},
+	{"Moonbeam"},
+	{"Esperanto"},
+	{"Taxi"},
+	{"Washington"},
+	{"Bobcat"},
+	{"Mr Whoopee"},
+	{"BF Injection"},
+	{"Hunter"},
+	{"Premier"},
+	{"Enforcer"},
+	{"Securicar"},
+	{"Banshee"},
+	{"Predator"},
+	{"Bus"},
+	{"Rhino"},
+	{"Barracks"},
+	{"Hotknife"},
+	{"Trailer 1"},
+	{"Previon"},
+	{"Coach"},
+	{"Cabbie"},
+	{"Stallion"},
+	{"Rumpo"},
+	{"RC Bandit"},
+	{"Romero"},
+	{"Packer"},
+	{"Monster"},
+	{"Admiral"},
+	{"Squalo"},
+	{"Seasparrow"},
+	{"Pizzaboy"},
+	{"Tram"},
+	{"Trailer 2"},
+	{"Turismo"},
+	{"Speeder"},
+	{"Reefer"},
+	{"Tropic"},
+	{"Flatbed"},
+	{"Yankee"},
+	{"Caddy"},
+	{"Solair"},
+	{"Berkley's RC Van"},
+	{"Skimmer"},
+	{"PCJ-600"},
+	{"Faggio"},
+	{"Freeway"},
+	{"RC Baron"},
+	{"RC Raider"},
+	{"Glendale"},
+	{"Oceanic"},
+	{"Sanchez"},
+	{"Sparrow"},
+	{"Patriot"},
+	{"Quad"},
+	{"Coastguard"},
+	{"Dinghy"},
+	{"Hermes"},
+	{"Sabre"},
+	{"Rustler"},
+	{"ZR-350"},
+	{"Walton"},
+	{"Regina"},
+	{"Comet"},
+	{"BMX"},
+	{"Burrito"},
+	{"Camper"},
+	{"Marquis"},
+	{"Baggage"},
+	{"Dozer"},
+	{"Maverick"},
+	{"News Chopper"},
+	{"Rancher"},
+	{"FBI Rancher"},
+	{"Virgo"},
+	{"Greenwood"},
+	{"Jetmax"},
+	{"Hotring"},
+	{"Sandking"},
+	{"Blista Compact"},
+	{"Police Maverick"},
+	{"Boxville"},
+	{"Benson"},
+	{"Mesa"},
+	{"RC Goblin"},
+	{"Hotring Racer A"},
+	{"Hotring Racer B"},
+	{"Bloodring Banger"},
+	{"Rancher"},
+	{"Super GT"},
+	{"Elegant"},
+	{"Journey"},
+	{"Bike"},
+	{"Mountain Bike"},
+	{"Beagle"},
+	{"Cropdust"},
+	{"Stunt"},
+	{"Tanker"},
+	{"Roadtrain"},
+	{"Nebula"},
+	{"Majestic"},
+	{"Buccaneer"},
+	{"Shamal"},
+	{"Hydra"},
+	{"FCR-900"},
+	{"NRG-500"},
+	{"HPV1000"},
+	{"Cement Truck"},
+	{"Tow Truck"},
+	{"Fortune"},
+	{"Cadrona"},
+	{"FBI Truck"},
+	{"Willard"},
+	{"Forklift"},
+	{"Tractor"},
+	{"Combine"},
+	{"Feltzer"},
+	{"Remington"},
+	{"Slamvan"},
+	{"Blade"},
+	{"Freight"},
+	{"Streak"},
+	{"Vortex"},
+	{"Vincent"},
+	{"Bullet"},
+	{"Clover"},
+	{"Sadler"},
+	{"Firetruck LA"},
+	{"Hustler"},
+	{"Intruder"},
+	{"Primo"},
+	{"Cargobob"},
+	{"Tampa"},
+	{"Sunrise"},
+	{"Merit"},
+	{"Utility"},
+	{"Nevada"},
+	{"Yosemite"},
+	{"Windsor"},
+	{"Monster A"},
+	{"Monster B"},
+	{"Uranus"},
+	{"Jester"},
+	{"Sultan"},
+	{"Stratum"},
+	{"Elegy"},
+	{"Raindance"},
+	{"RC Tiger"},
+	{"Flash"},
+	{"Tahoma"},
+	{"Savanna"},
+	{"Bandito"},
+	{"Freight Flat"},
+	{"Streak Carriage"},
+	{"Kart"},
+	{"Mower"},
+	{"Duneride"},
+	{"Sweeper"},
+	{"Broadway"},
+	{"Tornado"},
+	{"AT-400"},
+	{"DFT-30"},
+	{"Huntley"},
+	{"Stafford"},
+	{"BF-400"},
+	{"Newsvan"},
+	{"Tug"},
+	{"Trailer 3"},
+	{"Emperor"},
+	{"Wayfarer"},
+	{"Euros"},
+	{"Hotdog"},
+	{"Club"},
+	{"Freight Carriage"},
+	{"Trailer 3"},
+	{"Andromada"},
+	{"Dodo"},
+	{"RC Cam"},
+	{"Launch"},
+	{"Police Car (LSPD)"},
+	{"Police Car (SFPD)"},
+	{"Police Car (LVPD)"},
+	{"Police Ranger"},
+	{"Picador"},
+	{"S.W.A.T. Van"},
+	{"Alpha"},
+	{"Phoenix"},
+	{"Glendale"},
+	{"Sadler"},
+	{"Luggage Trailer A"},
+	{"Luggage Trailer B"},
+	{"Stair Trailer"},
+	{"Boxville"},
+	{"Farm Plow"},
+	{"Utility Trailer"}
+};
+
+// Environment settings	TODO: THESE SHOULD ALL BE READ FROM A CONFIG FILE!
+static bool:scriptDebug = true;	// Debug setting
+#define MODE_NAME "0.0a Build 10"
+#define SERVER_NAME "Bone County RPG"
+#define PG_HOST "127.0.0.1"
+#define PG_ROLE "rpfw-dev"
+#define PG_PASS "nJd&1k$0fs"
+#define PG_DB "rpfw-dev"
+#define PG_PORT 5432
+#define DISCORD_HOME_GUILD_ID "666077037470941184"			// Emerald City Roleplay
+#define DISCORD_ECHO_CHANNEL_ID "677855051166777344"		// #bcrp-echo
+//#define DISCORD_ECHO_CHANNEL_ID "666078187079598080"		// #ecrp-echo
+#define DISCORD_MAIN_CHANNEL_ID "677855315898793984"		// #bcrp
+//#define DISCORD_MAIN_CHANNEL_ID "667396220402270228"		// #development
+#define DISCORD_ADMIN_ECHO_CHANNEL_ID "672841892169383936"	// #admin-echo
+#define DISCORD_ADMIN_CHANNEL_ID "667396026058932236"		// #admins
+#define DISCORD_MANAGEMENT_CHANNEL_ID "666091376240361492"	// #management
+
+// Game-mode limits
+#define MAX_CHARACTERS_PER_USER 20  // Maximum of MAX_CHARACTERS_PER_USER_DIGITS digits (Due to SQL query string length)
+#define MAX_CHARACTERS_PER_USER_DIGITS 3
+
+// SQL plugin
+new SQL:sqlHandle;
+
+// discord-connector
+//static DCC_Guild:homeGuild;			// Discord guild controlled by game community.
+static DCC_Channel:echoChannel;			// Public echo channel.
+static DCC_Channel:mainChannel;			// Channel for communirty notifications.
+static DCC_Channel:adminEchoChannel;	// Admin echo channel.
+static DCC_Channel:adminChannel;		// Channel for admin notifications.
+static DCC_Channel:managementChannel;	// Channel for management notifications.
+
+DiscordEcho(const message[], messageLevel){ // Write to echo channels.
+	switch(messageLevel)	// Output facilities.
+    {
+        case ECHO_CHANNEL: {                                                                // Public echo message
+			DiscordSendChannelMessage(echoChannel, message);
+			DiscordSendChannelMessage(adminEchoChannel, message);   // Also send to admin echo channel, so admin can see everything in one channel without needing to constantly switch. Also handy as log on conflicts/complaints.
+		}
+		case MAIN_CHANNEL: {DiscordSendChannelMessage(mainChannel, message);}				// Public notification
+        case ADMIN_ECHO_CHANNEL: {DiscordSendChannelMessage(adminEchoChannel, message);}	// Admin echo message
+		case ADMIN_CHANNEL: {DiscordSendChannelMessage(adminChannel, message);}				// Admin notification
+        case MANAGEMENT_CHANNEL: {DiscordSendChannelMessage(managementChannel, message);}	// Management notification
+    }
+
+	return 0;
+}
+
+// Natives
+native WP_Hash(buffer[], len, const str[]);	// https://forum.sa-mp.com/showthread.php?t=570945
+//native Float:loadavg();	// https://forum.sa-mp.com/showthread.php?t=260206	LINUX ONLY
+
+// Includes
+#include <a_samp>	// https://sa-mp.com
+#include <sql>	// https://github.com/udan11/samp-plugin-sql	(Fastest player in town and only one supporting postgreSQL) | Examples: https://pastebin.com/67y2nq2n https://github.com/udan11/samp-plugin-sql/issues/10
+#include <sscanf2>	// Newest version: https://github.com/maddinat0r/sscanf/releases | Better readme: https://github.com/Y-Less/sscanf
+#include <strlib>	// https://github.com/oscar-broman/strlib
+#include <Pawn.Regex>	// https://github.com/urShadow/Pawn.Regex
+#include <Pawn.CMD>	// https://github.com/urShadow/Pawn.CMD	(Fastest player in town)
+#include <gvar>	// https://github.com/samp-incognito/samp-gvar-plugin
+#include <discord-connector>	// https://github.com/maddinat0r/samp-discord-connector	(Only player in town)
+#include <streamer>	// https://github.com/samp-incognisto/samp-streamer-plugin
+
+
+/// Middle-ware
+// Logging
+logger(const log_level, const message[]){	// Write to logging facility
+	// Do not log commands or debug when script debugging is turned off.
+	if(scriptDebug == false){   // Debug is off
+		if(log_level == LOGLEVEL_COMMAND || log_level == LOGLEVEL_DEBUG){   // Command or debug message
+
+			return 0;   // Stop and do not log
+		}
+	}
+	
+	// Messagelevel tag
+	new human_readable_log_level[8 + 1];
+	switch(log_level){	// Assign log level.
+		case LOGLEVEL_CHAT: human_readable_log_level = "chat";
+		case LOGLEVEL_COMMAND: human_readable_log_level = "command";
+        case LOGLEVEL_DEBUG: human_readable_log_level = "debug";
+        case LOGLEVEL_INFO: human_readable_log_level = "info";
+        case LOGLEVEL_NOTICE: human_readable_log_level = "notice";
+		case LOGLEVEL_WARNING: human_readable_log_level = "warning";
+		case LOGLEVEL_ERROR: human_readable_log_level = "error";
+		case LOGLEVEL_CRITICAL: human_readable_log_level = "critical";
+		case LOGLEVEL_PANIC: human_readable_log_level = "panic";
+    }
+    
+	printf("[%s] %s", human_readable_log_level, message);	// Print to STDOUT.
+
+	return 0;
+}
+
+/*// SQL plugin (BROKEN, look at it again after I have more then a week of experience)
+//forward sqlQuery(SQL:handle, query[]);
+//public sqlQuery(SQL:handle, query[]){
+sqlQuery(SQL:handle, query[]){
+	//sql_wait(handle);	// Wait for all queries to finish.
+
+	new Result:result = sql_query(handle, query);
+	if(sql_error(result)){printf("SQL error");}	// Did not work during a test with a faulty statement.
+	return result;
+}*/
+
+// discord-connector
+DiscordSendChannelMessage(DCC_Channel:channel, const message[]){
+	if(scriptDebug){    // Log middle-ware event in debugging mode only
+		new channel_name[100 + 1];	// Default value from tutorial
+		DCC_GetChannelName(channel, channel_name);
+		new logMessage[26 + 100 + 2000 + 1];	// Discord max message length = 2000
+		format(logMessage, sizeof(logMessage), "Send to discord channel %s: %s", channel_name, message);
+
+		logger(LOGLEVEL_DEBUG, logMessage);	// Actually log the message
+	}
+
+	DCC_SendChannelMessage(channel, message);	// Call discord-connector	DISABLE THIS TO STOP ALL OUTGOING DISCORD MESSAGES
+}
+
+
+/// Game-mode
+// Account functions
+forward changeName(playerid, const name[]);
+public changeName(playerid, const name[]){	// Check if name is valid and force change if needed.
+	// Prevent regex error when comparing against null
+	if(isempty(name)){  // No name entered
+	    ShowPlayerDialog(playerid, DIALOG_CHANGENAME, DIALOG_STYLE_INPUT, "Character name", "You must enter a name.\n\nExamples:\n Jo_Bo\n Dingle_P._J._Berry\n Jackson_DeForest_Kelley\n MaryJo_Ann_LaFluer", "Change", "");	// Force RP name.
+	    
+	    return 0;
+	}
+	
+	// Check name
+	new Regex:r = Regex_New("^[A-Z][a-z]{1,}([A-Z][a-z]{1,})?(_([A-Z][a-z]{1,}([A-Z][a-z]{1,})?|[A-Z]\\.(_[A-Z]\\.)?))?_[A-Z][a-z]{1,}([A-Z][a-z]{1,})?$");	// Regex name filter
+	new isValidName = Regex_Check(name, r); // Validate name to filter
+	Regex_Delete(r);
+	if(!isValidName){	// Invalid role-play name
+		ShowPlayerDialog(playerid, DIALOG_CHANGENAME, DIALOG_STYLE_INPUT, "Character name", "Please pick a realistic name, separate first and last name with an underscore.\n\nExamples:\n Jo_Bo\n Dingle_P._J._Berry\n Jackson_DeForest_Kelley\n MaryJo_Ann_LaFluer", "Change", "");	// Force RP name.
+	}
+	else {	// Valid role-play name
+	    print("Valid name");
+	    // Check for name in use
+		/*new escaped_name[MAX_PLAYER_NAME + 1];  // TODO should be more, to account for escape characters.
+	    sql_escape_string(sqlHandle, name, escaped_name, sizeof(escaped_name));	// Escape player name   BROKEN argument type mismatch on argument 2, but name is a sting...*/
+	    new character_query[40 + MAX_PLAYER_NAME + 1], Result:character_result = sql_query(sqlHandle, character_query);
+		format(character_query, sizeof(character_query), "SELECT id FROM character WHERE name = '%s'", name);
+		
+        if(sql_num_rows(character_result) > 0){  // Name taken
+            ShowPlayerDialog(playerid, DIALOG_CHANGENAME, DIALOG_STYLE_INPUT, "Character name", "Name already taken. Please pick an original name.", "Change", "");	// Force RP name.
+        }
+        else{   // Name free
+            // Notify all players
+			new message[11 + 4 + MAX_PLAYER_NAME + 1];
+
+			format(message, sizeof(message), "* [%i] %s joined.", playerid, getCharacterName(playerid));
+			SendClientMessageToAll(COLOR_NOTICE, message);	// Notify all players
+			DiscordEcho(message, ECHO_CHANNEL);	// Notify discord public echo
+			
+			new client_connect_username[MAX_PLAYER_NAME + 1], admin_message[38 + 4 + MAX_PLAYER_NAME + MAX_PLAYER_NAME + 1];
+            GetGVarString("client_connect_username", client_connect_username, sizeof(client_connect_username), playerid);   // Get client connect name
+		    if(GetPlayerState(playerid) == PLAYER_STATE_NONE){	// Not spawned: character creation (Creating a character without registering)
+		        // Notify admins
+	            
+	            format(admin_message, sizeof(admin_message), "* [%i] %s temporary charcter, created by: %s", playerid, getCharacterName(playerid), client_connect_username);
+				sendToAdmins(COLOR_NOTICE, admin_message);
+
+	            // Do nothing let continue to spawn, after spawn character will be saved to database.
+		    }
+	    	else{   // Spawnedplayer: Creating permanent or renaming an existing permanent character
+	    	    // Notify admins
+	            format(admin_message, sizeof(admin_message), "* [%i] %s created by: %s", playerid, getCharacterName(playerid), client_connect_username);
+				sendToAdmins(COLOR_NOTICE, admin_message);
+				
+                // Send to skin selection
+                ForceClassSelection(playerid);
+                TogglePlayerSpectating(playerid, true);
+			    TogglePlayerSpectating(playerid, false);
+			}
+	    
+			// Change name  (No way yet to change name ingame)
+			/*if(GetGVarInt("userlevel", playerid) > 1){	// Registered player.
+				// Get username
+				new username[MAX_PLAYER_NAME + 1], message[75 + MAX_PLAYER_NAME + 1];
+				GetGVarString("username", username, sizeof(username), playerid);
+
+				// Update or create character name in database
+				new callback[1];
+				new Result:result;
+				new query[51 + MAX_PLAYER_NAME + MAX_PLAYER_NAME + 1];
+				format(query, sizeof(query), "UPDATE \"user\"(name) VALUES('%s') WHERE username == '%s'", name, username);
+				sql_wait(sqlHandle);	// Wait for other queries to finish
+				result = sql_query(sqlHandle, query, callback = "", "r");
+				
+				// Inform user
+				format(message, sizeof(message), "SERVER: Your username remains unchanged, next time connect as: %s", client_connect_username);
+				SendClientMessage(playerid, COLOR_WHITE, message);
+			}*/
+
+			SetPlayerName(playerid, name);	// Change name in-game
+		}
+	}
+	
+	return 0;
+}
+
+forward register(playerid);
+public register(playerid){	// Register player in database
+	if(GetPlayerState(playerid) == PLAYER_STATE_NONE){	// Not spawned
+		SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "ERROR: You need to have spawned to register.");
+	}
+	else{	// Spawned player
+		if(GetGVarInt("userlevel", playerid) != UNREGISTERED_PLAYER){	// Registered player.
+			new message[35 + MAX_PLAYER_NAME + 1];
+			format(message, sizeof(message), "ERROR: You are already registered"); //, %s.",
+			SendClientMessage(playerid, COLOR_WHITE, message);
+		}
+		else{	// Unregistered player.
+			ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Password", "Please pick a strong and safe password, that you are able to remember.", "Continue", "Cancel");	// Password prompt
+		}
+	}
+}
+
+forward createCharacterRecord(playerid, id);
+public createCharacterRecord(playerid, id){
+	new character_query[94 + MAX_SQL_INTEGER + MAX_PLAYER_NAME + 3 + 1];
+	format(character_query, sizeof(character_query), "INSERT INTO character(user_id, name, skin_id) VALUES(%i, '%s', %i)", id, getPlayerName(playerid), GetPlayerSkin(playerid));
+	sql_query(sqlHandle, character_query);
+}
+
+forward authenticate(playerid);
+public authenticate(playerid){
+    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Sign in", "Enter your password to log on", "Log in", "Cancel");	// Show password confirmation dialog
+}
+
+forward characterSelection(playerid);
+public characterSelection(playerid){
+	if(GetGVarInt("userlevel", playerid) < REGISTERED_PLAYER){  // Unregistered player (Or worse?)
+	    SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "SERVER: Register first with: /my account register");
+	}
+	else{   // Registered player
+		// If spawned, save current character
+		if(GetPlayerState(playerid) != PLAYER_STATE_NONE){
+		    savePlayerState(playerid);
+		}
+
+		new id = getUserID(playerid);
+		new character_query[75 + MAX_SQL_INTEGER + MAX_CHARACTERS_PER_USER_DIGITS + 1];
+		format(character_query, sizeof(character_query), "SELECT id, name FROM character WHERE user_id = %i LIMIT %i", id, MAX_CHARACTERS_PER_USER);
+		new Result:character_result = sql_query(sqlHandle, character_query);
+
+		new character_string[(MAX_PLAYER_NAME * MAX_CHARACTERS_PER_USER) + 1], character_array[MAX_CHARACTERS_PER_USER + 1];
+		for(new i = 0; i < sql_num_rows(character_result); i++){
+			new name[MAX_PLAYER_NAME + 1];
+			sql_get_field_assoc_ex(character_result, i, "name", name, sizeof(name));
+			format(character_string, sizeof(character_string), "%s%s\n", character_string, name);
+			character_array[i] = sql_get_field_assoc_int_ex(character_result, i, "id");
+			printf("Character ID from array: %i", character_array[i]);
+		}
+		new character_array_string[MAX_CHARACTERS_PER_USER * MAX_SQL_INTEGER + 1];
+		strfrombin(character_array_string, character_array);    // Convert array to string for use with GVar
+		SetGVarString("character_array_string", character_array_string, playerid);
+
+		ShowPlayerDialog(playerid, DIALOG_CHARACTERS, DIALOG_STYLE_LIST, "Characters", character_string, "Spawn", "New");
+	}
+}
+
+forward savePlayerState(playerid);
+public savePlayerState(playerid){
+	new escaped_playername[MAX_PLAYER_NAME + 1], character_query[156 + MAX_SQL_INTEGER + (MAX_SQL_FLOAT * 3) + MAX_SQL_INTEGER + (MAX_SQL_FLOAT * 4) + (MAX_SQL_INTEGER * 2) + 1];    // Should be longer to allow for escaped characters
+	sql_escape_string(sqlHandle, getPlayerName(playerid), escaped_playername, sizeof(escaped_playername));	// Escape player name
+	new Float:health, Float:armour, Float:x, Float:y, Float:z, Float:angle;
+	// Unrealiable TODO change to gvars
+	GetPlayerHealth(playerid, health);
+	GetPlayerArmour(playerid, armour);
+	new world_id, interior_id;
+	getPlayerLocation(playerid, x, y, z, angle, world_id, interior_id);
+
+	format(character_query, sizeof(character_query), "UPDATE character SET (cash, health, armour, jailed, pos_x, pos_y, pos_z, rotation, world_id, interior_id) = (%i, '%f', '%f', %i, '%f', '%f', '%f', '%f', %i, %i) WHERE name = '%s'", GetPlayerMoney(playerid), health, armour, 0, x, y, z, angle, world_id, interior_id, escaped_playername);
+	sql_query(sqlHandle, character_query);
+}
+
+forward kickPlayerDelay(playerid);
+public kickPlayerDelay(playerid){
+    Kick(playerid);
+}
+
+forward kickPlayer(playerid, kickerid, const reason[], banned);
+public kickPlayer(playerid, kickerid, const reason[], banned){	// Kick a player
+    // Issuer of kick
+    new kickername[MAX_PLAYER_NAME + 1], kicker_id[MAX_SQL_INTEGER + 1];
+    if(kickerid == -1){ // Not kicked by in-game player
+        kickername = "SERVER";
+        kicker_id = "NULL";
+	}
+	else{   //  Kicked by in-game player
+	    kickername = getPlayerName(playerid);
+	    kicker_id = "%s", getUserID(kickerid);
+	}
+	strreplace(kickername, "_", " ");
+
+	// Action
+	new action[16 + MAX_SQL_INTEGER + 1];
+	if(banned){
+	    if(banned < 1){   // Permanent ban
+			action = "banned permanently";
+		}
+		else{   // Temporary ban
+	        format(action, sizeof(action), "banned for %i days", banned);
+		}
+    }
+    else{
+        action = "kicked";
+	}
+
+	// Notify all players
+	new playername[MAX_PLAYER_NAME + 1], message[16 + 4 + MAX_PLAYER_NAME + MAX_PLAYER_NAME + 16 + MAX_SQL_REASON + 1], admin_message[23 + 4 + MAX_PLAYER_NAME + 16 + MAX_PLAYER_NAME + MAX_SQL_REASON + 1];	// Max samp chat message length 128 - 8 for "/kick ? ".
+    GetPlayerName(playerid, playername, sizeof(playername));
+	format(message, sizeof(message), "* [%i] %s %s, reason: %s", playerid, getCharacterName(playerid), action, reason);
+	format(admin_message, sizeof(admin_message), "* [%i] %s kicked %s, reason: %s", kickerid, kickername, getCharacterName(playerid), action, reason);
+	logger(LOGLEVEL_INFO, message);	// Log event
+	SendClientMessageToAll(COLOR_NOTICE, message);
+	DiscordEcho(message, ECHO_CHANNEL);
+	sendToAdmins(COLOR_NOTICE, admin_message);
+
+	// Inform player (Redundant, but some people are blind or stupid)
+	new player_message[30 + 6 + MAX_PLAYER_NAME + MAX_SQL_REASON + 1];	// Max samp chat message length 128 - 8 for "/kick ? ".
+	format(player_message, sizeof(player_message), "SERVER: You have been %s, reason: %s", action, reason);
+	SendClientMessage(playerid, COLOR_ERROR, player_message);	// Notify player
+	if(banned){
+	    SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "You may appeal this ban via the forum or Discord.");
+	}
+
+	new ip_id = getIPID(playerid);
+	// Crearte IP kick record
+	new ip_query[61 + 4 + MAX_SQL_REASON + 4 + 1];
+	format(ip_query, sizeof(ip_query), "INSERT INTO ip_kick(ip_id, reason, kicker_id) VALUES(%i, '%s', %s)", ip_id, reason, kicker_id);
+	sql_query(sqlHandle, ip_query);
+
+	// Get IP kick record
+	new ip_id_query[64 + 4 + MAX_SQL_REASON + 4 + 1];
+	format(ip_id_query, sizeof(ip_id_query), "SELECT id FROM ip_kick WHERE ip_id = %i ORDER BY id DESC LIMIT 1", ip_id);
+	new Result:ip_id_result = sql_query(sqlHandle, ip_id_query);
+	new ip_kick_id = sql_get_field_assoc_int(Result:ip_id_result, "id");
+
+	// User kick record
+	printf("Userlevel: %i", GetGVarInt("userlevel", playerid));
+	if(GetGVarInt("userlevel", playerid) > UNREGISTERED_PLAYER){    // Not logged in to a user account
+		new user_query[79 + 4 + MAX_SQL_REASON + 4 + 1];
+		format(user_query, sizeof(user_query), "INSERT INTO user_kick(user_id, reason, kicker_id, ip_kick_id) VALUES(%i, '%s', %s, %i)", getUserID(playerid), reason, kicker_id, ip_kick_id);
+		sql_query(sqlHandle, user_query);
+	}
+
+	SetTimerEx("kickPlayerDelay", 50, false, "i", playerid);	// Give the message 50 milliseconds to reach the player before kicking.
+}
+
+banExpiration(days);
+banExpiration(days){
+	if(days < 1){   // Permanent ban
+	    new foo[MAX_SQL_TIMESTAMP + 1] = "0";
+	    return foo;
+	}
+	else{   // Temporary ban
+	    new year, month, day, hour, minute, second, expires[MAX_SQL_TIMESTAMP + 1];
+		getdate(year, month, day);
+		gettime(hour, minute, second);
+		day = day + days;
+		format(expires, sizeof(expires), "%i-%i-%i %i:%i:%i", year, month, day, hour, minute, second);
+		
+		return expires;
+		//return year, month, day, hour, minute, second;
+		//return 0;
+	}
+}
+
+forward banPlayer(playerid, bannerid, const reason[], days);
+public banPlayer(playerid, bannerid, const reason[], days){	// Ban & kick a player
+	new ip_id = getIPID(playerid);
+	// Create IP ban record
+    new banner_id, ip_query[72 + MAX_SQL_INTEGER + MAX_SQL_TIMESTAMP + MAX_SQL_REASON + MAX_SQL_INTEGER + 1];
+	if(bannerid < 0){   // Not banned by in-game player
+	    format(ip_query, sizeof(ip_query), "INSERT INTO ip_ban(ip_id, expires, reason) VALUES(%i, '%s', '%s')", ip_id, banExpiration(days), reason);
+	}
+	else{   // Banned by in-game player
+	    banner_id = getUserID(bannerid);
+	    format(ip_query, sizeof(ip_query), "INSERT INTO ip_ban(ip_id, expires, reason, banner_id) VALUES(%i, '%s', '%s', %i)", ip_id, banExpiration(days), reason, banner_id);
+	}
+	sql_query(sqlHandle, ip_query);
+
+	// Get IP ban record ID
+	new ban_id_query[61 + MAX_PLAYER_NAME + 1];
+	format(ban_id_query, sizeof(ban_id_query), "SELECT id FROM ip_ban WHERE ip_id = %i ORDER BY id DESC LIMIT 1", ip_id);
+	new Result:ban_id_result = sql_query(sqlHandle, ban_id_query);
+ 	new ip_ban_id = sql_get_field_assoc_int(ban_id_result, "id");
+
+	// User ban record (As banned players get only kicked, noneed to check for active ban)
+	if(GetGVarInt("userlevel", playerid) > 1){  // Registered player
+		new user_query[97 + MAX_SQL_INTEGER + MAX_SQL_TIMESTAMP + MAX_SQL_REASON + MAX_SQL_INTEGER + MAX_SQL_INTEGER + 1];
+		format(user_query, sizeof(user_query), "INSERT INTO user_ban(user_id, expires, reason, banner_id, ip_ban_id) VALUES(%i, %s, %s, %i, %i) WHERE id = %i", ip_id, banExpiration(days), reason, banner_id, ip_ban_id);
+		sql_query(sqlHandle, user_query);
+	}
+
+	// Kick player
+	kickPlayer(playerid, bannerid, reason, days);
+}
+
+
+// Database functions
+forward getIPID(playerid);
+public getIPID(playerid){
+    new player_ip[MAX_SQL_IP + 1], query[37 + MAX_SQL_IP + 1]; // Create varaibles
+    GetPlayerIp(playerid, player_ip, sizeof(player_ip));    // Polulate player_ip variable
+	format(query, sizeof(query), "SELECT id FROM ip WHERE address = '%s'", player_ip);   // Format query string
+	new Result:result = sql_query(sqlHandle, query);    // Execute query
+	
+	return sql_get_field_assoc_int(result, "id");  // Get id from result
+}
+
+forward getUserID(playerid);
+public getUserID(playerid){
+	// SQL escape username
+    new client_connect_username[MAX_PLAYER_NAME + 1], escaped_username[MAX_PLAYER_NAME + 1]; // TODO escaped_username should be longer to account for escape characters (Also increate database column size!)
+	GetGVarString("client_connect_username", client_connect_username, sizeof(client_connect_username), playerid);   // Get client connect name
+	sql_escape_string(sqlHandle, client_connect_username, escaped_username, sizeof(escaped_username));	// Escape player name
+
+	// Get user ID
+	new userid_query[47 + MAX_PLAYER_NAME + 1];
+	format(userid_query, sizeof(userid_query), "SELECT id FROM \"user\" WHERE name = '%s'", escaped_username);
+	new Result:result = sql_query(sqlHandle, userid_query);
+
+	return sql_get_field_assoc_int(result, "id");
+}
+
+// Player functions
+forward deleteAllGVars(playerid);
+public deleteAllGVars(playerid){    // Delete GVars as per https://forum.sa-mp.com/showthread.php?t=151076
+	DeleteGVar("client_connect_username", playerid);    // From OnPlayerConnect()
+	DeleteGVar("userlevel", playerid);  				// From OnPlayerConnect()
+	DeleteGVar("hash", playerid);       				// From DIALOG_REGISTER
+	DeleteGVar("character_array_string", playerid);		// From OnDialogResponse()
+	DeleteGVar("authentication_count", playerid);       // From DIALOG_LOGIN
+	DeleteGVar("character_id", playerid);                // From DIALOG_CHARACTERS
+	DeleteGVar("chatmode", playerid);                   // From cmd:my()
+	DeleteGVar("disable_pickups", playerid);			// From OnPlayerPickUpDynamicPickup()
+	DeleteGVar("goto_target", playerid);				// From cmd:my() & cmd:p()
+	DeleteGVar("job", playerid);                        // From OnDialogResponse()
+}
+
+//getPlayerName(playerid);
+getPlayerName(playerid){
+//	new playername[MAX_PLAYER_NAME + 1];
+	new const playername[MAX_PLAYER_NAME + 1];
+	GetPlayerName(playerid, playername, sizeof(playername));
+
+//	new output[MAX_PLAYER_NAME + 1];
+//	strfromliteral(output, playername);
+	
+	return playername;
+}
+
+forward gotoCallback(Float:x, Float:y, Float:z, world, interior, Float:angle, const name[], playerid = -1);
+stock gotoCallback(Float:x, Float:y, Float:z, world, interior, Float:angle, const name[], playerid = -1){
+	if(playerid== -1){
+	    playerid = GetGVarInt("goto_target", playerid);
+		DeleteGVar("goto_target", playerid);
+	}
+
+    teleportPlayer(playerid, x, y, z, angle, world, interior);
+	
+	// Inform admins
+	new admin_message[21 + 4 + MAX_PLAYER_NAME + 5 + 4 + MAX_PLAYER_NAME + 1 + 1];  // 5 + 4 + MAX_PLAYER_NAME + 1 = name
+	format(admin_message, sizeof(admin_message), "* [%i] %s teleported to: %s", playerid, getCharacterName(playerid), name);
+	sendToAdmins(COLOR_NOTICE, admin_message);
+}
+
+forward setPlayerSkin(playerid, skinid);
+public setPlayerSkin(playerid, skinid){
+	print("Called setPlayerSkin()");
+	new
+	    Float:tmpPos[4],
+		vehicleid = GetPlayerVehicleID(playerid),
+		seatid = GetPlayerVehicleSeat(playerid);
+	GetPlayerPos(playerid, tmpPos[0], tmpPos[1], tmpPos[2]);
+	GetPlayerFacingAngle(playerid, tmpPos[3]);
+	if(skinid < 0 || skinid > 299) return 0;
+	if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DUCK)
+	{
+	    SetPlayerPos(playerid, tmpPos[0], tmpPos[1], tmpPos[2]);
+		SetPlayerFacingAngle(playerid, tmpPos[3]);
+		TogglePlayerControllable(playerid, 1); // preventing any freeze - optional
+		return SetPlayerSkin(playerid, skinid);
+	}
+	else if(IsPlayerInAnyVehicle(playerid))
+	{
+	    new
+	        tmp;
+	    RemovePlayerFromVehicle(playerid);
+	    SetPlayerPos(playerid, tmpPos[0], tmpPos[1], tmpPos[2]);
+		SetPlayerFacingAngle(playerid, tmpPos[3]);
+		TogglePlayerControllable(playerid, 1); // preventing any freeze - important - because of doing animations of exiting vehicle
+		tmp = SetPlayerSkin(playerid, skinid);
+		PutPlayerInVehicle(playerid, vehicleid, (seatid == 128) ? 0 : seatid);
+		return tmp;
+	}
+	else
+	{
+	    return SetPlayerSkin(playerid, skinid);
+	}
+}
+
+forward getPlayerLocation(playerid, &Float:x, &Float:y, &Float:z, &Float:angle, &world, &interior);
+public getPlayerLocation(playerid, &Float:x, &Float:y, &Float:z, &Float:angle, &world, &interior){
+	GetPlayerPos(playerid, x, y, z);
+	GetPlayerFacingAngle(playerid, angle);
+	world = GetPlayerVirtualWorld(playerid);
+	interior = GetPlayerInterior(playerid);
+	printf("Angle: %f", angle);
+}
+
+forward teleportPlayer(playerid, Float:x, Float:y, Float:z, Float:angle, world, interior);
+public teleportPlayer(playerid, Float:x, Float:y, Float:z, Float:angle, world, interior){
+    SetPlayerPos(playerid, x, y, z);
+	SetPlayerVirtualWorld(playerid, world);
+	SetPlayerInterior(playerid, interior);
+	SetPlayerFacingAngle(playerid, angle);
+}
+
+//forward setPlayerJob(playerid, job, skin_id = 0, color = COLOR_WHITE);
+stock setPlayerJob(playerid, job, skin_id = 0, color = COLOR_WHITE){
+	switch(job){
+	    case JOB_NONE:{
+			// Get skin from character record
+			new character_query[42 + MAX_SQL_INTEGER + 1];
+		    format(character_query, sizeof(character_query), "SELECT skin_id FROM character WHERE id = %i", GetGVarInt("character_id", playerid));
+		    new Result:id_result = sql_query(sqlHandle, character_query);
+		    skin_id = sql_get_field_assoc_int(id_result, "skin_id");
+		    
+		    color = COLOR_WHITE;
+		    ResetPlayerWeapons(playerid);
+		    // TODO: get weaponskill fromddatabase and set it to player.
+		    // TODO: Set player weapons from database
+		}
+		case JOB_POLICE:{
+		    SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 1);
+			GivePlayerWeapon(playerid, 3, 1);   	// Baton
+			GivePlayerWeapon(playerid, 17, 10);		// Teargas
+			GivePlayerWeapon(playerid, 22, 170);    // 10 clips and a 9mm
+		}
+//		case JOB_MEDIC:
+		case JOB_FIRE:{
+		    GivePlayerWeapon(playerid, 42, 1);   	// Fire extinguisher
+		}
+		case JOB_SHERIFF:{
+		    SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 1);
+			GivePlayerWeapon(playerid, 3, 1);   	// Baton
+			GivePlayerWeapon(playerid, 17, 10);		// Teargas
+			GivePlayerWeapon(playerid, 22, 170);    // 10 clips and a 9mm
+		}
+		case JOB_FBI:{
+  		    GivePlayerWeapon(playerid, 42, 1);   	// Fire extinguisher
+		}
+		case JOB_DMV:{
+			GivePlayerWeapon(playerid, 17, 10);		// Teargas
+		}
+		case JOB_NEWS:{
+		    GivePlayerWeapon(playerid, 43, 1);		// Camera
+		}
+	}
+	printf("setPlayerSkin(%i, %i);", playerid, skin_id);
+    setPlayerSkin(playerid, skin_id);
+	SetGVarInt("job", job, playerid);
+    SetPlayerColor(playerid, color);
+}
+
+
+// Chat functions
+//forward getCharacterName(playerid);
+stock getCharacterName(playerid){ // Convert name from player name
+	new playername[MAX_PLAYER_NAME + 1];
+	GetPlayerName(playerid, playername, sizeof(playername));
+	strreplace(playername, "_", " ");
+
+	return playername;
+}
+
+forward sendToChat(playerid, target, text[128 + 1], receiver_id, DCC_User:author);
+public sendToChat(playerid, target, text[128 + 1], receiver_id, DCC_User:author){
+    strtrim(text);  // Trim edge whitespaces
+	if(isempty(text)){
+	    return 0;   // Fail if text is empty
+	}
+    new playername[MAX_PLAYER_NAME + 1];
+    if(playerid < 0){
+		DCC_GetUserName(author, playername, sizeof(playername));
+	}  // Discord messagge
+	else{playername = getCharacterName(playerid);}
+	
+	new chat_format, chat_color, chat_range, chat_userlevel, chat_character[1 + 1], chat_name[13 + 1], discord_channel;
+	switch(target){
+	    case CHAT_WHISPER:{
+			chat_format = 2;
+			chat_range = 3;
+			chat_name = "whispers";
+			chat_color = COLOR_COMMAND_OUTPUT;
+			discord_channel = ADMIN_ECHO_CHANNEL;
+		}
+		case CHAT_LOW:{
+			chat_format = 2;
+			chat_range = 10;
+			chat_name = "speaks softly";
+			chat_color = COLOR_COMMAND_OUTPUT;
+			discord_channel = ADMIN_ECHO_CHANNEL;
+		}
+        case CHAT_LOCAL:{
+            chat_format = 1;
+            chat_range = 20;
+			chat_color = COLOR_COMMAND_OUTPUT;
+			discord_channel = ADMIN_ECHO_CHANNEL;
+		}
+		case CHAT_SHOUT:{
+		    chat_format = 2;
+		    chat_range = 50;
+			chat_name = "shouts";
+			chat_color = COLOR_COMMAND_OUTPUT;
+			discord_channel = ADMIN_ECHO_CHANNEL;
+		}
+		case CHAT_ACTION:{
+		    chat_format = 0;
+		    chat_range = 20;
+			chat_color = COLOR_COMMAND_OUTPUT;
+			discord_channel = ADMIN_ECHO_CHANNEL;
+		}
+        case CHAT_OC:{
+	        chat_format = 3;
+            chat_range = 20;
+            chat_character = "'";
+            chat_name = "OOC";
+			chat_color = COLOR_COMMAND_OUTPUT;
+			discord_channel = ADMIN_ECHO_CHANNEL;
+		}
+  		case CHAT_GLOBAL:{
+	  		chat_format = 3;
+			chat_character = "`";
+			chat_name = "Global";
+			chat_color = COLOR_COMMAND_OUTPUT;
+			discord_channel = ECHO_CHANNEL;
+		}
+		case CHAT_GANG:{
+		    chat_format = 3;
+			chat_character = "~";
+			chat_name = "Gang";
+			chat_color = COLOR_CREW_CHAT;
+			// TODO: Output to gang Discord channel
+			discord_channel = ADMIN_ECHO_CHANNEL;
+		}
+		case CHAT_GANG_OC:{
+		    chat_format = 3;
+			chat_character = "#";
+			chat_name = "Gang OC";
+			chat_color = COLOR_CREW_CHAT;
+			// TODO: Output to gang Discord channel
+			discord_channel = ADMIN_ECHO_CHANNEL;
+		}
+		case CHAT_FACTION:{
+		    chat_format = 3;
+			chat_character = "!";
+			chat_name = "Faction";
+			chat_color = COLOR_CREW_CHAT;
+			// TODO: Output to faction Discord channel
+			discord_channel = ADMIN_ECHO_CHANNEL;
+		}
+		case CHAT_FACTION_OC:{
+		    chat_format = 3;
+			chat_character = "$";
+			chat_name = "Faction OC";
+			chat_color = COLOR_CREW_CHAT;
+			// TODO: Output to faction Discord channel
+			discord_channel = ADMIN_ECHO_CHANNEL;
+		}
+		case CHAT_CREW:{
+		    chat_format = 3;
+			chat_character = "@";
+			chat_name = "Crew";
+			chat_color = COLOR_CREW_CHAT;
+			chat_userlevel = MODERATOR_CREW;
+			discord_channel = ADMIN_ECHO_CHANNEL;
+		}
+		case CHAT_ADMIN:{
+		    chat_format = 3;
+			chat_character = "%";
+			chat_name = "Admin";
+			chat_color = COLOR_ADMIN_CHAT;
+			chat_userlevel = ADMIN_CREW;
+			discord_channel = ADMIN_ECHO_CHANNEL;
+		}
+		case CHAT_MANAGEMENT:{
+		    chat_format = 3;
+			chat_character = "&";
+			chat_name = "Management";
+			chat_color = COLOR_ADMIN_CHAT;
+			chat_userlevel = MANAGEMENT_CREW;
+			discord_channel = MANAGEMENT_CHANNEL;
+		}
+		case CHAT_VIP:{
+		    chat_format = 3;
+			chat_character = "^";
+			chat_name = "VIP";
+			chat_color = COLOR_VIP_CHAT;
+			chat_userlevel = VIP_PLAYER;
+			discord_channel = ADMIN_ECHO_CHANNEL;
+			//TODO: Add VIP discord channel.
+		}
+		case CHAT_UNDERCOVER:{
+		    chat_format = -1;
+			chat_character = "*";
+			chat_color = COLOR_COMMAND_OUTPUT;
+			chat_userlevel = ADMIN_CREW;
+			discord_channel = ECHO_CHANNEL;
+		}
+		case CHAT_PM:{
+		    chat_format = 3;
+		    chat_character = ">";
+		    chat_name = "PM";
+			chat_color = COLOR_PM_CHAT;
+			discord_channel = ADMIN_ECHO_CHANNEL;
+		}
+		case CHAT_CALL:{
+		    chat_format = 3;
+		    chat_character = "+";
+		    chat_name = "Call";
+			chat_color = COLOR_PM_CHAT;
+			discord_channel = ADMIN_ECHO_CHANNEL;
+		}
+		case CHAT_SMS:{
+		    chat_format = 3;
+		    chat_character = "-";
+		    chat_name = "SMS";
+			chat_color = COLOR_PM_CHAT;
+			discord_channel = ADMIN_ECHO_CHANNEL;
+		}
+		case CHAT_RADIO:{
+		    chat_format = 3;
+		    chat_character = "=";
+		    chat_name = "Radio";
+			chat_color = COLOR_PM_CHAT;
+			discord_channel = ADMIN_ECHO_CHANNEL;
+		}
+	}
+	
+	// Format chat message
+	new message[9 + sizeof(chat_character) + (6 * 8) + sizeof(chat_name) + 4 + MAX_PLAYER_NAME + 128 + 1];
+	new discord_message[23 + sizeof(chat_character) + sizeof(chat_name) + sizeof(playerid) + MAX_PLAYER_NAME + 128 + 1];
+	switch(chat_format){
+	    case -1:{
+			format(message, sizeof(message), "%s %s", chat_character, text);
+			format(discord_message, sizeof(discord_message), "```css\n%s %s\n```", chat_character, text);
+		}
+		case 0:{
+			format(message, sizeof(message), EMBED_COLOR_GREY"[{%06x}%i"EMBED_COLOR_GREY"] {%06x}%s{%06x} %s", GetPlayerColor(playerid) >>> 8, playerid, GetPlayerColor(playerid) >>> 8, playername, chat_color >>> 8, text);
+			format(discord_message, sizeof(discord_message), "```css\n[%i] %s %s\n```", playerid, playername, text);
+		}
+		case 1:{
+			format(message, sizeof(message), EMBED_COLOR_GREY"[{%06x}%i"EMBED_COLOR_GREY"] {%06x}%s"EMBED_COLOR_GREY":{%06x} %s", GetPlayerColor(playerid) >>> 8, playerid, GetPlayerColor(playerid) >>> 8, playername, chat_color >>> 8, text);
+			format(discord_message, sizeof(discord_message), "```css\n[%i] %s: %s\n```", playerid, playername, text);
+		}
+		case 2:{
+			format(message, sizeof(message), EMBED_COLOR_GREY"[{%06x}%i"EMBED_COLOR_GREY"] {%06x}%s %s"EMBED_COLOR_GREY":{%06x} %s", GetPlayerColor(playerid) >>> 8, playerid, GetPlayerColor(playerid) >>> 8, playername, chat_name, chat_color >>> 8, text);
+			format(discord_message, sizeof(discord_message), "```css\n[%i] %s %s: %s\n```", playerid, playername, chat_name, text);
+		}
+		case 3:{
+			format(message, sizeof(message), "%s "EMBED_COLOR_GREY"({%06x}%s"EMBED_COLOR_GREY") [{%06x}%i"EMBED_COLOR_GREY"] {%06x}%s"EMBED_COLOR_GREY":{%06x} %s", chat_character, chat_color >>> 8, chat_name, GetPlayerColor(playerid) >>> 8, playerid, GetPlayerColor(playerid) >>> 8, playername, chat_color >>> 8, text);
+			format(discord_message, sizeof(discord_message), "```css\n%s (%s) [%i] %s: %s\n```", chat_character, chat_name, playerid, playername, text);
+		}// Good discord tag options for color effects: yaml, css, moon, elixir, haxe, groovy, brainfuck, accesslog,inform7, c,
+	}
+	
+	// Authorisation
+	if(chat_userlevel && chat_userlevel > GetGVarInt("userlevel", playerid)){    // User not privilged to read chat
+	    if(target == CHAT_CREW){    // Show the user the message was sent to crew chat.
+	        SendClientMessage(playerid, chat_color, message);
+		}
+		else{
+		    SendClientMessage(playerid, COLOR_CREW_CHAT, "ERROR: You are not authorized to speak in this chat.");
+
+		    return 0;   // Fail to send the message
+		}
+	}
+	
+    // Send TODO: Add checks for muted.
+    if(chat_range){ // Ranged chats
+        logger(LOGLEVEL_CHAT, message);	// Log event
+        
+        // Show message to players in range
+        new Float:x, Float:y, Float:z;
+		GetPlayerPos(playerid, x, y, z);
+		for(new recipient_id, a = GetMaxPlayers(); recipient_id < a; recipient_id++){
+			if(IsPlayerConnected(receiver_id)){
+				new Float:distance = GetPlayerDistanceFromPoint(recipient_id, x, y, z);
+				if(distance <= chat_range){  // Player nearby
+		    		sendClientMultiMessage(recipient_id, chat_color, message, Bool:false);
+				}
+			}
+		}
+
+    	DiscordEcho(discord_message, discord_channel);
+	}
+	else{   // Global chats
+	    if(target == CHAT_GLOBAL){  // Public chat
+	        logger(LOGLEVEL_CHAT, message);	// Log event
+     		sendClientMultiMessage(0, chat_color, message, Bool:true);
+     		DiscordEcho(discord_message, discord_channel);
+   		}
+   		else if(target == CHAT_GANG || target == CHAT_GANG_OC || target == CHAT_FACTION || target == CHAT_FACTION_OC || target == CHAT_CALL || target == CHAT_SMS || target == CHAT_RADIO ){    // Entity chat
+			// TODO
+			// TODO sendToAdmins();
+			// TODO send to specific discord channel
+			SendClientMessage(playerid, chat_color, "You are not a member of the required entity.");
+		}
+		else if(target == CHAT_PM){
+		    new output[sizeof(message)];
+			strdel(message, 0, 1);
+		    format(output, sizeof(output), "<%s", message);
+			sendClientMultiMessage(receiver_id, chat_color, output, Bool:false);
+			
+			new receipt[12 + 1 + sizeof(chat_name) + 4 + MAX_PLAYER_NAME + 128 + 1];
+			format(receipt, sizeof(receipt), "%s (%s) to [%i] %s: %s", chat_character, chat_name, receiver_id, playername, text);
+			sendClientMultiMessage(playerid, chat_color, receipt, Bool:false);
+
+			new admin_message[15 + 1 + sizeof(chat_name) + 4 + MAX_PLAYER_NAME + 4 + 128 + 1];
+			format(admin_message, sizeof(admin_message), "%s (%s) [%i] %s to [%i]: %s", chat_character, chat_name, playerid, playername, receiver_id, text);
+			logger(LOGLEVEL_CHAT, admin_message);	// Log event
+			
+			sendToAdmins(chat_color, admin_message);
+		}
+		
+		else{   // Chat with privileged users
+			for(new recipient_id, a = GetMaxPlayers(); recipient_id < a; recipient_id++){
+				if(IsPlayerConnected(recipient_id)){
+					if(GetGVarInt("userlevel", recipient_id) >= chat_userlevel){    // Privileged
+					    logger(LOGLEVEL_CHAT, message);	// Log event
+						sendClientMultiMessage(recipient_id, chat_color, message, Bool:false);
+						DiscordEcho(discord_message, discord_channel);
+					}
+				}
+			}
+		}
+	}
+	return 1;
+}
+
+forward sendToAdmins(chat_color, const message[]);
+public sendToAdmins(chat_color, const message[]){
+    for(new recipient_id, a = GetMaxPlayers(); recipient_id < a; recipient_id++){
+		if(IsPlayerConnected(recipient_id)){
+			if(GetGVarInt("userlevel", recipient_id) >= ADMIN_CREW){    // Privileged
+				SendClientMessage(recipient_id, chat_color, message);
+			}
+		}
+	}
+	DiscordEcho(message, ADMIN_ECHO_CHANNEL);
+}
+
+forward sendPM(playerid, text[128 + 1], recipient_id);
+public sendPM(playerid, text[128 + 1], recipient_id){
+	if (recipient_id == INVALID_PLAYER_ID){
+		SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "ERROR: Player not found.");
+	}
+	else{
+		sendToChat(playerid, CHAT_PM, text, recipient_id, DCC_INVALID_USER);
+	}
+}
+
+forward sendClientMultiMessage(recipient_id, chat_color, const message[], Bool:toall);
+public sendClientMultiMessage(recipient_id, chat_color, const message[], Bool:toall){
+    if(strlen(message) > 144){  // SAMP does not send messages longer than 144 characters
+        new part_1[144 + 1], part_2[144 + 1];
+        strmid(part_1, message, 0, 143);    // TODO see if this can be moved 1 bit
+        strmid(part_2, message, 143, 286);
+		if(toall){
+			SendClientMessageToAll(chat_color, part_1);
+			SendClientMessageToAll(chat_color, part_2);
+		}
+		else{
+	        SendClientMessage(recipient_id, chat_color, part_1);
+    	    SendClientMessage(recipient_id, chat_color, part_2);
+		}
+	}
+	else{
+	    if(toall){SendClientMessageToAll(chat_color, message);}
+	    else{SendClientMessage(recipient_id, chat_color, message);}
+	}
+}
+
+// Pickup functions
+forward createDynamicPickup(object, Float:x, Float:y, Float:z, world, interior, pickup_type);
+public createDynamicPickup(object, Float:x, Float:y, Float:z, world, interior, pickup_type){
+	// Object position corrections
+	if(object == 19902){
+	    z = z - 0.5;
+	}
+	else if(object == 19607){
+	    z = z - 0.5;
+	}
+	
+	// Pickup types
+	new type;
+	switch(pickup_type){
+		case 99999: type = 2;
+		default: type = 1;
+	}
+
+    new pickupid = CreateDynamicPickup(object, type, x, y, z, world, interior);
+    SetGVarInt("pickup_type", pickup_type, pickupid);
+    printf("new pickupid = CreateDynamicPickup(%i, %i, %f, %f, %f, %i, %i);", pickupid, object, type, x, y, z, world, interior);
+    return pickupid;
+}
+
+forward spawnPortal(id, object, Float:pos_x, Float:pos_y, Float:pos_z, world, interior, exit_object, Float:exit_pos_x, Float:exit_pos_y, Float:exit_pos_z, exit_world, exit_interior);
+public spawnPortal(id, object, Float:pos_x, Float:pos_y, Float:pos_z, world, interior, exit_object, Float:exit_pos_x, Float:exit_pos_y, Float:exit_pos_z, exit_world, exit_interior){
+	new pickup_id = createDynamicPickup(object, pos_x, pos_y, pos_z, world, interior, PICKUP_PORTAL);
+	SetGVarFloat("pickup_x", exit_pos_x, pickup_id);
+	SetGVarFloat("pickup_y", exit_pos_y, pickup_id);
+	SetGVarFloat("pickup_z", exit_pos_z, pickup_id);
+	SetGVarInt("pickup_world", exit_world, pickup_id);
+	SetGVarInt("pickup_interior", exit_interior, pickup_id);
+	new exit_pickup_id = createDynamicPickup(exit_object, exit_pos_x, exit_pos_y, exit_pos_z, exit_world, exit_interior, PICKUP_PORTAL);
+	SetGVarFloat("pickup_x", pos_x, exit_pickup_id);
+	SetGVarFloat("pickup_y", pos_y, exit_pickup_id);
+	SetGVarFloat("pickup_z", pos_z, exit_pickup_id);
+	SetGVarInt("pickup_world", world, exit_pickup_id);
+	SetGVarInt("pickup_interior", interior, exit_pickup_id);
+
+	new portal_query[64 + MAX_SQL_INTEGER + MAX_SQL_INTEGER + MAX_SQL_INTEGER + 1];
+	format(portal_query, sizeof(portal_query), "UPDATE portal SET (pickup_id, exit_pickup_id) = (%i, %i) WHERE id = %i", pickup_id, exit_pickup_id, id);
+	sql_query(sqlHandle, portal_query);
+}
+
+forward destroyPortal(id);
+public destroyPortal(id){
+    DestroyDynamicPickup(id);
+	DeleteGVar("pickup_type", id);
+	DeleteGVar("pickup_x", id);
+	DeleteGVar("pickup_y", id);
+	DeleteGVar("pickup_z", id);
+	DeleteGVar("pickup_world", id);
+	DeleteGVar("pickup_interior", id);
+}
+
+// Vehicle functions
+getVehicleModelFromName(name[])
+{
+        for(new i = 0; i < 211; i++)
+        {
+                if(strfind(vehicleNameArray[i], name, true) != -1)
+                return i + 400;
+        }
+        return -1;
+}
+
+stock editVehicle(playerid, target, option, color1 = -1, color2 = -1, respawn = -1){
+	new vehicleid = GetPlayerVehicleID(target);
+    if(vehicleid == 0){
+	    return SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Target player does not occupy a vehicle.");
+	}
+	
+    // Get vehicle record
+    new vehicle_query[54 + sizeof(vehicleid) + 1], admin_message[23 + (4 * 2) + (MAX_PLAYER_NAME * 2) + 1];
+    format(vehicle_query, sizeof(vehicle_query), "SELECT id, addsiren FROM vehicle WHERE vehicle_id = %i", vehicleid);
+	new Result:vehicle_result = sql_query(sqlHandle, vehicle_query), record_id;
+	if(sql_num_rows(vehicle_result) > 0){ // Record exists
+		record_id = sql_get_field_assoc_int(vehicle_result, "id");
+	}
+	
+	new save_query[88 + (MAX_SQL_INTEGER *2) + (MAX_SQL_FLOAT * 4) + 1];
+	switch(option){
+	    case EDITVEHICLE_PARK:{
+	        new Float:x, Float:y, Float:z, Float:angle;
+			GetVehiclePos(vehicleid, x, y, z);
+			GetVehicleZAngle(vehicleid, angle);
+			
+		    if(sql_num_rows(vehicle_result) < 1){   // New vehicle
+				format(save_query, sizeof(save_query), "INSERT INTO vehicle(model_id, pos_x, pos_y, pos_z, angle, vehicle_id) VALUES(%i, %f, %f, %f, %f, %i)", GetVehicleModel(vehicleid), x, y, z, angle, vehicleid);
+				format(admin_message, sizeof(admin_message), "* [%i] %s has saved a vehicle for [%i] %s", playerid, getPlayerName(playerid), target, getPlayerName(target));
+			}
+			else{   // Existing vehicle
+		        format(save_query, sizeof(save_query), "UPDATE vehicle(pos_x, pos_y, pos_z, angle) VALUES(%f, %f, %f, %f) WHERE id = %i", x, y, z, angle, record_id);
+				format(admin_message, sizeof(admin_message), "* [%i] %s has parked vehicle %i, for [%i] %s", record_id, getPlayerName(playerid), record_id, target, getPlayerName(target));
+			}
+		    sql_query(sqlHandle, save_query);
+			sendToAdmins(COLOR_NOTICE, admin_message);
+		}
+		case EDITVEHICLE_COLOR:{
+		    if(sql_num_rows(vehicle_result) < 1){
+		        SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "To be able to permanently save colours, the vehicle needs to be parked first.");
+		    }
+		    else{
+		        format(save_query, sizeof(save_query), "UPDATE vehicle(color1, color2) VALUES(%i, %i) WHERE id = %i", color1, color2, record_id);
+		        format(admin_message, sizeof(admin_message), "* [%i] %s has updated the colours of vehicle %i, for [%i] %s", playerid, getPlayerName(playerid), record_id, target, getPlayerName(target));
+		        sql_query(sqlHandle, save_query);
+		    }
+	     	ChangeVehicleColor(vehicleid, color1, color2);
+		}
+		case EDITVEHICLE_RESPAWN:{
+            if(sql_num_rows(vehicle_result) < 1){
+                SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "To be able to save the respawn delay, the vehicle needs to be parked first.");
+            }
+		    else{
+		        DestroyVehicle(vehicleid);
+				format(save_query, sizeof(save_query), "UPDATE vehicle SET respawn_delay = %i WHERE id = %i", respawn, record_id);
+		        format(admin_message, sizeof(admin_message), "* [%i] %s has updated the respawn delay of vehicle %i, for [%i] %s", playerid, getPlayerName(playerid), record_id, target, getPlayerName(target));
+		        sql_query(sqlHandle, save_query);
+				vehicleid = addvehicle(record_id);
+				PutPlayerInVehicle(target, vehicleid, 0);
+		    }
+			
+		}
+		case EDITVEHICLE_SIREN:{
+	    	printf("num rows: %i", sql_num_rows(vehicle_result));
+            if(sql_num_rows(vehicle_result) < 1){
+                SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "To be able to save the siren, the vehicle needs to be parked first.");
+            }
+		    else{
+		        DestroyVehicle(vehicleid);
+			    new siren = sql_get_field_assoc_int(vehicle_result, "addsiren");
+			    if(siren){
+			        format(save_query, sizeof(save_query), "UPDATE vehicle(siren) VALUES(0) WHERE id = %i", record_id);
+			        format(admin_message, sizeof(admin_message), "* [%i] %s has removed the siren of vehicle %i, for [%i] %s", playerid, getPlayerName(playerid), record_id, target, getPlayerName(target));
+                    vehicleid = addvehicle(record_id);
+			        PutPlayerInVehicle(target, vehicleid, 0);
+				}
+			    else{
+			        format(save_query, sizeof(save_query), "UPDATE vehicle(siren) VALUES(1) WHERE id = %i", record_id);
+			        format(admin_message, sizeof(admin_message), "* [%i] %s has added a siren to vehicle %i, for [%i] %s", playerid, getPlayerName(playerid), record_id, target, getPlayerName(target));
+			        sql_query(sqlHandle, save_query);
+			        vehicleid = addvehicle(record_id);
+			        PutPlayerInVehicle(target, vehicleid, 0);
+				}
+		    }
+		}
+	}
+	
+	return 0;
+}
+
+addvehicle(vehicle_id){
+    // Get vehicle record
+    new vehicle_query[109 + (MAX_SQL_INTEGER * 6) + (MAX_SQL_FLOAT * 4) + 1];
+    format(vehicle_query, sizeof(vehicle_query), "SELECT model_id, pos_x, pos_y, pos_z, angle, color1, color2, respawn_delay, addsiren FROM vehicle WHERE id = %i", vehicle_id);
+	new Result:vehicle_result = sql_query(sqlHandle, vehicle_query);
+	if(sql_num_rows(vehicle_result) > 0){   // Record exists
+	
+	    new model_id = sql_get_field_assoc_int(vehicle_result, "model_id"); // Work around for next line will be deemed to long with this included.
+		new vehicleid = AddStaticVehicleEx(model_id, sql_get_field_assoc_float(vehicle_result, "pos_x"), sql_get_field_assoc_float(vehicle_result, "pos_y"), sql_get_field_assoc_float(vehicle_result, "pos_z"), sql_get_field_assoc_float(vehicle_result, "angle"), sql_get_field_assoc_int(vehicle_result, "color1"), sql_get_field_assoc_int(vehicle_result, "color2"), sql_get_field_assoc_int(vehicle_result, "respawn_delay"), sql_get_field_assoc_int(vehicle_result, "addsiren"));
+		printf("Added ingame vehicle: %i", vehicleid);
+		new update_query[44 + (MAX_SQL_INTEGER * 2) + 1];
+		format(update_query, sizeof(update_query), "UPDATE vehicle SET vehicle_id = %i WHERE id = %i", vehicleid, vehicle_id);
+		sql_query(sqlHandle, update_query);
+
+		return vehicleid;
+	}
+
+	return 0;
+}
+	
+
+// Command functions
+public OnPlayerCommandPerformed(playerid, cmd[], params[], result, flags){
+    if(result == -1){
+        SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "SERVER: Unknown command.");
+
+        return 0;
+    }
+
+    return 1;
+}
+public OnPlayerCommandReceived(playerid, cmd[], params[], flags){
+	new userlevel = GetGVarInt("userlevel", playerid);
+	if(flags){
+	    if(flags > userlevel){
+	        SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "SERVER: Access denied.");
+        	printf("player %d doesn�t have access to command '%s'", playerid, cmd); // TODO make a list of unique commands we dont have but people try to use
+        	
+        	return 0;
+		}
+	}
+
+    return 1;
+}
+public PC_OnInit(){ // TODO
+
+	return 1;	// Remove this once stuff is in place.
+}
+
+flags:test(ADMIN_CREW);
+cmd:test(playerid, params[]){
+	SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Executed");
+
+	return 1;
+}
+
+// Command commands
+cmd:help(playerid, params[]){
+    SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "SERVER: Ask questions in the chat, on Discord or the forum.\nTo list all commands: /cmds");
+
+    return 1;
+}
+alias:help("h");
+
+cmd:cmds(playerid, params[]){
+	SendClientMessage(playerid, COLOR_NOTICE, "Command help syntax: \"/\" = start of cmd, \"()\" = group, \"|\" = or, \"<>\" = required parameter, \"[]\" = optional parameter, \",\" = next item.");
+	SendClientMessage(playerid, COLOR_NOTICE, "Command help syntax example: /command <parameter> [optional_parameter], /next_command (option | option | option <parameter> <parameter>)");
+	SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "General commands: (/help, /h), (/cmds, /cmd, /commands), (/my, /myself, /mine), (/v, /vehivle, /veh), (/p, /player)");
+	SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Chat commands: (/me, /emote, /action) <msg>, (/w, /whisper) <msg>, (/low, /soft) <msg>, (/l, /local) <msg>, (/s, /shout, /scream) <msg>, (/o, ', /oc, /ooc) <msg>");
+	SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Chat commands: (/g, `, /global, /public) <msg>, (/gc, ~) <msg>, (/fc, !) <msg>, (/vc, &) <msg>, (/cc, @) <msg>, /my chatmode <chat_name>");
+	if(GetGVarInt("userlevel", playerid) >= ADMIN_CREW){
+	    SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Admin commands: /property (pickup | portal)");
+	    SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Admin commands extend the options for commands like /my, /p & /v");
+	}
+
+    return 0;
+}
+alias:cmds("commands", "cmd");
+
+// User commands
+cmd:register(playerid, params[]){
+	register(playerid);
+}
+
+cmd:my(playerid, params[]){
+	// No option specified
+	if(strlen(params) < 1){
+		SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Usage: /my <option> <value>");
+		SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Options: account, chatmode");
+		if(GetGVarInt("userlevel", playerid) >= ADMIN_CREW){
+		    SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Admin options: goto");
+		}
+		return 0;
+	}
+	
+	// Options
+	if(!strcmp(params, "account", true, 7)){    // /my account
+		strdel(params, 0, 8);	// Remove first 8 characters, "account ", from the string.
+
+		// Values
+		if (isequal(params, "register", .ignorecase = true)){   // /my account register
+			register(playerid);	// Call public register function
+		}
+		else if (isequal(params, "characters", .ignorecase = true)){   // /my account characters
+			characterSelection(playerid);
+		}
+		else if (isequal(params, "deletecharacter", .ignorecase = true)){   // /my account characters
+			ShowPlayerDialog(playerid, DIALOG_DELETE_CHARACTER, DIALOG_STYLE_MSGBOX, "Charater deletion", "You are about to permanently delete this charater and all it's assets.\n This can NOT be undone.", "Destroy", "Abort");
+		}
+		else{   // Invalid value
+			SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Usage: /my account ( register | characters | deletecharacter)");
+		}
+	}
+	else if(!strcmp(params, "chatmode", true, 8)){    // /my chatmode
+		strdel(params, 0, 9);	// Remove first 9 characters, "account ", from the string.
+
+        // Values
+        if (isequal(params, "whisper", .ignorecase = true)){
+            SetGVarInt("chatmode", CHAT_WHISPER, playerid);
+		}
+		else if (isequal(params, "low", .ignorecase = true)){
+            SetGVarInt("chatmode", CHAT_LOW, playerid);
+		}
+		else if (isequal(params, "local", .ignorecase = true)){
+			SetGVarInt("chatmode", CHAT_LOCAL, playerid);
+		}
+        else if (isequal(params, "shout", .ignorecase = true)){
+            SetGVarInt("chatmode", CHAT_SHOUT, playerid);
+		}
+		else if (isequal(params, "oc", .ignorecase = true)){
+			SetGVarInt("chatmode", CHAT_OC, playerid);
+		}
+		else if (isequal(params, "global", .ignorecase = true)){
+			SetGVarInt("chatmode", CHAT_GLOBAL, playerid);
+		}
+		else if (isequal(params, "gang", .ignorecase = true)){
+		    SetGVarInt("chatmode", CHAT_GANG, playerid);
+		}
+		else if (isequal(params, "faction", .ignorecase = true)){
+		    SetGVarInt("chatmode", CHAT_FACTION, playerid);
+		}
+		else if (isequal(params, "vip", .ignorecase = true)){
+		    SetGVarInt("chatmode", CHAT_VIP, playerid);
+		}
+		else if (isequal(params, "crew", .ignorecase = true)){
+		    SetGVarInt("chatmode", CHAT_CREW, playerid);
+		}
+		else if (isequal(params, "admin", .ignorecase = true)){
+            SetGVarInt("chatmode", CHAT_ADMIN, playerid);
+		}
+        else if (isequal(params, "management", .ignorecase = true)){
+            SetGVarInt("chatmode", CHAT_MANAGEMENT, playerid);
+		}
+		else{   // Invalid value
+			printf("else isequals register");
+			SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Usage: /my chatmode <value>");
+			SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Values: whisper low local shout oc global gang faction vip crew admin management");
+		}
+	}
+	else if(!strcmp(params, "goto", true, 4) || !strcmp(params, "sendto", true, 6) || !strcmp(params, "teleport", true, 8)){
+		if(GetGVarInt("userlevel", playerid) < ADMIN_CREW){
+		    return SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "SERVER: Access denied.");
+		}
+		
+		SetGVarInt("goto_target", playerid, playerid);
+		ShowPlayerDialog(playerid, DIALOG_GOTO, DIALOG_STYLE_LIST, "Categories", "Interiors\nPlayers", "Select", "Cancel");
+	}
+	else{   // Invalid option
+		SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "/my options: account chatmode");
+		if(GetGVarInt("userlevel", playerid) >= ADMIN_CREW){
+		    SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Admin options: goto");
+		}
+	}
+	return 0;
+}
+alias:my("myself", "mine");
+
+// Chat commands
+cmd:w(playerid, params[128 + 1]){
+    sendToChat(playerid, CHAT_WHISPER, params, 0, DCC_INVALID_USER);
+    
+    return 1;
+}
+alias:w("whisper");
+cmd:low(playerid, params[128 + 1]){
+    sendToChat(playerid, CHAT_LOW, params, 0, DCC_INVALID_USER);
+
+    return 1;
+}
+alias:low("soft");
+cmd:l(playerid, params[128 + 1]){
+    sendToChat(playerid, CHAT_LOCAL, params, 0, DCC_INVALID_USER);
+
+    return 1;
+}
+alias:l("local");
+cmd:me(playerid, params[128 + 1]){
+    sendToChat(playerid, CHAT_ACTION, params, 0, DCC_INVALID_USER);
+
+    return 1;
+}
+alias:me("emote", "action");
+cmd:s(playerid, params[128 + 1]){
+	sendToChat(playerid, CHAT_SHOUT, params, 0, DCC_INVALID_USER);
+
+    return 1;
+}
+alias:s("shout", "scream");
+cmd:o(playerid, params[128 + 1]){
+    sendToChat(playerid, CHAT_OC, params, 0, DCC_INVALID_USER);
+
+    return 1;
+}
+alias:o("oc", "ooc");
+cmd:g(playerid, params[128 + 1]){
+    sendToChat(playerid, CHAT_GLOBAL, params, 0, DCC_INVALID_USER);
+
+    return 1;
+}
+alias:g("global", "public");
+cmd:gc(playerid, params[128 + 1]){
+    sendToChat(playerid, CHAT_GANG, params, 0, DCC_INVALID_USER);
+
+    return 1;
+}
+cmd:fc(playerid, params[128 + 1]){
+    sendToChat(playerid, CHAT_FACTION, params, 0, DCC_INVALID_USER);
+
+    return 1;
+}
+cmd:vc(playerid, params[128 + 1]){
+    sendToChat(playerid, CHAT_VIP, params, 0, DCC_INVALID_USER);
+
+    return 1;
+}
+cmd:cc(playerid, params[128 + 1]){
+    sendToChat(playerid, CHAT_CREW, params, 0, DCC_INVALID_USER);
+
+    return 1;
+}
+
+cmd:pm(playerid, params[128 + 1]){
+    new recipient_id, message[128 + 1];
+	if (sscanf(params, "u s", recipient_id, message)){
+		SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Usage: /pm <playerid> <message>");
+	}
+	else{
+		sendPM(playerid, message, recipient_id);
+	}
+
+    return 1;
+}
+alias:pm("msg", "dm");
+
+// Vehicle commands
+flags:v(ADMIN_CREW);
+cmd:v(playerid, params[]){
+    //new vehicle_id;
+	if(strlen(params) < 1){
+	    return SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Usage: /v [playerID] <model> | park | respawn <seconds> | siren");
+	}
+	//new option[125 + 1];
+	
+
+	new target;
+	if(!sscanf(params, "i s", target, params)){ // This should overwrite the params to excluse the player id, or cause problems.
+		if(!IsPlayerConnected(target)){
+    	    return SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "That player is not ingame.");
+		}
+	}
+	else{
+	    target = playerid;
+	}
+	
+	
+	
+	if(!strcmp(params, "park", true, 4)){
+		editVehicle(playerid, target, EDITVEHICLE_PARK);
+		/*new vehicleid = GetPlayerVehicleID(target);
+	    if(vehicleid == 0){
+		    return SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Player not in a vehicle.");
+		}
+
+	    new Float:x, Float:y, Float:z, Float:angle;
+		GetVehiclePos(vehicleid, x, y, z);
+		GetVehicleZAngle(vehicleid, angle);
+		
+	    // Get vehicle record
+	    new vehicle_query[75 + 1], admin_message[23 + 4 + MAX_PLAYER_NAME + 1];
+	    format(vehicle_query, sizeof(vehicle_query), "SELECT id FROM vehicle WHERE vehicle_id = %i", vehicleid);
+		new Result:vehicle_result = sql_query(sqlHandle, vehicle_query);
+		
+		new save_query[75 + 1];
+	    if(sql_num_rows(vehicle_result) < 1){   // New vehicle
+			format(save_query, sizeof(save_query), "INSERT INTO vehicle SET (model_id, pos_x, pos_y, pos_z, angle) = (%i, %f, %f, %f, %f)", GetVehicleModel(vehicleid), x, y, z, angle);
+			format(admin_message, sizeof(admin_message), "[%i] %s has saved a vehicle.", playerid, getPlayerName(playerid));
+		}
+		else{   // Existing vehicle
+		    new id = sql_get_field_assoc_int(vehicle_result, "id");
+            format(save_query, sizeof(save_query), "UPDATE vehicle(pos_x, pos_y, pos_z, angle) VALUES(%f, %f, %f, %f) WHERE id = %i", x, y, z, angle, id);
+            format(admin_message, sizeof(admin_message), "[%i] %s has updated vehicle: %i", playerid, getPlayerName(playerid), id);
+		}
+	    sql_query(sqlHandle, save_query);
+		sendToAdmins(COLOR_NOTICE, admin_message);*/
+	}
+	else if(!strcmp(params, "respawn", true, 7)){
+	    strdel(params, 0, 8);	// Remove first 8 characters from the string.
+        new respawn;
+        if(!sscanf(params, "i", respawn)){
+            editVehicle(playerid, target, EDITVEHICLE_RESPAWN, -1, -1, respawn);
+		}
+	    else{
+	        SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "/v [ID] respawn usage: <seconds>");
+		}
+	
+	}
+	else if(!strcmp(params, "siren", true, 5)){
+	    editVehicle(playerid, target, EDITVEHICLE_SIREN);
+	}
+	else if(!sscanf(params, "s")){
+	    // Get model ID
+	    new modelid = getVehicleModelFromName(params);
+	    if(modelid == -1){
+	        return SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Unkown parameter or model name.");
+		}
+
+	    new Float:x, Float:y, Float:z, Float:angle, worldid, interiorid;
+	    getPlayerLocation(target, x, y, z, angle, worldid, interiorid);
+
+		// To prevent crashses in certain situations.
+		if(IsPlayerInAnyVehicle(target)){
+		    GetVehicleZAngle(GetPlayerVehicleID(target), angle);
+	 		RemovePlayerFromVehicle(target);
+		}
+
+
+	    new vehicleid = AddStaticVehicleEx(modelid, x, y, z, angle, -1, -1, -1);
+	    SetVehicleVirtualWorld(vehicleid, worldid);
+	    PutPlayerInVehicle(target, vehicleid, 0);
+
+		new admin_message[33 + 4 + MAX_PLAYER_NAME + 1];
+		format(admin_message, sizeof(admin_message), "[%i] %s has created a temporary vehicle.", playerid, getPlayerName(playerid));
+		sendToAdmins(COLOR_NOTICE, admin_message);
+	}
+	else{
+        SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Usage: /v (model_name_part | park | respawn <seconds>| siren");
+	}
+	
+    
+    return 1;
+}
+alias:v("vehicle", "veh");
+
+// Player commands
+cmd:p(playerid, params[]){
+    // No parameters
+	if(strlen(params) < 1){
+	    SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Usage: /p <ID> option");
+		return SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "/p options: admin, goto");
+	}
+
+	// Syntax
+	new player_id, option[123 + 1];
+	if(sscanf(params, "i s", player_id, option)){
+		SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Usage: /p <ID> <option>");
+		return SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "/p options: admin, goto");
+	}
+	
+	if(!strcmp(option, "admin", true, 5)){
+	    SetGVarInt("userlevel", ADMIN_CREW, player_id);
+	    // TODO take admin if already admin
+	    // TODO notify admins
+	}
+	else if(!strcmp(option, "goto", true, 4) && !strcmp(option, "sendto", true, 6 && !strcmp(option, "teleport", true, 8)) ){
+	    if(GetGVarInt("userlevel", playerid) < ADMIN_CREW){
+	        SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "SERVER: Access denied.");
+	        
+	        SetGVarInt("goto_target", player_id);
+		}
+	}
+	else{
+	    return SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "/p <ID> options: admin, goto");
+	}
+			
+    return 1;
+}
+alias:p("player");
+
+// Admin commands
+flags:property(ADMIN_CREW);
+cmd:property(playerid, params[]){
+    // No option specified
+	if(strlen(params) < 1){
+		return SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "/property options: pickup, portal");
+	}
+
+	// Options
+	if(!strcmp(params, "pickup", true, 6)){    // /property pickup
+		strdel(params, 0, 7);	// Remove first 7 characters, "pickup ", from the string.
+		
+		// No parameters
+		if(strlen(params) < 1){
+		    SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Usage: /property pickup <create | ID <goto | move | delete>>");
+			return SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "/p options: admin, goto");
+		}
+		
+		// Values
+        new pickup_id, option[110 + 1];
+		if(!strcmp(params, "create", true)){   // /property pickup create
+            ShowPlayerDialog(playerid, DIALOG_CREATE_PICKUP, DIALOG_STYLE_LIST, "Pickup caterogy", "Faction", "Select", "Cancel");
+		}
+		else if (!sscanf(params, "i s", pickup_id, option)){
+		    new pickup_query[69 + MAX_SQL_INTEGER + 1];
+			format(pickup_query, sizeof(pickup_query), "SELECT object_id, type_id, pickup_id, pos_x, pos_y, pos_z, world_id, pickup_id, angle FROM pickup WHERE id = %i", pickup_id);
+			new Result:pickup_result = sql_query(sqlHandle, pickup_query);
+			if(sql_num_rows(pickup_result) < 1){   // Invalid pickup ID
+			    return SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Invalid pickup ID");
+			}
+			
+			new pickupid = sql_get_field_assoc_int(pickup_result, "pickup_id");
+            if(!strcmp(option, "move", true)){
+                // Destroy old pickup
+                DestroyDynamicPickup(pickupid);
+                
+                // Create new pickup
+                new Float:x, Float:y, Float:z;
+				GetPlayerPos(playerid, x, y, z);
+				new interior = GetPlayerInterior(playerid);
+				new world = GetPlayerVirtualWorld(playerid);
+				
+				new Float:angle;
+				new object_id = sql_get_field_assoc_int(pickup_result, "object_id");
+				new type_id = sql_get_field_assoc_int(pickup_result, "type_id");
+				new new_pickupid = createDynamicPickup(object_id, x, y, z, world, interior, type_id);
+				angle = GetPlayerFacingAngle(playerid, angle);
+
+				// Update pickup record
+				new update_query[118 + MAX_SQL_FLOAT + MAX_SQL_FLOAT + MAX_SQL_FLOAT + MAX_SQL_INTEGER + MAX_SQL_INTEGER + MAX_SQL_INTEGER + 1];
+				format(update_query, sizeof(update_query), "UPDATE pickup SET pos_x = '%f', pos_y = '%f', pos_z = '%f', world_id = %i, interior_id = %i, pickup_id = %i, angle = %f WHERE id = %i", x, y, z, world, interior, new_pickupid, pickup_id, angle);
+				sql_query(sqlHandle, update_query);
+				
+				// Inform admins
+				new admin_message[39 + 4 + MAX_PLAYER_NAME + MAX_SQL_INTEGER + 1];
+				format(admin_message, sizeof(admin_message), "* [%i] %s modified the location of pickup: %i", playerid, getPlayerName(playerid), pickup_id);
+				sendToAdmins(COLOR_NOTICE, admin_message);
+			}
+            else if(!strcmp(option, "delete", true)){
+                // Destroy pickup
+                DestroyDynamicPickup(pickupid);
+                
+                // Delete pickup record
+				new update_query[95 + MAX_SQL_FLOAT + MAX_SQL_FLOAT + MAX_SQL_FLOAT + MAX_SQL_INTEGER + MAX_SQL_INTEGER + MAX_SQL_INTEGER + 1];
+				format(update_query, sizeof(update_query), "DELETE FROM pickup WHERE id = %i", pickup_id);
+				sql_query(sqlHandle, update_query);
+
+                // Inform admins
+				new admin_message[39 + 4 + MAX_PLAYER_NAME + MAX_SQL_INTEGER + 1];
+				format(admin_message, sizeof(admin_message), "* [%i] %s deleted pickup: %i", playerid, getPlayerName(playerid), pickup_id);
+				sendToAdmins(COLOR_NOTICE, admin_message);
+			}
+			else if(!strcmp(option, "goto", true)){
+			    new name[7 + MAX_SQL_INTEGER];
+				format(name, sizeof(name), "pickup %i", pickupid);
+				gotoCallback(sql_get_field_assoc_float(pickup_result, "pos_x"), sql_get_field_assoc_float(pickup_result, "pos_y"), sql_get_field_assoc_float(pickup_result, "pos_z"), sql_get_field_assoc_int(pickup_result, "world_id"), sql_get_field_assoc_int(pickup_result, "interior_id"), sql_get_field_assoc_float(pickup_result, "angle"), name, playerid); // TODO check if this informs admins
+			}
+			else{   // Invalid option.
+				SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "/property pickup <ID> usage: goto, move, delete");
+			}
+		}
+		else{   // Invalid value
+			SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "/property pickup usage: create, <ID> <goto | move | delete>");
+		}
+	}
+	else if(!strcmp(params, "portal", true, 6)){    // /property portal
+		strdel(params, 0, 7);	// Remove first 7 characters, "portal ", from the string.
+
+        // No parameters
+		if(strlen(params) < 1){
+			return SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Usage: /property portal <create | ID <goto | exit | entrance | object | delete>>");
+		}
+		
+        // Values
+        new portal_id, option[116 + 1];
+		if (!strcmp(params, "create", true, 6)){   // /property portal create
+            strdel(params, 0, 7);	// Remove first 7 characters, "create ", from the string.
+
+			// Worlds
+			new value[105 + 1], world_id;
+            if (sscanf(params, "s", value)){
+				SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "For a portal that works in all worlds use: /property portal create all");
+			}
+			if(!strcmp(value, "all", true)){
+			    world_id = -1;
+			}
+			else{
+				world_id = GetPlayerVirtualWorld(playerid);
+				SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Invalid world option, creating default portal.");
+			}
+
+			new Float:x, Float:y, Float:z, Float:angle, world, interior;
+			getPlayerLocation(playerid, x, y, z, angle, world, interior);
+			
+			new pickup_id = createDynamicPickup(19902, x, y, z, world_id, interior, PICKUP_PORTAL);
+
+			// Create portal database record
+			new portal_query[120 + (MAX_SQL_FLOAT * 3) + (MAX_SQL_INTEGER * 3) + MAX_SQL_FLOAT + 1];
+			format(portal_query, sizeof(portal_query), "INSERT INTO portal(object, pos_x, pos_y, pos_z, world, pickup_id, interior_id, angle) VALUES (19902, '%f', '%f', '%f', %i, %i, %i, %f)", x, y, z, world_id, pickup_id, interior, 360 - angle);
+			sql_query(sqlHandle, portal_query);
+			
+			// Inform user(s)
+			new portal_id_query[91 + MAX_SQL_FLOAT + MAX_SQL_FLOAT + MAX_SQL_FLOAT + MAX_SQL_INTEGER + 1];
+			format(portal_id_query, sizeof(portal_id_query), "SELECT id FROM portal WHERE pos_x = '%f' AND pos_y = '%f' AND pos_z = '%f' AND world = %i AND interior_id = %i", x, y, z, world_id, interior);
+			new Result:portal_id_result = sql_query(sqlHandle, portal_id_query);
+			portal_id = sql_get_field_assoc_int(Result:portal_id_result, "id");
+			new message[69 + MAX_SQL_INTEGER + MAX_SQL_INTEGER + 1], admin_message[21 + 4 + MAX_PLAYER_NAME + MAX_SQL_INTEGER + 1];
+			format(message, sizeof(message), "Portal %i created. Create the other side with: /property portal %i exit", portal_id, portal_id);
+			format(admin_message, sizeof(admin_message), "* [%i] %s created portal: %i", playerid, getPlayerName(playerid), portal_id);
+			sendToAdmins(COLOR_NOTICE , admin_message);
+			SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, message);
+		}
+        else if (!sscanf(params, "i s", portal_id, option)){
+            // Get portal record
+   			new portal_query[189 + MAX_SQL_INTEGER + 1];
+   			format(portal_query, sizeof(portal_query), "SELECT object, pos_x, pos_y, pos_z, world, interior_id, pickup_id, exit_pos_x, exit_pos_y, exit_pos_z, exit_world, exit_interior_id, exit_pickup_id, angle, exit_angle FROM portal WHERE id = %i", portal_id);
+   			new Result:portal_result = sql_query(sqlHandle, portal_query);
+   			
+   			// Invalid portal ID
+   			if(sql_num_rows(portal_result) < 1){   // Invalid portal ID
+			    return SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Invalid portal ID");
+			}
+   			
+            if (!strcmp(option, "exit", true, 4)){
+				new Float:pos_x = sql_get_field_assoc_float(portal_result, "pos_x");
+				new Float:pos_y = sql_get_field_assoc_float(portal_result, "pos_y");
+				new Float:pos_z = sql_get_field_assoc_float(portal_result, "pos_z");
+				new world_id = sql_get_field_assoc_int(portal_result, "world");
+				new interior_id = sql_get_field_assoc_int(portal_result, "interior_id");
+				new session_id = sql_get_field_assoc_int(portal_result, "pickup_id");
+				new exit_pickup_id = sql_get_field_assoc_int(portal_result, "exit_pickup_id");
+				new Float:angle = sql_get_field_assoc_float(portal_result, "angle");
+				
+				// Location
+				new Float:x, Float:y, Float:z, Float:player_angle, world, interior;
+				getPlayerLocation(playerid, x, y, z, player_angle, world, interior);
+
+				// World
+				if(world_id != -1){   // Not an all-world portal
+				    world = GetPlayerVirtualWorld(playerid);
+				}
+				else{
+				    world = world_id;
+				}
+
+				// Delete old exit if exists
+				if(exit_pickup_id){
+				     destroyPortal(exit_pickup_id);
+				}
+
+	            new pickup_id = createDynamicPickup(19607, x, y, z, world, interior, PICKUP_PORTAL);
+	            SetGVarFloat("pickup_x", pos_x, pickup_id);
+				SetGVarFloat("pickup_y", pos_y, pickup_id);
+				SetGVarFloat("pickup_z", pos_z, pickup_id);
+				SetGVarInt("pickup_world", world_id, pickup_id);
+				SetGVarFloat("pickup_angle", angle, pickup_id);
+				SetGVarInt("pickup_interior", interior_id, pickup_id);
+				SetGVarFloat("pickup_x", x, session_id);
+				SetGVarFloat("pickup_y", y, session_id);
+				SetGVarFloat("pickup_z", z, session_id);
+				SetGVarInt("pickup_world", world, session_id);
+				SetGVarFloat("pickup_angle", player_angle, session_id);
+				SetGVarInt("pickup_interior", interior, session_id);
+
+				// Update portal record
+				new update_query[172 + MAX_SQL_FLOAT + MAX_SQL_FLOAT + MAX_SQL_FLOAT + MAX_SQL_INTEGER + MAX_SQL_INTEGER + MAX_SQL_INTEGER + 1];
+				format(update_query, sizeof(update_query), "UPDATE portal SET exit_object = 19607, exit_pos_x = '%f', exit_pos_y = '%f', exit_pos_z = '%f', exit_world = %i, exit_interior_id = %i, exit_pickup_id = %i, exit_angle = %i WHERE id = %i", x, y, z, world, interior, pickup_id, 360 - player_angle, portal_id);
+				sql_query(sqlHandle, update_query);
+
+				// Inform admins and Discord
+				new admin_message[61 + 4 + MAX_PLAYER_NAME + MAX_SQL_INTEGER + 1];
+				format(admin_message, sizeof(admin_message), "* [%i] %s modified the exit location of portal: %i", playerid, getPlayerName(playerid), portal_id);
+				sendToAdmins(COLOR_NOTICE , admin_message);
+			}
+			else if(!strcmp(option, "object", true, 6)){
+			    strdel(option, 0, 7);	// Remove first 7 characters, from the string.
+			    new object, exit_object;
+			    print(option);
+				if (sscanf(option, "i i", object, exit_object)){
+				    return SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Invalid syntax, specify two object ID's: /property portal <ID> object <ID> <ID>");
+				}
+
+				new Float:pos_x = sql_get_field_assoc_float(portal_result, "pos_x");
+				new Float:pos_y = sql_get_field_assoc_float(portal_result, "pos_y");
+				new Float:pos_z = sql_get_field_assoc_float(portal_result, "pos_z");
+				new world_id = sql_get_field_assoc_int(portal_result, "world");
+				new interior_id = sql_get_field_assoc_int(portal_result, "interior_id");
+				new pickup_id = sql_get_field_assoc_int(portal_result, "pickup_id");
+				new Float:exit_pos_x = sql_get_field_assoc_float(portal_result, "exit_pos_x");
+				new Float:exit_pos_y = sql_get_field_assoc_float(portal_result, "exit_pos_y");
+				new Float:exit_pos_z = sql_get_field_assoc_float(portal_result, "exit_pos_z");
+				new exit_world_id = sql_get_field_assoc_int(portal_result, "exit_world");
+				new exit_interior_id = sql_get_field_assoc_int(portal_result, "exit_interior_id");
+				new exit_pickup_id = sql_get_field_assoc_int(portal_result, "exit_pickup_id");
+
+	            destroyPortal(exit_pickup_id);
+				destroyPortal(pickup_id);
+				spawnPortal(portal_id, object, pos_x, pos_y, pos_z, world_id, interior_id, exit_object, exit_pos_x, exit_pos_y, exit_pos_z, exit_world_id, exit_interior_id);
+
+				new update_query[57 + MAX_SQL_INTEGER + MAX_SQL_INTEGER + MAX_SQL_INTEGER + 1];
+				format(update_query, sizeof(update_query), "UPDATE portal SET (object, exit_object) = (%i, %i) WHERE id = %i", object, exit_object, portal_id);
+				sql_query(sqlHandle, update_query);
+
+			}
+			else if(!strcmp(option, "delete", true, 6)){
+				new pickup_id = sql_get_field_assoc_int(portal_result, "pickup_id");
+				new exit_pickup_id = sql_get_field_assoc_int(portal_result, "exit_pickup_id");
+
+	   			// TODO: Confirmation, by spectating the pickup or having to be near.
+
+	   			destroyPortal(exit_pickup_id);
+				destroyPortal(pickup_id);
+
+				// Delete portal record
+				new delete_query[31 + MAX_SQL_INTEGER + 1];
+				format(delete_query, sizeof(delete_query), "DELETE FROM portal WHERE id = %i", portal_id);
+				sql_query(sqlHandle, delete_query);
+			}
+			else if(!strcmp(option, "entrance", true, 8)){
+	   			new object = sql_get_field_assoc_int(portal_result, "object");
+				//new Float:x = sql_get_field_assoc_float(portal_result, "pos_x");
+				//new Float:y = sql_get_field_assoc_float(portal_result, "pos_y");
+				//new Float:z = sql_get_field_assoc_float(portal_result, "pos_z");  todo shorten qeury
+				new world = sql_get_field_assoc_int(portal_result, "world");
+				new pickup_id = sql_get_field_assoc_int(portal_result, "pickup_id");
+				new Float:pos_x = sql_get_field_assoc_float(portal_result, "exit_pos_x");
+				new Float:pos_y = sql_get_field_assoc_float(portal_result, "exit_pos_y");
+				new Float:pos_z = sql_get_field_assoc_float(portal_result, "exit_pos_z");
+				new world_id = sql_get_field_assoc_int(portal_result, "exit_world");
+				new interior_id = sql_get_field_assoc_int(portal_result, "exit_interior");
+				new Float:angle = sql_get_field_assoc_float(portal_result, "exit_angle");
+				if(sql_num_rows(portal_result) < 1){   // Invalid portal ID
+				    return SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Invalid portal ID");
+				}
+
+                // Location
+	            new Float:x, Float:y, Float:z, Float:player_angle, player_world, interior;
+	            getPlayerLocation(playerid, x, y, z, player_angle, player_world, interior);
+	            
+				// World
+				if(world_id == -1){   // All-world portal
+				    world = world_id;
+				}
+
+	   			destroyPortal(pickup_id);   // Despawn old pickups and remove GVars
+
+	            new pickupid = createDynamicPickup(object, x, y, z, world, interior, PICKUP_PORTAL);
+	            SetGVarFloat("pickup_x", pos_x, pickupid);
+				SetGVarFloat("pickup_y", pos_y, pickupid);
+				SetGVarFloat("pickup_z", pos_z, pickupid);
+				SetGVarInt("pickup_world", world_id, pickupid);
+				SetGVarInt("pickup_interior", interior_id, pickupid);
+				SetGVarFloat("pickup_angle", angle, pickupid);
+
+				// Inform admins and Discord
+				new admin_message[65 + 4 + MAX_PLAYER_NAME + MAX_SQL_INTEGER + 1];
+				format(admin_message, sizeof(admin_message), "* [%i] %s modified the entrance location of portal: %i", playerid, getPlayerName(playerid), portal_id);
+				sendToAdmins(COLOR_NOTICE, admin_message);
+			}
+			else if(!strcmp(option, "goto", true)){
+				teleportPlayer(playerid, sql_get_field_assoc_float(Result:portal_result, "exit_pos_x"), sql_get_field_assoc_float(Result:portal_result, "exit_pos_y"), sql_get_field_assoc_float(Result:portal_result, "exit_pos_z"), sql_get_field_assoc_float(Result:portal_result, "angle"), sql_get_field_assoc_int(Result:portal_result, "exit_world_id"), sql_get_field_assoc_int(Result:portal_result, "exit_interior_id"));
+			}
+			else{   // Invalid option
+				SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "/property portal <ID> options: goto, exit, entrance, object, delete");
+			}
+		}
+		else{   // Invalid value
+			SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Usage: /property portal <create | ID <goto | exit | entrance | object | delete>>");
+		}
+
+	}
+	else{   // Invalid option
+		SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "/property options: pickup, portal");
+	}
+    
+    return 1;
+}
+
+// Dialog functions
+forward dialogGotoInterior(playerid);
+public dialogGotoInterior(playerid){
+    ShowPlayerDialog(playerid, DIALOG_GOTO_INTERIOR, DIALOG_STYLE_LIST, "Categories", "Avaition\nHouses\nMissions\nMission exteriors\nPolice departments\nSex work\nShops\nStadia", "Select", "Back");
+}
+
+forward dialogGotoPlayer(playerid);
+public dialogGotoPlayer(playerid){
+    for(new targetid, a = GetMaxPlayers(); targetid < a; targetid++){
+		if(IsPlayerConnected(targetid)){
+		    // TODO: Decide to use this or TABplayer list.
+		}
+	}
+
+    ShowPlayerDialog(playerid, DIALOG_GOTO_PLAYER, DIALOG_STYLE_LIST, "Players", "", "Goto", "Back");
+}
+
+dialogGotoHouses(playerid){
+	ShowPlayerDialog(playerid, DIALOG_GOTO_HOUSES, DIALOG_STYLE_TABLIST, "Houses", "Burglary houses\nMission houses\nSafe houses\nUncategorized", "Select", "Cancel");
+}
+
+dialogGotoShops(playerid){
+	ShowPlayerDialog(playerid, DIALOG_GOTO_SHOPS, DIALOG_STYLE_TABLIST, "Shops", "24/7's\nAmmunation's\nCasino's\nModding shops\nUncatagorized", "Select", "Cancel");
+}
+
+// a_samp events
+public OnGameModeInit(){
+	new message[36 + 22 + 1];
+	format(message, sizeof(message), "* Global game-mode initialization: v%s", MODE_NAME);
+	logger(LOGLEVEL_NOTICE, "* Global game-mode initialization.");	// Log event.
+
+	// Player radar blip markers only visible to nearby players.
+	ShowPlayerMarkers(PLAYER_MARKERS_MODE_STREAMED);
+	LimitPlayerMarkerRadius(15);
+	
+
+	// Set mode name
+	SetGameModeText(MODE_NAME);
+
+	// SQL log level
+	if(scriptDebug){
+		sql_debug(LOG_ALL, LOG_ALL);	// Log everything everywhere.
+	}
+	else{
+	    sql_debug(LOG_INFO, LOG_WARNING);    // Loglevel info for file and worning for console.
+	}
+
+	// Connect to database
+	sqlHandle = SQL:sql_connect(SQL_HANDLER_POSTGRESQL, PG_HOST, PG_ROLE, PG_PASS, PG_DB, PG_PORT);
+	printf("sqlconnection = %d", _:sqlHandle);
+	if(!sql_ping(sqlHandle)){
+		print( " + Database connection" );
+	}
+    else{
+		print( "Database connection failed" );
+	}
+
+    // Initialize Discord
+	//homeGuild = DCC_GetGuildId(DISCORD_HOME_GUILD_ID);	// Set home guild ID.	NOT NEEDED FOR NOW AND BROKEN
+	echoChannel = DCC_FindChannelById(DISCORD_ECHO_CHANNEL_ID);	// Set main echo channel ID.
+	mainChannel = DCC_FindChannelById(DISCORD_MAIN_CHANNEL_ID);	// Set main notification channel ID.
+	adminEchoChannel = DCC_FindChannelById(DISCORD_ADMIN_ECHO_CHANNEL_ID);	// Set admin echo channel ID.
+	adminChannel = DCC_FindChannelById(DISCORD_ADMIN_CHANNEL_ID);	// Set admin notification channel ID.
+	managementChannel = DCC_FindChannelById(DISCORD_MANAGEMENT_CHANNEL_ID);	// Set management notification channel ID.
+	
+	DiscordEcho(message, ECHO_CHANNEL); // Notify Discord
+	//DiscordEcho(message, MAIN_CHANNEL);   // TODO Enable after we are stable
+	
+	// Portals
+   	new Result:portal_result = sql_query(sqlHandle, "SELECT id, object, pos_x, pos_y, pos_z, world, interior_id, exit_object, exit_pos_x, exit_pos_y, exit_pos_z, exit_world, exit_interior_id FROM portal");
+   	for(new i = 0; i < sql_num_rows(portal_result); i++){
+	   	new id = sql_get_field_assoc_int_ex(portal_result, i, "id");
+		new object = sql_get_field_assoc_int_ex(portal_result, i, "object");
+   	    new Float:pos_x = sql_get_field_assoc_float_ex(portal_result, i, "pos_x");
+		new Float:pos_y = sql_get_field_assoc_float_ex(portal_result, i, "pos_y");
+		new Float:pos_z = sql_get_field_assoc_float_ex(portal_result, i, "pos_z");
+		new world = sql_get_field_assoc_int_ex(portal_result, i, "world");
+		new interior = sql_get_field_assoc_int_ex(portal_result, i, "interior_id");
+		new exit_object = sql_get_field_assoc_int_ex(portal_result, i, "exit_object");
+		new Float:exit_pos_x = sql_get_field_assoc_float_ex(portal_result, i, "exit_pos_x");
+		new Float:exit_pos_y = sql_get_field_assoc_float_ex(portal_result, i, "exit_pos_y");
+		new Float:exit_pos_z = sql_get_field_assoc_float_ex(portal_result, i, "exit_pos_z");
+		new exit_world = sql_get_field_assoc_int_ex(portal_result, i, "exit_world");
+		new exit_interior = sql_get_field_assoc_int_ex(portal_result, i, "exit_interior_id");
+		
+		spawnPortal(id, object, pos_x, pos_y, pos_z, world, interior, exit_object, exit_pos_x, exit_pos_y, exit_pos_z, exit_world, exit_interior);
+   	}
+   	
+   	// Pickups
+   	new Result:pickup_result = sql_query(sqlHandle, "SELECT id, object_id, pos_x, pos_y, pos_z, world_id, interior_id, type_id FROM pickup");
+   	for(new i = 0; i < sql_num_rows(pickup_result); i++){
+   	    new id = sql_get_field_assoc_int_ex(pickup_result, i, "id");
+		new object_id = sql_get_field_assoc_int_ex(pickup_result, i, "object_id");
+   	    new Float:pos_x = sql_get_field_assoc_float_ex(pickup_result, i, "pos_x");
+		new Float:pos_y = sql_get_field_assoc_float_ex(pickup_result, i, "pos_y");
+		new Float:pos_z = sql_get_field_assoc_float_ex(pickup_result, i, "pos_z");
+		new world_id = sql_get_field_assoc_int_ex(pickup_result, i, "world_id");
+		new interior_id = sql_get_field_assoc_int_ex(pickup_result, i, "interior_id");
+		new type_id = sql_get_field_assoc_int_ex(pickup_result, i, "type_id");
+		
+		new pickupid = createDynamicPickup(object_id, pos_x, pos_y, pos_z, world_id, interior_id, type_id);
+
+		// Update pickup record
+		new pickup_query[44 + MAX_SQL_INTEGER + MAX_SQL_INTEGER + 1];
+		format(pickup_query, sizeof(pickup_query), "UPDATE pickup SET pickup_id = %i WHERE id = %i", pickupid, id);
+		sql_query(sqlHandle, pickup_query);
+   	}
+   	
+   	// Vehicles
+   	new Result:vehicle_result = sql_query(sqlHandle, "SELECT id FROM vehicle");
+   	for(new i = 0; i < sql_num_rows(vehicle_result); i++){
+   	    printf("Add: %i | vehicle_id: %i", i, sql_get_field_assoc_int_ex(vehicle_result, i, "id"));
+	   	addvehicle(sql_get_field_assoc_int_ex(vehicle_result, i, "id"));
+	}
+
+	// Hobo's with a cane (0 ammo value makes them lose the cane as soon as they switch weapon)
+	// Only homeless skins, as players should slowly class up in society.
+	AddPlayerClass(134, -184.7607, 950.5010, 16.7740, 358.3032, 15, 0, 0, 0, 0, false);		// Fort Carson West boulevard right curb.
+	AddPlayerClass(10, -184.7607, 950.5010, 16.7740, 358.3032, 15, 0, 0, 0, 0, false);		// Fort Carson West boulevard right curb.
+	AddPlayerClass(78, 111.0115, 1189.2029, 18.1627, 89.0095, 15, 0, 0, 0, 0, false);		// Fort Carson South boulevard left curb.
+	AddPlayerClass(129, 111.0115, 1189.2029, 18.1627, 89.0095, 15, 0, 0, 0, 0, false);		// Fort Carson South boulevard left curb.
+	AddPlayerClass(162, -109.4227, 1242.4860, 16.8223, 183.5798, 15, 0, 0, 0, 0, false);	// Fort Carson East boulevard left curb.
+	AddPlayerClass(77, -109.4227, 1242.4860, 16.8223, 183.5798, 15, 0, 0, 0, 0, false);		// Fort Carson East boulevard left curb.
+	AddPlayerClass(79, -201.5379, 948.1683, 15.9131, 359.9720, 15, 0, 0, 0, 0, false); 		// Fort Carson West boulevard left curb.
+	AddPlayerClass(196, -201.5379, 948.1683, 15.9131, 359.9720, 15, 0, 0, 0, 0, false); 	// Fort Carson West boulevard left curb.
+	AddPlayerClass(239, 62.4694, 1205.0531, 18.8153, 89.9380, 15, 0, 0, 0, 0, false); 		// Fort Carson South boulevard right curb.
+	AddPlayerClass(89, 62.4694, 1205.0531, 18.8153, 89.9380, 15, 0, 0, 0, 0, false); 		// Fort Carson South boulevard right curb.
+	AddPlayerClass(135, -126.0831, 1242.5745, 18.6138, 183.2986, 15, 0, 0, 0, 0, false); 	// Fort Carson East boulevard right curb.
+	AddPlayerClass(197, -126.0831, 1242.5745, 18.6138, 183.2986, 15, 0, 0, 0, 0, false); 	// Fort Carson East boulevard right curb.
+
+	return 1;
+}
+
+public OnGameModeExit(){
+	// Cycle every player
+	for(new playerid, a = GetMaxPlayers(); playerid < a; playerid++){
+		if(IsPlayerConnected(playerid)){
+			// Set name back to username
+			//new client_connect_username[MAX_PLAYER_NAME + 1];
+			//GetGVarString("client_connect_username", client_connect_username, sizeof(client_connect_username), playerid);
+			//SetPlayerName(playerid, client_connect_username);	// Change name in-game back to username, for login after restart  PROBLEM: Crashses the server on GMX.
+
+			deleteAllGVars(playerid);   // Delete GVars as per https://forum.sa-mp.com/showthread.php?t=151076
+			// TODO think of somthing for the usernames, kickign every player, or accapting character names as usersnames.
+        }
+	}
+
+    logger(LOGLEVEL_NOTICE, "* Global game-mode termination.");	// Log event
+	sql_wait(sqlHandle);	// Wait for queries to finish.
+	sql_disconnect(sqlHandle);	// Disconnect from database.
+	DiscordEcho("* Global game-mode termination.", ECHO_CHANNEL);	// Notify discord
+	//DiscordEcho("* Global game-mode termination.", MAIN_CHANNEL);	// Enable when stable
+	
+	return 1;
+}
+
+public OnPlayerRequestClass(playerid, classid){	// Skin selection before spawn.
+	if(scriptDebug){
+	    new message[23 + 4 + MAX_PLAYER_NAME + 1];
+		format(message, sizeof(message), "* [%i] %s Class selection.", playerid, getCharacterName(playerid));
+
+		logger(LOGLEVEL_DEBUG, message);	// Log event.
+	}
+
+	SetPlayerPos(playerid, -185.5514, 944.2042, 15.9337);	// In front of Fort Carson city limits sign.
+	SetPlayerFacingAngle(playerid, 182.7345);	// Charater looks toward the camera.
+	SetPlayerCameraPos(playerid, -185.5514, 939.0957, 15.6594);	// Further in front of the Fort Carson city limits sign.
+	SetPlayerCameraLookAt(playerid, -185.5514, 944.2042, 15.9337);	// In front of Fort Carson city limits sign.
+
+	return 1;   // Must return one, or skin selection breaks
+}
+
+public OnPlayerConnect(playerid){
+	SetPlayerColor(playerid, COLOR_BLACK);
+	
+	// Create & populate variables
+	new playername[MAX_PLAYER_NAME + 1], playerip[MAX_SQL_IP + 1];
+	playername = getPlayerName(playerid);
+	GetPlayerIp(playerid, playerip, sizeof(playerip));
+
+	// Global connection notification
+	new admin_message[23 + MAX_PLAYER_NAME + MAX_SQL_IP + 1];
+	format(admin_message, sizeof(admin_message), "* [%d] %s (IP: %s) connected.", playerid, getCharacterName(playerid), playerip);
+	logger(LOGLEVEL_INFO, admin_message);	// Log event
+    sendToAdmins(COLOR_NOTICE, admin_message);	// Notify all admins.
+
+	// Create IP record or update connection attempts
+	new ip_query[109 + MAX_SQL_IP + 1];
+	format(ip_query, sizeof(ip_query), "INSERT INTO ip(address) VALUES('%s') ON CONFLICT (address) DO UPDATE SET connections = ip.connections+1", playerip);
+	sql_query(sqlHandle, ip_query);
+	
+	// Check if IP is banned
+	new ip_id = getIPID(playerid);
+	
+	new ban_query[75 + MAX_SQL_INTEGER + 1];
+	format(ban_query, sizeof(ban_query), "SELECT id, reason FROM ip_ban WHERE ip_id = %i AND expires > NOW()::timestamp", ip_id);
+	new Result:ban_result = sql_query(sqlHandle, ban_query);
+	if(sql_num_rows(ban_result) > 0){  // Banned
+	    new kick_message[8 + MAX_SQL_REASON + 1];
+	    format(kick_message, sizeof(kick_message), "Banned: %s", sql_get_field_assoc_int(ban_result, "reason"));
+	    kickPlayer(playerid, -1, kick_message, 1);
+	}
+
+    // Get user record
+	new escaped_username[MAX_PLAYER_NAME + 1], user_query[47 + MAX_PLAYER_NAME + 1];    // Should be longer to allow for escaped characters
+	sql_escape_string(sqlHandle, playername, escaped_username, sizeof(escaped_username));	// Escape player name
+	format(user_query, sizeof(user_query), "SELECT id FROM \"user\" WHERE name = '%s'", escaped_username);
+	//new Result:result = sqlQuery(sqlHandle, user_query);  // Middleware broken.
+	new Result:result = sql_query(sqlHandle, user_query);
+	
+	SetGVarString("client_connect_username", playername, playerid); // Used by register, DIALOG_LOGIN, getUserID & OnGameModeExit
+	
+	if(sql_num_rows(result) == 0){  // Unkown user
+		SetGVarInt("userlevel", UNREGISTERED_PLAYER, playerid);	// Set userlevel unregistered
+		print("UNkown user sending to changeName()");
+		changeName(playerid, playername);	// Check, force and set role-play name
+	}
+	else{   // Known user
+		ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Sign in", "Enter your password to log on", "Log in", "Cancel");	// Show password confirmation dialog
+	}
+
+	//return 1;
+}
+
+public OnPlayerDisconnect(playerid, reason){
+    if(GetPlayerState(playerid) != PLAYER_STATE_NONE){  // Only save character if spawned
+		savePlayerState(playerid);  // Save character
+	}
+	deleteAllGVars(playerid);   // Delete GVars as per https://forum.sa-mp.com/showthread.php?t=151076
+	
+	new playername[MAX_PLAYER_NAME + 1], message[40 + 4 + MAX_PLAYER_NAME + 1];
+	playername = getPlayerName(playerid);
+    switch(reason){
+		case 0: format(message, sizeof(message), "* [%i] %s disconnected. (Lost Connection)", playerid, getCharacterName(playerid));
+		case 1: format(message, sizeof(message), "* [%i] %s disconnected. (Leaving)", playerid, getCharacterName(playerid));
+		case 2: format(message, sizeof(message), "* [%i] %s disconnected. (Kicked)", playerid, getCharacterName(playerid)); // Leave this in place for RCON kicks.
+	}
+
+ 	logger(LOGLEVEL_INFO, message);	// Log event
+	SendClientMessageToAll(COLOR_NOTICE, message);	// Notify all players.
+	DiscordEcho(message, ECHO_CHANNEL);	// Notify discord.
+	
+	return 1;
+}
+
+public OnPlayerSpawn(playerid){
+	if(scriptDebug){	// Log event in case of debugging.
+		new message[MAX_PLAYER_NAME + 14 + 1];
+		format(message, sizeof(message), "* [%i] %s spawned.", playerid, getCharacterName(playerid));
+
+		logger(LOGLEVEL_DEBUG, message);	// Log event.
+	}
+
+	if(GetGVarInt("userlevel", playerid) == UNREGISTERED_PLAYER){	// Unregistered player.
+		SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "SERVER: To reserve your name, save your character, statistics and money, type: /register");
+	}
+
+	return 1;
+}
+
+public OnPlayerDeath(playerid, killerid, reason){
+	new message[15 + MAX_PLAYER_NAME + 1];
+	format(message, sizeof(message), "* [%d] %s died.", playerid, getCharacterName(playerid));	// TODO Add killerid & reason.
+
+	logger(LOGLEVEL_DEBUG, message);	// Log event
+	DiscordEcho(message, ADMIN_ECHO_CHANNEL);	// Notify Discord admin echo.
+	
+	//ResetPlayerMoney(playerid);   TODO test if required
+	//SpawnPlayer(playerid);
+
+	return 1;
+}
+
+public OnVehicleSpawn(vehicleid)
+{
+	return 1;
+}
+
+public OnVehicleDeath(vehicleid, killerid)
+{
+	return 1;
+}
+
+public OnPlayerText(playerid, text[]){
+	new shortcut_message[128 + 1];
+	strfromliteral(shortcut_message, text);
+	strdel(shortcut_message, 0, 1); // Remove chat character from text
+	switch(strgetfirstc(text)){
+		case '`': {
+		    if(GetGVarInt("chatmode", playerid) == CHAT_LOCAL){
+		        sendToChat(playerid, CHAT_GLOBAL, shortcut_message, 0, DCC_INVALID_USER);
+			}
+			else if (GetGVarInt("chatmode", playerid) == CHAT_GLOBAL){
+				sendToChat(playerid, CHAT_LOCAL, shortcut_message, 0, DCC_INVALID_USER);
+			}
+			else{
+			    sendToChat(playerid, CHAT_GLOBAL, shortcut_message, 0, DCC_INVALID_USER);
+			}
+		}
+		case '~': {sendToChat(playerid, CHAT_GANG, shortcut_message, 0, DCC_INVALID_USER);}
+		case '#': {sendToChat(playerid, CHAT_GANG_OC, shortcut_message, 0, DCC_INVALID_USER);}
+		case '!': {sendToChat(playerid, CHAT_FACTION, shortcut_message, 0, DCC_INVALID_USER);}
+		case '$': {sendToChat(playerid, CHAT_FACTION_OC, shortcut_message, 0, DCC_INVALID_USER);}
+		case '^': {sendToChat(playerid, CHAT_VIP, shortcut_message, 0, DCC_INVALID_USER);}
+		case '@': {sendToChat(playerid, CHAT_CREW, shortcut_message, 0, DCC_INVALID_USER);}
+		case '%': {sendToChat(playerid, CHAT_ADMIN, shortcut_message, 0, DCC_INVALID_USER);}
+		case '&': {sendToChat(playerid, CHAT_MANAGEMENT, shortcut_message, 0, DCC_INVALID_USER);}
+		case '*': {sendToChat(playerid, CHAT_UNDERCOVER, shortcut_message, 0, DCC_INVALID_USER);}
+		case '+': {sendToChat(playerid, CHAT_CALL, shortcut_message, 0, DCC_INVALID_USER);}
+		case '-': {sendToChat(playerid, CHAT_SMS, shortcut_message, 0, DCC_INVALID_USER);}
+		case '=': {sendToChat(playerid, CHAT_RADIO, shortcut_message, 0, DCC_INVALID_USER);}
+		case '>': {
+		    new recipient_id, message[128 + 1];
+    		if (sscanf(shortcut_message, "u s", recipient_id, message)){
+				SendClientMessage(playerid, COLOR_COMMAND_OUTPUT, "Usage: > <playerid> <message>");
+			}
+			else{
+				sendPM(playerid, message, recipient_id);
+			}
+		}
+		default:{
+			new	chatmode = GetGVarInt("chatmode", playerid), message[128 + 1];
+			strmid(message, text, 0, 128);
+//			message = text;
+			if(!chatmode){  // Default is local chat
+				sendToChat(playerid, CHAT_LOCAL, message, 0, DCC_INVALID_USER);
+			}
+			else{   // Send to preferred chat
+			    printf("chatmode: %i", chatmode);
+			    sendToChat(playerid, chatmode, message, 0, DCC_INVALID_USER);
+			}
+		}
+ 	}
+
+	return 0;   // Return 1 for default behavior, return 0 to disable default output.
+}
+
+public OnPlayerCommandText(playerid, cmdtext[]){
+	if(scriptDebug){	// Log event in case of debugging.
+		new message[5 + 4 + MAX_PLAYER_NAME + 128 + 1]; // 128 = samp text input limit.
+		format(message, sizeof(message), "[%d] %s: %s", playerid, getCharacterName(playerid), cmdtext);
+
+		logger(LOGLEVEL_COMMAND, message);	// Log event
+	}
+
+	return 0;
+}
+
+public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
+{
+	return 1;
+}
+
+public OnPlayerExitVehicle(playerid, vehicleid)
+{
+	return 1;
+}
+
+public OnPlayerStateChange(playerid, newstate, oldstate)
+{
+	return 1;
+}
+
+public OnPlayerEnterCheckpoint(playerid)
+{
+	return 1;
+}
+
+public OnPlayerLeaveCheckpoint(playerid)
+{
+	return 1;
+}
+
+public OnPlayerEnterRaceCheckpoint(playerid)
+{
+	return 1;
+}
+
+public OnPlayerLeaveRaceCheckpoint(playerid)
+{
+	return 1;
+}
+
+public OnRconCommand(cmd[]){    // The website and some cronjobs do RCON commands. TODO create filter not to show some commands to preven spam
+	new message[8 + 128 + 1];	// Max samp message legnth = 128.
+	format(message, sizeof(message), "* RCON: %s", cmd);
+
+	logger(LOGLEVEL_NOTICE, message);	// Log event
+	DiscordEcho(message, MANAGEMENT_CHANNEL);
+
+	return 1;
+}
+
+public OnPlayerRequestSpawn(playerid){  // After picking a skin in class selection.
+    SetPlayerColor(playerid, COLOR_WHITE);
+    
+	new playername[MAX_PLAYER_NAME + 1], message[14 + MAX_PLAYER_NAME + 1];
+	playername = getPlayerName(playerid);
+
+	if(scriptDebug){	// Only log spawns when debuggins script.
+		format(message, sizeof(message), "* [%d] %s Chose a character.", playerid, getCharacterName(playerid));
+		logger(LOGLEVEL_DEBUG, message);	// Log event
+	}
+
+	if(GetGVarInt("userlevel", playerid) > UNREGISTERED_PLAYER){    // Registered player
+	    createCharacterRecord(playerid, getUserID(playerid));	// Save character
+	    
+	    new client_connect_username[MAX_PLAYER_NAME + 1], admin_message[25 + 4 + MAX_PLAYER_NAME + MAX_PLAYER_NAME + 1];
+	    GetGVarString("client_connect_username", client_connect_username, sizeof(client_connect_username), playerid);   // Get client connect name
+	    format(admin_message, sizeof(admin_message), "[%i] %s has been created by %s.", playerid, getCharacterName(playerid), client_connect_username);
+	    DiscordEcho(admin_message, ADMIN_ECHO_CHANNEL);
+	}
+
+	return 1;
+}
+
+public OnObjectMoved(objectid)
+{
+	return 1;
+}
+
+public OnPlayerObjectMoved(playerid, objectid)
+{
+	return 1;
+}
+
+//public OnPlayerPickUpPickup(playerid, pickupid){} // Replaced byOnPlayerPickUpDynamicPickup() streamer.inc
+
+public OnPlayerPickUpDynamicPickup(playerid, pickupid){ // Requires streamer
+
+	new type = GetGVarInt("pickup_type", pickupid);
+	// Special pickup types first, rugular in the else{} conditional statement
+	if(type == PICKUP_PORTAL){
+   		// Do nothing if the player just used a pickup
+		if(GetGVarInt("disable_pickups", playerid)){
+            return 0;
+		}
+
+		new Float:x = GetGVarFloat("pickup_x", pickupid);
+		new Float:y = GetGVarFloat("pickup_y", pickupid);
+		new Float:z = GetGVarFloat("pickup_z", pickupid);
+		new world = GetGVarInt("pickup_world", pickupid);
+		// Don't releport when the exit is not set
+		if(x == 0 && y == 0 && z == 0){
+		    return 0;
+		}
+
+		// Create dynamic area and temporarily disable pickups for player
+		new area = CreateDynamicCircle(x, y, 1.7, world, -1, playerid);
+		SetGVarInt("disable_pickups", area, playerid);
+
+		// Teleport player
+		teleportPlayer(playerid, x, y, z, GetGVarInt("pickup_angle", pickupid), world, GetGVarInt("pickup_interior", pickupid));
+	}
+	else{
+        // Do nothing if the player just used a pickup
+		if(GetGVarInt("disable_pickups", playerid)){
+            return 0;
+		}
+		
+		// Create dynamic area and temporarily disable pickups for player
+		new Float:x, Float:y, Float:z;
+		GetPlayerPos(playerid, x, y, z);
+		new area = CreateDynamicCircle(x, y, 1, GetPlayerVirtualWorld(playerid), -1, playerid);
+		SetGVarInt("disable_pickups", area, playerid);
+		
+		// Regular pickup types
+		switch(type){
+	        case PICKUP_FACTION_PD: {
+				switch(GetGVarInt("job", playerid)){
+				    case JOB_NONE:{ShowPlayerDialog(playerid, DIALOG_DUTY_PD, DIALOG_STYLE_MSGBOX, "Active police duty", "Go on police duty as a rookie cop?", "Yes", "No");}
+				    case JOB_POLICE:{ShowPlayerDialog(playerid, DIALOG_DUTY_PD, DIALOG_STYLE_MSGBOX, "Active police duty", "Go off police duty?", "Yes", "No");}
+				    default:{SendClientMessage(playerid, COLOR_ERROR, "SERVER: You can not use this pickup as long as you are on another job.");}
+				}
+
+			}
+			case PICKUP_FACTION_MD:{
+			    switch(GetGVarInt("job", playerid)){
+				    case JOB_NONE:{ShowPlayerDialog(playerid, DIALOG_DUTY_MD, DIALOG_STYLE_MSGBOX, "Active medic duty", "Go on medic duty as a rookie paramedic?", "Yes", "No");}
+				    case JOB_MEDIC:{ShowPlayerDialog(playerid, DIALOG_DUTY_MD, DIALOG_STYLE_MSGBOX, "Active medic duty", "Go off paramedic duty?", "Yes", "No");}
+				    default:{SendClientMessage(playerid, COLOR_ERROR, "SERVER: You can not use this pickup as long as you have another job.");}
+				}
+			}
+			case PICKUP_FACTION_FD:{
+			    printf("jobid: %i", GetGVarInt("job", playerid));
+			    switch(GetGVarInt("job", playerid)){
+				    case JOB_NONE:{ShowPlayerDialog(playerid, DIALOG_DUTY_FD, DIALOG_STYLE_MSGBOX, "Active fire duty", "Go on fire duty as a rookie firefighter?", "Yes", "No");}
+				    case JOB_FIRE:{ShowPlayerDialog(playerid, DIALOG_DUTY_FD, DIALOG_STYLE_MSGBOX, "Active firefighter duty", "Go off firefighter duty?", "Yes", "No");}
+				    default:{SendClientMessage(playerid, COLOR_ERROR, "SERVER: You can not use this pickup as long as you have another job.");}
+				}
+			}
+			case PICKUP_FACTION_FBI:{
+			    switch(GetGVarInt("job", playerid)){
+				    case JOB_NONE:{ShowPlayerDialog(playerid, DIALOG_DUTY_FBI, DIALOG_STYLE_MSGBOX, "Active FBI duty", "Go on FBI duty as a rookie agent?", "Yes", "No");}
+				    case JOB_FBI:{ShowPlayerDialog(playerid, DIALOG_DUTY_FBI, DIALOG_STYLE_MSGBOX, "Active medic duty", "Go off FBI duty?", "Yes", "No");}
+				    default:{SendClientMessage(playerid, COLOR_ERROR, "SERVER: You can not use this pickup as long as you have another job.");}
+				}
+			}
+			case PICKUP_FACTION_DMV:{
+			    switch(GetGVarInt("job", playerid)){
+				    case JOB_NONE:{ShowPlayerDialog(playerid, DIALOG_DUTY_DMV, DIALOG_STYLE_MSGBOX, "Active DMV duty", "Go on DMV duty as a rookie service officer?", "Yes", "No");}
+				    case JOB_DMV:{ShowPlayerDialog(playerid, DIALOG_DUTY_DMV, DIALOG_STYLE_MSGBOX, "Active DMV duty", "Go off DMV duty?", "Yes", "No");}
+				    default:{SendClientMessage(playerid, COLOR_ERROR, "SERVER: You can not use this pickup as long as you have another job.");}
+				}
+			}
+			case PICKUP_FACTION_NEWS:{
+			    switch(GetGVarInt("job", playerid)){
+				    case JOB_NONE:{ShowPlayerDialog(playerid, DIALOG_DUTY_NEWS, DIALOG_STYLE_MSGBOX, "Active broadcasting duty", "Go on network duty as a rookie reporter?", "Yes", "No");}
+				    case JOB_NEWS:{ShowPlayerDialog(playerid, DIALOG_DUTY_NEWS, DIALOG_STYLE_MSGBOX, "Active broadcasting duty", "Go off network duty?", "Yes", "No");}
+				    default:{SendClientMessage(playerid, COLOR_ERROR, "SERVER: You can not use this pickup as long as you have another job.");}
+				}
+			}
+		}
+	
+	}
+
+	return 1;
+}
+
+public OnPlayerLeaveDynamicArea(playerid, areaid){  // Requires streamer
+	// Reactivate pickup after player leaves it
+	new area = GetGVarInt("disable_pickups", playerid);
+	if(area == 0 && areaid != 0){   // Stop if player had not had this area disabled (With the exception of areaid 0 as GetVarInt() returns 0 on null)
+	    return;
+	}
+	else if(area == 0){ // Player has not had picks disabled
+		return;
+	}
+	if(area == areaid){ // Player had this pickup disabled
+		DestroyDynamicArea(GetGVarInt("disable_pickups", playerid));
+		DeleteGVar("disable_pickups", playerid);
+	}
+}
+
+public OnVehicleMod(playerid, vehicleid, componentid)
+{
+	return 1;
+}
+
+public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
+{
+	return 1;
+}
+
+public OnVehicleRespray(playerid, vehicleid, color1, color2)
+{
+	return 1;
+}
+
+public OnPlayerSelectedMenuRow(playerid, row)
+{
+	return 1;
+}
+
+public OnPlayerExitedMenu(playerid)
+{
+	return 1;
+}
+
+public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
+{
+	return 1;
+}
+
+public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
+{
+	return 1;
+}
+
+public OnRconLoginAttempt(ip[], password[], success){
+	new message[30 + MAX_SQL_IP + 1];
+	if(success){
+		format(message, sizeof(message), "* [%s] authenticated via RCON.", ip);
+	}
+	else{
+		format(message, sizeof(message), "* [%s] invalid RCON authentication.", ip);
+	}
+
+	logger(LOGLEVEL_NOTICE, message);	// Log event
+	DiscordEcho(message, MANAGEMENT_CHANNEL);	// Notify Discord management.
+
+	return 1;
+}
+
+public OnPlayerUpdate(playerid)	// Don't use for now.
+{
+	return 1;
+}
+
+public OnPlayerStreamIn(playerid, forplayerid){
+
+	return 1;
+}
+
+public OnPlayerStreamOut(playerid, forplayerid)
+{
+	return 1;
+}
+
+public OnVehicleStreamIn(vehicleid, forplayerid)
+{
+	return 1;
+}
+
+public OnVehicleStreamOut(vehicleid, forplayerid)
+{
+	return 1;
+}
+
+public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]){
+	switch(dialogid){
+
+		case DIALOG_CHANGENAME:{
+			if(GetGVarInt("userlevel", playerid) > UNREGISTERED_PLAYER){ // Registered player
+			    if(!response){  // User aborted
+			        return 0;   // Allow escaping dialogm without forcing to continue
+				}
+			}
+			
+			changeName(playerid, inputtext);    // Forced name check and change
+		}
+
+		case DIALOG_REGISTER:{
+			if(response){ // If they clicked 'Yes' or pressed enter
+				// Check password complexity
+				new Regex:r = Regex_New("^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[0-9!@#\\$%\\^&\\*\\(\\)\\-\\_=+[{\\]}\\\\|;:'\",<.>\\/?]).{8,}$");	// Regex password filter
+				new isSecurePassword = Regex_Check(inputtext, r); // Validate name to filter
+				Regex_Delete(r);
+				if(!isSecurePassword){   // Insecure password
+				    ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Insecure password", "Enter a secure password, containg at least:\n\n * A lowercase letter (a-z)\n * A capiral letter (A-Z)\n * A number (0-9).\n * A character that is not a letter (0-9!@#$%^&*()-_=+[{]}\\|;:'\",<.>/?).\n * 8 characters.", "Register", "Cancel");	// Show password requirements.
+				}
+				else {  // Secure password
+					// Hash password
+					new buffer[MAX_SQL_HASH + 1], hash[MAX_SQL_HASH + 1];
+					WP_Hash(buffer, sizeof(buffer), inputtext);
+					GetGVarString("hash", hash, sizeof(hash), playerid);
+
+					if(isempty(hash)){	// First password dialog
+						SetGVarString("hash", buffer, playerid);	// Save password has a GVar
+						ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Password confirmation", "Repeat your password to confirm.", "Register", "Cancel");	// Show password confirmation dialog
+					}
+					else{	// Password confirmation
+						if(!isequal(hash, buffer)){	// Password does not match confirmation
+					    	DeleteGVar("hash", playerid);
+					    
+							SendClientMessage(playerid, COLOR_RED, "ERROR: Password does not match password confirmation.");
+							ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Password", "Enter the same password twice.", "Continue", "Cancel");	// Password prompt
+						}
+						else{	// Password matches confirmation
+						 	DeleteGVar("hash", playerid);
+					 	
+							new client_connect_username[MAX_PLAYER_NAME + 1], playerIP[MAX_SQL_IP + 1], escaped_username[MAX_PLAYER_NAME + 1];
+							GetGVarString("client_connect_username", client_connect_username, sizeof(client_connect_username), playerid);
+							GetPlayerIp(playerid, playerIP, sizeof(playerIP));
+							sql_escape_string(sqlHandle, client_connect_username, escaped_username, sizeof(escaped_username));
+
+							// Create user record
+							new user_query[61 + MAX_PLAYER_NAME + MAX_SQL_HASH + 1 + MAX_SQL_IP + 1];
+							format(user_query, sizeof(user_query), "INSERT INTO \"user\"(name, password) VALUES('%s', '%s')", escaped_username, hash);
+							/*new Result:user_result = sql_query(sqlHandle, user_query);
+							//new id = sql_insert_id(user_result);   // Broken, always returns 0.
+							// sql_insert_id workaround*/
+							sql_query(sqlHandle, user_query);
+							
+							new id = getUserID(playerid);  // Get ID user user record
+							
+							SetGVarInt("userlevel", REGISTERED_PLAYER, playerid);
+
+							// Create user_ip relation table record
+							new user_ip_query[50 + MAX_SQL_INTEGER + MAX_SQL_INTEGER + 1 ];
+							format(user_ip_query, sizeof(user_ip_query), "INSERT INTO user_ip(id, id) VALUES(%i, %i)", getIPID(playerid), id);
+							sql_query(sqlHandle, user_ip_query);
+
+							createCharacterRecord(playerid, id);	// Save character
+							
+							// Inform user
+							new dialogMessage[135 + MAX_PLAYER_NAME + 1], message[31 + MAX_PLAYER_NAME + 1];
+							format(dialogMessage, sizeof(dialogMessage), "To login as any of your characters, connect as: \nRemember your username carefully, as you have to use it to connect with SA-MP client!", client_connect_username);
+							ShowPlayerDialog(playerid, DIALOG_ACCOUNT_CREATED, DIALOG_STYLE_MSGBOX, "Account created", dialogMessage, "Play", "");
+							format(message, sizeof(message), "SERVER: Remember your username, %s!", client_connect_username);
+							SendClientMessage(playerid, COLOR_WARNING, message);
+							
+							// send discord admin echo
+							new admin_message[30 + 4 + MAX_PLAYER_NAME + 1];
+							format(admin_message, sizeof(admin_message), "[%i] %s has registered an account.", playerid, client_connect_username);
+							DiscordEcho(admin_message, ADMIN_ECHO_CHANNEL);
+						}
+					}
+				}
+			}
+			else{ // Pressed ESC or clicked cancel
+				DeleteGVar("hash", playerid);
+			}
+		}
+		case DIALOG_LOGIN:{
+			if(response){ // If they clicked 'Yes' or pressed enter
+				// Escape username
+				new client_connect_username[MAX_PLAYER_NAME + 1], escaped_username[MAX_PLAYER_NAME + 1];
+				GetGVarString("client_connect_username", client_connect_username, sizeof(client_connect_username), playerid);
+				sql_escape_string(sqlHandle, client_connect_username, escaped_username, sizeof(escaped_username));
+
+				// Get account
+				new user_query[82 + MAX_PLAYER_NAME + 1], hash[MAX_SQL_HASH + 1];
+				format(user_query, sizeof(user_query), "SELECT id, password, level FROM \"user\" WHERE name = '%s'", escaped_username);
+				new Result:user_result = sql_query(sqlHandle, user_query);
+				sql_get_field_assoc_ex(user_result, 0, "password", hash, sizeof(hash));
+
+				// Compare hashes
+				new buffer[MAX_SQL_HASH + 1];
+				WP_Hash(buffer, sizeof(buffer), inputtext);
+				if (!isequal(buffer, hash)){ //	Hashes don't match
+					// Brute-force protection
+						new authentication_count = GetGVarInt("authentication_count", playerid);
+						authentication_count++;
+						SetGVarInt("authentication_count", authentication_count, playerid);
+						ShowPlayerDialog(playerid, DIALOG_LOGIN_FAILED, DIALOG_STYLE_MSGBOX, "Authenticaion failed", "Invalid password.", "Wait", "");
+						switch(authentication_count){
+							case 0: SetTimerEx("authenticate", 3000, false, "i", playerid);	// Return to authentication workflow in 3 second.
+							case 1: SetTimerEx("authenticate", 5000, false, "i", playerid);	// Return to authentication workflow in 5 seconds.
+							case 2: SetTimerEx("authenticate", 7000, false, "i", playerid);	// Return to authentication workflow in 7 seconds.
+							default: ShowPlayerDialog(playerid, DIALOG_CHANGE_USERNAME, DIALOG_STYLE_INPUT, "Username", "Pick an unregistered username.", "Change", "");  // After 4 failed authentication attempts
+						}
+				}
+				else{	// Hashes match
+				    // Set userlevel    (This has to be done before banning, else the user ban record won't save)
+        			new userlevel = sql_get_field_assoc_int(user_result, "level");
+        			printf("Setting userlevel: %i", userlevel);
+					SetGVarInt("userlevel", userlevel, playerid);
+					
+					// Check bans
+					new ban_query[76 + MAX_SQL_INTEGER + 1];
+					format(ban_query, sizeof(ban_query), "SELECT user_id FROM user_ban WHERE user_id = %i AND expires > NOW()::timestamp", getUserID(playerid));
+					new Result:ban_result = sql_query(sqlHandle, ban_query);
+					if(sql_num_rows(ban_result) > 0){  // Banned
+					    new reason[121 + 1];
+						format(reason, sizeof(reason), "Logged in with banned account: %i", sql_get_field_assoc_int(ban_result, "user_id"));
+					    banPlayer(playerid, -1, reason, 10);
+					}
+					
+					// Get character names
+					characterSelection(playerid);
+				}
+			}
+			else{	// Pressed ESC or clicked cancel
+				ShowPlayerDialog(playerid, DIALOG_CHANGE_USERNAME, DIALOG_STYLE_INPUT, "Username", "Pick an unregistered username.", "Change", "");
+			}
+		}
+		case DIALOG_CHANGE_USERNAME:{
+			if(response){ // If they clicked 'Yes' or pressed enter
+				new Regex:r = Regex_New("^[0-9a-zA-Z\\[\\]\\(\\)\\$@._=]{1,}$");	// Regex name filter
+				new isValidName = Regex_Check(inputtext, r);
+				Regex_Delete(r);
+				if(isValidName){	// Valid name
+				    // Get user record
+					new escaped_username[MAX_PLAYER_NAME + 1], user_query[36 + MAX_PLAYER_NAME + 1];
+					sql_escape_string(sqlHandle, inputtext, escaped_username, sizeof(escaped_username));	// Escape player name
+					format(user_query, sizeof(user_query), "SELECT id FROM \"user\" WHERE name = '%s'", escaped_username);
+					//new Result:result = sqlQuery(sqlHandle, user_query);  // Middleware broken.
+					new Result:result = sql_query(sqlHandle, user_query);
+					
+					if(sql_num_rows(result) > 0){  // Username taken
+					    ShowPlayerDialog(playerid, DIALOG_CHANGE_USERNAME, DIALOG_STYLE_INPUT, "Username", "Pick an unregistered username.", "Change", "");
+					}
+					else{   // Username free
+					    SetGVarString("client_connect_username", inputtext, playerid); // Used by register and DIALOG_LOGIN
+					    SetPlayerName(playerid, inputtext);	// Change name in-game
+
+						return 1;   // Do nothing to let player continue class selection
+					}
+				}
+				else{	// Invalid name
+					ShowPlayerDialog(playerid, DIALOG_CHANGE_USERNAME, DIALOG_STYLE_INPUT, "Username", "Invalid name. Names may only contain numbers (0-9), letters (a-z) & (A-Z) and special characters ([]()$@._=)", "Change", "");
+				}
+			}
+			else{	// Pick another username
+			    ShowPlayerDialog(playerid, DIALOG_CHANGE_USERNAME, DIALOG_STYLE_INPUT, "Username", "Pick an unregistered username.", "Change", "");
+			}
+		}
+		case DIALOG_CHARACTERS:{    // TODO set color & skin in case of job
+			if(response){ // Spawn as character
+			    new character_array_string[MAX_CHARACTERS_PER_USER * MAX_SQL_INTEGER + 1], character_array[MAX_CHARACTERS_PER_USER + 1];
+       			GetGVarString("character_array_string", character_array_string, sizeof(character_array_string), playerid);
+       			DeleteGVar("character_array_string");
+       			
+       			strtobin(character_array, character_array_string);
+			    
+				new character_query[132 + MAX_PLAYER_NAME + 1], name[24 + 1];
+				format(character_query, sizeof(character_query), "SELECT name, skin_id, cash, armour, health, pos_x, pos_y, pos_z, rotation, world_id, interior_id, job_id FROM character WHERE id = %i", character_array[listitem]);
+				new Result:character_result = sql_query(sqlHandle, character_query);
+				sql_get_field_assoc(character_result, "name", name, sizeof(name));
+				new skin_id = sql_get_field_assoc_int(character_result, "skin_id");
+				new cash = sql_get_field_assoc_int(character_result, "cash");
+				new Float:armour = sql_get_field_assoc_int(character_result, "armour");
+				new Float:health = sql_get_field_assoc_int(character_result, "health");
+				new Float:pos_x = sql_get_field_assoc_int(character_result, "pos_x");
+				new Float:pos_y = sql_get_field_assoc_int(character_result, "pos_y");
+				new Float:pos_z = sql_get_field_assoc_int(character_result, "pos_z");
+				new Float:rotation = sql_get_field_assoc_int(character_result, "rotation");
+				new world_id = sql_get_field_assoc_int(character_result, "world_id");
+				new interior_id = sql_get_field_assoc_int(character_result, "interior_id");
+				//new job_id = sql_get_field_assoc_int(character_result, "job_id");
+				
+				// Temporary bug workaround TODO find cause
+				if(pos_x == 0 && pos_y == 0 && pos_z == 0){ // Sometimes this happens. Due to unreliable OnPlayerDisconnect() & OnGamemodeExit(), due to character creation, or due to (forgot the other possiblity, but had a strong hunch)?
+				    pos_x = -144.0328;
+					pos_y = 1225.0564;
+					pos_z = 19.8992;
+					rotation = 175.5507;
+				}
+				SetSpawnInfo(playerid, 0, skin_id, pos_x, pos_y, pos_z, rotation, 0, 0, 0, 0, 0, 0);
+                SetGVarInt("character_id", character_array[listitem], playerid);
+                
+                SetPlayerName(playerid, name);	// Change name in-game
+                SetPlayerColor(playerid, COLOR_WHITE);
+                SpawnPlayer(playerid);
+                ResetPlayerMoney(playerid);
+                GivePlayerMoney(playerid, cash);
+                SetPlayerHealth(playerid, health);
+                SetPlayerArmour(playerid, armour);
+                SetPlayerVirtualWorld(playerid, world_id);
+				SetPlayerInterior(playerid, interior_id);
+				// TODO design a way to keep job on rejoin
+                
+                // Notify all players
+				new message[16 + 4 + MAX_PLAYER_NAME + 1];
+				format(message, sizeof(message), "* [%i] %s joined.", playerid, getCharacterName(playerid));
+				SendClientMessageToAll(COLOR_NOTICE, message);	// Notify all players.
+				DiscordEcho(message, ECHO_CHANNEL);	// Notify discord public echo
+                
+			}
+			else{	// New character
+			    // character cap
+			    new id = getUserID(playerid);
+				new character_query[60 + MAX_SQL_INTEGER + 1];
+				format(character_query, sizeof(character_query), "SELECT id FROM character WHERE character_id = %i", id);
+				new Result:character_result = sql_query(sqlHandle, character_query);
+				printf("%i", sql_num_rows(character_result));
+				if(sql_num_rows(character_result) >= MAX_CHARACTERS_PER_USER){  // At or over character limit
+				    SendClientMessage(playerid, COLOR_WARNING, "SERVER: Maximum characters reached, can not create another.");
+				    characterSelection(playerid);
+				}
+			    else{
+			        ShowPlayerDialog(playerid, DIALOG_CHANGENAME, DIALOG_STYLE_INPUT, "Character name", "Pick a name.\n\nExamples:\n Jo_Bo\n Dingle_P._J._Berry\n Jackson_DeForest_Kelley\n MaryJo_Ann_LaFluer", "Change", "");	// Force RP name.
+			        // changeName(playerid, "");	// Pick name and save character ANNOYING this forces new character creation, no way out.
+				}
+                
+			}
+		}
+        case DIALOG_LOGIN_FAILED:{
+			ShowPlayerDialog(playerid, DIALOG_LOGIN_FAILED, DIALOG_STYLE_MSGBOX, "Authenticaion failed", "Take some time to think about your password...", "Wait", "Longer");
+		}
+		case DIALOG_DELETE_CHARACTER:{
+			if(response){ // Delete character
+				new playername[MAX_PLAYER_NAME + 1];
+				playername = getPlayerName(playerid);
+				
+				// Checkcharacter amount
+				new id = getUserID(playerid), character_query[75 + MAX_SQL_INTEGER + MAX_CHARACTERS_PER_USER_DIGITS + 1];
+				format(character_query, sizeof(character_query), "SELECT id, name FROM character WHERE user_id = %i LIMIT %i", id, MAX_CHARACTERS_PER_USER);
+				new Result:character_result = sql_query(sqlHandle, character_query);
+                if(sql_num_rows(character_result) < 2){  // 1 character or less
+                    SendClientMessage(playerid, COLOR_WARNING, "SERVER: You can not have less then one character.\nCreate another character,before deleting this one.");
+                
+				}
+			    else{   // More then 1 character
+					// delete character record
+					new delete_query[50 + MAX_PLAYER_NAME + MAX_SQL_INTEGER + 1];
+					format(delete_query, sizeof(delete_query), "DELETE FROM character WHERE name = '%s' AND user_id = %i", playername, getUserID(playerid));
+					sql_query(sqlHandle, delete_query);
+			
+					// infordm admin echo
+					new client_connect_username[MAX_PLAYER_NAME + 1], message[28 + 4 + MAX_PLAYER_NAME + MAX_PLAYER_NAME + 1];
+					GetGVarString("client_connect_username", client_connect_username, sizeof(client_connect_username), playerid);   // Get client connect name
+					format(message, sizeof(message), "* [%i] %s has been deleted by it's user: %s", playerid, getCharacterName(playerid), client_connect_username);
+					DiscordEcho(message, ADMIN_ECHO_CHANNEL);
+					sendToAdmins(COLOR_COMMAND_OUTPUT, message);
+					
+					// Player must not be spawned or will be able to esacpe the character menu and continue with character without dartabase record
+					ForceClassSelection(playerid);
+					TogglePlayerSpectating(playerid, true);
+				    TogglePlayerSpectating(playerid, false);
+				    
+					characterSelection(playerid);
+				}
+			}
+		}
+		case DIALOG_GOTO:{
+		    if(response){
+				switch(listitem){
+				    case GOTO_CATEGORY_INTERIOR:{
+				        dialogGotoInterior(playerid);
+					}
+					/*case GOTO_CATEGORY_PLAYER:{
+				        dialogGotoPlayer(playerid);
+					}*/
+				}
+			}
+		}
+        case DIALOG_GOTO_INTERIOR:{
+		    if(response){
+				switch(listitem){
+				    
+					case INTERIOR_CATEGORY_AVIATION:{
+						ShowPlayerDialog(playerid, DIALOG_GOTO_AVIATION, DIALOG_STYLE_TABLIST, "Aviation interiors", "Francis Intn'l Airport - Ticket sales\tStarting Cutscene\nFrancis Intn'l Airport - Baggage claim\tStarting Cutscene\nShamal cabin\tMission \"Free Fall\"\nAndromada cargo hold\tMission \"Stowaway\"\nLS Airport, Baggage Reclaim\tCutscene in \"Opening Mission\"", "Goto", "Cancel");
+					}
+					case INTERIOR_CATEGORY_HOUSES:{
+					    dialogGotoHouses(playerid);
+					}
+					case INTERIOR_CATEGORY_MISSION:{
+						ShowPlayerDialog(playerid, DIALOG_GOTO_MISSION, DIALOG_STYLE_TABLIST, "Mission interiors", "Atrium\tMission \"Just Business\"\tLS\nBig Smoke's Crack Palace\tMission \"End of the Line\"\nJefferson Motel\tMission \"Reuniting the Families\"\tLS\nPleasure Domes/Jizzy's\tMission \"Ice Cold Killa\"\tSF\nRC Battlefield\tMission \"New Model Army\"\nWoozies Apartment/Wu-Zi Mu's\t\tSF\n", "Goto", "Cancel");
+					}
+					case INTERIOR_CATEGORY_MISSIONEXT:{
+					    ShowPlayerDialog(playerid, DIALOG_GOTO_MISSIONEXT, DIALOG_STYLE_TABLIST, "Mission exteriors", "Dillimore Gas Station\tMission \"Tanker Commander\"\nLiberty City\tMission \"Saint Marks Bistro\"\nSan Fierro Garage\tDoherty (Locked Camera Position}", "Goto", "Cancel");
+					}
+					case INTERIOR_CATEGORY_POLICE:{
+						ShowPlayerDialog(playerid, DIALOG_GOTO_POLICE, DIALOG_STYLE_LIST, "Police departments", "Las Venturas\nLos Santos\nSan Fierro\nBarbara's love nest", "Goto", "Cancel");
+					}
+					case INTERIOR_CATEGORY_SEXWORK:{
+						ShowPlayerDialog(playerid, DIALOG_GOTO_SEXWORK, DIALOG_STYLE_LIST, "Brothels & stip clubs", "Brother\nBrother2\nBig spread ranch\tBC\n", "Goto", "Cancel");
+					}
+					case INTERIOR_CATEGORY_SHOPS:{
+					    dialogGotoShops(playerid);
+					}
+					case INTERIOR_CATEGORY_STADIA:{
+					    ShowPlayerDialog(playerid, DIALOG_GOTO_STADIA, DIALOG_STYLE_TABLIST, "Stadia", "Bloodbowl stadium\nKickstart stadium\n8 Track stadium\nDirtbike stadium\n", "Goto", "Cancel");
+					}
+				}
+        	}
+			else{
+			    ShowPlayerDialog(playerid, DIALOG_GOTO, DIALOG_STYLE_LIST, "Categories", "Interiors\nPlayers", "Select", "Cancel");
+			}
+		}
+		case DIALOG_GOTO_HOUSES:{
+		    if(response){
+				switch(listitem){
+					case INTERIOR_HOUSE_CAT_BURGLARY:{
+						ShowPlayerDialog(playerid, DIALOG_GOTO_BURGLARYHOUSE, DIALOG_STYLE_TABLIST, "Burglary houses", "Large\t2 story\t3 bedroom clone of house 9\t\nMedium\t1 story\t1 bedroom\tEast LS\nSmall\t1 story\t1 bedroom\tCalton Heights, SF\nVery large\t2 story\t4 bedrooms\nSmall\t1 story\t2 bedrooms\tJefferson LS\nSmall\t1 story\t2 bedrooms\tEast LS\nSmall\t1 story\t1 bedroom (NO BATHROOM!)", "Goto", "Cancel");
+					}
+					case INTERIOR_HOUSE_CAT_MISSION:{
+                        ShowPlayerDialog(playerid, DIALOG_GOTO_MISSIONHOUSE, DIALOG_STYLE_TABLIST, "Mission houses", "Burning Desire house\t\tEast LS\nColonel Furhberger's\tMission \"Home Invasion\"\t Los Flores, LS\nRyder's house\nSweet's house\tCutscene in \"First Date\"\nCrack Den\tMission \"Cleaning The Hood\"", "Goto", "Cancel");
+					}
+					case INTERIOR_HOUSE_CAT_SAFE:{
+						ShowPlayerDialog(playerid, DIALOG_GOTO_SAFEHOUSE, DIALOG_STYLE_TABLIST, "Safe houses", "Golden Bed motel room\t\t\nHashbury house\tHashburry\tSF\nThe Johnson house\tGanton\tLS\nMadd Doggs mansion\tMulholland\tLS\nRed Bed motel Room\nVerdant Bluffs safehouse\tVerdant Bluffs\t LV\nUnused safehouse\tLarge modern safehouse", "Goto", "Cancel");
+					}
+					case INTERIOR_HOUSE_CAT_U:{
+						ShowPlayerDialog(playerid, DIALOG_GOTO_UHOUSE, DIALOG_STYLE_TABLIST, "To be categorized houses", "", "Goto", "Cancel");
+					}
+				}
+        	}
+			else{
+			    dialogGotoInterior(playerid);
+			}
+		}
+		case DIALOG_GOTO_SHOPS:{
+		    if(response){
+				switch(listitem){
+					case INTERIOR_SHOP_CAT_247:{
+						ShowPlayerDialog(playerid, DIALOG_GOTO_247, DIALOG_STYLE_TABLIST, "24/7's", "L-shaped\tBig\tNO EXIT\nOblong\tBig\tNO EXIT\nSquare\tMedium\tCreek, LV\nSquare\tMedium\tNO EXIT\nLong\tSmall\tMulholland\nSquare\tSmall\tWhetstone", "Goto", "Cancel");
+					}
+					case INTERIOR_SHOP_CAT_AMMUNATION:{
+						ShowPlayerDialog(playerid, DIALOG_GOTO_AMMUNATION, DIALOG_STYLE_TABLIST, "Ammunation's", "Ocean Flats\tSF\nPalomino Creek\tLV\nAngel Pine\tSF\nEl Quebrados\tLV\n2 Stories/t with Booth and Range\n Booth\n Range", "Goto", "Cancel");
+					}
+					case INTERIOR_SHOP_CAT_CASINO:{
+						ShowPlayerDialog(playerid, DIALOG_GOTO_SHOP, DIALOG_STYLE_TABLIST, "Casino's", "Caligulas casino\tThe Strip\tLV\nCasino (Redsands West)\tThe Strip\tLV\n4 Dragons casino\tThe Strip\tLV\n Four Dragons' Managerial Suite", "Goto", "Cancel");
+					}
+					case INTERIOR_SHOP_CAT_MODSHOP:{
+						ShowPlayerDialog(playerid, DIALOG_GOTO_MODDING, DIALOG_STYLE_TABLIST, "Modding shops", "Loco Low Co\tLos Santos\nWheel Arch Angels\tSan Fierro\nTransfender", "Goto", "Cancel");
+					}
+					case INTERIOR_SHOP_CAT_SHOP:{
+						ShowPlayerDialog(playerid, DIALOG_GOTO_SHOP, DIALOG_STYLE_TABLIST, "Stores & parlors", "Tattoos\tIdlewood\tLS\nBurger Shot\tWhitewood Estates\nWell Stacked Pizza\tBlueberry\nCluckin' Bell\nRusty Brown's donuts\tMission \"Burning Desire\"\nZero's RC shop\tGarcia\tSF\nThe Welcome Pump\nGanton Gym\tGanton\tLS\nInside Track Betting\nBlastin' Fools Records", "Goto", "Cancel");
+					}
+				}
+        	}
+			else{
+			    dialogGotoInterior(playerid);
+			}
+		}
+		case DIALOG_GOTO_247:{
+		    if(response){
+		        new Float:x, Float:y, Float:z, world, interior, Float:angle, name[25 + 1];
+		        world = GetPlayerVirtualWorld(playerid);
+				switch(listitem){
+					case INTERIOR_247_LSHAPED:{
+						x = -25.7220;
+						y = -187.8216;
+						z = 1003.5469;
+						interior = 17;
+						angle = 5.0760;
+						name = "L-shaped ammunation";
+					}
+					case INTERIOR_247_OBLONG:{
+						x = 6.0856;
+						y = -28.8966;
+						z = 1003.5494;
+						interior = 10;
+						angle = 5.0365;
+	                    name = "Oblong ammunation";
+					}
+					case INTERIOR_247_MEDIUM:{
+						x = -30.9875;
+						y = -89.6806;
+						z = 1003.5469;
+						interior = 18;
+						angle = 359.8401;
+	                    name = "Medium ammunation";
+					}
+					case INTERIOR_247_MEDIUM_NOEXIT:{
+						x = -26.1856;
+						y = -140.9164;
+						z = 1003.5469;
+						interior = 16;
+						angle = 2.9087;
+					    name = "Medium no exit ammunation";
+					}
+					case INTERIOR_247_LONG:{
+						x = -27.844;
+						y = 26.6737;
+						z = 1003.5573;
+						interior = 4;
+						angle = 184.3118;
+					    name = "Small long ammunation";
+					}
+					case INTERIOR_247_SQAURE:{
+						x = -26.8339,
+						y = -55.5846,
+						z = 1003.5469,
+						interior = 6,
+						angle = 3.9528;
+						name = "Small square ammunation";
+					}
+				}
+				gotoCallback(x, y, z, world, interior, angle, name);
+			}
+			else{dialogGotoShops(playerid);}
+		}
+		case DIALOG_GOTO_AVIATION:{
+		    if(response){
+		        new Float:x, Float:y, Float:z, world, interior, Float:angle, name[39 + 1];
+		        world = GetPlayerVirtualWorld(playerid);
+				switch(listitem){
+					case INTERIOR_AVIATION_TICKET:{
+						x = -1827.147338;
+						y = 7.207418;
+						z = 1061.143554;
+						interior = 14;
+						angle = 335.3199;
+						name = "Francis Intn'l Airport - Ticket sales";
+					}
+					case INTERIOR_AVIATION_BAGGAGE:{
+						x = -1855.568725;
+						y = 41.263156;
+						z = 1061.143554;
+						interior = 14;
+						angle = 335.3199;
+	                    name = "Francis Intn'l Airport - Baggage claim";
+					}
+					case INTERIOR_AVIATION_SHAMAL:{
+						x = 2.384830;
+						y = 33.103397;
+						z = 1199.849976 ;
+						interior = 1;
+						angle = 359.8401;
+	                    name = "Shamal cabin";
+					}
+					case INTERIOR_AVIATION_ANDROMADA:{
+						x = 315.856170;
+						y = 1024.496459;
+						z = 1949.797363;
+						interior = 9;
+						angle = 359.6368;
+					    name = "Andromada cargo hold";
+					}
+					case INTERIOR_AVIATION_LSAIRPORT:{
+						x = -1870.80;
+						y = 59.81;
+						z = 1056.25;
+						interior = 14;
+						angle = 85.8541;
+						name = "LS Airport, Baggage Reclaim";
+					}
+				}
+				gotoCallback(x, y, z, world, interior, angle, name);
+			}
+			else{dialogGotoInterior(playerid);}
+		}
+		case DIALOG_GOTO_AMMUNATION:{   // TODO there are more ammunations that deserve a booth and range teleport
+		    if(response){
+		        new Float:x, Float:y, Float:z, world, interior, Float:angle, name[31 + 1];
+		        world = GetPlayerVirtualWorld(playerid);
+				switch(listitem){
+					case INTERIOR_AMMU_OCEAN:{
+						x = 286.148987;
+						y = -40.644398 ;
+						z = 1001.569946;
+						interior = 1;
+						angle = 0.7529;
+						name = "Ocean Flats, SF";
+					}
+					case INTERIOR_AMMU_PALOMINO:{
+						x = 286.800995;
+						y = -82.547600;
+						z = 1001.539978;
+						interior = 4;
+						angle = 290.2195;
+	                    name = "Palomino Creek, LV";
+					}
+					case INTERIOR_AMMU_ANGEL:{
+						x = 296.919983;
+						y = -108.071999;
+						z = 1001.569946;
+						interior = 6;
+						angle = 290.2195;
+	                    name = "Angel Pine, SF";
+					}
+					case INTERIOR_AMMU_QUEBRADOS:{
+						x = 316.524994;
+						y = -167.706985;
+						z = 999.661987;
+						interior = 6;
+						angle = 10.3031;
+	                    name = "El Quebrados, LV";
+					}
+					case INTERIOR_AMMU_2STORIES:{
+						x = 314.820984;
+						y = -141.431992;
+						z = 999.661987;
+						interior = 7;
+						angle = 20.2254;
+	                    name = "2 Stories, with booth and range";
+					}
+					case INTERIOR_AMMU_BOOTH:{
+						x = 302.292877;
+						y = -143.139099;
+						z = 1004.062500;
+						interior = 7;
+						angle = 20.2254;
+	                    name = "Booth";
+					}
+					case INTERIOR_AMMU_RANGE:{
+						x = 280.795104;
+						y = -135.203353;
+						z = 1004.062500;
+						interior = 7;
+						angle = 20.2254;
+	                    name = "Range";
+					}
+				}
+				gotoCallback(x, y, z, world, interior, angle, name);
+			}
+			else{dialogGotoShops(playerid);}
+		}
+        case DIALOG_GOTO_BURGLARYHOUSE:{
+			if(response){
+		        new Float:x, Float:y, Float:z, world, interior, Float:angle, name[45 + 1];
+			    world = GetPlayerVirtualWorld(playerid);
+				switch(listitem){
+					case INTERIOR_BURGRLARY_LARGE:{
+						x = 235.508994;
+						y = 1189.169897;
+						z = 1080.339966;
+						interior = 3;
+						angle = 349.4844;
+						name = "Large: 2 story, 3 bedroom clone of house 9";
+					}
+					case INTERIOR_BURGRLARY_MEDIUM:{
+						x = 225.756989;
+						y = 1240.000000;
+						z = 1082.149902;
+						interior = 2;
+						angle = 96.2852;
+						name = "Medium: 1 story, 1 bedroom";
+					}
+					case INTERIOR_BURGRLARY_SMALL:{
+						x = 223.043991;
+						y = 1289.259888;
+						z = 1082.199951;
+						interior = 1;
+						angle = 359.868;
+						name = "Small: 1 story, 1 bedroom";
+					}
+                    case INTERIOR_BURGRLARY_VERYLARGE:{
+						x = 225.630997;
+						y = 1022.479980;
+						z = 1084.069946;
+						interior = 7;
+						angle = 270.2654;
+						name = "VERY Large: 2 story, 4 bedrooms";
+					}
+					case INTERIOR_BURGRLARY_5:{
+						x = 295.138977;
+						y = 1474.469971;
+						z = 1080.519897;
+						interior = 15;
+						angle = 0;
+						name = "Small: 1 story, 2 bedrooms";
+					}
+					case INTERIOR_BURGRLARY_6:{
+						x = 328.493988;
+						y = 1480.589966;
+						z = 1084.449951;
+						interior = 15;
+						angle = 0;
+						name = "Small: 1 story, 2 bedrooms";
+					}
+					case INTERIOR_BURGRLARY_NOBATH:{
+						x = 385.803986;
+						y = 1471.769897;
+						z = 1080.209961;
+						interior = 15;
+						angle = 0;
+						name = "Small: 1 story, 1 bedroom (NO BATHROOM!)";
+					}
+				}
+				gotoCallback(x, y, z, world, interior, angle, name);
+			}
+			else{dialogGotoHouses(playerid);}
+		}
+		case DIALOG_GOTO_CASINO:{
+			if(response){
+		        new Float:x, Float:y, Float:z, world, interior, Float:angle, name[30 + 1];
+			    world = GetPlayerVirtualWorld(playerid);
+				switch(listitem){
+					case INTERIOR_CASINO_CALIGULAS:{
+						x = 2233.8032;
+						y = 1712.2303;
+						z = 1011.7632;
+						interior = 1;
+						angle = 184.3891;
+						name = "Caligulas Casino";
+					}
+                    case INTERIOR_CASINO_REDLAND:{
+						x = 1118.8878;
+						y = -10.2737;
+						z = 1002.0859;
+						interior = 12;
+						angle = 165.8482;
+						name = "Casino (Redsands West)";
+					}
+                    case INTERIOR_CASINO_4DRAGONS:{
+						x = 2016.2699;
+						y = 1017.7790;
+						z = 996.8750;
+						interior = 10;
+						angle = 88.0055;
+						name = "4 Dragons Casino";
+					}
+					case INTERIOR_CASINO_4DRAGONSUITE:{
+						x = 2003.1178;
+						y = 1015.1948;
+						z = 33.008;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 11;
+						angle = 351.5789;
+						name = "Four Dragons' Managerial Suite";
+					}
+                }
+				gotoCallback(x, y, z, world, interior, angle, name);
+			}
+			else{dialogGotoInterior(playerid);}
+		}
+		case DIALOG_GOTO_MISSION:{
+			if(response){
+		        new Float:x, Float:y, Float:z, world, interior, Float:angle, name[30 + 1];
+			    world = GetPlayerVirtualWorld(playerid);
+				switch(listitem){
+					case INTERIOR_MISSION_ATRIUM:{
+						x = 1726.18;
+						y = -1641.00;
+						z = 20.23;
+						interior = 18;
+						angle = 172.4193;
+						name = "Atrium";
+					}
+					case INTERIOR_MISSION_BIGSMOKE:{
+						x = 2567.52;
+						y = -1294.59;
+						z = 1063.25 ;
+						interior = 2;
+						angle = 254.9548;
+						name = "Big Smoke's Crack Palace";
+					}
+					case INTERIOR_MISSION_JEFFERSON:{
+						x = 2220.26;
+						y = -1148.01;
+						z = 1025.80;
+						interior = 15;
+						angle = 273.7328;
+						name = "Jefferson Motel";
+					}
+					case INTERIOR_MISSION_JIZZY:{
+						x = -2637.69;
+						y = 1404.24;
+						z = 906.46;
+						interior = 3;
+						angle = 94.6794;
+						name = "Pleasure Domes/Jizzy's";
+					}
+					case INTERIOR_MISSION_RC:{
+						x = -1079.99;
+						y = 1061.58;
+						z = 1343.04;
+						interior = 10;
+						angle = 274.5268;
+						name = "RC Battlefield";
+					}
+					case INTERIOR_MISSION_WUZI:{
+						x = -2158.72;
+						y = 641.29;
+						z = 1052.38;
+						interior = 1;
+						angle = 86.5402;
+						name = "Woozies Apartment/Wu-Zi Mu's";
+					}
+				}
+				gotoCallback(x, y, z, world, interior, angle, name);
+			}
+			else{dialogGotoInterior(playerid);}
+		}
+		case DIALOG_GOTO_MISSIONEXT:{
+			if(response){
+		        new Float:x, Float:y, Float:z, world, interior, Float:angle, name[30 + 1];
+		        world = GetPlayerVirtualWorld(playerid);
+				switch(listitem){
+		            case INTERIOR_MISSIONEXT_GAS:{
+						x = 664.19;
+						y = -570.73;
+						z = 16.34;
+						interior = 0;
+						angle = 264.9829;
+						name = "Dillimore Gas Station";
+					}
+					case INTERIOR_MISSIONEXT_LIBERTY:{ // TODO Create extra interior inside the shop
+						x = -750.80;
+						y = 491.00;
+						z = 1371.70;
+						interior = 1;
+						angle = 71.7782;
+						name = "Liberty City";
+					}
+					case INTERIOR_MISSIONEXT_SFGARAGE:{    // TODO Create extra interior of area that does not capture the camera & see about the camera camera capturing (Use it for broadcast? & In other world or interior place more usable?)
+						x = -2042.42;
+						y = 178.59;
+						z = 28.84;
+						interior = 1;
+						angle = 156.2153;
+						name = "San Fierro Garage Interior";
+					}
+                }
+				gotoCallback(x, y, z, world, interior, angle, name);
+			}
+			else{dialogGotoInterior(playerid);}
+		}
+		case DIALOG_GOTO_MISSIONHOUSE:{
+			if(response){
+		        new Float:x, Float:y, Float:z, world, interior, Float:angle, name[30 + 1];
+			    world = GetPlayerVirtualWorld(playerid);
+				switch(listitem){
+		            case INTERIOR_MISSIONHOUSE_DESIRE:{
+						x = 2338.32;
+						y = -1180.61;
+						z = 1027.98;
+						interior = 5;
+						angle = 99.1864;
+						name = "Burning Desire House";
+					}
+					case INTERIOR_MISSIONHOUSE_COLONEL:{
+						x = 2807.63;
+						y = -1170.15;
+						z = 1025.57;
+						interior = 8;
+						angle = 193.7117;
+						name = "Colonel Furhberger's";
+					}
+					case INTERIOR_MISSIONHOUSE_RYDER:{
+						x = 2451.77;
+						y = -1699.80;
+						z = 1013.51;
+						interior = 2;
+						angle = 314.5253;
+						name = "Ryder's House";
+					}
+					case INTERIOR_MISSIONHOUSE_SWEET:{
+						x = 2535.83;
+						y = -1674.32;
+						z = 1015.50;
+						interior = 1;
+						angle = 260.9709;
+						name = "Sweet's House";
+					}
+					case INTERIOR_MISSIONHOUSE_CRACK:{
+						x = 318.565;
+						y = 1115.210;
+						z = 1082.98;
+						interior = 5;
+						angle = 267.459;
+						name = "Crack den";
+					}
+				}
+				gotoCallback(x, y, z, world, interior, angle, name);
+			}
+			else{dialogGotoHouses(playerid);}
+		}
+		case DIALOG_GOTO_MODDING:{
+			if(response){
+		        new Float:x, Float:y, Float:z, world, interior, Float:angle, name[25 + 1];
+			    world = GetPlayerVirtualWorld(playerid);
+				switch(listitem){
+					case INTERIOR_MOD_LOCO:{
+						x = 616.7820;
+						y = -74.8151;
+						z = 997.6350;
+						interior = 2;
+						angle = 320.9263;
+						name = "Loco Low Co";
+					}
+					case INTERIOR_MOD_WHEEL:{
+						x = 615.2851;
+						y = -124.2390;
+						z = 997.6350;
+						interior = 3;
+						angle = 266.5704;
+						name = "Wheel Arch Angels";
+					}
+					case INTERIOR_MOD_TRANSFENDER:{
+						x = 617.5380;
+						y = -1.9900;
+						z = 1000.6829;
+						interior = 1;
+						angle = 15.6789;
+						name = "Transfender";
+					}
+				}
+				gotoCallback(x, y, z, world, interior, angle, name);
+			}
+			else{dialogGotoShops(playerid);}
+		}
+		case DIALOG_GOTO_POLICE:{
+			if(response){
+		        new Float:x, Float:y, Float:z, world, interior, Float:angle, name[30 + 1];
+				world = GetPlayerVirtualWorld(playerid);
+				switch(listitem){
+					case INTERIOR_PD_LV:{
+						x = 288.4723;
+						y = 170.0647;
+						z = 1007.1794;
+						interior = 3;
+						angle = 22.0477;
+						name = "Las Venturas police deparment";
+					}
+					case INTERIOR_PD_LS:{
+						x = 246.6695;
+						y = 65.8039;
+						z = 1003.6406;
+						interior = 6;
+						angle = 7.9562;
+						name = "Los Santos police deparment";
+					}
+					case INTERIOR_PD_SF:{
+						x = 246.0688;
+						y = 108.9703;
+						z = 1003.2188;
+						interior = 10;
+						angle = 0.2922;
+						name = "San Fierro police deparment";
+					}
+					case INTERIOR_PD_BARBARA:{
+						x = 322.5014;
+						y = 303.6906;
+						z = 999.1484;
+						interior = 5;
+						angle = 8.1747;
+						name = "Barbara's Love nest";
+					}
+				}
+				gotoCallback(x, y, z, world, interior, angle, name);
+			}
+			else{dialogGotoInterior(playerid);}
+		}
+		case DIALOG_GOTO_SAFEHOUSE:{
+			if(response){
+		        new Float:x, Float:y, Float:z, world, interior, Float:angle, name[25 + 1];
+			    world = GetPlayerVirtualWorld(playerid);
+				switch(listitem){
+					case INTERIOR_HOUSE_GOLDEN:{
+						x = 2251.85;
+						y = -1138.16;
+						z = 1050.63;
+						interior = 9;
+						angle = 167.3959;
+						name = "Golden Bed motel room";
+					}
+					case INTERIOR_HOUSE_HASHBURY:{
+						x = 2260.76;
+						y = -1210.45;
+						z = 1049.02;
+						interior = 10;
+						angle = 266.88;
+						name = "Hashbury house";
+					}
+					case INTERIOR_HOUSE_JOHNSON:{
+						x = 2496.65;
+						y = -1696.55;
+						z = 1014.74;
+						interior = 3;
+						angle = 179.2174;
+						name = "The Johnson house";
+					}
+					case INTERIOR_HOUSE_MADDDOGG:{
+						x = 1299.14;
+						y = -794.77;
+						z = 1084.00;
+						interior = 5;
+						angle = 231.3418;
+						name = "Madd Doggs mansion";
+					}
+                    case INTERIOR_HOUSE_RED:{
+						x = 2262.83;
+						y = -1137.71;
+						z = 1050.63;
+						interior = 10;
+						angle = 266.88;
+						name = "Red Bed motel room";
+					}
+                    case INTERIOR_HOUSE_VERDANT:{
+						x = 2365.42;
+						y = -1131.85;
+						z = 1050.88;
+						interior = 8;
+						angle = 177.3947;
+						name = "Verdant Bluffs safehouse";
+					}
+					case INTERIOR_HOUSE_UNUSED:{
+						x = 2324.33;
+						y = -1144.79;
+						z = 1050.71;
+						interior = 12;
+						angle = 269.0954;
+						name = "Unused safe house";
+					}
+				}
+				gotoCallback(x, y, z, world, interior, angle, name);
+			}
+			else{dialogGotoHouses(playerid);}
+		}
+		case DIALOG_GOTO_SHOP:{
+			if(response){
+		        new Float:x, Float:y, Float:z, world, interior, Float:angle, name[30 + 1];
+			    world = GetPlayerVirtualWorld(playerid);
+				switch(listitem){
+					case INTERIOR_SHOP_TATTOO:{
+						x = -203.0764;
+						y = -24.1658;
+						z = 1002.2734;
+						interior = 16;
+						angle = 252.8154;
+						name = "Tattoos";
+					}
+					case INTERIOR_SHOP_BURGER:{
+						x = 366.0248;
+						y = -73.3478;
+						z = 1001.5078;
+						interior = 10;
+						angle = 292.0084;
+						name = "Burger Shot";
+					}
+                    case INTERIOR_SHOP_PIZZA:{
+						x = 372.3520;
+						y = -131.6510;
+						z = 1001.4922;
+						interior = 5;
+						angle = 354.2285;
+						name = "Well Stacked Pizza";
+					}
+                    case INTERIOR_SHOP_CLUCKIN:{
+						x = 365.7158;
+						y = -9.8873;
+						z = 1001.8516;
+						interior = 9;
+						angle = 160.528;
+						name = "Cluckin' Bell";
+					}
+                    case INTERIOR_SHOP_DONUTS:{
+      					x = 376.99;
+						y = -191.21;
+						z = 1000.63;
+						interior = 17;
+						angle = 141.0245;
+						name = "Rusty Brown's donuts";
+					}
+					case INTERIOR_SHOP_RC:{
+						x = -2240.00;
+						y = 131.00;
+						z = 1035.40;
+						interior = 6;
+						angle = 269.0954;
+						name = "Zero's RC shop";
+					}
+					case INTERIOR_SHOP_PUMP:{
+						x = 681.66;
+						y = -453.32;
+						z = -25.61;
+						interior = 1;
+						angle = 166.166;
+						name = "The Welcome Pump";
+					}
+					case INTERIOR_SHOP_GYM:{
+						x = 770.8033;
+						y = -0.7033;
+						z = 1000.7267;
+						world = GetPlayerVirtualWorld(playerid);
+						interior =  5;
+						angle = 22.8599;
+						name = "Ganton Gym";
+					}
+					case INTERIOR_SHOP_BETTING:{
+						x = 830.6016;
+						y = 5.9404;
+						z = 1004.1797;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 3;
+						angle = 125.8149;
+						name = "Inside Track Betting";
+					}
+					case INTERIOR_SHOP_RECORDS:{
+						x = 1037.8276;
+						y = 0.397;
+						z = 1001.2845;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 3;
+						angle = 353.9335;
+						name = "Blastin' Fools Records";
+					}
+				}
+				gotoCallback(x, y, z, world, interior, angle, name);
+			}
+			else{dialogGotoShops(playerid);}
+		}
+		case DIALOG_GOTO_STADIA:{
+			if(response){
+		        new Float:x, Float:y, Float:z, world, interior, Float:angle, name[25 + 1];
+			    world = GetPlayerVirtualWorld(playerid);
+				switch(listitem){
+				    case INTERIOR_STADIUM_BLOODBOWL:{
+						x = -1394.20;
+						y = 987.62;
+						z = 1023.96;
+						interior = 15;
+						angle = 0.7013;
+						name = "Bloodbowl Stadium";
+					}
+					case INTERIOR_STADIUM_KICKSTART:{
+						x = -1410.72;
+						y = 1591.16;
+						z = 1052.53;
+						interior = 14;
+						angle = 159.1255;
+						name = "Kickstart Stadium";
+					}
+					case INTERIOR_STADIUM_8TRACK:{
+						x = -1395.958;
+						y = -208.197;
+						z = 1051.170;
+						interior = 7;
+						angle = 355.8576;
+						name = "8 Track Stadium";
+					}
+					case INTERIOR_STADIUM_DIRTBIKE:{
+						x = -1424.9319;
+						y = -664.5869;
+						z = 1059.8585;
+						interior = 4;
+						angle = 170.9341;
+						name = "Dirtbike Stadium";
+					}
+				}
+				gotoCallback(x, y, z, world, interior, angle, name);
+			}
+			else{dialogGotoInterior(playerid);}
+		}
+		case DIALOG_GOTO_SEXWORK:{
+			if(response){
+		        new Float:x, Float:y, Float:z, world, interior, Float:angle, name[31 + 1];
+			    world = GetPlayerVirtualWorld(playerid);
+				switch(listitem){
+				    case INTERIOR_SEXWORK_BROTHEL:{
+						x = 974.0177;
+						y = -9.5937;
+						z = 1001.1484;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 3;
+						angle = 22.6045;
+						name = "Brothel";
+					}
+                    case INTERIOR_SEXWORK_BROTHEL2:{
+						x = 961.9308;
+						y = -51.9071;
+						z = 1001.1172;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 3;
+						angle = 95.5381;
+						name = "Brothel2";
+					}
+                    case INTERIOR_SEXWORK_BIGSPREAD:{
+						x = 1212.1489;
+						y = -28.5388;
+						z = 1000.9531;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 3;
+						angle = 170.5692;
+						name = "The Big Spread Ranch";
+					}
+				}
+				gotoCallback(x, y, z, world, interior, angle, name);
+			}
+			else{dialogGotoInterior(playerid);}
+		}
+				
+		/*case DIALOG_GOTO_UNCATAGORIZED:{
+			if(response){
+		        new Float:x, Float:y, Float:z, world, interior, Float:angle, name[31 + 1];
+			    world = GetPlayerVirtualWorld(playerid);
+				switch(listitem){
+                    case INTERIOR_UNCATEGORIZED_WAREHOUSE1:{
+						x = 1290.4106;
+						y = 1.9512;
+						z = 1001.0201;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 18;
+						angle = 179.9419;
+						name =" Warehouse 1";
+					}
+                    case INTERIOR_UNCATEGORIZED_WAREHOUSE2:{
+						x = 1412.1472;
+						y = -2.2836;
+						z = 1000.9241;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 1;
+						angle = 114.661;
+						name = "Warehouse 2";
+					}
+                    case INTERIOR_UNCATEGORIZED_BDUPAPPARTMENT:{
+						x = 1527.0468;
+						y = -12.0236;
+						z = 1002.0971;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 3;
+						angle = 350.0013;
+						name = "B Dup's Apartment";
+					}
+                    case INTERIOR_UNCATEGORIZED_PALACE:{
+						x = 1523.5098;
+						y = -47.8211;
+						z = 1002.2699;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 2;
+						angle = 262.7038;
+						name = "B Dup's Crack Palace";
+					}
+                    case INTERIOR_UNCATEGORIZED_OGLOC:{
+						x = 512.9291;
+						y = -11.6929;
+						z = 1001.5653;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 3;
+						angle = 198.7669;
+						name = "OG Loc's House";
+					}
+                    case INTERIOR_UNCATEGORIZED_:{
+						x = 418.4666;
+						y = -80.4595;
+						z = 1001.8047;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 3;
+						angle = 343.2358;
+						name = "Barber Shop";
+					}
+                    case INTERIOR_UNCATEGORIZED_PLANDEPT:{
+						x = 386.5259;
+						y = 173.6381;
+						z = 1008.3828;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 3;
+						angle = 63.7399;
+						name = "Planning Department";
+					}
+                    case INTERIOR_:{
+						x = 206.4627;
+						y = -137.7076;
+						z = 1003.0938;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 3;
+						angle = 10.9347;
+						name = "Pro-Laps";
+					}
+                    case INTERIOR_SHOP_SEX:{
+						x = -100.2674;
+						y = -22.9376;
+						z = 1000.7188;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 3;
+						angle = 17.285;
+						name = "Sex Shop";
+					}
+                    case INTERIOR_SHOP_LVTATTOO:{
+						x = -201.2236;
+						y = -43.2465;
+						z = 1002.2734;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 3;
+						angle = 45.8613;
+						name = "Las Venturas Tattoo parlor";
+					}
+                    case INTERIOR_SHOP_SFTATTOO:{
+						x = -202.9381;
+						y = -6.7006;
+						z = 1002.2734;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 17;
+						angle = 204.2693;
+						name = "Lost San Fierro Tattoo parlor";
+					}
+                    case INTERIOR_UNCATEGORIZED_DINER1:{
+						x = 454.9853;
+						y = -107.2548;
+						z = 999.4376;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 5;
+						angle = 309.0195;
+						name = "Diner 1";
+					}
+                    case INTERIOR_:{
+						x = 372.5565;
+						y = -131.3607;
+						z = 1001.4922;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 5;
+						angle = 354.2285;
+						name = "Pizza Stack";
+					}
+                    case INTERIOR_:{
+						x = 378.026;
+						y = -190.5155;
+						z = 1000.6328;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 17;
+						angle = 141.0245;
+						name = "Rusty Brown's Donuts";
+					}
+                    case INTERIOR_SHOP_VICTIM:{
+						x = 225.0306;
+						y = -9.1838;
+						z = 1002.218;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 5;
+						angle = 85.5322;
+						name = "Victim";
+					}
+                    case INTERIOR_SHOP_GYM:{
+						x = 773.7318;
+						y = -74.6957;
+						z = 1000.6542;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 7;
+						angle = 5.2304;
+						name = "Below The Belt Gym (Las Venturas)";
+					}
+                    case INTERIOR_UNCATEGORIZED_COQ:{
+						x = 445.6003;
+						y = -6.9823;
+						z = 1000.7344;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 1;
+						angle = 172.2105;
+						name = "World of Coq";
+					}
+                    case INTERIOR_SHOP_URBAN:{
+						x = 204.1174;
+						y = -46.8047;
+						z = 1001.8047;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 1;
+						angle = 357.5777;
+						name = "SubUrban";
+					}
+                    case INTERIOR_GIRL_DENISE:{
+						x = 245.2307;
+						y = 304.7632;
+						z = 999.1484;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 1;
+						angle = 273.4364;
+						name = "Denise's Bedroom";
+					}
+                    case INTERIOR_GIRL_HELENA:{
+						x = 290.623;
+						y = 309.0622;
+						z = 999.1484;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 3;
+						angle = 89.9164;
+						name = "Helena's Barn";
+					}
+                    case INTERIOR_:{
+						x = -2041.2334;
+						y = 178.3969;
+						z = 28.8465;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 1;
+						angle = 156.2153;
+						name = "San Fierro Garage";
+					}
+                    case INTERIOR_UNCATEGORIZED_STIPCLUB:{
+						x = 1204.6689;
+						y = -13.5429;
+						z = 1000.9219;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 2;
+						angle = 350.0204;
+						name = "The Pig Pen (strip club 2)";
+					}
+                    case INTERIOR_:{
+						x = -741.8495;
+						y = 493.0036;
+						z = 1371.9766;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 1;
+						angle = 71.7782;
+						name = "Liberty City";
+					}
+                    case INTERIOR_:{
+						x = 366.0248;
+						y = -73.3478;
+						z = 1001.5078;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 10;
+						angle = 292.0084;
+						name = "Burger shot";
+					}
+                    case INTERIOR_GIRL_KATIE:{
+						x = 269.6405;
+						y = 305.9512;
+						z = 999.1484;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 2;
+						angle = 215.6625;
+						name = "Katie's Lovenest";
+					}
+                    case INTERIOR_SHOP_BARBER2:{
+						x = 414.2987;
+						y = -18.8044;
+						z = 1001.8047;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 2;
+						angle = 41.4265;
+						name = "Barber Shop 2 (Reece's)";
+					}
+                    case INTERIOR_:{
+						x = 1.1853;
+						y = -3.2387;
+						z = 999.4284;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 2;
+						angle = 87.5718;
+						name = "Angel Pine Trailer";
+					}
+                    case INTERIOR_SHIP_ZIP:{
+						x = 161.4048;
+						y = -94.2416;
+						z = 1001.8047;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 18;
+						angle = 0.7938;
+						name = "Zip";
+					}
+                    case INTERIOR_:{
+						x = 1267.8407;
+						y = -776.9587;
+						z = 1091.9063;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 5;
+						angle = 231.3418;
+						name = "Madd Dogg's Mansion";
+					}
+                    case INTERIOR_:{
+						x = 2536.5322;
+						y = -1294.8425;
+						z = 1044.125;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 2;
+						angle = 254.9548;
+						name = "Big Smoke's Crack Palace";
+					}
+                    case INTERIOR_:{
+						x = 2350.1597;
+						y = -1181.0658;
+						z = 1027.9766;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 5;
+						angle = 99.1864;
+						name = "Burning Desire Building";
+					}
+                    case INTERIOR_:{
+						x = -2158.6731;
+						y = 642.09;
+						z = 1052.375;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 1;
+						angle = 86.5402;
+						name = "Wu-Zi Mu's";
+					}
+                    case INTERIOR_:{
+						x = 419.8936;
+						y = 2537.1155;
+						z = 10;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 10;
+						angle = 67.6537;
+						name = "Abandoned AC tower";
+					}
+                    case INTERIOR_:{
+						x = 256.9047;
+						y = -41.6537;
+						z = 1002.0234;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 14;
+						angle = 85.8774;
+						name = "Wardrobe/Changing room";
+					}
+                    case INTERIOR_:{
+						x = 204.1658;
+						y = -165.7678;
+						z = 1000.5234;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 14;
+						angle = 181.7583;
+						name = "Didier Sachs";
+					}
+                    case INTERIOR_:{
+						x = 493.1443;
+						y = -24.2607;
+						z = 1000.6797;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 17;
+						angle = 356.9864;
+						name = "Club";
+					}
+                    case INTERIOR_:{
+						x = 1727.2853;
+						y = -1642.9451;
+						z = 20.2254;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 18;
+						angle = 172.4193;
+						name = "Atrium";
+					}
+                    case INTERIOR_:{
+						x = -202.842;
+						y = -24.0325;
+						z = 1002.2734;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 16;
+						252.8154;
+						name = "Los Santos Tattoo Parlor";
+					}
+                    case INTERIOR_:{
+						x = 2233.6919;
+						y = -1112.8107;
+						z = 1050.8828;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 5;
+						angle = 8.6483;
+						name = "Safe House group 1";
+					}
+                    case INTERIOR_:{
+						x = 1211.2484;
+						y = 1049.0234;
+						z = 359.941;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 6;
+						angle = 170.9341;
+						name = "Safe House group 2";
+					}
+                    case INTERIOR_:{
+						x = 2319.1272;
+						y = -1023.9562;
+						z = 1050.2109;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 9;
+						angle = 167.3959;
+						name = "Safe House group 3";
+					}
+                    case INTERIOR_:{
+						x = 2261.0977;
+						y = -1137.8833;
+						z = 1050.6328;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 10;
+						angle = 266.88;
+						name = "Safe House group 4";
+					}
+                    case INTERIOR_:{
+						x = -944.2402;
+						y = 1886.1536;
+						z = 5.0051;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 17;
+						angle = 179.8548;
+						name = "Sherman Dam";
+					}
+                    case INTERIOR_:{
+						x = 2217.281;
+						y = -1150.5349;
+						z = 1025.7969;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 15;
+						angle = 273.7328;
+						name = "Jefferson Motel";
+					}
+                    case INTERIOR_:{
+						x = 234.6087;
+						y = 1187.8195;
+						z = 1080.2578;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 3;
+						angle = 349.4844;
+						name = "Burglary House X1";
+					}
+                    case INTERIOR_:{
+						x = 225.5707;
+						y = 1240.0643;
+						z = 1082.1406;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 2;
+						angle = 96.2852;
+						name = "Burglary House X2";
+					}
+                    case INTERIOR_:{
+						x = 224.288;
+						y = 1289.1907;
+						z = 1082.1406;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 1;
+						angle = 359.868;
+						name = "Burglary House X3";
+					}
+                    case INTERIOR_:{
+						x = 239.2819;
+						y = 1114.1991;
+						z = 1080.9922;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 5;
+						angle = 270.2654;
+						name = "Burglary House X4";
+					}
+                    case INTERIOR_SHOP_BINCO:{
+						x = 207.5219;
+						y = -109.7448;
+						z = 1005.1328;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 15;
+						angle = 358.62;
+						name = "Binco";
+					}
+                    case INTERIOR_:{
+						x = 295.1391;
+						y = 1473.3719;
+						z = 1080.2578;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 15;
+						angle = 352.9526;
+						name = "4 Burglary houses";
+					}
+                    case INTERIOR_:{
+						x = 446.3247;
+						y = 509.9662;
+						z = 1001.4195;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 12;
+						angle = 330.5671;
+						name = "Budget Inn Motel Room";
+					}
+                    case INTERIOR_:{
+						x = 2306.3826;
+						y = -15.2365;
+						z = 26.7496;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 0;
+						angle = 274.49;
+						name = "Palamino Bank";
+					}
+                    case INTERIOR_:{
+						x = 2331.8984;
+						y = 6.7816;
+						z = 26.5032;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 0;
+						angle = 100.2357;
+						name = "Palamino Diner";
+					}
+                    case INTERIOR_:{
+						x = 663.0588;
+						y = -573.6274;
+						z = 16.3359;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 0;
+						angle = 264.9829;
+						name = "Dillimore Gas Station";
+					}
+                    case INTERIOR_:{
+						x = -227.5703;
+						y = 1401.5544;
+						z = 27.7656;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 18;
+						angle = 269.2978;
+						name = "Lil' Probe Inn";
+					}
+                    case INTERIOR_:{
+						x = -688.1496;
+						y = 942.0826;
+						z = 13.6328;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 0;
+						angle = 177.6574;
+						name = "Torreno's Ranch";
+					}
+                    case INTERIOR_:{
+						x = -1916.1268;
+						y = 714.8617;
+						z = 46.5625;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 0;
+						angle = 152.2839;
+						name = "Zombotech - lobby area";
+					}
+                    case INTERIOR_:{
+						x = 818.7714;
+						y = -1102.8689;
+						z = 25.794;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 0;
+						angle = 91.1439;
+						name = "Crypt in LS cemetery (temple)";
+					}
+                    case INTERIOR_:{
+						x = 255.2083;
+						y = -59.6753;
+						z = 1.5703;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 0;
+						angle = 1.4645;
+						name = "Blueberry Liquor Store";
+					}
+                    case INTERIOR_:{
+						x = 446.626;
+						y = 1397.738;
+						z = 1084.3047;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 2;
+						angle = 343.9647;
+						name = "Pair of Burglary Houses";
+					}
+                    case INTERIOR_:{
+						x = 227.3922;
+						y = 1114.6572;
+						z = 1080.9985;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 5;
+						angle = 267.459;
+						name = "Crack Den";
+					}
+                    case INTERIOR_:{
+						x = 227.7559;
+						y = 1114.3844;
+						z = 1080.9922;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 5;
+						angle = 266.2624;
+						name = "Burglary House X11";
+					}
+                    case INTERIOR_:{
+						x = 261.1165;
+						y = 1287.2197;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 4;
+						z = 1080.2578;
+						angle = 178.9149;
+						name = "Burglary House X12";
+					}
+                    case INTERIOR_:{
+						x = 449.0172;
+						y = -88.9894;
+						z = 999.5547;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 4;
+						angle = 89.6608;
+						name = "Jay's Diner";
+					}
+                    case INTERIOR_GIRL_MICHELLE:{
+						x = 306.1966;
+						y = 307.819;
+						z = 1003.3047;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 4;
+						angle = 203.1354;
+						name = "Michelle's Love Nest*";
+					}
+                    case INTERIOR_:{
+						x = 24.3769;
+						y = 1341.1829;
+						z = 1084.375;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 10;
+						angle = 8.3305;
+						name = "Burglary House X14";
+					}
+                    case INTERIOR_:{
+						x = 963.0586;
+						y = 2159.7563;
+						z = 1011.0303;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 1;
+						angle = 175.313;
+						name = "Sindacco Abatoir";
+					}
+                    case INTERIOR_:{
+						x = 2548.4807;
+						y = 2823.7429;
+						z = 10.8203;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 0;
+						angle = 270.6003;
+						name = "K.A.C.C. Military Fuels Depot";
+					}
+                    case INTERIOR_:{
+						x = 215.1515;
+						y = 1874.0579;
+						z = 13.1406;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 0;
+						angle = 177.553;
+						name = "Area 69";
+					}
+                    case INTERIOR_:{
+						x = 221.6766;
+						y = 1142.4962;
+						z = 1082.6094;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 4;
+						angle = 184.9618;
+						name = "Burglary House X13";
+					}
+                    case INTERIOR_:{
+						x = 2323.7063;
+						y = -1147.6509;
+						z = 1050.7101;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 12;
+						angle = 206.5352;
+						name = "Unused Safe House";
+					}
+                    case INTERIOR_GIRL_MILLIE:{
+						x = 344.9984;
+						y = 307.1824;
+						z = 999.1557;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 6;
+						angle = 193.643;
+						name = "Millie's Bedroom";
+					}
+                    case INTERIOR_SHOP_BARBER:{
+						x = 411.9707;
+						y = -51.9217;
+						z = 1001.8984;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 12;
+						angle = 173.3449;
+						name = "Barber Shop";
+					}
+                    case INTERIOR_:{
+						x = 773.8887;
+						y = -47.7698;
+						z = 1000.5859;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 6;
+						angle = 10.7161;
+						name = "Cobra Gym";
+					}
+                    case INTERIOR_:{
+						x = -1864.9434;
+						y = 55.7325;
+						z = 1055.5276;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 14;
+						angle = 85.8541;
+						name = "Los Santos Airport";
+					}
+                    case INTERIOR_:{
+						x = -262.1759;
+						y = 1456.6158;
+						z = 1084.3672;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 4;
+						angle = 82.459;
+						name = "Burglary House X15";
+					}
+                    case INTERIOR_:{
+						x = 22.861;
+						y = 1404.9165;
+						z = 1084.4297;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 5;
+						angle = 349.6158;
+						name = "Burglary House X16";
+					}
+                    case INTERIOR_:{
+						x = 140.3679;
+						y = 1367.8837;
+						z = 1083.8621;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 5;
+						angle = 349.2372;
+						name = "Burglary House X17";
+					}
+                    case INTERIOR_:{
+						x = 1494.8589;
+						y = 1306.48;
+						z = 1093.2953;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 3;
+						angle = 196.065;
+						name = "Bike School";
+					}
+                    case INTERIOR_:{
+						x = -1401.067;
+						y = 1265.3706;
+						z = 1039.8672;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 16;
+						angle = 178.6483;
+						name = "Vice Stadium";
+					}
+                    case INTERIOR_:{
+						x = 234.2826;
+						y = 1065.229;
+						z = 1084.2101;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 6;
+						angle = 4.3864;
+						name = "Burglary House X18";
+					}
+                    case INTERIOR_:{
+						x = -68.5145;
+						y = 1353.8485;
+						z = 1080.2109;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 6;
+						angle = 3.5742;
+						name = "Burglary House X19";
+					}
+                    case INTERIOR_:{
+						x = -2240.1028;
+						y = 136.973;
+						z = 1035.4141;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 6;
+						angle = 269.0954;
+						name = "Zero's RC Shop";
+					}
+                    case INTERIOR_:{
+						x = -285.2511;
+						y = 1471.197;
+						z = 1084.375;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 15;
+						angle = 85.6547;
+						name = "Burglary House X20";
+					}
+                    case INTERIOR_:{
+						x = 442.1295;
+						y = -52.4782;
+						z = 999.7167;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 6;
+						angle = 177.9394;
+						name = "Secret Valley Diner";
+					}
+                    case INTERIOR_:{
+						x = 2182.2017;
+						y = 1628.5848;
+						z = 1043.8723;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 2;
+						angle = 224.8601;
+						name = "Rosenberg's Office in Caligulas";
+					}
+                    case INTERIOR_:{
+						x = 748.4623;
+						y = 1438.2378;
+						z = 1102.9531;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 6;
+						angle = 0.6069;
+						name = "Fanny Batter's Whore House";
+					}
+                    case INTERIOR_:{
+						x = 2807.3604;
+						y = -1171.7048;
+						z = 1025.5703;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 8;
+						angle = 193.7117;
+						name = "Colonel Furhberger's";
+					}
+                    case INTERIOR_:{
+						x = 366.0002;
+						y = -9.4338;
+						z = 1001.8516;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 9;
+						angle = 160.528;
+						name = "Cluckin' Bell";
+					}
+                    case INTERIOR_:{
+						x = 2216.1282;
+						y = -1076.3052;
+						z = 1050.4844;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 1;
+						angle = 86.428;
+						name = "The Camel's Toe Safehouse";
+					}
+                    case INTERIOR_:{
+						x = 2268.5156;
+						y = 1647.7682;
+						z = 1084.2344;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 1;
+						angle = 99.7331;
+						name = "Caligula's Roof";
+					}
+                    case INTERIOR_:{
+						x = 2236.6997;
+						y = -1078.9478;
+						z = 1049.0234;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 2;
+						angle = 2.5706;
+						name = "Old Venturas Strip Casino";
+					}
+                    case INTERIOR_:{
+						x = -2031.1196;
+						y = -115.8287;
+						z = 1035.1719;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 3;
+						angle = 190.1877;
+						name = "Driving School";
+					}
+                    case INTERIOR_:{
+						x = 2365.1089;
+						y = -1133.0795;
+						z = 1050.875;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 8;
+						angle = 177.3947;
+						name = "Verdant Bluffs Safehouse";
+					}
+                    case INTERIOR_:{
+						x = 1168.512;
+						y = 1360.1145;
+						z = 10.9293;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 0;
+						angle = 196.5933;
+						name = "Bike School";
+					}
+                    case INTERIOR_:{
+						x = 1893.0731;
+						y = 1017.8958;
+						z = 31.8828;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 10;
+						angle = 86.1044;
+						name = "Four Dragons' Janitor's Office";
+					}
+                    case INTERIOR_:{
+						x = 501.9578;
+						y = -70.5648;
+						z = 998.7578;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 11;
+						angle = 171.5706;
+						name = "Bar";
+					}
+                    case INTERIOR_:{
+						x = -42.5267;
+						y = 1408.23;
+						z = 1084.4297;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 8;
+						angle = 172.068;
+						name = "Burglary House X21";
+					}
+                    case INTERIOR_:{
+						x = 2283.3118;
+						y = 1139.307;
+						z = 1050.8984;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 11;
+						angle = 19.7032;
+						name = "Willowfield Safehouse";
+					}
+                    case INTERIOR_:{
+						x = 84.9244;
+						y = 1324.2983;
+						z = 1083.8594;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 9;
+						angle = 159.5582;
+						name = "Burglary House X22";
+					}
+                    case INTERIOR_:{
+						x = 260.7421;
+						y = 1238.2261;
+						z = 1084.2578;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 9;
+						angle = 84.3084;
+						name = "Burglary House X23";
+					}
+                    case INTERIOR_:{
+						x = -1658.1656;
+						y = 1215.0002;
+						z = 7.25;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 0;
+						angle = 103.9074;
+						name = "Otto's Autos";
+					}
+                    case INTERIOR_:{
+						x = -1961.6281;
+						y = 295.2378;
+						z = 35.4688;
+						world = GetPlayerVirtualWorld(playerid);
+						interior = 0;
+						angle = 264.4891;
+						name = "Wang Cars";
+					}
+                }
+				gotoCallback(x, y, z, world, interior, angle, name);
+			}
+			else{dialogGotoUncatagorized(playerid);}
+		}*/
+
+		case DIALOG_CREATE_PICKUP:{
+			if(response){
+                switch(listitem){
+                    case 0: ShowPlayerDialog(playerid, DIALOG_CREATE_FACTION_PICKUP, DIALOG_STYLE_LIST, "Faction types", "Police\nMedic\nFire fighter\nFederal Bureau of Investigation\nDepeartment of motorvehicles\nBroadcasting", "Select", "Cancel");				}
+			}
+		}
+		case DIALOG_CREATE_FACTION_PICKUP:{
+			if(response){
+			    printf("Listitem: % i", listitem);
+			    new Float:x, Float:y, Float:z;
+				GetPlayerPos(playerid, x, y, z);
+				new world = GetPlayerVirtualWorld(playerid);
+				new interior = GetPlayerInterior(playerid);
+				
+				new pickupid = createDynamicPickup(1247, x, y, z, world, interior, listitem);
+
+				// Create pickup record
+				new pickup_query[127 + MAX_SQL_FLOAT + MAX_SQL_FLOAT + MAX_SQL_FLOAT + MAX_SQL_INTEGER + MAX_SQL_INTEGER + MAX_SQL_INTEGER + MAX_SQL_INTEGER + 1];
+				format(pickup_query, sizeof(pickup_query), "INSERT INTO pickup(object_id, pos_x, pos_y, pos_z, world_id, interior_id, type_id, pickup_id) VALUES (1247, '%f', '%f', '%f', %i, %i, %i, %i)", x, y, z, world, interior, listitem, pickupid);
+				sql_query(sqlHandle, pickup_query);
+
+				// Get pickup record ID
+				new id_query[44 + 1];
+				format(id_query, sizeof(id_query), "SELECT id FROM pickup WHERE pickup_id = %i", pickupid);
+				new Result:id_result = sql_query(sqlHandle, id_query);
+				new pickup_id = sql_get_field_assoc_int(id_result, "id");
+						
+				new admin_message[21 + 4 + MAX_PLAYER_NAME + MAX_SQL_INTEGER + 1];
+				
+				// Inform admins
+				listitem++;  // To account for FACTION_NONE
+				printf("Listitem: % i", listitem);
+                switch(listitem){
+                    case FACTION_POLICE: format(admin_message, sizeof(admin_message), "* [%i] %s created police faction pickup: %i", playerid, getPlayerName(playerid), pickup_id);
+					case FACTION_MEDIC: format(admin_message, sizeof(admin_message), "* [%i] %s created medic faction pickup: %i", playerid, getPlayerName(playerid), pickup_id);
+					case FACTION_FIRE: format(admin_message, sizeof(admin_message), "* [%i] %s created firefighter faction pickup: %i", playerid, getPlayerName(playerid), pickup_id);
+					case FACTION_SHERIFF: format(admin_message, sizeof(admin_message), "* [%i] %s created shariff faction pickup: %i", playerid, getPlayerName(playerid), pickup_id);
+					case FACTION_FBI: format(admin_message, sizeof(admin_message), "* [%i] %s created FBI faction pickup: %i", playerid, getPlayerName(playerid), pickup_id);
+    				case FACTION_DMV: format(admin_message, sizeof(admin_message), "* [%i] %s created DMV faction pickup: %i", playerid, getPlayerName(playerid), pickup_id);
+    				case FACTION_NEWS: format(admin_message, sizeof(admin_message), "* [%i] %s created broadcasting faction pickup: %i", playerid, getPlayerName(playerid), pickup_id);
+					default: return 0;
+				}
+				sendToAdmins(COLOR_NOTICE, admin_message);
+			}
+		}
+		
+		case DIALOG_DUTY_PD:{
+		    if(response){
+		        // TODO: Check if has passport
+		        switch(GetGVarInt("job", playerid)){
+				    case JOB_NONE:{ // Is citizen
+
+				        // TODO: Check for crimes, warrents, etc
+
+				        ShowPlayerDialog(playerid, DIALOG_POLICE_SKIN, DIALOG_STYLE_TABLIST, "Police skins", "Police Officer\tMale\tLS\nPolice Officer\tMale\tSF\nMotorbike Cop\tMale\tLS\nPolice Officer (Without gun holster)\tMale\tLS\nPolice Officer (Without gun holster)\tMale\tSF\nPolice Officer\tFemale\tLS\nPolice Officer\tFemale\tSF", "Duty", "Cancel");
+					}
+				    case JOB_POLICE:{   // Is on duty
+				        setPlayerJob(playerid, JOB_NONE);
+					}
+				    default:{SendClientMessage(playerid, COLOR_ERROR, "SERVER: You can not use this pickup as long as you are on another job.");}
+				}
+			}
+		}
+		case DIALOG_POLICE_SKIN:{
+		    if(response){
+		        new skin;
+		        switch(listitem){
+					case 0:{skin = 280;}
+					case 1:{skin = 281;}
+					case 2:{skin = 284;}
+					case 3:{skin = 300;}
+					case 4:{skin = 301;}
+					case 5:{skin = 306;}
+					case 6:{skin = 307;}
+				}
+				
+				setPlayerJob(playerid, JOB_POLICE, skin, COLOR_POLICE);
+			}
+		}
+		case DIALOG_DUTY_MD:{
+		    if(response){
+		        // TODO: Check if has passport
+		        switch(GetGVarInt("job", playerid)){
+				    case JOB_NONE:{
+
+				        // TODO: Check for crimes, warrents, etc
+
+				        ShowPlayerDialog(playerid, DIALOG_MEDIC_SKIN, DIALOG_STYLE_TABLIST, "Paramedic skins", "Los Santos white\tMale\nLas Venturas blue\tMale\nSan Fierro green\tMale\nSan Fierro green\tFemale", "Duty", "Cancel");
+					}
+				    case JOB_MEDIC:{
+						setPlayerJob(playerid, JOB_NONE);
+					}
+				    default:{SendClientMessage(playerid, COLOR_ERROR, "SERVER: You can not use this pickup as long as you are on another job.");}
+				}
+			}
+		}
+		case DIALOG_MEDIC_SKIN:{
+		    if(response){
+		        new skin;
+		        switch(listitem){
+					case 0:{skin = 274;}
+					case 1:{skin = 275;}
+					case 2:{skin = 276;}
+					case 3:{skin = 308;}    // TODO find out why this is broken.
+				}
+                setPlayerJob(playerid, JOB_MEDIC, skin, COLOR_MEDIC);
+			}
+		}
+		case DIALOG_DUTY_FD:{
+		    if(response){
+		        // TODO: Check if has passport
+		        switch(GetGVarInt("job", playerid)){
+				    case JOB_NONE:{
+
+				        // TODO: Check for crimes, warrents, etc
+
+				        ShowPlayerDialog(playerid, DIALOG_FIRE_SKIN, DIALOG_STYLE_TABLIST, "Firefighter skins", "Los Santos green\tMale\nLas Venturas yellow\tMale\nSan Fierro black\tMale", "Duty", "Cancel");
+					}
+				    case JOB_FIRE:{
+						setPlayerJob(playerid, JOB_NONE);
+					}
+				    default:{SendClientMessage(playerid, COLOR_ERROR, "SERVER: You can not use this pickup as long as you are on another job.");}
+				}
+			}
+		}
+		case DIALOG_FIRE_SKIN:{
+		    if(response){
+		        new skin;
+		        switch(listitem){
+					case 0:{skin = 277;}
+					case 1:{skin = 278;}
+					case 2:{skin = 279;}
+				}
+				setPlayerJob(playerid, JOB_FIRE, skin, COLOR_FIRE);
+			}
+		}
+		case DIALOG_DUTY_SD:{
+		    if(response){
+		        // TODO: Check if has passport
+		        switch(GetGVarInt("job", playerid)){
+				    case JOB_NONE:{
+
+				        // TODO: Check for crimes, warrents, etc
+
+				        ShowPlayerDialog(playerid, DIALOG_SHERIFF_SKIN, DIALOG_STYLE_TABLIST, "Sheriff skins", "Officer\tMale\tLV\nCounty sheriff\tMale\tCountryside\nDesert sheriff\tMale\tDesert\nOfficer (Without gun holster)\tMale\nOfficer\tFemale\nCounty sheriff (Without hat)\tMale\nDesert sheriff\tMale", "Duty", "Cancel");
+					}
+				    case JOB_SHERIFF:{
+						setPlayerJob(playerid, JOB_NONE);
+					}
+				    default:{SendClientMessage(playerid, COLOR_ERROR, "SERVER: You can not use this pickup as long as you are on another job.");}
+				}
+			}
+		}
+		case DIALOG_SHERIFF_SKIN:{
+		    if(response){
+		        new skin;
+		        switch(listitem){
+					case 0:{skin = 282;}
+					case 1:{skin = 283;}
+					case 2:{skin = 288;}
+					case 3:{skin = 302;}
+					case 4:{skin = 309;}
+					case 5:{skin = 310;}
+					case 6:{skin = 311;}
+				}
+				setPlayerJob(playerid, JOB_SHERIFF, skin, COLOR_SHERIFF);
+			}
+		}
+		case DIALOG_DUTY_FBI:{
+		    if(response){
+		        // TODO: Check if has passport
+		        switch(GetGVarInt("job", playerid)){
+				    case JOB_NONE:{
+
+				        // TODO: Check for crimes, warrents, etc
+
+				        ShowPlayerDialog(playerid, DIALOG_FBI_SKIN, DIALOG_STYLE_TABLIST, "Agent skins", "Caucasian MIB agent\tMale\nAfro-American MIB agent\tMale\nSWAT special forces\tMale\nFBI agent\tMale\nAfro-American bouncer\tMale\nCaucasian Bouncer\tMale\nOriental businesswoman\tFemale\nCaucasian businesswoman\tFemale", "Duty", "Cancel");
+					}
+				    case JOB_FBI:{
+						setPlayerJob(playerid, JOB_NONE);
+					}
+				    default:{SendClientMessage(playerid, COLOR_ERROR, "SERVER: You can not use this pickup as long as you are on another job.");}
+				}
+			}
+		}
+		case DIALOG_FBI_SKIN:{
+		    if(response){
+		        new skin;
+		        switch(listitem){
+					case 0:{skin = 165;}
+					case 1:{skin = 166;}
+					case 2:{skin = 258;}
+					case 3:{skin = 286;}
+					case 4:{skin = 163;}
+					case 5:{skin = 164;}
+					case 7:{skin = 141;}
+					case 8:{skin = 150;}
+				}
+				setPlayerJob(playerid, JOB_FBI, skin, COLOR_FBI);
+			}
+		}
+		case DIALOG_DUTY_DMV:{
+		    if(response){
+		        // TODO: Check if has passport
+		        switch(GetGVarInt("job", playerid)){
+				    case JOB_NONE:{
+
+				        // TODO: Check for crimes, warrents, etc
+
+				        ShowPlayerDialog(playerid, DIALOG_DMV_SKIN, DIALOG_STYLE_TABLIST, "DMV skins", "Airport ground worker\tMale\nSecurity guard\tMale", "Duty", "Cancel");
+					}
+				    case JOB_DMV:{
+						setPlayerJob(playerid, JOB_NONE);
+					}
+				    default:{SendClientMessage(playerid, COLOR_ERROR, "SERVER: You can not use this pickup as long as you are on another job.");}
+				}
+			}
+		}
+		case DIALOG_DMV_SKIN:{
+		    if(response){
+		        new skin;
+		        switch(listitem){
+					case 0:{skin = 16;}
+					case 1:{skin = 71;}
+				}
+				setPlayerJob(playerid, JOB_DMV, skin, COLOR_DMV);
+			}
+		}
+		case DIALOG_DUTY_NEWS:{
+		    if(response){
+		        // TODO: Check if has passport
+		        switch(GetGVarInt("job", playerid)){
+				    case JOB_NONE:{
+
+				        // TODO: Check for crimes, warrents, etc
+
+				        ShowPlayerDialog(playerid, DIALOG_DMV_SKIN, DIALOG_STYLE_TABLIST, "Network skins", "Hispanic businesswoman\nCaucasian Businesswoman\nBusinessman\nRich woman", "Duty", "Cancel");
+					}
+				    case JOB_NEWS:{
+						setPlayerJob(playerid, JOB_NONE);
+					}
+				    default:{SendClientMessage(playerid, COLOR_ERROR, "SERVER: You can not use this pickup as long as you are on another job.");}
+				}
+			}
+		}
+		case DIALOG_NEWS_SKIN:{
+			if(response){
+		        new skin;
+		        switch(listitem){
+					case 0:{skin = 148;}
+					case 1:{skin = 150;}
+					case 2:{skin = 187;}
+					case 3:{skin = 219;}
+				}
+				setPlayerJob(playerid, JOB_NEWS, skin, COLOR_NEWS);
+			}
+		}
+	}
+	
+	return 0; // MUST return 0 here, just like OnPlayerCommandText.
+}
+
+
+public OnPlayerClickPlayer(playerid, clickedplayerid, source)
+{
+	return 1;
+}
+public OnEnterExitModShop(playerid, enterexit, interiorid)
+{
+	return 1;
+}
+
+public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
+{
+	return 1;
+}
+
+public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
+{
+	return 1;
+}
+
+
+// discord-connector events
+public DCC_OnMessageCreate(DCC_Message:message){
+
+	// Originating Discord channel
+	new DCC_Channel:channel;
+	DCC_GetMessageChannel(message, channel);
+
+	// Originating Discord user
+	new DCC_User:author;
+	DCC_GetMessageAuthor(message, author);
+
+	// Message content
+	new str[128 + 1];   // Orignal was 256
+	new command[32 + 1], params[128 + 1];
+	DCC_GetMessageContent(message, str);
+	sscanf(str, "s[32]s[128]", command, params);    // This string is to small some times, and throws an error BROKEN TODO
+
+	// Ignore bots
+	new bool:isBot;
+	DCC_IsUserBot(author, isBot);
+	if(isBot){
+
+		return 1;
+	}
+	if(!strcmp(command, "!players")){
+        new players_string[14 + (2 * MAX_PLAYERS) + (MAX_PLAYER_NAME * MAX_PLAYERS) + 1] = "Online players:";
+        for(new playerid, a = GetMaxPlayers(); playerid < a; playerid++){
+			if(IsPlayerConnected(playerid)){
+			    format(players_string, sizeof(players_string), "%s %s,", players_string, getPlayerName(playerid));
+			}
+		}
+		strdel(players_string, strlen(players_string), strlen(players_string));  // Delete trailing comma
+        DiscordSendChannelMessage(channel, players_string);
+        print("Should be sending players");
+	}
+	else if(!strcmp(command, "!ip")){
+		DiscordSendChannelMessage(channel, "ecrp.h0v1n8.nl:6666");
+	}
+	else{
+	    if(channel == echoChannel){
+			sendToChat(-1, CHAT_GLOBAL, str, 0, author);
+		}
+	}
+
+	/*// Beyond this point, don't respond to commands on foreign guilds.
+	if(guild != homeGuild){
+
+		return 1;
+	}*/
+
+	// Beyond this point, only respond to privilaged channels.
+	if(channel != adminEchoChannel && channel != adminChannel && channel != managementChannel){
+
+		return 1;
+	}
+
+
+	//  Test command.
+	if(!strcmp(command, "!test", true)){
+		DiscordSendChannelMessage(channel, "Works.");
+		print("Some said !test in the echo channel.");
+	}
+
+	return 1;
+}
+
+
+// Entrypoint
+main(){
+	// Credits
+	print("\n*----------------------------------*");
+	print(" RPFW by tBKwtWS.");
+	new message[21 + 20 + 1];
+	format(message, sizeof(message), " Role-play framework v%s", MODE_NAME);
+	print(message);
+	//printf("System load average: %f",loadavg());	// Linux only   TODO: test
+	print("*----------------------------------*\n");
+}

Неке датотеке нису приказане због велике количине промена