Teleports not working!
#1

Hey guys, i have this GM(starting) to my server but teleport cmds don't work... see:

Whole GameMode:

pawn Код:
#include <a_samp>

#include <dcmd>

#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_SYSTEM 0xFFA500AA
#define COLOR_SUSPECT 0xFF8000AA
#define COLOR_NEWS 0x0259EAAA
#define COLOR_DARKRED 0x8B0000AA
#define COLOR_RED 0xFF0000AA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_PINK 0xDC00DDAA
#define COLOR_BLUE 0x0259EAAA
#define COLOR_GREEN 0x00A800AA
#define COLOR_ORANGE 0xFF8000AA
#define COLOR_CYAN 0xFF8080AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_DARKBLUE 0x0000A0AA
#define COLOR_BLACK 0x000000AA
#define COLOR_DARKGOLD 0x808000AA
#define COLOR_PURPLE 0xFF00FFAA
#define COLOR_BROWN 0x804000AA
main()
{
}

public OnGameModeInit()
{
    SetGameModeText("RFreeDoom");
    CreateObject(2898,1440.65014648,-1036.38879395,22.67819214,0.00000000,0.00000000,0.00000000); //object(funturf_law) (1)
    CreateObject(2898,1440.66796875,-1031.07531738,22.67819214,0.00000000,0.00000000,0.00000000); //object(funturf_law) (2)
    CreateObject(2898,1357.66809082,-1254.94763184,12.40475464,0.00000000,0.00000000,0.00000000); //object(funturf_law) (3)
    CreateObject(2898,1343.07897949,-929.07324219,34.24380875,0.00000000,4.00000000,345.00000000); //object(funturf_law) (4)
    CreateObject(2898,1093.66564941,-952.14678955,41.63053894,0.00000000,0.00000000,0.00000000); //object(funturf_law) (5)
    CreateObject(2898,777.49200439,-1050.38342285,23.42416763,0.00000000,0.00000000,0.00000000); //object(funturf_law) (6)
    CreateObject(2898,595.45819092,-1222.35058594,16.91105843,0.00000000,0.00000000,20.00000000); //object(funturf_law) (7)
    CreateObject(2898,483.34301758,-1293.67211914,14.46936607,0.00000000,0.00000000,36.00000000); //object(funturf_law) (8)
    CreateObject(2898,341.99822998,-1385.13842773,13.24461555,0.00000000,0.00000000,24.00000000); //object(funturf_law) (9)
    CreateObject(2898,179.55345154,-1602.02856445,13.22305965,0.00000000,0.00000000,308.00000000); //object(funturf_law) (10)
    CreateObject(3915,2491.73022461,-1666.67883301,15.77994728,0.00000000,0.00000000,0.00000000); //object(snowover03) (1)
    CreateObject(972,159.56848145,-1779.26379395,3.25289345,0.00000000,0.00000000,0.00000000); //object(tunnelentrance) (1)
    CreateObject(972,159.26565552,-1802.41198730,2.73163700,0.00000000,0.00000000,0.00000000); //object(tunnelentrance) (2)
    CreateObject(972,159.27120972,-1817.93713379,2.74680138,0.00000000,0.00000000,0.00000000); //object(tunnelentrance) (3)
    CreateObject(972,159.13052368,-1835.66137695,2.76411533,0.00000000,0.00000000,0.00000000); //object(tunnelentrance) (4)
    CreateObject(972,159.31645203,-1852.60644531,2.77343750,0.00000000,0.00000000,0.00000000); //object(tunnelentrance) (5)
    CreateObject(972,159.26876831,-1870.61608887,2.77343750,0.00000000,0.00000000,0.00000000); //object(tunnelentrance) (6)
    CreateObject(972,176.39356995,-1867.66027832,2.03627586,0.00000000,0.00000000,90.00000000); //object(tunnelentrance) (7)
    CreateObject(972,194.27047729,-1866.79870605,1.99329472,0.00000000,0.00000000,94.00000000); //object(tunnelentrance) (8)
    CreateObject(972,211.93524170,-1865.73437500,1.94472885,0.00000000,0.00000000,94.00000000); //object(tunnelentrance) (9)
    CreateObject(972,229.67585754,-1864.71801758,1.89329338,0.00000000,0.00000000,94.00000000); //object(tunnelentrance) (10)
    CreateObject(972,243.40328979,-1863.61389160,1.88372803,0.00000000,0.00000000,94.00000000); //object(tunnelentrance) (11)
    CreateObject(972,259.63696289,-1862.53710938,1.89356041,0.00000000,0.00000000,94.00000000); //object(tunnelentrance) (12)
    CreateObject(972,276.63043213,-1861.47631836,1.94306946,0.00000000,0.00000000,94.00000000); //object(tunnelentrance) (13)
    CreateObject(972,293.49066162,-1860.24975586,2.00533295,0.00000000,0.00000000,94.00000000); //object(tunnelentrance) (14)
    CreateObject(972,299.47732544,-1846.63232422,2.40825272,0.00000000,0.00000000,0.00000000); //object(tunnelentrance) (15)
    CreateObject(972,299.24645996,-1833.92724609,2.78361511,0.00000000,0.00000000,0.00000000); //object(tunnelentrance) (16)
    CreateObject(972,299.07330322,-1817.09973145,3.27109146,0.00000000,0.00000000,0.00000000); //object(tunnelentrance) (17)
    CreateObject(972,298.85961914,-1802.57958984,3.44260406,0.00000000,0.00000000,0.00000000); //object(tunnelentrance) (18)
    CreateObject(972,298.77072144,-1789.92871094,3.47040749,0.00000000,0.00000000,0.00000000); //object(tunnelentrance) (19)
    CreateObject(972,292.14395142,-1779.48461914,3.37387657,0.00000000,0.00000000,94.00000000); //object(tunnelentrance) (20)
    CreateObject(972,268.35494995,-1780.91528320,3.26043129,0.00000000,0.00000000,94.00000000); //object(tunnelentrance) (21)
    CreateObject(972,249.46452332,-1782.07043457,3.21254730,0.00000000,0.00000000,94.00000000); //object(tunnelentrance) (22)
    CreateObject(972,225.82264709,-1783.03393555,3.25384331,0.00000000,0.00000000,90.00000000); //object(tunnelentrance) (23)
    CreateObject(972,204.59481812,-1782.23498535,2.87313271,0.00000000,0.00000000,87.00000000); //object(tunnelentrance) (24)
    CreateObject(972,188.73603821,-1780.56848145,2.77518940,0.00000000,0.00000000,85.00000000); //object(tunnelentrance) (25)
    CreateObject(972,175.30044556,-1778.88867188,3.04587078,0.00000000,0.00000000,88.00000000); //object(tunnelentrance) (26)
    CreateObject(3564,176.85183716,-1780.55505371,4.64306450,0.00000000,0.00000000,266.00000000); //object(lastran1_la01) (1)
    CreateObject(3564,179.25988770,-1786.06225586,4.58946609,0.00000000,0.00000000,0.00000000); //object(lastran1_la01) (2)
    CreateObject(3564,178.96438599,-1793.74072266,4.58788300,0.00000000,0.00000000,0.00000000); //object(lastran1_la01) (3)
    CreateObject(3564,170.44720459,-1793.84973145,4.75832748,0.00000000,0.00000000,0.00000000); //object(lastran1_la01) (4)
    CreateObject(3564,166.40971375,-1793.78796387,4.83923721,0.00000000,0.00000000,0.00000000); //object(lastran1_la01) (5)
    CreateObject(3564,178.06732178,-1793.98107910,7.86112595,0.00000000,0.00000000,0.00000000); //object(lastran1_la01) (6)
    CreateObject(3564,169.73263550,-1793.88781738,8.11248016,0.00000000,0.00000000,0.00000000); //object(lastran1_la01) (7)
    CreateObject(3564,178.98849487,-1786.03503418,7.86270905,0.00000000,0.00000000,0.00000000); //object(lastran1_la01) (8)
    CreateObject(3043,189.39501953,-1782.86987305,4.21166515,0.00000000,0.00000000,0.00000000); //object(kmb_container_open) (1)
    CreateObject(3043,189.64006042,-1790.19250488,4.34631157,0.00000000,0.00000000,0.00000000); //object(kmb_container_open) (2)
    CreateObject(3043,189.68374634,-1797.49108887,4.53927612,0.00000000,0.00000000,0.00000000); //object(kmb_container_open) (3)
    CreateObject(3043,189.51077271,-1804.45104980,4.72119045,0.00000000,0.00000000,0.00000000); //object(kmb_container_open) (4)
    CreateObject(3043,189.66535950,-1790.31701660,7.25164604,0.00000000,0.00000000,0.00000000); //object(kmb_container_open) (5)
    CreateObject(3043,189.54562378,-1797.25683594,7.44461060,0.00000000,0.00000000,0.00000000); //object(kmb_container_open) (6)
    CreateObject(3043,189.79693604,-1783.12683105,7.11699963,0.00000000,0.00000000,0.00000000); //object(kmb_container_open) (7)
    CreateObject(3043,189.70594788,-1790.15881348,10.15698051,0.00000000,0.00000000,0.00000000); //object(kmb_container_open) (8)
    CreateObject(3043,189.44973755,-1796.99755859,10.34994507,0.00000000,0.00000000,0.00000000); //object(kmb_container_open) (9)
    CreateObject(3043,189.38075256,-1797.02355957,13.25527954,0.00000000,0.00000000,0.00000000); //object(kmb_container_open) (10)
    CreateObject(3043,185.59692383,-1779.49255371,4.29101849,0.00000000,0.00000000,90.00000000); //object(kmb_container_open) (11)
    CreateObject(3043,186.54968262,-1811.57800293,4.88026905,0.00000000,0.00000000,0.00000000); //object(kmb_container_open) (12)
    CreateObject(3043,186.47076416,-1811.71740723,7.78560352,0.00000000,0.00000000,0.00000000); //object(kmb_container_open) (13)
    CreateObject(3043,180.02471924,-1798.21325684,4.46395397,0.00000000,0.00000000,0.00000000); //object(kmb_container_open) (14)
    CreateObject(3043,180.10379028,-1798.52343750,7.36928844,0.00000000,0.00000000,0.00000000); //object(kmb_container_open) (15)
    CreateObject(3043,180.33137512,-1798.84655762,10.27462292,0.00000000,0.00000000,0.00000000); //object(kmb_container_open) (16)
    CreateObject(2934,179.68058777,-1805.45874023,4.65172815,0.00000000,0.00000000,0.00000000); //object(kmb_container_red) (1)
    CreateObject(2934,179.65766907,-1812.00671387,4.82424021,0.00000000,0.00000000,0.00000000); //object(kmb_container_red) (2)
    CreateObject(2934,179.41108704,-1805.48754883,7.55706310,0.00000000,0.00000000,0.00000000); //object(kmb_container_red) (3)
    CreateObject(2934,176.77938843,-1812.80822754,4.81726265,0.00000000,0.00000000,0.00000000); //object(kmb_container_red) (4)
    CreateObject(2934,176.97270203,-1819.48767090,4.69616222,0.00000000,0.00000000,0.00000000); //object(kmb_container_red) (5)
    CreateObject(2934,179.54139709,-1812.55688477,7.72957516,0.00000000,0.00000000,0.00000000); //object(kmb_container_red) (6)
    CreateObject(2934,186.68664551,-1818.51940918,4.75991249,0.00000000,0.00000000,0.00000000); //object(kmb_container_red) (7)
    CreateObject(2934,189.76654053,-1811.19494629,4.90159416,0.00000000,0.00000000,0.00000000); //object(kmb_container_red) (8)
    CreateObject(2934,186.63139343,-1825.39074707,4.60685921,0.00000000,0.00000000,0.00000000); //object(kmb_container_red) (9)
    CreateObject(2934,186.65257263,-1832.19323730,4.41070509,0.00000000,0.00000000,0.00000000); //object(kmb_container_red) (10)
    CreateObject(2934,176.84722900,-1825.66235352,4.57645893,0.00000000,0.00000000,0.00000000); //object(kmb_container_red) (11)
    CreateObject(2934,186.60791016,-1826.27392578,7.51219368,0.00000000,0.00000000,0.00000000); //object(kmb_container_red) (12)
    CreateObject(2934,186.86346436,-1833.53039551,7.31604004,0.00000000,0.00000000,0.00000000); //object(kmb_container_red) (13)
    CreateObject(2934,176.57188416,-1826.90258789,7.48179340,0.00000000,0.00000000,0.00000000); //object(kmb_container_red) (14)
    CreateObject(2669,190.19891357,-1817.56665039,4.68294239,0.00000000,0.00000000,0.00000000); //object(cj_chris_crate) (1)
    CreateObject(3569,186.91612244,-1845.85363770,5.17568207,0.00000000,0.00000000,0.00000000); //object(lasntrk3) (1)
    CreateObject(3569,177.24220276,-1855.41662598,4.96355295,0.00000000,0.00000000,0.00000000); //object(lasntrk3) (2)
    CreateObject(3569,169.87075806,-1836.18078613,5.50286913,0.00000000,0.00000000,0.00000000); //object(lasntrk3) (3)
    CreateObject(3569,203.16778564,-1852.52526855,4.93430948,0.00000000,0.00000000,0.00000000); //object(lasntrk3) (4)
    CreateObject(3569,213.24496460,-1837.75842285,5.28948498,0.00000000,0.00000000,0.00000000); //object(lasntrk3) (5)
    CreateObject(3569,201.42663574,-1825.25988770,5.71607065,0.00000000,0.00000000,0.00000000); //object(lasntrk3) (6)
    CreateObject(3569,221.08987427,-1853.93652344,4.82644367,0.00000000,0.00000000,0.00000000); //object(lasntrk3) (7)
    CreateObject(3569,223.23765564,-1829.36450195,5.48465395,0.00000000,0.00000000,0.00000000); //object(lasntrk3) (8)
    CreateObject(3569,209.33496094,-1808.25439453,6.12613249,0.00000000,0.00000000,0.00000000); //object(lasntrk3) (9)
    CreateObject(3569,215.90017700,-1817.42211914,5.87480497,0.00000000,0.00000000,0.00000000); //object(lasntrk3) (10)
    CreateObject(3569,201.94071960,-1788.99194336,5.61466694,0.00000000,0.00000000,0.00000000); //object(lasntrk3) (11)
    CreateObject(3569,219.57441711,-1790.90295410,5.94816923,0.00000000,0.00000000,0.00000000); //object(lasntrk3) (12)
    CreateObject(3569,229.46072388,-1803.51477051,6.07752132,0.00000000,0.00000000,0.00000000); //object(lasntrk3) (13)
    CreateObject(3570,238.59671021,-1851.54296875,3.54872894,0.00000000,0.00000000,0.00000000); //object(lasdkrt2) (1)
    CreateObject(3570,264.01620483,-1834.89868164,3.98312521,0.00000000,0.00000000,0.00000000); //object(lasdkrt2) (2)
    CreateObject(3570,247.86311340,-1838.39038086,3.88143969,0.00000000,0.00000000,0.00000000); //object(lasdkrt2) (3)
    CreateObject(3570,255.31808472,-1847.10656738,3.63981915,0.00000000,0.00000000,0.00000000); //object(lasdkrt2) (4)
    CreateObject(3570,256.19641113,-1829.51074219,4.11905479,0.00000000,0.00000000,0.00000000); //object(lasdkrt2) (5)
    CreateObject(3574,246.37753296,-1816.30224609,5.86637926,0.00000000,0.00000000,0.00000000); //object(lasdkrtgrp2) (1)
    CreateObject(3574,236.89483643,-1832.76782227,5.41135931,0.00000000,0.00000000,0.00000000); //object(lasdkrtgrp2) (2)
    CreateObject(3574,257.78063965,-1842.32104492,5.10576820,0.00000000,0.00000000,0.00000000); //object(lasdkrtgrp2) (3)
    CreateObject(3574,242.88531494,-1790.92041016,6.00464535,0.00000000,0.00000000,0.00000000); //object(lasdkrtgrp2) (4)
    CreateObject(3574,259.75524902,-1802.34924316,6.13309145,0.00000000,0.00000000,0.00000000); //object(lasdkrtgrp2) (5)
    CreateObject(3724,283.12145996,-1824.44482422,21.36287689,0.00000000,0.00000000,88.00000000); //object(laxrf_cargotop) (1)
    CreateObject(923,261.19119263,-1797.68054199,7.01841259,0.00000000,0.00000000,0.00000000); //object(packing_carates2) (1)
    //cars
    CreateVehicle(560,1458.22680664,-689.31628418,94.55497742,0.00000000,1,1,1500); //Sultan
    CreateVehicle(560,1461.23596191,-689.23840332,94.55497742,0.00000000,1,1,1500); //Sultan
    CreateVehicle(560,1464.32092285,-689.54199219,94.55497742,0.00000000,1,1,1500); //Sultan
    CreateVehicle(560,1467.10156250,-689.59094238,94.55497742,0.00000000,1,1,1500); //Sultan
    CreateVehicle(560,1469.88305664,-689.48138428,94.55497742,0.00000000,1,1,1500); //Sultan
    CreateVehicle(560,1472.78466797,-689.56939697,94.55497742,0.00000000,1,1,1500); //Sultan
    CreateVehicle(560,1475.73168945,-689.84423828,94.55497742,0.00000000,1,1,1500); //Sultan
    CreateVehicle(560,1458.00366211,-661.24444580,94.55497742,0.00000000,-1,1,1500); //Sultan
    CreateVehicle(560,1461.49328613,-661.11932373,94.55497742,0.00000000,-1,1,1500); //Sultan
    CreateVehicle(560,1464.99438477,-660.99377441,94.55497742,0.00000000,-1,1,1500); //Sultan
    CreateVehicle(560,1468.50305176,-661.01556396,94.55497742,0.00000000,-1,1,1500); //Sultan
    CreateVehicle(560,1471.38378906,-661.18078613,94.55497742,0.00000000,-1,1,1500); //Sultan
    CreateVehicle(560,1458.44067383,-675.12835693,94.55497742,0.00000000,3,1,1500); //Sultan
    CreateVehicle(560,1461.55883789,-674.93762207,94.55497742,0.00000000,3,1,1500); //Sultan
    CreateVehicle(560,1464.69641113,-674.85156250,94.55497742,0.00000000,3,1,1500); //Sultan
    CreateVehicle(560,1467.72375488,-674.87042236,94.55497742,0.00000000,3,1,1500); //Sultan
    CreateVehicle(560,1470.88073730,-674.67810059,94.55497742,0.00000000,3,1,1500); //Sultan
    CreateVehicle(560,1473.90563965,-674.80303955,94.55497742,0.00000000,3,1,1500); //Sultan
    CreateVehicle(560,1474.59802246,-661.34759521,94.55497742,0.00000000,-1,1,1500); //Sultan

    AddStaticVehicleEx(405,2228.00073242,-1176.99145508,25.72656250,92.00000000,6,6,15); //Sentinel
    AddStaticVehicleEx(405,2227.89160156,-1173.49658203,25.72656250,90.00000000,3,1,15); //Sentinel
    AddStaticVehicleEx(546,2227.98168945,-1166.62683105,25.58635330,90.00000000,106,1,15); //Intruder
    AddStaticVehicleEx(546,2228.04223633,-1170.01623535,25.56841087,90.00000000,114,1,15); //Intruder
    AddStaticVehicleEx(471,2214.75927734,-1169.10998535,25.30156326,90.00000000,-1,-1,15); //Quad
    AddStaticVehicleEx(471,2218.79663086,-1172.00024414,25.30156326,90.00000000,3,3,15); //Quad
    AddStaticVehicleEx(471,2214.80639648,-1171.89746094,25.30156326,90.00000000,-1,-1,15); //Quad
    AddStaticVehicleEx(471,2218.61938477,-1169.10791016,25.30156326,90.00000000,3,3,15); //Quad
    AddStaticVehicleEx(436,2216.69628906,-1157.86755371,25.60455513,90.00000000,93,1,15); //Previon
    AddStaticVehicleEx(436,2216.23999023,-1166.27697754,25.60455513,90.00000000,86,1,15); //Previon
    AddStaticVehicleEx(436,2216.16894531,-1162.10058594,25.60455513,90.00000000,61,1,15); //Previon
    AddStaticVehicleEx(527,2227.65405273,-1162.72326660,25.54477692,90.00000000,62,1,15); //Cadrona
    AddStaticVehicleEx(527,2227.93872070,-1152.97583008,25.62001038,90.00000000,66,1,15); //Cadrona
    AddStaticVehicleEx(527,2227.69970703,-1156.30371094,25.59219170,90.00000000,3,1,15); //Cadrona
    AddStaticVehicleEx(462,2203.83178711,-1176.07348633,25.39678192,0.00000000,-1,-1,15); //Faggio
    AddStaticVehicleEx(462,2205.33032227,-1175.97143555,25.39678192,0.00000000,-1,-1,15); //Faggio
    AddStaticVehicleEx(462,2206.80834961,-1175.89965820,25.39678192,0.00000000,-1,-1,15); //Faggio
    AddStaticVehicleEx(462,2208.27319336,-1175.90820312,25.39678192,0.00000000,-1,-1,15); //Faggio
    AddStaticVehicleEx(462,2203.71093750,-1171.88586426,25.40244102,0.00000000,-1,-1,15); //Faggio
    AddStaticVehicleEx(462,2205.08984375,-1171.90527344,25.39678192,0.00000000,-1,-1,15); //Faggio
    AddStaticVehicleEx(462,2206.53295898,-1171.85717773,25.39678192,0.00000000,-1,-1,15); //Faggio
    AddStaticVehicleEx(462,2208.02246094,-1171.86645508,25.39678192,0.00000000,-1,-1,15); //Faggio
    AddStaticVehicleEx(581,2203.59106445,-1168.10656738,25.43626022,0.00000000,-1,-1,15); //BF-400
    AddStaticVehicleEx(581,2205.08520508,-1168.09228516,25.42632294,0.00000000,-1,-1,15); //BF-400
    AddStaticVehicleEx(581,2206.50097656,-1168.05078125,25.42632294,0.00000000,-1,-1,15); //BF-400
    AddStaticVehicleEx(581,2207.92675781,-1168.12915039,25.42632294,0.00000000,-1,-1,15); //BF-400
    AddStaticVehicleEx(581,2208.00585938,-1164.18737793,25.42632294,0.00000000,-1,-1,15); //BF-400
    AddStaticVehicleEx(581,2206.68896484,-1164.18066406,25.42632294,0.00000000,-1,-1,15); //BF-400
    AddStaticVehicleEx(581,2205.30371094,-1164.06457520,25.43184280,0.00000000,-1,-1,15); //BF-400
    AddStaticVehicleEx(581,2203.83203125,-1164.03955078,25.43905449,0.00000000,-1,-1,15); //BF-400
    AddStaticVehicleEx(507,2205.77075195,-1160.74291992,25.68304634,90.00000000,-1,-1,15); //Elegant
    AddStaticVehicleEx(507,2205.83227539,-1153.53881836,25.68978310,90.00000000,-1,-1,15); //Elegant
    AddStaticVehicleEx(507,2206.00488281,-1156.87280273,25.68568420,90.00000000,-1,-1,15); //Elegant
    AddStaticVehicleEx(507,2135.31372070,-1141.64477539,25.10777092,0.00000000,-1,-1,15); //Elegant
    AddStaticVehicleEx(507,2116.79467773,-1151.30236816,24.37163544,0.00000000,-1,-1,15); //Elegant
    AddStaticVehicleEx(551,2135.69506836,-1129.77795410,25.52692223,0.00000000,-1,-1,15); //Merit
    AddStaticVehicleEx(551,2126.41406250,-1141.88195801,24.94487572,0.00000000,-1,-1,15); //Merit
    AddStaticVehicleEx(551,2119.04907227,-1129.85498047,25.20104599,0.00000000,-1,-1,15); //Merit
    AddStaticVehicleEx(551,2121.09472656,-1151.64074707,23.91438675,0.00000000,-1,-1,15); //Merit
    AddStaticVehicleEx(580,1775.21545410,-1060.92016602,23.86846161,0.00000000,-1,-1,15); //Stafford
    AddStaticVehicleEx(445,1770.82995605,-1060.26843262,23.95093727,0.00000000,-1,-1,15); //Admiral
    AddStaticVehicleEx(445,1784.41284180,-1060.60559082,23.95093727,0.00000000,-1,-1,15); //Admiral
    AddStaticVehicleEx(575,1788.75000000,-1060.89147949,23.70093727,0.00000000,-1,-1,15); //Broadway
    AddStaticVehicleEx(546,1793.11547852,-1061.27575684,23.80278587,0.00000000,-1,-1,15); //Intruder
    AddStaticVehicleEx(546,1771.42822266,-1069.39794922,23.80278587,0.00000000,-1,-1,15); //Intruder
    AddStaticVehicleEx(540,1762.43652344,-1060.82360840,23.94043922,0.00000000,-1,-1,15); //Vincent
    AddStaticVehicleEx(540,1753.28491211,-1046.84643555,23.94043922,0.00000000,-1,-1,15); //Vincent
    AddStaticVehicleEx(540,1762.11145020,-1046.75854492,23.94043922,0.00000000,-1,-1,15); //Vincent
    AddStaticVehicleEx(540,1780.08581543,-1069.31420898,23.94043922,0.00000000,-1,-1,15); //Vincent
    AddStaticVehicleEx(540,1788.75891113,-1069.08166504,23.94043922,0.00000000,-1,-1,15); //Vincent
    AddStaticVehicleEx(540,1757.68737793,-1037.99804688,23.94043922,179.99963379,-1,-1,15); //Vincent
    AddStaticVehicleEx(540,1505.85107422,-1750.89733887,13.52637577,0.00000000,-1,-1,15); //Vincent
    AddStaticVehicleEx(540,1509.48144531,-1750.87683105,13.52637577,0.00000000,-1,-1,15); //Vincent
    AddStaticVehicleEx(540,1456.82458496,-1750.22265625,13.52637577,0.00000000,-1,-1,15); //Vincent
    AddStaticVehicleEx(540,1452.82092285,-1750.36853027,13.52637577,0.00000000,-1,-1,15); //Vincent
    AddStaticVehicleEx(596,1535.63977051,-1666.76635742,13.20281219,0.00000000,125,1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1535.59960938,-1678.36694336,13.20281219,0.00000000,125,1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1551.74267578,-1614.70031738,13.20281219,0.00000000,125,1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1555.20043945,-1614.87866211,13.20281219,0.00000000,125,1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1558.44396973,-1615.00390625,13.20281219,0.00000000,125,1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1561.68725586,-1615.06262207,13.20281219,0.00000000,125,1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1565.02331543,-1614.94067383,13.20281219,0.00000000,125,1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1568.47241211,-1614.91613770,13.20281219,0.00000000,125,1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1571.61572266,-1615.12951660,13.20281219,0.00000000,125,1,15); //Police Car (LSPD)
    AddStaticVehicleEx(596,1575.02124023,-1615.11669922,13.20281219,0.00000000,125,1,15); //Police Car (LSPD)
    AddStaticVehicleEx(427,1591.12182617,-1710.61511230,6.13862514,0.00000000,-1,1,15); //Enforcer
    AddStaticVehicleEx(427,1594.79626465,-1710.45642090,6.13862514,0.00000000,-1,1,15); //Enforcer
    AddStaticVehicleEx(427,1587.14685059,-1710.29882812,6.13862514,0.00000000,-1,1,15); //Enforcer
    AddStaticVehicleEx(427,1583.18273926,-1710.10070801,6.13862514,0.00000000,-1,1,15); //Enforcer
    AddStaticVehicleEx(427,1578.79370117,-1709.84423828,6.13862514,0.00000000,-1,1,15); //Enforcer
    AddStaticVehicleEx(427,1574.03100586,-1709.80981445,6.13862514,0.00000000,-1,1,15); //Enforcer
    AddStaticVehicleEx(427,1569.95654297,-1709.86560059,6.13862514,0.00000000,-1,1,15); //Enforcer
    AddStaticVehicleEx(427,1559.53906250,-1710.16638184,6.13862514,0.00000000,-1,1,15); //Enforcer
    AddStaticVehicleEx(411,1530.06079102,-1684.61120605,5.69062471,272.00000000,-1,-1,15); //Infernus
    AddStaticVehicleEx(411,1530.25805664,-1688.31982422,5.69062471,272.00000000,-1,-1,15); //Infernus
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public 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;
}

