C# Вызов NPC по команде

Edwards

Trainee
Скриптер
Простая команда для вызова NPC по координатам игрока.
Пример:
/addnpc PedHash
/addnpc 42647445

C#:
[Command("addnpc")]
        public void addnpc(Player player, PedHash pedHash)
        {
            Vector3 PlayerPos = NAPI.Entity.GetEntityPosition(player);
            Ped John = NAPI.Ped.CreatePed((uint)pedHash, new Vector3(PlayerPos.X+1f, PlayerPos.Y + 1f, PlayerPos.Z + 1f), 5f, true, false, false, false, 0);
            NAPI.Chat.SendChatMessageToPlayer(player, $"Игрок: {player.Name} | Заспавнил НПС: {pedHash}!");
            NAPI.Chat.SendChatMessageToPlayer("https://rage-script.ru/");
        }

PedHash
public enum PedHash : uint
{
Skidrow01AMM = 32417469,
Hooker01SFY = 42647445,
Hooker03SFY = 51789996,
JimmyBostonCutscene = 60192701,
SalvaGoon03GMY = 62440720,
Autoshop01SMM = 68070371,
Eastsa02AFY = 70821038,
Car3Guy1Cutscene = 71501447,
Clown01SMY = 71929310,
TracyDisantoCutscene = 101298480,
FloydCutscene = 103106535,
Pigeon = 111281960,
TigerShark = 113504370,
Genfat01AMM = 115168927,
AnitaCutscene = 117698822,
Eastsa02AMM = 131961260,
Indian01AFY = 153984193,
MaryannCutscene = 161007533,
Zimbor = 188012277,
Baywatch01SMY = 189425762,
PestContGunman = 193469166,
Socenlat01AMM = 193817059,
DaleCutscene = 216536661,
Janet = 225287241,
Michael = 225514697,
Tanisha = 226559113,
Corpse02UFY = 228356856,
StrPunk02GMY = 228715206,
AmmuCountrySMM = 233415434,
Soucent03AMO = 238213328,
Jewelass = 257763003,
GuadalopeCutscene = 261428209,
TanishaCutscene = 1123963760,
Poodle = 1125994524,
Shepherd = 1126154828,
ExecutivePAFemale01 = 1126998116,
MartinMadrazoCutscene = 1129928304,
Xmech01SMY = 1142162924,
JewelassCutscene = 1145088004,
Bevhills01AFY = 1146800212,
JackHowitzerCutscene = 1153203121,
JoshCutscene = 1158606749,
ExArmy01 = 1161072059,
LamarDavisCutscene = 1162230285,
RampHic = 1165307954,
Fitness01AFY = 1165780219,
MollyCutscene = 1167167044,
JosefCutscene = 1167549130,
Glenstank01 = 1169888870,
HeadTargets = 1173958009,
RussianDrunkCutscene = 1179785778,
Dale = 1182012905,
Finguru01 = 1189322339,
FabienCutscene = 1191403201,
MilitaryBum = 1191548746,
Humpback = 1193010354,
DomCutscene = 1198698306,
Ktown01AFO = 1204772502,
Andreas = 1206185632,
PestCont01SMY = 1209091352,
Tramp01AFM = 1224306523,
VagosSpeakCutscene = 1224690857,
MexBoss02GMM = 1226102803,
Gardener01SMM = 1240094341,
Chef = 1240128502,
Baywatch01SFY = 1250841910,
Vinewood01AMY = 1264851357,
Musclbeac01AMY = 1264920838,
CocaineFemale01 = 1264941816,
Acult02AMO = 1268862154,
KarenDanielsCutscene = 1269774364,
MoviePremFemaleCutscene = 1270514905,
SiemonYetarian = 1283141381,
PriestCutscene = 1299047806,
LesterCrest = 1302784073,
Families01GFY = 1309468115,
Hipster03AMY = 1312913862,
Husky = 1318032802,
NataliaCutscene = 1325314544,
Salton01AMM = 1328415626,
PoloGoon01GMY = 1329576454,
Lost01GMY = 1330042375,
MrsThornhillCutscene = 1334976110,
Paparazzi = 1346941736,
Tourist01AFM = 1347814329,
FemaleAgent = 1348537411,
Blackops03SMY = 1349953339,
Hiker01AMY = 1358380044,
Eastsa03AFY = 1371553700,
Baygor = 1380197501,
Stripper01SFY = 1381498905,
TylerDixon = 1382414087,
Ktown01AFM = 1388848350,
TaosTranslatorCutscene = 1397974313,
Lifeinvad01 = 1401530684,
TrampBeac01AMM = 1404403376,
Acult01AMM = 1413662315,
Tennis01AMM = 1416254276,
Bevhills01AMM = 1423699487,
Tennis01AFY = 1426880966,
WinClean01SMY = 1426951581,
Acult01AMO = 1430544400,
Tourist01AFY = 1446741360,
Prisguard01SMM = 1456041926,
CocaineMale01 = 1456705429,
Cormorant = 1457690978,
JimmyDisanto = 1459905209,
TrafficWarden = 1461287021,
Cat = 1462895032,
Bestmen = 1464257942,
MarnieCutscene = 1464721716,
MexBoss01GMM = 1466037421,
MagentaCutscene = 1477887514,
FbiSuit01Cutscene = 1482427218,
Marine02SMY = 1490458366,
Trucker01SMM = 1498487404,
ExecutivePAFemale02 = 1500695792,
Soucent02AFY = 1519319503,
Vagos01GFY = 1520708641,
PaigeCutscene = 1528799427,
KerryMcintosh = 1530648845,
HunterCutscene = 1531218220,
SpyActress = 1535236204,
StripperLiteSFY = 1544875514,
TennisCoachCutscene = 1545995274,
Bevhills02AFY = 1546450936,
FibSec01 = 1558115333,
Vinewood02AMY = 1561705728,
Airhostess01SFY = 1567728751,
Mistress = 1573528872,
Cop01SMY = 1581098148,
PrisMuscl01SMY = 1596003233,
RivalPaparazzi = 1624626906,
Omega = 1625728984,
Salton02AMM = 1626646295,
MerryWeatherCutscene = 1631478380,
ForgeryMale01 = 1631482011,
Bride = 1633872967,
RampMarineCutscene = 1634506681,
PopovCutscene = 1635617250,
Genstreet01AFO = 1640504453,
Fatlatin01AMM = 1641152947,
Orleans = 1641334641,
AirworkerSMY = 1644266841,
DoaMan = 1646160893,
Postal01SMM = 1650036788,
CiaSec01SMM = 1650288984,
Armymech01SMY = 1657546978,
TonyaCutscene = 1665391897,
Armoured02SMM = 1669696074,
Eastsa02AFM = 1674107025,
Priest = 1681385341,
Coyote = 1682622302,
MovAlien01 = 1684083350,
Motox01AMY = 1694362237,
Downtown01AFM = 1699403886,
Marine01SMY = 1702441027,
Hao = 1704428387,
LamarDavis = 1706635382,
Bevhills02AMY = 1720428295,
Terry = 1728056212,
OgBoss01AMM = 1746653202,
Soucent01AMM = 1750583735,
Azteca01GMY = 1752208920,
Epsilon01AFY = 1755064960,
Xmech02SMYMP = 1762949645,
BarryCutscene = 1767447799,
Skater01AFY = 1767892582,
Methhead01AMY = 1768677545,
TomCutscene = 1776856003,
Factory01SFY = 1777626099,
Groom = 4274948997,
Dhill01AMY = 4282288299,
ChiGoon02GMM = 4285659174,
ScreenWriter = 4293277303
Screenshot_4.png
 
Последнее редактирование:

Lev Angel

Developer
Команда форума
Скриптер
а как сделать чтобы он сразу в агре был?
Я делал это через RelationshipGroup. Создавал две группы. В одну добавлял бота, в другую игрока. Ставил чтобы группы враждовали между собой.
Но боты не атаковали сразу, а только если их саргить, например, ударить.

Чтобы бот атаковал я делал еще https://wiki.rage.mp/index.php?title=Player::taskCombat
Примерно так.

Там были нюансы что бот пугался, когда игрок доставал оружие. Но это отключается в его свойствах. Точно уже не помню, могу где-то ошибаться, но направление верное :)
 
Яндекс.Метрика
Верх