12.03.2018, 12:43
(
Последний раз редактировалось Libbyphay; 12.03.2018 в 13:20.
)
Hi guys, i'm building my own project. But i'm meeting about FCNPC:
Code source: https://sampforum.blast.hk/showthread.php?tid=574547
Help me pls, sorry i bad english.
Code source: https://sampforum.blast.hk/showthread.php?tid=574547
Код HTML:
enum npcInfo { npc_Name[MAX_PLAYER_NAME], npc_Skin, Float:npc_TargetDist, Float:npc_X, Float:npc_Y, Float:npc_Z, Float:npc_A, weaponnpcid, npc_ID } new npc[][npcInfo] = { {"Pedestrian_alhambra_1", 2, 15.0, 1829.0376,-1724.2073,13.5469,172.9064,0}, {"Pedestrian_alhambra_2", 7, 15.0, 1829.3373,-1744.0007,13.5469,358.4577,0}, {"Pedestrian_major_1", 23, 15.0, 1420.8108,-1584.4639,13.5469,185.6047,0}, {"Pedestrian_major_2", 41, 15.0, 1422.0692,-1740.3816,13.5469,283.3656,0}, {"Pedestrian_major_3", 44, 15.0, 1537.3142,-1740.3983,13.5469,0.4464,0}, {"Pedestrian_major_4", 43, 15.0, 1536.7340,-1585.5454,13.5469,2.9530,0}, {"Pedestrian_major_5", 47, 15.0, 1483.6631,-1610.8466,14.0393,159.9345,0}, {"Pedestrian_major_6", 55, 15.0, 1484.0264,-1676.6455,14.0469,189.0747,0}, {"Pedestrian_alhambra_3", 56, 15.0, 1933.1835,-1619.9907,13.5391,266.7766,0}, {"Pedestrian_alhambra_4", 190, 15.0, 1949.4403,-1743.0580,13.5469,180.6091,0}, {"Pedestrian_prea_1", 85, 15.0, 1681.3740,-1585.8608,13.5469,179.0807,0}, {"Pedestrian_prea_2", 79, 15.0, 1742.9073,-1591.5424,13.5439,174.3807,0}, {"Pedestrian_prea_3", 122, 15.0, 1741.2233,-1739.0149,13.5469,176.8873,0}, {"Pedestrian_prea_4", 136, 15.0, 1681.4899,-1740.0146,13.5590,358.9124,0}, {"Pedestrian_pregl_1", 6, 15.0, 2079.9355,-1376.8184,23.9987,180.4605,0}, {"Pedestrian_pregl_2", 7, 15.0, 2263.0144,-1376.9508,23.9823,82.7230,0}, {"Pedestrian_pregl_3", 14, 15.0, 2264.0920,-1227.9930,23.9766,92.1793,0}, {"Pedestrian_pregl_4", 15, 15.0, 2178.7988,-1257.8750,23.9778,268.9010,0}, {"Pedestrian_pregl_5", 21, 15.0, 2079.7339,-1227.8716,23.9766,182.7101,0}, {"Pedestrian_prgl2_1", 29, 15.0, 2334.7510,-1492.1539,24.0044,358.7075,0}, {"Pedestrian_prgl2_2", 37, 15.0, 2422.3596,-1452.3146,24.0096,273.2952,0}, {"Pedestrian_prgl2_3", 35, 15.0, 2383.5698,-1391.8702,24.0329,89.7036,0}, {"Pedestrian_prgl2_4", 53, 15.0, 2438.3882,-1512.5706,23.9932,90.6436,0}, {"Pedestrian_grove_1", 9, 15.0, 2254.3884,-1666.4169,15.4690,78.3300,0}, {"Pedestrian_grove_2", 10, 15.0, 2350.9810,-1667.0916,13.5469,182.0210,0}, {"Pedestrian_grove_3", 13, 15.0, 2371.8909,-1695.5531,13.4716,269.7552,0}, {"Pedestrian_grove_4", 20, 15.0, 2406.4121,-1756.7699,13.5469,206.7745,0}, {"Pedestrian_grove_5", 22, 15.0, 2253.0432,-1742.1621,13.5469,1.5393,0}, {"Pedestrian_grove_6", 46, 15.0, 2226.8774,-1699.6871,13.7538,354.6459,0}, {"Pedestrian_glenp_1", 51, 15.0, 1967.8705,-1301.6317,23.9837,266.1067,0}, {"Pedestrian_glenp_2", 53, 15.0, 2058.9541,-1143.8591,23.8984,152.7023,0}, {"Pedestrian_glenp_3", 61, 15.0, 2028.1210,-1165.5778,22.0727,110.0886,0}, {"Pedestrian_glenp_4", 65, 15.0, 2005.2762,-1186.7554,20.0234,145.4956,0}, {"Pedestrian_glenp_5", 69, 15.0, 1887.5042,-1268.4724,13.5469,271.2236,0}, {"Pedestrian_glenp_6", 71, 15.0, 1859.7393,-1245.6707,14.2109,0.2111,0}, {"Pedestrian_vinewood_1", 73, 15.0, 516.9893,-1212.2113,44.2202,287.1628,0}, {"Pedestrian_vinewood_2", 75, 15.0, 386.7436,-1228.6584,52.5793,27.8996,0}, {"Pedestrian_vinewood_3", 79, 15.0, 171.2327,-1391.3322,48.3281,39.2517,0}, {"Pedestrian_vinewood_4", 94, 15.0, 225.2717,-1313.1869,55.9934,27.2747,0}, {"Pedestrian_vinewood_5", 24, 15.0, 271.8044,-1245.2720,73.8353,312.2912,0}, {"Pedestrian_vinewood_6", 27, 15.0, 371.2009,-1166.5931,78.2870,321.2719,0}, {"Pedestrian_grovecluck_1", 133, 15.0, 2421.2151,-1885.8774,13.5469,181.0540,0}, {"Pedestrian_grovecluck_2", 135, 15.0, 2368.0759,-1934.1711,13.5469,93.3972,0}, {"Pedestrian_grovecluck_3", 137, 15.0, 2405.7456,-1980.4506,13.5469,114.2384,0}, {"Pedestrian_grovecluck_4", 143, 15.0, 2305.5427,-1964.2297,13.5717,126.4375,0}, {"Pedestrian_grovecluck_5", 148, 15.0, 2296.5037,-1901.9596,13.5850,92.5882,0}, {"Pedestrian_grovecluck_6", 152, 15.0, 2207.7925,-1936.1647,13.5469,187.5511,0}, {"Pedestrian_marina_1", 65, 15.0, 789.3992,-1629.3615,13.3828,268.8918,0}, {"Pedestrian_marina_2", 67, 15.0, 739.3969,-1666.2673,10.6621,1.8986,0}, {"Pedestrian_marina_3", 69, 15.0, 802.4042,-1762.0770,13.5469,348.1393,0}, {"Pedestrian_marina_4", 84, 15.0, 745.4694,-1669.7550,4.1558,205.8780,0}, {"Pedestrian_marina_5", 88, 15.0, 676.8501,-1719.4725,8.6992,223.8270,0}, {"Pedestrian_marina_6", 93, 15.0, 642.4741,-1723.7279,14.0731,351.7580,0}, {"Pedestrian_marina_7", 94, 15.0, 646.0323,-1593.7917,15.7191,269.2045,0}, {"Pedestrian_marina_8", 95, 15.0, 746.5423,-1578.4102,14.1363,269.8621,0}, {"Pedestrian_marina_9", 96, 15.0, 708.1379,-1436.0104,13.5391,194.4280,0}, {"Pedestrian_marina_10", 122, 15.0,769.1869,-1542.2876,13.5469,164.5484,0}, {"Pedestrian_cbeach_1", 45, 15.0,362.7839,-1861.5585,7.8359,1.8716,0}, {"Pedestrian_cbeach_2", 92, 15.0,377.1489,-1946.6036,7.8359,188.5967,0}, {"Pedestrian_cbeach_3", 97, 15.0,397.0294,-2013.8910,7.8359,88.3290,0}, {"Pedestrian_cbeach_4", 140, 15.0,351.0923,-2084.8289,7.8301,191.1033,0}, {"Pedestrian_rodeo_1", 147, 15.0,459.1479,-1571.6117,25.5411,87.1748,0}, {"Pedestrian_rodeo_2", 148, 15.0,419.7747,-1550.5602,27.5781,44.2478,0}, {"Pedestrian_rodeo_3", 150, 15.0,314.5111,-1592.4413,33.2109,126.6552,0}, {"Pedestrian_rodeo_4", 161, 15.0,330.4363,-1524.4794,35.8400,338.4471,0}, {"Pedestrian_rodeo_5", 170, 15.0,379.1410,-1518.1765,32.7312,226.8994,0}, {"Pedestrian_rodeo_6", 179, 15.0,430.7235,-1448.7976,30.5781,311.1868,0}, {"Pedestrian_hospitalls_1", 180, 15.0,1187.8456,-1287.5787,13.5541,209.0764,0}, {"Pedestrian_hospitalls_2", 181, 15.0,1213.8900,-1345.2806,13.5721,181.8162,0}, {"Pedestrian_hospitalls_3", 182, 15.0,1267.8092,-1412.3247,13.2833,267.9837,0}, {"Pedestrian_hospitalls_4", 183, 15.0,1248.3098,-1328.2773,13.3883,274.2505,0}, {"Pedestrian_trade_1", 184, 15.0,909.1410,-1386.5073,13.5534,92.4667,0}, {"Pedestrian_trade_2", 185, 15.0,887.0135,-1359.7833,13.7978,87.7667,0}, {"Pedestrian_trade_3", 186, 15.0,903.7175,-1311.9811,13.5469,12.2526,0}, {"Pedestrian_trade_4", 187, 15.0,805.4054,-1335.0598,13.5469,215.9211,0}, {"Pedestrian_trade_5", 188, 15.0,789.2946,-1387.2456,13.7266,324.0222,0}, {"Pedestrian_losflor_1", 190, 15.0,2746.1653,-1264.9506,59.7481,266.6689,0}, {"Pedestrian_losflor_2", 191, 15.0,2745.6904,-1250.5403,59.7188,273.5622,0}, {"Pedestrian_losflor_3", 192, 15.0,2789.6636,-1377.8600,21.4144,206.4355,0}, {"Pedestrian_losflor_4", 193, 15.0,2804.6382,-1377.7412,21.4075,278.2621,0}, {"Pedestrian_westcoast_1", 195, 15.0,2938.4651,-1505.6382,11.0469,166.9939,0}, {"Pedestrian_westcoast_2", 202, 15.0,2913.3296,-1568.9167,11.0469,164.4872,0}, {"Pedestrian_westcoast_3", 206, 15.0,2885.0386,-1593.2607,21.5313,70.1730,0}, {"Pedestrian_westcoast_4", 208, 15.0,2834.2161,-1586.3358,11.0938,255.9581,0}, {"Pedestrian_westcoast_5", 210, 15.0,2875.9919,-1572.3213,11.0842,342.4389,0}, {"Pedestrian_westcoast_6", 211, 15.0,2864.3899,-1496.8168,10.8984,346.5123,0}, {"Pedestrian_willowf_1", 227, 15.0,2706.2236,-2041.4678,13.5469,178.7679,0}, {"Pedestrian_willowf_2", 228, 15.0,2799.6125,-2032.4882,13.5547,270.5755,0}, {"Pedestrian_willowf_3", 229, 15.0,2815.9983,-1969.7418,11.0940,89.8038,0}, {"Pedestrian_willowf_4", 230, 15.0,2806.3455,-1905.4739,13.5469,272.4555,0}, {"Pedestrian_willowf_5", 231, 15.0,2761.8633,-1943.8059,13.5469,91.0571,0}, {"Pedestrian_willowf_6", 232, 15.0,2706.5620,-1944.0938,13.5469,178.7913,0}, {"Pedestrian_willowf_7", 233, 15.0,2640.6594,-1996.4750,13.5547,93.9333,0}, {"Pedestrian_centre_1", 234, 15.0,1030.5569,-948.1165,42.6050,271.6937,0}, {"Pedestrian_centre_2", 235, 15.0,1094.4608,-964.7598,42.4138,269.1202,0}, {"Pedestrian_centre_3", 236, 15.0,1151.7017,-935.7966,43.1463,274.0051,0}, {"Pedestrian_centre_4", 237, 15.0,1318.2113,-913.9108,37.7404,268.4918,0}, {"Pedestrian_centre_5", 238, 15.0,1359.7006,-924.3317,34.3759,260.6585,0}, {"Pedestrian_centre_6", 239, 15.0,1032.2507,-973.1421,42.6125,278.1198,0}, {"Pedestrian_centre_7", 241, 15.0,1286.7510,-939.8834,41.5986,96.1570,0} }; forward CreateNPC(); public CreateNPC() { for (new npcid = 0; npcid < sizeof(npc); npcid++) { npc[npcid][npc_ID] = FCNPC_Create(npc[npcid][npc_Name]); FCNPC_Spawn(npc[npcid][npc_ID], npc[npcid][npc_Skin], npc[npcid][npc_X], npc[npcid][npc_Y], npc[npcid][npc_Z]); FCNPC_SetWeapon(npc[npcid][npc_ID],npc[npcid][weaponnpcid]); FCNPC_SetQuaternion(npc[npcid][npc_ID],0.0,0.0,0.0,0.0); FCNPC_SetAngle(npc[npcid][npc_ID], npc[npcid][npc_A]); SetPlayerColor(npc[npcid][npc_ID],00); SetPlayerVirtualWorld(npc[npcid][npc_ID],3); ApplyAnimation(npc[npcid][npc_ID], "CARRY", "crry_prtial", 4.0, 0, 0, 0, 0, 0 ); FCNPC_Stop(npc[npcid][npc_ID]); FCNPC_StopAttack(npc[npcid][npc_ID]); } SetPVarInt(npc[0][npc_ID], "alhambra", 1),SetPVarInt(npc[1][npc_ID], "alhambra", 1), SetPVarInt(npc[8][npc_ID], "alhambra", 1), SetPVarInt(npc[9][npc_ID], "alhambra", 1); for (new npcid = 2; npcid < 8; npcid++) { SetPVarInt(npc[npcid][npc_ID], "major", 1); } for (new npcid = 9; npcid < 14; npcid++) { SetPVarInt(npc[npcid][npc_ID], "nearalnambra", 1); } for (new npcid = 14; npcid < 19; npcid++) { SetPVarInt(npc[npcid][npc_ID], "preglen", 1); } for (new npcid = 19; npcid < 23; npcid++) { SetPVarInt(npc[npcid][npc_ID], "prgl2", 1); } for (new npcid = 23; npcid < 29; npcid++) { SetPVarInt(npc[npcid][npc_ID], "grove", 1); } for (new npcid = 29; npcid < 35; npcid++) { SetPVarInt(npc[npcid][npc_ID], "glenpark", 1); } for (new npcid = 35; npcid < 41; npcid++) { SetPVarInt(npc[npcid][npc_ID], "vinewood", 1); } for (new npcid = 41; npcid < 47; npcid++) { SetPVarInt(npc[npcid][npc_ID], "grove_cluck", 1); } for (new npcid = 47; npcid < 57; npcid++) { SetPVarInt(npc[npcid][npc_ID], "marina", 1); } for (new npcid = 57; npcid < 61; npcid++) { SetPVarInt(npc[npcid][npc_ID], "circle_beach", 1); } for (new npcid = 61; npcid < 67; npcid++) { SetPVarInt(npc[npcid][npc_ID], "rodeo", 1); } for (new npcid = 67; npcid < 71; npcid++) { SetPVarInt(npc[npcid][npc_ID], "hospital_ls", 1); } for (new npcid = 71; npcid < 76; npcid++) { SetPVarInt(npc[npcid][npc_ID], "tradeplace", 1); } for (new npcid = 76; npcid < 80; npcid++) { SetPVarInt(npc[npcid][npc_ID], "losflores", 1); } for (new npcid = 80; npcid < 86; npcid++) { SetPVarInt(npc[npcid][npc_ID], "westcoast", 1); } for (new npcid = 86; npcid < 93; npcid++) { SetPVarInt(npc[npcid][npc_ID], "willowfield", 1); } for (new npcid = 93; npcid < 100; npcid++) { SetPVarInt(npc[npcid][npc_ID], "centre", 1); } }
Код HTML:
[19:21:10] [npc:join] Pedestrian_alhambra_1 has joined the server (149:127.0.0.1) [19:21:10] [npc:part] Pedestrian_alhambra_1 has left the server (149:0) [19:21:10] [FCNPC] Error: NPC 'Pedestrian_alhambra_1' not created. Name 'Pedestrian_alhambra_1' is invalid or the maxnpc limit in server.cfg has been reached. [19:21:10] [npc:join] Pedestrian_alhambra_2 has joined the server (149:127.0.0.1) [19:21:10] [npc:part] Pedestrian_alhambra_2 has left the server (149:0) [19:21:10] [FCNPC] Error: NPC 'Pedestrian_alhambra_2' not created. Name 'Pedestrian_alhambra_2' is invalid or the maxnpc limit in server.cfg has been reached. [19:21:10] [npc:join] Pedestrian_major_1 has joined the server (149:127.0.0.1) [19:21:10] [npc:part] Pedestrian_major_1 has left the server (149:0) [19:21:10] [FCNPC] Error: NPC 'Pedestrian_major_1' not created. Name 'Pedestrian_major_1' is invalid or the maxnpc limit in server.cfg has been reached. [19:21:10] [npc:join] Pedestrian_major_2 has joined the server (149:127.0.0.1) [19:21:10] [npc:part] Pedestrian_major_2 has left the server (149:0) [19:21:10] [FCNPC] Error: NPC 'Pedestrian_major_2' not created. Name 'Pedestrian_major_2' is invalid or the maxnpc limit in server.cfg has been reached. [19:21:10] [npc:join] Pedestrian_major_3 has joined the server (149:127.0.0.1) [19:21:10] [npc:part] Pedestrian_major_3 has left the server (149:0) [19:21:10] [FCNPC] Error: NPC 'Pedestrian_major_3' not created. Name 'Pedestrian_major_3' is invalid or the maxnpc limit in server.cfg has been reached. [19:21:10] [npc:join] Pedestrian_major_4 has joined the server (149:127.0.0.1) [19:21:10] [npc:part] Pedestrian_major_4 has left the server (149:0) [19:21:10] [FCNPC] Error: NPC 'Pedestrian_major_4' not created. Name 'Pedestrian_major_4' is invalid or the maxnpc limit in server.cfg has been reached. [19:21:10] [npc:join] Pedestrian_major_5 has joined the server (149:127.0.0.1) [19:21:10] [npc:part] Pedestrian_major_5 has left the server (149:0) [19:21:10] [FCNPC] Error: NPC 'Pedestrian_major_5' not created. Name 'Pedestrian_major_5' is invalid or the maxnpc limit in server.cfg has been reached. [19:21:10] [npc:join] Pedestrian_major_6 has joined the server (149:127.0.0.1) [19:21:10] [npc:part] Pedestrian_major_6 has left the server (149:0) [19:21:10] [FCNPC] Error: NPC 'Pedestrian_major_6' not created. Name 'Pedestrian_major_6' is invalid or the maxnpc limit in server.cfg has been reached. [19:21:10] [npc:join] Pedestrian_alhambra_3 has joined the server (149:127.0.0.1) ......