public OnPlayerConnect(playerid)
{
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"%s has joined the server. Welcome!",pName);
    SendClientMessageToAll(0xFFFFFFAA,string);
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    return 1;
}

public OnPlayerSpawn(playerid)
{
    SetPlayerPos(playerid,2229.348388,-1159.111653,25.806554);
    SetPlayerHealth(playerid, 100);
    GivePlayerWeapon(playerid, 24, 30);
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    SetPlayerScore(killerid, GetPlayerScore(killerid)+1); //+1 score for the killer
    GivePlayerMoney(killerid, 500); //Gives 500 bucks to the killer
    if(killerid != INVALID_PLAYER_ID) GivePlayerMoney(playerid, -500); //Remove 500 dollar from the one that died
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
    return 1;
}

public OnPlayerText(playerid, text[])
{
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/joindm", true, 7))
    {
        SetPlayerPos(playerid, 169.717285, -1783.324829, 4.153337);
        GivePlayerWeapon(playerid, 24, 5000);
        GivePlayerWeapon(playerid, 25, 5000);
        GivePlayerWeapon(playerid, 29, 5000);
        GivePlayerWeapon(playerid, 31, 5000);
        GivePlayerWeapon(playerid, 34, 5000);
        SetPlayerHealth(playerid, 100);
        SetPlayerArmour(playerid, 100);
        return 1;
    }
    if(!strcmp(cmdtext, "/leavedm", true, 7))
    {
        SetPlayerPos(playerid,2229.348388,-1159.111653,25.806554);
        SetPlayerHealth(playerid, 100);
        return 1;
    }
    return 0;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    SendClientMessage(playerid, 0x1229FAFF, " [FreeDoom]You are entering a State car! Drive careful!");
    return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
    SendClientMessage(playerid, 0x1229FAFF, "[FreeDooom]You Leaved the car, DON'T Forget to park it rigth!");
    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[])
{
    return 1;
}

