17.05.2016, 16:41
Hi, samp forum.
Can i make this code smaller
When i remove this code
The server starts perfect.
No errors
Can i make this code smaller
Код:
if(PInfo[playerid][pCop] <= 7) { new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); SetPlayerPos(playerid, x, y, z+1); SendClientMessage(playerid,0xAA3333AA, "You are not a Detective I"); } } if(vehicleid == PD_LSPDUND4) { if(PInfo[playerid][pCop] <= 7) { new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); SetPlayerPos(playerid, x, y, z+1); SendClientMessage(playerid,0xAA3333AA, "You are not a Detective I"); } } if(vehicleid == PD_LSPDUND5) { if(PInfo[playerid][pCop] <= 7) { new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); SetPlayerPos(playerid, x, y, z+1); SendClientMessage(playerid,0xAA3333AA, "You are not a Detective I"); } } if(vehicleid == PD_LSPDUND6) { if(PInfo[playerid][pCop] <= 7) { new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); SetPlayerPos(playerid, x, y, z+1); SendClientMessage(playerid,0xAA3333AA, "You are not a Detective I"); } } if(vehicleid == PD_LSPDUND7) { if(PInfo[playerid][pCop] <= 7) { new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); SetPlayerPos(playerid, x, y, z+1); SendClientMessage(playerid,0xAA3333AA, "You are not a Detective I"); } } if(vehicleid == PD_LSPDUND8) { if(PInfo[playerid][pCop] <= 7) { new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); SetPlayerPos(playerid, x, y, z+1); SendClientMessage(playerid,0xAA3333AA, "You are not a Detective I"); } } if(vehicleid == PD_LSPDUND9) { if(PInfo[playerid][pCop] <= 7) { new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); SetPlayerPos(playerid, x, y, z+1); SendClientMessage(playerid,0xAA3333AA, "You are not a Detective I"); } } if(vehicleid == PD_LSPDTAXI) { if(PInfo[playerid][pCop] <= 7) { new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); SetPlayerPos(playerid, x, y, z+1); SendClientMessage(playerid,0xAA3333AA, "You are not a Detective I"); } } return 0; }
Код:
PD_CAR = CreateVehicle(596,1558.8412,-1711.6847,5.6107,0.2152,0,1); // LSPD1 PD_CAR2 = CreateVehicle(596,1562.9648,-1711.0802,5.6118,0.0865,0,1); // LSPD2 PD_CAR3 = CreateVehicle(596,1570.4252,-1711.2849,5.6113,0.1652,0,1); // LSPD3 PD_CAR4 = CreateVehicle(596,1574.5020,-1711.2111,5.6105,0.7812,0,1); // LSPD4 PD_CAR5 = CreateVehicle(596,1578.6610,-1711.2418,5.6115,359.9628,0,1); // LSPD5 PD_CAR6 = CreateVehicle(596,1583.5205,-1711.1624,5.6111,359.9993,0,1); // LSPD6 PD_CAR7 = CreateVehicle(596,1587.4843,-1710.9558,5.6105,359.5211,0,1); // LSPD7 PD_CAR8 = CreateVehicle(596,1591.5603,-1710.9192,5.6110,0.3880,0,1); // LSPD8 PD_CAR9 = CreateVehicle(596,1595.4760,-1711.1044,5.6106,359.1207,0,1); // LSPD9 PD_CAR10 = CreateVehicle(596,1601.6406,-1704.0292,5.6107,90.6271,0,1); // LSPD10 PD_CAR11 = CreateVehicle(596,1601.4740,-1700.0243,5.6108,90.7542,0,1); // LSPD11 PD_CAR12 = CreateVehicle(596,1601.4498,-1696.0110,5.6109,90.4040,0,1); // LSPD12 PD_CAR13 = CreateVehicle(596,1601.6042,-1692.0181,5.6109,90.1785,0,1); // LSPD13 PD_CAR14 = CreateVehicle(596,1601.5448,-1687.9376,5.6109,90.5516,0,1); // LSPD14 PD_CAR15 = CreateVehicle(596,1601.8317,-1683.8500,5.6108,89.6264,0,1); // LSPD15 PD_NRG = CreateVehicle(521,1599.4846,-1713.0972,5.4622,15.1706,0,1); // LSPDSpeedBike PD_HPV = CreateVehicle(523,1604.4741,-1670.3304,5.4618,90.2007,0,1); // LSPDHPV1 PD_HPV2 = CreateVehicle(523,1604.4326,-1672.7900,5.4645,92.6691,0,1); // LSPDHPV2 PD_HPV3 = CreateVehicle(523,1603.4644,-1676.4287,5.4600,87.8529,0,1); // LSPDHPV3 PD_HPV4 = CreateVehicle(523,1603.5798,-1679.2388,5.4605,89.8969,0,1); // LSPDHPV4 PD_SPEED = CreateVehicle(415,1584.3889,-1667.6753,5.6649,269.7265,1,1); // LSPDCheeta PD_SPEED2 = CreateVehicle(541,1584.3314,-1671.6809,5.5179,270.4131,1,0); // LSPDBullet PD_SPEED3 = CreateVehicle(402,1584.4209,-1675.5552,5.7270,269.3290,1,1); // LSPDBuffalo PD_LSPDTOW = CreateVehicle(525,1585.3226,-1680.3849,5.7683,269.2274,0,0); // LSPDTow PD_LSPDRancher = CreateVehicle(528,1528.0724,-1688.3204,5.9339,269.3846,1,1); // LSPDBear2 PD_LSPDRancher2 = CreateVehicle(528,1527.9764,-1683.4500,5.9347,270.5230,1,1); // LSPDBear1 PD_LSPDRancher3 = CreateVehicle(490,1526.7581,-1644.0273,6.0186,180.0747,0,0); // LSPDRancher1 PD_LSPDRancher4 = CreateVehicle(490,1530.4824,-1643.9750,6.0183,179.9766,0,0); // LSPDRancher2 PD_LSPDRancher5 = CreateVehicle(490,1534.6812,-1643.7118,6.0187,180.0512,0,0); // LSPDRancher3 PD_LSPDSWAT = CreateVehicle(490,1538.8079,-1643.5621,6.0187,179.5128,0,0); // LSPDRancher4 PD_LSPDSWAT2 = CreateVehicle(490,1545.9469,-1644.5985,6.0179,134.0692,0,0); // LSPDRancher5 PD_LSPDSWAT3 = CreateVehicle(427,1544.5010,-1650.9823,6.0225,90.1126,0,1); // LSPDEnforcer1 PD_LSPDUND = CreateVehicle(427,1544.8378,-1654.8641,6.0225,89.0770,0,1); // LSPDEnforcer2 PD_LSPDUND2 = CreateVehicle(426,1545.8666,-1659.0496,5.6339,89.9158,0,0); // LSPDUnd1 PD_LSPDUND3 = CreateVehicle(426,1545.2424,-1663.0219,5.6336,88.7208,0,0); // LSPDUnd2 PD_LSPDUND4 = CreateVehicle(426,1545.8109,-1667.9266,5.6337,89.3767,8,8); // LSPDUnd3 PD_LSPDUND5 = CreateVehicle(426,1545.4313,-1671.9921,5.6340,89.2795,9,9); // LSPDUnd4 PD_LSPDTAXI = CreateVehicle(420,1527.9890,-1656.0585,5.6688,269.8552,6,6); // LSPDTaxi PD_LSPDUND7 = CreateVehicle(492,1545.7913,-1676.0049,5.6724,89.5243,4,4); // LSPDUnd5 PD_LSPDUND8 = CreateVehicle(560,1546.3625,-1680.2058,5.5956,89.3625,0,0); // LSPDUnd6 PD_LSPDUND9 = CreateVehicle(560,1545.2932,-1684.1990,5.5954,89.6851,0,0); // LSPDUnd7
No errors