From 05aa2a05007ef651defb8d6e4fa083f1f0a31289 Mon Sep 17 00:00:00 2001 From: Sergey Yarkov Date: Wed, 5 Aug 2020 19:31:37 +0300 Subject: [PATCH] starter --- client/index.mjs | 16 + resource.cfg | 10 + server/config.mjs | 715 +++++++++++++++++++++++++++++ server/index.mjs | 20 + server/modules/commands/admin.mjs | 41 ++ server/modules/commands/player.mjs | 16 + server/modules/defaultLabels.mjs | 15 + server/modules/events/events.mjs | 19 + server/modules/helpers/helpers.mjs | 9 + 9 files changed, 861 insertions(+) create mode 100644 client/index.mjs create mode 100644 resource.cfg create mode 100644 server/config.mjs create mode 100644 server/index.mjs create mode 100644 server/modules/commands/admin.mjs create mode 100644 server/modules/commands/player.mjs create mode 100644 server/modules/defaultLabels.mjs create mode 100644 server/modules/events/events.mjs create mode 100644 server/modules/helpers/helpers.mjs diff --git a/client/index.mjs b/client/index.mjs new file mode 100644 index 0000000..8f5a21a --- /dev/null +++ b/client/index.mjs @@ -0,0 +1,16 @@ +import * as alt from 'alt' +import * as native from 'natives' + +alt.onServer('onConnect', () => { + alt.log('Вы присоеденились!') + alt.emitServer('spawnPlayer') +}) + +alt.onServer('vehicle:setInto', (newVehicle) => { + const localPlayer = alt.Player.local.scriptID + + alt.setTimeout(() => { + native.setPedIntoVehicle(localPlayer, newVehicle.scriptID, -1) + }, 300) +}) + diff --git a/resource.cfg b/resource.cfg new file mode 100644 index 0000000..48aaf77 --- /dev/null +++ b/resource.cfg @@ -0,0 +1,10 @@ +type: js, + +main: server/index.mjs, +client-main: client/index.mjs, +client-files: [ + client/* +] +deps: [ + chat +] diff --git a/server/config.mjs b/server/config.mjs new file mode 100644 index 0000000..b65aa48 --- /dev/null +++ b/server/config.mjs @@ -0,0 +1,715 @@ +export default { + spawn: { + x: -425.578, + y: 1123.490, + z: 325.853 + }, + admins: [ + { socialId: '370262977' } + ], + skins: [ + "A_C_Boar", + "A_F_M_Beach_01", + "A_F_M_BevHills_01", + "A_F_M_BevHills_02", + "A_F_M_BodyBuild_01", + "A_F_M_Business_02", + "A_F_M_Downtown_01", + "A_F_M_EastSA_01", + "A_F_M_EastSA_02", + "A_F_M_FatBla_01", + "A_F_M_FatCult_01", + "A_F_M_FatWhite_01", + "A_F_M_KTown_01", + "A_F_M_KTown_02", + "A_F_M_rolHost_01", + "A_F_M_Salton_01", + "A_F_M_SkidRow_01", + "A_F_M_SouCent_01", + "A_F_M_SouCent_02", + "A_F_M_SouCentMC_01", + "A_F_M_Tourist_01", + "A_F_M_Tramp_01", + "A_F_M_TrampBeac_01", + "A_F_O_DesStreet_01", + "A_F_O_GenStreet_01", + "A_F_O_Indian_01", + "A_F_O_KTown_01", + "A_F_O_Salton_01", + "A_F_O_SouCent_01", + "A_F_O_SouCent_02", + "A_F_Y_Beach_01", + "A_F_Y_BevHills_01", + "A_F_Y_BevHills_02", + "A_F_Y_BevHills_03", + "A_F_Y_BevHills_04", + "A_F_Y_Business_01", + "A_F_Y_Business_02", + "A_F_Y_Business_03", + "A_F_Y_Business_04", + "A_F_Y_EastSA_01", + "A_F_Y_EastSA_02", + "A_F_Y_EastSA_03", + "A_F_Y_Epsilon_01", + "A_F_Y_Fitness_01", + "A_F_Y_Fitness_02", + "A_F_Y_GenAsian01", + "A_F_Y_GenHot_01", + "A_F_Y_Golfer_01", + "A_F_Y_Hiker_01", + "A_F_Y_Hippie_01", + "A_F_Y_Hipster_01", + "A_F_Y_Hipster_02", + "A_F_Y_Hipster_03", + "A_F_Y_Hipster_04", + "A_F_Y_Indian_01", + "A_F_Y_Juggalo_01", + "A_F_Y_Runner_01", + "A_F_Y_RurMeth_01", + "A_F_Y_SCDressy_01", + "A_F_Y_SilverHip_01", + "A_F_Y_Skater_01", + "A_F_Y_Skivill_02", + "A_F_Y_SouCent_01", + "A_F_Y_SouCent_02", + "A_F_Y_SouCent_03", + "A_F_Y_Streetlady", + "A_F_Y_Tennis_01", + "A_F_Y_Topless_01", + "A_F_Y_Tourist_01", + "A_F_Y_Tourist_02", + "A_F_Y_Vinewood_01", + "A_F_Y_Vinewood_02", + "A_F_Y_Vinewood_03", + "A_F_Y_Vinewood_04", + "A_F_Y_Yoga_01", + "A_M_M_ACult_01", + "A_M_M_AfriAmer_01", + "A_M_M_Beach_01", + "A_M_M_Beach_02", + "A_M_M_BevHills_01", + "A_M_M_BevHills_02", + "A_M_M_Business_01", + "A_M_M_DesBeg_01", + "A_M_M_DesRebel_02", + "A_M_M_DesRebel_04", + "A_M_M_EastSA_01", + "A_M_M_EastSA_02", + "A_M_M_Farmer_01", + "A_M_M_FatLatin_01", + "A_M_M_GenFat_01", + "A_M_M_GenFat_02", + "A_M_M_Golfer_01", + "A_M_M_HasJew_01", + "A_M_M_Hillbilly_01", + "A_M_M_Hillbilly_02", + "A_M_M_Indian_01", + "A_M_M_KTown_01", + "A_M_M_Malibu_01", + "A_M_M_MexCntry_01", + "A_M_M_MexLabor_01", + "A_M_M_OG_Boss_01", + "A_M_M_aparazzi_01", + "A_M_M_olynesian_01", + "A_M_M_rolHost_01", + "A_M_M_RurMeth_01", + "A_M_M_Salton_01", + "A_M_M_Salton_02", + "A_M_M_Salton_03", + "A_M_M_Salton_04", + "A_M_M_Skater_01", + "A_M_M_Skidrow_01", + "A_M_M_SkiVill_07", + "A_M_M_SoCenLat_01", + "A_M_M_SouCent_01", + "A_M_M_SouCent_02", + "A_M_M_SouCent_03", + "A_M_M_SouCent_04", + "A_M_M_StLat_02", + "A_M_M_Tennis_01", + "A_M_M_Tourist_01", + "A_M_M_Tramp_01", + "A_M_M_TrampBeac_01", + "A_M_M_TranVest_01", + "A_M_M_TranVest_02", + "A_M_O_ACult_01", + "A_M_O_ACult_02", + "A_M_O_Beach_01", + "A_M_O_DesStreet_01", + "A_M_O_GenStreet_01", + "A_M_O_KTown_01", + "A_M_O_Salton_01", + "A_M_O_SouCent_01", + "A_M_O_SouCent_02", + "A_M_O_SouCent_03", + "A_M_O_Tramp_01", + "A_M_Y_ACult_01", + "A_M_Y_ACult_02", + "A_M_Y_Beach_01", + "A_M_Y_Beach_02", + "A_M_Y_Beach_03", + "A_M_Y_BeachVesp_01", + "A_M_Y_BeachVesp_02", + "A_M_Y_BevHills_01", + "A_M_Y_BevHills_02", + "A_M_Y_BreakDance_01", + "A_M_Y_BusiCas_01", + "A_M_Y_Business_01", + "A_M_Y_Business_02", + "A_M_Y_Business_03", + "A_M_Y_Cyclist_01", + "A_M_Y_DesRebel_01", + "A_M_Y_DesStreet_01", + "A_M_Y_DHill_01", + "A_M_Y_Downtown_01", + "A_M_Y_EastSA_01", + "A_M_Y_EastSA_02", + "A_M_Y_Epsilon_01", + "A_M_Y_Epsilon_02", + "A_M_Y_Gay_01", + "A_M_Y_Gay_02", + "A_M_Y_GenStreet_01", + "A_M_Y_GenStreet_02", + "A_M_Y_Golfer_01", + "A_M_Y_HasJew_01", + "A_M_Y_Hiker_01", + "A_M_Y_Hippy_01", + "A_M_Y_Hipster_01", + "A_M_Y_Hipster_02", + "A_M_Y_Hipster_03", + "A_M_Y_Indian_01", + "A_M_Y_Jetski_01", + "A_M_Y_Juggalo_01", + "A_M_Y_KTown_01", + "A_M_Y_KTown_02", + "A_M_Y_Latino_01", + "A_M_Y_MethHead_01", + "A_M_Y_MexThug_01", + "A_M_Y_MotoX_01", + "A_M_Y_MotoX_02", + "A_M_Y_MusclBeac_01", + "A_M_Y_MusclBeac_02", + "A_M_Y_olynesian_01", + "A_M_Y_RoadCyc_01", + "A_M_Y_Runner_01", + "A_M_Y_Runner_02", + "A_M_Y_Salton_01", + "A_M_Y_Skater_01", + "A_M_Y_Skater_02", + "A_M_Y_SouCent_01", + "A_M_Y_SouCent_02", + "A_M_Y_SouCent_03", + "A_M_Y_SouCent_04", + "A_M_Y_StBla_01", + "A_M_Y_StBla_02", + "A_M_Y_StLat_01", + "A_M_Y_StWhi_01", + "A_M_Y_StWhi_02", + "A_M_Y_Sunbathe_01", + "A_M_Y_Surfer_01", + "A_M_Y_VinDouche_01", + "A_M_Y_Vinewood_01", + "A_M_Y_Vinewood_02", + "A_M_Y_Vinewood_03", + "A_M_Y_Vinewood_04", + "A_M_Y_Yoga_01", + "comp_eds_helmets_moped", + "comp_eds_helmets_motox", + "comp_eds_helmets_shorty", + "comp_eds_helmets_sports", + "comp_eds_marine", + "CS_AmandaTownley", + "CS_Andreas", + "CS_ashley", + "CS_Bankman", + "CS_Barry", + "CS_Beverly", + "CS_Brad", + "CS_BradCadaver", + "CS_Carbuyer", + "CS_Casey", + "CS_ChengSr", + "CS_ChrisFormage", + "CS_Clay", + "CS_Dale", + "CS_DaveNorton", + "CS_debra", + "CS_denise", + "CS_Devin", + "CS_Dom", + "CS_Dreyfuss", + "CS_DrFriedlander", + "CS_Fabien", + "CS_fabien", + "CS_FBISuit_01", + "CS_Floyd", + "CS_Guadalope", + "CS_gurk", + "CS_Hunter", + "CS_Janet", + "CS_JewelAss", + "CS_JimmyBoston", + "CS_JimmyDiSanto", + "CS_JoeMinuteMan", + "CS_JohnnyKlebitz", + "CS_Josef", + "CS_Josh", + "CS_LamarDavis", + "CS_Lazlow", + "CS_LesterCrest", + "CS_LifeInvad_01", + "CS_Magenta", + "CS_Manuel", + "CS_Marnie", + "CS_MartinMadrazo", + "CS_MaryAnn", + "CS_Michelle", + "CS_Milton", + "CS_Molly", + "CS_MovPremF_01", + "CS_MovPremMale", + "CS_MRK", + "CS_MRS_Thornhill", + "CS_MrsPhillips", + "CS_Natalia", + "CS_NervousRon", + "CS_Nigel", + "CS_Old_Man1A", + "CS_Old_Man2", + "CS_Omega", + "CS_Orleans", + "CS_aper", + "CS_atricia", + "CS_riest", + "CS_rolSec_02", + "CS_RussianDrunk", + "CS_SiemonYetarian", + "CS_Solomon", + "CS_SteveHains", + "CS_Stretch", + "CS_Tanisha", + "CS_TaoCheng", + "CS_TaosTranslator", + "CS_TennisCoach", + "CS_Terry", + "CS_Tom", + "CS_TomEpsilon", + "CS_TracyDiSanto", + "CS_Wade", + "CS_Zimbor", + "CSB_Abigail", + "CSB_Anita", + "CSB_Anton", + "CSB_BallasOG", + "CSB_Bride", + "CSB_BurgerDrug", + "CSB_Car3guy1", + "CSB_Car3guy2", + "CSB_Chef", + "CSB_Chin_goon", + "CSB_Cletus", + "CSB_Cop", + "CSB_Customer", + "CSB_Denise_friend", + "CSB_FOS_rep", + "CSB_G", + "CSB_Groom", + "CSB_Grove_str_dlr", + "CSB_Hao", + "CSB_Hugh", + "CSB_Imran", + "CSB_Janitor", + "CSB_Maude", + "CSB_MWeather", + "CSB_Ortega", + "CSB_Oscar", + "CSB_ornDudes", + "CSB_rologueDriver", + "CSB_rolSec", + "CSB_Ramp_Gang", + "CSB_Ramp_hic", + "CSB_Ramp_hipster", + "CSB_Ramp_Marine", + "CSB_Ramp_Mex", + "CSB_Reporter", + "CSB_RoccoPelosi", + "CSB_Screen_Writer", + "CSB_Stripper_01", + "CSB_Stripper_02", + "CSB_Tonya", + "CSB_TrafficWarden", + "G_F_Y_ballas_01", + "G_F_Y_Families_01", + "G_F_Y_Lost_01", + "G_F_Y_Vagos_01", + "G_M_M_AlpHench_01", + "G_M_M_AlpHench_02", + "G_M_M_ArmBoss_01", + "G_M_M_ArmGoon_01", + "G_M_M_ArmLieut_01", + "G_M_M_ChemWork_01", + "G_M_M_ChiBoss_01", + "G_M_M_ChiCold_01", + "G_M_M_ChiGoon_01", + "G_M_M_ChiGoon_02", + "G_M_M_KorBoss_01", + "G_M_M_MexBoss_01", + "G_M_M_MexBoss_02", + "G_M_O_DesOfficer", + "G_M_Y_AlpHeli_01", + "G_M_Y_ArmGoon_02", + "G_M_Y_Azteca_01", + "G_M_Y_BallaEast_01", + "G_M_Y_BallaOrig_01", + "G_M_Y_BallaSout_01", + "G_M_Y_Black01", + "G_M_Y_Const_01", + "G_M_Y_DesArmy_01", + "G_M_Y_DesArmy_02", + "G_M_Y_DesArmy_05", + "G_M_Y_DesHench_02", + "G_M_Y_DesHench_03", + "G_M_Y_DesMilit_03", + "G_M_Y_FamCA_01", + "G_M_Y_FamDNF_01", + "G_M_Y_FamFor_01", + "G_M_Y_Famfor_01", + "G_M_Y_Korean_01", + "G_M_Y_Korean_02", + "G_M_Y_KorLieut_01", + "G_M_Y_Latino01", + "G_M_Y_Lost_01", + "G_M_Y_Lost_02", + "G_M_Y_Lost_03", + "G_M_Y_MexGang_01", + "G_M_Y_MexGoon_01", + "G_M_Y_MexGoon_02", + "G_M_Y_MexGoon_03", + "G_M_Y_oloGoon_01", + "G_M_Y_oloGoon_02", + "G_M_Y_SalvaBoss_01", + "G_M_Y_SalvaGoon_01", + "G_M_Y_SalvaGoon_02", + "G_M_Y_SalvaGoon_03", + "G_M_Y_SciHench_01", + "G_M_Y_ScuHench_02", + "G_M_Y_SpaceHench_01", + "G_M_Y_SPACHENCH_02", + "G_M_Y_StrPunk_01", + "G_M_Y_StrPunk_02", + "G_M_Y_SubHench_01", + "G_M_Y_White01", + "HC_Driver", + "HC_Gunman", + "HC_Hacker", + "IG_Abigail", + "IG_AmandaTownley", + "IG_Andreas", + "IG_Ashley", + "IG_BallasOG", + "IG_Bankman", + "IG_Barry", + "IG_BestMen", + "IG_Beverly", + "IG_Brad", + "IG_Bride", + "IG_Car3guy1", + "IG_Car3guy2", + "IG_Casey", + "IG_Chef", + "IG_ChengSr", + "IG_ChrisFormage", + "IG_Clay", + "IG_ClayPain", + "IG_Cletus", + "IG_Dale", + "IG_DaveNorton", + "IG_Denise", + "IG_Devin", + "IG_Dom", + "IG_Dreyfuss", + "IG_DrFriedlander", + "IG_Fabien", + "IG_FBISuit_01", + "IG_Floyd", + "IG_Groom", + "IG_Hao", + "IG_Hunter", + "IG_Janet", + "IG_JAY_Norris", + "IG_JewelAss", + "IG_JimmyBoston", + "IG_JimmyDiSanto", + "IG_JoeMinuteMan", + "IG_JohnnyKlebitz", + "IG_Josef", + "IG_Josh", + "IG_KerryMcIntosh", + "IG_LamarDavis", + "IG_Lazlow", + "IG_LesterCrest", + "IG_LifeInvad_01", + "IG_LifeInvad_02", + "IG_Magenta", + "IG_Manuel", + "IG_Marnie", + "IG_MaryAnn", + "IG_Maude", + "IG_Michelle", + "IG_Milton", + "IG_Molly", + "IG_MRK", + "IG_MRS_Thornhill", + "IG_MrsPhillips", + "IG_Natalia", + "IG_NervousRon", + "IG_Nigel", + "IG_Old_Man1A", + "IG_Old_Man2", + "IG_Omega", + "IG_ONeil", + "IG_Orleans", + "IG_Ortega", + "IG_aper", + "IG_atricia", + "IG_riest", + "IG_rolSec_02", + "IG_Ramp_Gang", + "IG_Ramp_Hic", + "IG_Ramp_Hipster", + "IG_Ramp_Mex", + "IG_RoccoPelosi", + "IG_RussianDrunk", + "IG_Screen_Writer", + "IG_SiemonYetarian", + "IG_Solomon", + "IG_SteveHains", + "IG_Stretch", + "IG_Talina", + "IG_Tanisha", + "IG_TaoCheng", + "IG_TaosTranslator", + "IG_TennisCoach", + "IG_Terry", + "IG_TomEpsilon", + "IG_Tonya", + "IG_TracyDiSanto", + "IG_TrafficWarden", + "IG_TylerDix", + "IG_Wade", + "IG_Zimbor", + "MP_F_Cop_01", + "MP_F_DeadHooker", + "MP_F_Freemode_01", + "MP_F_Misty_01", + "MP_F_StripperLite", + "MP_G_F_Mexican_01", + "MP_G_F_Vagos_01", + "MP_G_M_Black_01", + "MP_G_M_Mexican_01", + "MP_G_M_ros_01", + "MP_G_M_Vagos_01", + "MP_HeadTargets", + "MP_M_Claude_01", + "MP_M_Cop_01", + "MP_M_ExArmy_01", + "MP_M_FamDD_01", + "MP_M_FIBSec_01", + "MP_M_Freemode_01", + "MP_M_Marston_01", + "MP_M_Niko_01", + "MP_M_ShopKeep_01", + "MP_S_M_Armoured_01", + "player", + "Player_One", + "Player_Two", + "Player_Zero", + "S_F_M_Fembarber", + "S_F_M_Maid_01", + "S_F_M_MAID_02", + "S_F_M_Shop_HIGH", + "S_F_M_SweatShop_01", + "S_F_Y_AirHostess_01", + "S_F_Y_Bartender_01", + "S_F_Y_Baywatch_01", + "S_F_Y_Cop_01", + "S_F_Y_Factory_01", + "S_F_Y_Hooker_01", + "S_F_Y_Hooker_02", + "S_F_Y_Hooker_03", + "S_F_Y_Migrant_01", + "S_F_Y_MovPrem_01", + "S_F_Y_Ranger_01", + "S_F_Y_Scrubs_01", + "S_F_Y_Sheriff_01", + "S_F_Y_Shop_LOW", + "S_F_Y_Shop_MID", + "S_F_Y_Snowcop_01", + "S_F_Y_Stripper_01", + "S_F_Y_Stripper_02", + "S_F_Y_StripperLite", + "S_F_Y_SweatShop_01", + "S_M_M_Alpstall", + "S_M_M_AmmuCountry", + "S_M_M_Armoured_01", + "S_M_M_Armoured_02", + "S_M_M_AutoShop_01", + "S_M_M_AutoShop_02", + "S_M_M_Bouncer_01", + "S_M_M_ChemSec_01", + "S_M_M_CIASec_01", + "S_M_M_CntryBar_01", + "S_M_M_DockWork_01", + "S_M_M_Doctor_01", + "S_M_M_FIBOffice_01", + "S_M_M_FIBOffice_02", + "S_M_M_Gaffer_01", + "S_M_M_Gardener_01", + "S_M_M_GenTransport", + "S_M_M_HairDress_01", + "S_M_M_HighSec_01", + "S_M_M_HighSec_02", + "S_M_M_INTWork", + "S_M_M_Janitor", + "S_M_M_LatHandy_01", + "S_M_M_LifeInvad_01", + "S_M_M_Linecook", + "S_M_M_LSMetro_01", + "S_M_M_Mariachi_01", + "S_M_M_Marine_01", + "S_M_M_Marine_02", + "S_M_M_Migrant_01", + "S_M_M_MovAlien_01", + "S_M_M_MovPrem_01", + "S_M_M_MovSpace_01", + "S_M_M_aramedic_01", + "S_M_M_ilot_01", + "S_M_M_ilot_02", + "S_M_M_ostal_01", + "S_M_M_ostal_02", + "S_M_M_risGuard_01", + "S_M_M_Scientist_01", + "S_M_M_Security_01", + "S_M_M_SnowCop_01", + "S_M_M_StrPerf_01", + "S_M_M_StrPreach_01", + "S_M_M_StrVend_01", + "S_M_M_Trucker_01", + "S_M_M_UPS_01", + "S_M_M_UPS_02", + "S_M_O_Busker_01", + "S_M_O_Snowcop_01", + "S_M_Y_AirWorker", + "S_M_Y_AmmuCity_01", + "S_M_Y_ArmyMech_01", + "S_M_Y_Autopsy_01", + "S_M_Y_Barman_01", + "S_M_Y_BayWatch_01", + "S_M_Y_BlackOps_01", + "S_M_Y_BlackOps_02", + "S_M_Y_BusBoy_01", + "S_M_Y_Chef_01", + "S_M_Y_Clown_01", + "S_M_Y_Construct_01", + "S_M_Y_Construct_02", + "S_M_Y_Cop_01", + "S_M_Y_Dealer_01", + "S_M_Y_DevinSec_01", + "S_M_Y_DockWork_01", + "S_M_Y_Doorman_01", + "S_M_Y_DWService_01", + "S_M_Y_DWService_02", + "S_M_Y_Factory_01", + "S_M_Y_Fireman_01", + "S_M_Y_Garbage", + "S_M_Y_Grip_01", + "S_M_Y_HwayCop_01", + "S_M_Y_Marine_01", + "S_M_Y_Marine_02", + "S_M_Y_Marine_03", + "S_M_Y_Mime", + "S_M_Y_estCont_01", + "S_M_Y_ilot_01", + "S_M_Y_risMuscl_01", + "S_M_Y_risoner_01", + "S_M_Y_Ranger_01", + "S_M_Y_Robber_01", + "S_M_Y_Scrubs_01", + "S_M_Y_Sheriff_01", + "S_M_Y_Shop_MASK", + "S_M_Y_StrVend_01", + "S_M_Y_Swat_01", + "S_M_Y_USCG_01", + "S_M_Y_Valet_01", + "S_M_Y_Waiter_01", + "S_M_Y_WinClean_01", + "S_M_Y_XMech_01", + "S_M_Y_XMech_02", + "slod_human", + "slod_large_quadped", + "slod_small_quadped", + "strm_eds_mpShare", + "strm_eds_mpTattRTs", + "U_F_M_Corpse_01", + "U_F_M_Miranda", + "U_F_M_roMourn_01", + "U_F_O_MovieStar", + "U_F_O_rolHost_01", + "U_F_Y_BikerChic", + "U_F_Y_COMJane", + "U_F_Y_corpse_01", + "U_F_Y_corpse_02", + "U_F_Y_HotPosh_01", + "U_F_Y_JewelAss_01", + "U_F_Y_Mistress", + "U_F_Y_oppyMich", + "U_F_Y_rincess", + "U_F_Y_SpyActress", + "U_M_M_Aldinapoli", + "U_M_M_BankMan", + "U_M_M_BikeHire_01", + "U_M_M_FIBArchitect", + "U_M_M_FilmDirector", + "U_M_M_GlenStank_01", + "U_M_M_Griff_01", + "U_M_M_Jesus_01", + "U_M_M_JewelSec_01", + "U_M_M_JewelThief", + "U_M_M_MarkFost", + "U_M_M_artyTarget", + "U_M_M_rolSec_01", + "U_M_M_roMourn_01", + "U_M_M_RivalPap", + "U_M_M_SpyActor", + "U_M_M_WillyFist", + "U_M_O_FinGuru_01", + "U_M_O_TapHillBilly", + "U_M_O_Tramp_01", + "U_M_Y_Abner", + "U_M_Y_AntonB", + "U_M_Y_BabyD", + "U_M_Y_Baygor", + "U_M_Y_BurgerDrug_01", + "U_M_Y_Chip", + "U_M_Y_Cyclist_01", + "U_M_Y_FIBMugger_01", + "U_M_Y_Guido_01", + "U_M_Y_GunVend_01", + "U_M_Y_Hippie_01", + "U_M_Y_ImpoRage", + "U_M_Y_Justin", + "U_M_Y_Mani", + "U_M_Y_MilitaryBum", + "U_M_Y_aparazzi", + "U_M_Y_arty_01", + "U_M_Y_ogo_01", + "U_M_Y_risoner_01", + "U_M_Y_rolDriver_01", + "U_M_Y_RSRanger_01", + "U_M_Y_SBike", + "U_M_Y_StagGrm_01", + "U_M_Y_Tattoo_01", + "U_M_Y_Zombie_01" + ], + defaultModel: 'mp_m_freemode_01' +} \ No newline at end of file diff --git a/server/index.mjs b/server/index.mjs new file mode 100644 index 0000000..1f313e0 --- /dev/null +++ b/server/index.mjs @@ -0,0 +1,20 @@ +/* + Events +*/ + +import './modules/events/events.mjs' + + +/* + Commands +*/ + +import './modules/commands/admin.mjs' +import './modules/commands/player.mjs' + +/* + Default text labels +*/ + +import './modules/defaultLabels.mjs' + diff --git a/server/modules/commands/admin.mjs b/server/modules/commands/admin.mjs new file mode 100644 index 0000000..ba2e3b3 --- /dev/null +++ b/server/modules/commands/admin.mjs @@ -0,0 +1,41 @@ +import * as alt from 'alt-server' +import * as chat from 'chat' +import config from '../../config.mjs' +import { isPlayerAdmin } from '../helpers/helpers.mjs' + +chat.registerCmd('pos', player => { + if (!isPlayerAdmin(player)) return chat.send(player, `{EE9A00}[SERVER]: {FF0000}Вам недоступна эта команда!`) + + chat.send(player, `X: ${player.pos.x}, Y: ${player.pos.y}, Z: ${player.pos.z}`) +}) + +chat.registerCmd('kill', (player, args) => { + if (!isPlayerAdmin(player)) return chat.send(player, `{EE9A00}[SERVER]: {FF0000}Вам недоступна эта команда!`) + + if (!args || !args[0] || isNaN(args[0])) { + return chat.send(player, `{EE9A00}[SERVER]: {FFF}/kill [id игрока]`); + } + + const target = alt.Player.getByID(parseInt(args[0])) + + if (target === null) { + return chat.send(player, `{EE9A00}[SERVER]: {FFF}Игрок с ID - ${args[0]} не найден`); + } + + target.health = 0 +}) + +chat.registerCmd('car', (player, args) => { + if (!isPlayerAdmin(player)) return chat.send(player, `{EE9A00}[SERVER]: {FF0000}Вам недоступна эта команда!`) + + if (!args || !args[0]) { + return chat.send(player, `{EE9A00}[SERVER]: {FFF}/car [reference машины]`); + } + + try { + const newVehicle = new alt.Vehicle(args[0], player.pos.x, player.pos.y, player.pos.z, 0, 0, 0) + alt.emitClient(player, 'vehicle:setInto', newVehicle) + } catch (error) { + chat.send(player, `{EE9A00}[SERVER]: {FF0000}Машины "${args[0]}" не существует!`) + } +}) \ No newline at end of file diff --git a/server/modules/commands/player.mjs b/server/modules/commands/player.mjs new file mode 100644 index 0000000..6209b41 --- /dev/null +++ b/server/modules/commands/player.mjs @@ -0,0 +1,16 @@ +import * as alt from 'alt-server' +import * as chat from 'chat' +import config from '../../config.mjs' + + +chat.registerCmd('spawn', (player, args) => { + player.pos = config.spawn +}) + +chat.registerCmd('online', (player, args) => { + return chat.send(player, `{EE9A00}[SERVER]: {FFF}Онлайн сейчас: {3232FF}${alt.Player.all.length}`) +}) + +chat.registerCmd('scid', (player, args) => { + return chat.send(player, `{EE9A00}[SERVER]: {FFF}SCID: ${player.socialId}`) +}) \ No newline at end of file diff --git a/server/modules/defaultLabels.mjs b/server/modules/defaultLabels.mjs new file mode 100644 index 0000000..e91d914 --- /dev/null +++ b/server/modules/defaultLabels.mjs @@ -0,0 +1,15 @@ +import * as alt from 'alt-server' + +alt.emit( + 'textLabel:Create', + 'label:help', + 'F1 - помощь по игре', + { x: -424.089, y: 1129.252, z: 325.853 }, + 15, + 4, + 0.5, + 255, + 255, + 255, + 1000 +) \ No newline at end of file diff --git a/server/modules/events/events.mjs b/server/modules/events/events.mjs new file mode 100644 index 0000000..bdacb8d --- /dev/null +++ b/server/modules/events/events.mjs @@ -0,0 +1,19 @@ +import * as alt from 'alt-server' +import chat from 'chat' +import config from '../../config.mjs' + +alt.on('playerConnect', (player) => { + chat.broadcast(`{EE9A00}[SERVER]: {FFF}${player.name} присоеденился к серверу`) + alt.emitClient(player, 'onConnect') +}) + +alt.on('playerDeath', (player) => { + alt.setTimeout(() => { + player.spawn(config.spawn.x, config.spawn.y,config.spawn.z) + }, 3000); +}) + +alt.onClient('spawnPlayer', (player) => { + player.model = config.skins[Math.floor(Math.random() * (config.skins.length - 1 - 0) + 0)] + player.spawn(config.spawn.x, config.spawn.y,config.spawn.z) +}) diff --git a/server/modules/helpers/helpers.mjs b/server/modules/helpers/helpers.mjs new file mode 100644 index 0000000..02a2430 --- /dev/null +++ b/server/modules/helpers/helpers.mjs @@ -0,0 +1,9 @@ +import config from '../../config.mjs' + +const isPlayerAdmin = player => config.admins.find(admin => player.socialId === admin.socialId) + ? true + : false + +export { + isPlayerAdmin +} \ No newline at end of file