public OnPlayerRequestSpawn(playerid)
{
    return 1;
}

public OnObjectMoved(objectid)
{
    return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    return 1;
}

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)
{
    return 1;
}

public OnPlayerUpdate(playerid)
{
    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[])
{
    return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    return 1;
}
Reply
#2

the /dm dont work?
if so...
try replacing the:
pawn Код:
if(!strcmp(cmdtext, "/joindm", true, 7))
into
pawn Код:
if(strcmp("/joindm", cmdtext, true, 10) == 0)
same with...
pawn Код:
if(!strcmp(cmdtext, "/leavedm", true, 7))
into
pawn Код:
if(strcmp("/leavedm", cmdtext, true, 10) == 0)
hope i helped!!!
Reply
#3

Try to use strtok:

Add this at the end of file:

pawn Код:
stock strtok(const string[], &index)
{
    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;
}
This at the begin of OnPlayerCommandText

pawn Код:
new cmd[256];
  new idx;
  cmd = strtok(cmdtext,idx);
And change the command system to

pawn Код:
//Example
  if(strcmp(cmd,"/help",true) == 0)
TIP: Also remove the unused callbacks if you don't need it
Reply
#4

It was a filterscript.... I removed the filterscript and it's working... The problem is i need this filterscript!
What i could change to don't fuck up the other cmds?
The filterscript is:

pawn Код:
// Vehicle System 1.0 Beta © 2010 Johny C. (design, ideas) & Luka P. (scripting)
// Contributors: Betamaster (Vehicle Name List), Slice (Speed Cap)

#include "a_samp.inc"

#define FUEL_UPDATE_TIME (5000)

forward Float:GetVehicleVelocityX(vehicleid); stock Float:GetVehicleVelocityX(vehicleid){new Float:velocity_X, Float:velocity_dump_Y, Float:velocity_dump_Z;GetVehicleVelocity(vehicleid, velocity_X, velocity_dump_Y, velocity_dump_Z);velocity_dump_Y = 0.00;velocity_dump_Z = 0.00;return velocity_X;}
forward Float:GetVehicleVelocityY(vehicleid); stock Float:GetVehicleVelocityY(vehicleid){new Float:velocity_dump_X, Float:velocity_Y, Float:velocity_dump_Z;GetVehicleVelocity(vehicleid, velocity_dump_X, velocity_Y, velocity_dump_Z);velocity_dump_X = 0.00;velocity_dump_Z = 0.00;return velocity_Y;}
forward Float:GetVehicleVelocityZ(vehicleid); stock Float:GetVehicleVelocityZ(vehicleid){new Float:velocity_dump_X, Float:velocity_dump_Y, Float:velocity_Z;GetVehicleVelocity(vehicleid, velocity_dump_X, velocity_dump_Y, velocity_Z);velocity_dump_X = 0.00;velocity_dump_Y = 0.00;return velocity_Z;}

#define GetVehicleSpeed_P(%0) floatmul(floatsqroot(floatadd(floatpower(GetVehicleVelocityX(GetPlayerVehicleID(%0)), 2), floatadd(floatpower(GetVehicleVelocityY(GetPlayerVehicleID(%0)), 2), floatpower(GetVehicleVelocityZ(GetPlayerVehicleID(%0)), 2)))), 200)
#define GetVehicleSpeed_V(%0) floatmul(floatsqroot(floatadd(floatpower(GetVehicleVelocityX(%0), 2), floatadd(floatpower(GetVehicleVelocityY(%0), 2), floatpower(GetVehicleVelocityZ(%0), 2)))), 200);

enum E_VEHICLE_INFO { bool:vehicle_processed, Float:vehicle_fuel, FuelUpdateTimer, Float:vehicle_health }
new Text:VehicleText[MAX_PLAYERS][8], Float:LastSpeed[MAX_PLAYERS], VehicleInfo[MAX_VEHICLES][E_VEHICLE_INFO], Float:g_fSpeedCap[MAX_PLAYERS] = {0.0, ...}, bool:textdraws_processed[MAX_PLAYERS];

forward PlayerVehicleFuelUpdate(playerid);
forward SetPlayerSpeedCap(playerid, Float:value);
forward DisablePlayerSpeedCap(playerid);

static VehicleList[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"}
};

static Float:FuelStationCoords[][3] =
{
    {2146.7766,2747.4424,10.8203},{2638.5972,1106.7181,10.8203},{1597.3271,2197.7712,10.8203},{608.5480,1699.3431,6.9922},{618.5945,1684.5210,6.9922},{-1470.1311,1863.6323,32.6328},{-737.2454,2742.9482,47.2266},{656.9113,-564.4317,16.510},{2202.2349,2474.3494,10.5258},{614.9333,1689.7418,6.6968},{-1328.8250,2677.2173,49.7665},{70.3882,1218.6783,18.5165},{2113.7390,920.1079,10.5255},{-1327.7218,2678.8723,50.0625},{-2409.5752,976.3114,45.2969},{-2026.0743,156.6390,28.7872},{-2244.5063,-2561.0781,31.9219},
    {-1603.3645,-2709.4622,48.3874},{-1609.7147,-2717.6572,48.3874},{-88.9507,-1164.7794,2.3085},{-93.0625,-1173.2089,2.3244},{1003.7032,-937.5828,42.3281},{1940.6816,-1770.7999,13.3906},{1940.0111,-1776.4730,13.3906},{1381.7468,459.1537,20.3452},{-1680.0511,408.4660,7.1797},{-1672.9927,415.2118,7.1797},{-730.05,2744.22,47.22}
};

public SetPlayerSpeedCap(playerid, Float:value) {   if(0 <= playerid < sizeof(g_fSpeedCap)) g_fSpeedCap[playerid] = value;  }
public DisablePlayerSpeedCap(playerid)          {   if(0 <= playerid < sizeof(g_fSpeedCap)) g_fSpeedCap[playerid] = 0.0;    }

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp("/refuel", cmdtext, true) == 0)
    {
        new bool:found = false;
       
        for(new i=0; i < sizeof(FuelStationCoords); i++)
        {
            if(IsPlayerInRangeOfPoint(playerid, 6.5, FuelStationCoords[i][0], FuelStationCoords[i][1], FuelStationCoords[i][2]))
            {
                found = true;
            }
        }
       
        if(!found) SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: You must be near fuel station to use this command.");
        else if(!IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: You must be in a vehicle to use this command.");
        else
        {
            new Float:cost = ((100.00 - VehicleInfo[GetPlayerVehicleID(playerid)][vehicle_fuel]) * 1);
            if(GetPlayerMoney(playerid) < cost)
            {
                new szOutput[128]; format(szOutput, sizeof(szOutput), "SERVER: You don't have enough money to refuel your vehicle ($%i).", floatround(cost));
                SendClientMessage(playerid, 0xFFFFFFFF, szOutput);
            }
            else
            {
                GivePlayerMoney(playerid, -(floatround(cost)));
                VehicleInfo[GetPlayerVehicleID(playerid)][vehicle_fuel] = 100.00;

                SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: Your vehicle has been refueled successfully.");
            }
        }
        return 1;
    }
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if((newkeys & 16) && IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER && VehicleInfo[GetPlayerVehicleID(playerid)][vehicle_fuel] < 1)
    {
        RemovePlayerFromVehicle(playerid);
        TogglePlayerControllable(playerid, true);
        DisablePlayerSpeedCap(playerid);
    }
    return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(!ispassenger)
    {
        if(VehicleInfo[vehicleid][vehicle_processed] == false)
        {
            VehicleInfo[vehicleid][vehicle_processed] = true;
            VehicleInfo[vehicleid][vehicle_fuel] = 100.00;
        }
        else
        {
            if(VehicleInfo[vehicleid][vehicle_fuel] == 0.00)
            {
                SetPlayerSpeedCap(playerid, 0.001);
                PutPlayerInVehicle(playerid, vehicleid, 0);

                TogglePlayerControllable(playerid, false);

                GameTextForPlayer(playerid, "~r~Out of fuel!", 1000, 4);
            }
        }

        VehicleInfo[vehicleid][FuelUpdateTimer] = SetTimerEx("PlayerVehicleFuelUpdate", FUEL_UPDATE_TIME, 1, "i", playerid);
    }
    return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
    DisablePlayerSpeedCap(playerid);
    return KillTimer(VehicleInfo[vehicleid][FuelUpdateTimer]);
}

public PlayerVehicleFuelUpdate(playerid)
{
    new const vehicleid = GetPlayerVehicleID(playerid);

    new Float:memory[3]={0.00,0.00,0.00 }, result_speed=0;
    GetVehicleVelocity(vehicleid,memory[0],memory[1],memory[2]);

    result_speed = floatround(floatround(floatsqroot(((memory[0]*memory[0])+(memory[1]*memory[1]))+(memory[2]*memory[2]))*(136.666667),floatround_round)*(1.609344));

    if(result_speed)
    {
        new _random = random(100); while(_random < 50) _random = random(100); new val[4]; format(val, sizeof(val), "0.%i", _random);

        if(floatsub(VehicleInfo[vehicleid][vehicle_fuel], floatstr(val)) > 0.00)
        {
            VehicleInfo[vehicleid][vehicle_fuel] = floatsub(VehicleInfo[vehicleid][vehicle_fuel], floatstr(val));
           
            new string[128], Float:health; GetVehicleHealth(GetPlayerVehicleID(playerid), health);
            format(string, sizeof(string), "~r~Vehicle name: ~w~%s~r~ Vehicle health:~w~ %.2f\%% ~r~Vehicle fuel: ~w~%.2f\%%", VehicleList[(GetVehicleModel(GetPlayerVehicleID(playerid)) - 400)], health / 1000 * 100, VehicleInfo[GetPlayerVehicleID(playerid)][vehicle_fuel]);

            TextDrawHideForPlayer(playerid, VehicleText[playerid][0]);
            TextDrawSetString(VehicleText[playerid][0], string);
            TextDrawShowForPlayer(playerid, VehicleText[playerid][0]);
        }
        else
        {
            VehicleInfo[vehicleid][vehicle_fuel] = 0.00;

            SetPlayerSpeedCap(playerid, 0.001);
            TogglePlayerControllable(playerid, false);
           
            GameTextForPlayer(playerid, "~r~Out of fuel!", 1000, 4);
        }
    }
    return 1;
}

public OnPlayerUpdate(playerid)
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            new Float:speed = GetVehicleSpeed_P(playerid);

            if(speed != LastSpeed[playerid])
            {
                new szOutput[9];
                format(szOutput, sizeof(szOutput), "%ikm/h", floatround(speed));

                TextDrawHideForPlayer(playerid, VehicleText[playerid][1]);
                TextDrawSetString(VehicleText[playerid][1], szOutput);
                TextDrawShowForPlayer(playerid, VehicleText[playerid][1]);

                LastSpeed[playerid] = speed;
            }

            new string[128], Float:health; GetVehicleHealth(GetPlayerVehicleID(playerid), health);
            format(string, sizeof(string), "~r~Vehicle name: ~w~%s~r~ Vehicle health:~w~ %.2f\%% ~r~Vehicle fuel: ~w~%.2f\%%", VehicleList[(GetVehicleModel(GetPlayerVehicleID(playerid)) - 400)], health / 1000 * 100, VehicleInfo[GetPlayerVehicleID(playerid)][vehicle_fuel]);

            if(textdraws_processed[playerid] == false)
            {
                CreateTextdraws(playerid);
            }
           
            TextDrawHideForPlayer(playerid, VehicleText[playerid][0]);
            TextDrawSetString(VehicleText[playerid][0], string);
            TextDrawShowForPlayer(playerid, VehicleText[playerid][0]);
        }
    }
   
    static s_iVehicle;

    if(g_fSpeedCap[playerid] != 0.0 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        s_iVehicle = GetPlayerVehicleID(playerid);

        if(s_iVehicle)
        {
            static Float:s_fX, Float:s_fY, Float:s_fZ, Float:s_fVX, Float:s_fVY, Float:s_fVZ;

            GetVehiclePos(s_iVehicle, s_fX, s_fY, s_fZ );
            GetVehicleVelocity(s_iVehicle, s_fVX, s_fVY, s_fVZ );

            if(!IsPlayerInRangeOfPoint(playerid, g_fSpeedCap[playerid] + 0.05, s_fX + s_fVX, s_fY + s_fVY, s_fZ + s_fVZ))
            {
                static Float:s_fLength;

                s_fLength = floatsqroot((s_fVX * s_fVX) + (s_fVY * s_fVY) + (s_fVZ * s_fVZ));

                s_fVX = (s_fVX / s_fLength) * g_fSpeedCap[playerid];
                s_fVY = (s_fVY / s_fLength) * g_fSpeedCap[playerid];
                s_fVZ = (s_fVZ / s_fLength) * g_fSpeedCap[playerid];

                if(s_iVehicle)
                {
                    SetVehicleVelocity(s_iVehicle, s_fVX, s_fVY, s_fVZ);
                }
                else
                {
                    SetPlayerVelocity(playerid, s_fVX, s_fVY, s_fVZ);
                }
            }
        }
    }
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        for(new i=0; i <= 7; i++)
        {
            TextDrawShowForPlayer(playerid, VehicleText[playerid][i]);

            new string[128], Float:health;
            GetVehicleHealth(GetPlayerVehicleID(playerid), health);
           
            format(string, sizeof(string), "~r~Vehicle name: ~w~%s~r~ Vehicle health:~w~ %.2f\%% ~r~Vehicle fuel: ~w~%.2f\%%", VehicleList[(GetVehicleModel(GetPlayerVehicleID(playerid)) - 400)], health / 1000 * 100, VehicleInfo[GetPlayerVehicleID(playerid)][vehicle_fuel]);

            TextDrawHideForPlayer(playerid, VehicleText[playerid][0]);
            TextDrawSetString(VehicleText[playerid][0], string);
            TextDrawShowForPlayer(playerid, VehicleText[playerid][0]);
           
            VehicleInfo[GetPlayerVehicleID(playerid)][vehicle_health] = health;
        }
    }
    else
    {
        for(new i=0; i <= 7; i++)
        {
            TextDrawHideForPlayer(playerid, VehicleText[playerid][i]);
        }
    }
    return 1;
}

public OnFilterScriptExit()
{
    for(new i=0; i < MAX_PLAYERS; i++)
    {
        for(new j=0; j <= 7; j++)
        {
            TextDrawDestroy(VehicleText[i][j]);
        }
    }
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    for(new i=0; i <= 7; i++)
    {
        TextDrawDestroy(VehicleText[playerid][i]);
    }
   
    LastSpeed[playerid] = 0.00;
    return 1;
}

public OnPlayerConnect(playerid)
{
    textdraws_processed[playerid] = false;
    CreateTextdraws(playerid);
    return 1;
}

stock CreateTextdraws(playerid)
{
    VehicleText[playerid][0] = TextDrawCreate(330.000000, 435.000000, "~r~Vehicle name: ~w~name~r~ Vehicle health:~w~ health ~r~Vehicle fuel: ~w~fuel");
    TextDrawAlignment(VehicleText[playerid][0], 2);
    TextDrawBackgroundColor(VehicleText[playerid][0], 255);
    TextDrawFont(VehicleText[playerid][0], 1);
    TextDrawLetterSize(VehicleText[playerid][0], 0.340000, 1.000000);
    TextDrawColor(VehicleText[playerid][0], -1);
    TextDrawSetOutline(VehicleText[playerid][0], 1);
    TextDrawSetProportional(VehicleText[playerid][0], 1);
    TextDrawUseBox(VehicleText[playerid][0], 1);
    TextDrawBoxColor(VehicleText[playerid][0], 100);
    TextDrawTextSize(VehicleText[playerid][0], 713.000000, 860.000000);

    VehicleText[playerid][1] = TextDrawCreate(321.000000, 409.000000, "000km/h");
    TextDrawAlignment(VehicleText[playerid][1], 2);
    TextDrawBackgroundColor(VehicleText[playerid][1], 255);
    TextDrawFont(VehicleText[playerid][1], 1);
    TextDrawLetterSize(VehicleText[playerid][1], 0.440000, 2.399999);
    TextDrawColor(VehicleText[playerid][1], -1);
    TextDrawSetOutline(VehicleText[playerid][1], 0);
    TextDrawSetProportional(VehicleText[playerid][1], 1);
    TextDrawSetShadow(VehicleText[playerid][1], 1);
    TextDrawUseBox(VehicleText[playerid][1], 1);
    TextDrawBoxColor(VehicleText[playerid][1], 100);
    TextDrawTextSize(VehicleText[playerid][1], 163.000000, -131.000000);

    VehicleText[playerid][2] = TextDrawCreate(259.000000, 433.000000, "_");
    TextDrawBackgroundColor(VehicleText[playerid][2], 255);
    TextDrawFont(VehicleText[playerid][2], 1);
    TextDrawLetterSize(VehicleText[playerid][2], 0.500000, -0.200000);
    TextDrawColor(VehicleText[playerid][2], -1);
    TextDrawSetOutline(VehicleText[playerid][2], 0);
    TextDrawSetProportional(VehicleText[playerid][2], 1);
    TextDrawSetShadow(VehicleText[playerid][2], 1);
    TextDrawUseBox(VehicleText[playerid][2], 1);
    TextDrawBoxColor(VehicleText[playerid][2], 255);
    TextDrawTextSize(VehicleText[playerid][2], -45.000000, 0.000000);

    VehicleText[playerid][3] = TextDrawCreate(386.000000, 433.000000, "_");
    TextDrawBackgroundColor(VehicleText[playerid][3], 255);
    TextDrawFont(VehicleText[playerid][3], 1);
    TextDrawLetterSize(VehicleText[playerid][3], 0.500000, -0.200000);
    TextDrawColor(VehicleText[playerid][3], -1);
    TextDrawSetOutline(VehicleText[playerid][3], 0);
    TextDrawSetProportional(VehicleText[playerid][3], 1);
    TextDrawSetShadow(VehicleText[playerid][3], 1);
    TextDrawUseBox(VehicleText[playerid][3], 1);
    TextDrawBoxColor(VehicleText[playerid][3], 255);
    TextDrawTextSize(VehicleText[playerid][3], 648.000000, 0.000000);

    VehicleText[playerid][4] = TextDrawCreate(259.000000, 409.000000, "_");
    TextDrawBackgroundColor(VehicleText[playerid][4], 255);
    TextDrawFont(VehicleText[playerid][4], 1);
    TextDrawLetterSize(VehicleText[playerid][4], 0.500000, 2.200000);
    TextDrawColor(VehicleText[playerid][4], -1);
    TextDrawSetOutline(VehicleText[playerid][4], 0);
    TextDrawSetProportional(VehicleText[playerid][4], 1);
    TextDrawSetShadow(VehicleText[playerid][4], 1);
    TextDrawUseBox(VehicleText[playerid][4], 1);
    TextDrawBoxColor(VehicleText[playerid][4], 255);
    TextDrawTextSize(VehicleText[playerid][4], 253.000000, 0.000000);

    VehicleText[playerid][5] = TextDrawCreate(388.500000, 407.000000, "_");
    TextDrawBackgroundColor(VehicleText[playerid][5], 255);
    TextDrawFont(VehicleText[playerid][5], 1);
    TextDrawLetterSize(VehicleText[playerid][5], 0.500000, -0.100000);
    TextDrawColor(VehicleText[playerid][5], -1);
    TextDrawSetOutline(VehicleText[playerid][5], 0);
    TextDrawSetProportional(VehicleText[playerid][5], 1);
    TextDrawSetShadow(VehicleText[playerid][5], 1);
    TextDrawUseBox(VehicleText[playerid][5], 1);
    TextDrawBoxColor(VehicleText[playerid][5], 255);
    TextDrawTextSize(VehicleText[playerid][5], 253.000000, 24.000000);

    VehicleText[playerid][6] = TextDrawCreate(386.000000, 408.000000, "_");
    TextDrawBackgroundColor(VehicleText[playerid][6], 255);
    TextDrawFont(VehicleText[playerid][6], 1);
    TextDrawLetterSize(VehicleText[playerid][6], 0.500000, 2.599999);
    TextDrawColor(VehicleText[playerid][6], -1);
    TextDrawSetOutline(VehicleText[playerid][6], 0);
    TextDrawSetProportional(VehicleText[playerid][6], 1);
    TextDrawSetShadow(VehicleText[playerid][6], 1);
    TextDrawUseBox(VehicleText[playerid][6], 1);
    TextDrawBoxColor(VehicleText[playerid][6], 255);
    TextDrawTextSize(VehicleText[playerid][6], 385.000000, 0.000000);

    VehicleText[playerid][7] = TextDrawCreate(676.000000, 448.000000, "_");
    TextDrawBackgroundColor(VehicleText[playerid][7], 255);
    TextDrawFont(VehicleText[playerid][7], 1);
    TextDrawLetterSize(VehicleText[playerid][7], 0.500000, -0.200000);
    TextDrawColor(VehicleText[playerid][7], -1);
    TextDrawSetOutline(VehicleText[playerid][7], 0);
    TextDrawSetProportional(VehicleText[playerid][7], 1);
    TextDrawSetShadow(VehicleText[playerid][7], 1);
    TextDrawUseBox(VehicleText[playerid][7], 1);
    TextDrawBoxColor(VehicleText[playerid][7], 255);
    TextDrawTextSize(VehicleText[playerid][7], -45.000000, 0.000000);
   
    textdraws_processed[playerid] = true;
    return 1;
}
Reply
#5

pawn Код:
return 0;
at the buttom of onplayercommand text instead of return 1.
Reply
#6

All filterscripts have to return the same value as the GM's one in every callback.
Reply
#7

Nice thanks man!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)