Jump to content

isa_Khamdan

Members
  • Posts

    484
  • Joined

  • Last visited

Everything posted by isa_Khamdan

  1. The objects have been removed but some black things showing in their place?
  2. I Want to delete some objects in some locations I used this code but it didn't work? addEventHandler ( "onClientResourceStart", resourceRoot, function () removeWorldModel(791,63.015308380127,-2820,-1339.0625,121.99219) -- removeWorldModel(791,63.015308380127,-2833.625,-1444.86719,134.82813) -- removeWorldModel(791,63.015308380127,-2867.52344,-1515.83594,134.30469) -- 785 removeWorldModel(791,63.015308380127,-2796.0625,-1582.76562,139.125) -- end
  3. in the cut scene I see moving peds doing stuffs like driving vehicles .. etc so how can I do this too?
  4. I saw cut senses playing on player login in some servers so can anyone tell me how to do that?
  5. there still one problem when I type the command again it don't stop changing the colors?
  6. Thanks a lot it works like a charm now
  7. Thank you but it will set the timer anytime you get into the vehicle even if you didn't use the command before to start it I want it that if you use the command it will start and if you exit the Vehicle it will stop and when you enter and the command was already used it will start the timer again and that's the whole code local theSerial = "0396C6F543425FFE37A326883D73B4F4" local vehicleTimer = {} addCommandHandler("colors", function(thePlayer, command) if ( getPlayerSerial ( thePlayer ) == theSerial ) then local v = getPedOccupiedVehicle ( thePlayer ); if ( v ) then if ( isTimer ( vehicleTimer[thePlayer] ) ) then killTimer ( vehicleTimer[thePlayer] ); return; end vehicleTimer[thePlayer] = setTimer ( randomVehColors, 2000, 0, thePlayer ); end end end ); addEventHandler("onVehicleEnter", getRootElement(), function ( thePlayer ) if ( getPlayerSerial ( thePlayer ) == theSerial ) then local v = getPedOccupiedVehicle ( thePlayer ); if ( v ) then vehicleTimer[thePlayer] = setTimer ( randomVehColors, 2000, 0, thePlayer ); end end end ); addEventHandler( "onVehicleStartExit", root, function ( thePlayer ) if ( isTimer ( vehicleTimer[thePlayer] ) ) then killTimer ( vehicleTimer[thePlayer] ); end end ); local color = {} function randomVehColors ( thePlayer ) local car = getPedOccupiedVehicle( thePlayer ) if not ( car ) then if ( isTimer ( vehicleTimer[thePlayer] ) ) then killTimer ( vehicleTimer[thePlayer] ); end return; end if ( isVehicleDamageProof( car ) == true ) then color[1] = math.random(0,126) ; color[2] = math.random(0,126); color[3] = math.random(0,126); color[4] = math.random(0,126) ; setVehicleColor ( car, color[1], color[2], color[3], color[4] ) end end
  8. It doesn't work? Error Bad argument in getPlayerSerial
  9. Hmm can you fix this for me so I can add it to the rest of the code? addEventHandler("onVehicleEnter", getRootElement(), start); if ( getPlayerSerial ( thePlayer ) == theSerial ) then local v = getPedOccupiedVehicle ( thePlayer ); if ( v ) then vehicleTimer[thePlayer] = setTimer ( randomVehColors, 2000, 0, thePlayer ); end end
  10. Can you explain to me what will this do exactly?
  11. I don't know exactly what was causing that problem, I just edited it to fix some things. What's wrong with using killTimer? If you want to start the timer again just use setTimer. I don't want to kill the timer I want to stop it and when you enter the vehicle again it will be resumed , if I set it to kill the timer on exit and set new timer on enter the random colors will be activated without using the command or I am wrong?
  12. Thank a lot it works great but can you tell me what was the problem so I can avoid it next time? Edit : else is it possible to stop the timer when you leave the vehicle instead of destroying it?
  13. try this Client side -- FILE: mapEditorScriptingExtension_c.lua -- PURPOSE: Prevent the map editor feature set being limited by what MTA can load from a map file by adding a script file to maps -- VERSION: RemoveWorldObjects (v1) AutoLOD (v1) function requestLODsClient() triggerServerEvent("requestLODsClient", resourceRoot) end addEvent("requestLODsClient",true) addEventHandler("onClientResourceStart", resourceRoot, requestLODsClient) function setLODsClient(lodTbl) for i, model in ipairs(lodTbl) do engineSetModelLODDistance(model, 300) end end addEvent("setLODsClient", true) addEventHandler("setLODsClient", resourceRoot, setLODsClient) function applyBreakableState() for k, obj in pairs(getElementsByType("object", resourceRoot)) do local breakable = getElementData(obj, "breakable") if breakable then setObjectBreakable(obj, breakable == "true") end end end addEventHandler("onClientResourceStart", resourceRoot, applyBreakableState) --Server side -- FILE: mapEditorScriptingExtension_s.lua -- PURPOSE: Prevent the map editor feature set being limited by what MTA can load from a map file by adding a script file to maps -- VERSION: RemoveWorldObjects (v1) AutoLOD (v1) local usedLODModels = {} function onResourceStartOrStop ( ) for _, object in ipairs ( getElementsByType ( "removeWorldObject", source ) ) do local model = getElementData ( object, "model" ) local lodModel = getElementData ( object, "lodModel" ) local posX = getElementData ( object, "posX" ) local posY = getElementData ( object, "posY" ) local posZ = getElementData ( object, "posZ" ) local interior = getElementData ( object, "interior" ) local radius = getElementData ( object, "radius" ) if ( eventName == "onResourceStart" ) then removeWorldModel ( model, radius, posX, posY, posZ, interior ) removeWorldModel ( lodModel, radius, posX, posY, posZ, interior ) else restoreWorldModel ( model, radius, posX, posY, posZ, interior ) restoreWorldModel ( lodModel, radius, posX, posY, posZ, interior ) end end if (eventName == "onResourceStart" and get(getResourceName(getThisResource())..".useLODs")) then for i, object in ipairs(getElementsByType("object", source)) do local objID = getElementModel(object) local lodModel = LOD_MAP[objID] if (lodModel) then local lodObj = cloneElement(object) local setm = setElementModel(lodObj, lodModel) setElementParent(lodObj, object) setLowLODElement(object, lodObj) table.insert(usedLODModels, lodModel) end end end end addEventHandler ( "onResourceStart", resourceRoot, onResourceStartOrStop ) addEventHandler ( "onResourceStop", resourceRoot, onResourceStartOrStop ) function requestLODsClient () triggerClientEvent(client, "setLODsClient", resourceRoot, usedLODModels) end addEvent("requestLODsClient", true) addEventHandler("requestLODsClient", resourceRoot, requestLODsClient) -- MTA LOD Table [object] = [lodmodel] LOD_MAP = { [17697] = 17768; [8476] = 8905; [9476] = 9263; [4339] = 4472; [8654] = 8751; [7465] = 7795; [8465] = 8744; [11114] = 11052; [13872] = 13884; [6999] = 7120; [7999] = 8098; [6959] = 7343; [9733] = 9644; [10927] = 11356; [10759] = 10804; [8445] = 8478; [7445] = 7761; [10928] = 11065; [9266] = 9475; [13676] = 13870; [8554] = 8804; [5745] = 5827; [10855] = 11187; [4813] = 4903; [8439] = 8910; [7439] = 7757; [7043] = 7059; [8043] = 8111; [9043] = 9134; [10384] = 10548; [9745] = 9873; [4833] = 4943; [6979] = 7006; [13692] = 13766; [7454] = 7784; [8454] = 8599; [11132] = 11208; [10843] = 10892; [8513] = 8820; [13732] = 13770; [9139] = 9145; [10903] = 10907; [5759] = 5917; [8343] = 8363; [10948] = 11021; [4303] = 4437; [9215] = 9460; [8533] = 8817; [17671] = 17788; [9303] = 9372; [4533] = 4532; [8625] = 8794; [4244] = 4379; [9613] = 9875; [13739] = 13772; [5145] = 5235; [10793] = 11330; [9899] = 9635; [4315] = 4449; [7315] = 7316; [6315] = 6424; [9315] = 9375; [10833] = 10896; [4243] = 4378; [7633] = 7764; [8633] = 8802; [8244] = 8024; [13715] = 13782; [8525] = 8902; [5166] = 5336; [4344] = 4477; [10823] = 11248; [4335] = 4468; [10559] = 10724; [9065] = 9068; [5123] = 5213; [9705] = 9772; [5028] = 5029; [9028] = 9179; [10763] = 10884; [7045] = 7063; [8045] = 8011; [4165] = 4166; [8512] = 8759; [8344] = 8364; [8543] = 8604; [9039] = 9040; [6879] = 6891; [4879] = 4921; [4345] = 4478; [9223] = 9406; [10939] = 11370; [8868] = 9085; [10758] = 10923; [4868] = 5045; [9345] = 9377; [11255] = 11262; [8212] = 8220; [6065] = 6082; [7443] = 7859; [8443] = 8914; [13672] = 13832; [13741] = 13765; [10870] = 11204; [4366] = 4496; [4245] = 4380; [9579] = 9626; [8611] = 8917; [8245] = 8025; [10861] = 11169; [10352] = 10715; [4365] = 4529; [9743] = 9872; [9066] = 9067; [13784] = 13836; [5679] = 5680; [11254] = 11268; [9235] = 9450; [5805] = 5912; [9711] = 9774; [13752] = 13876; [8627] = 8968; [11120] = 11196; [9026] = 9178; [9232] = 9359; [10018] = 10170; [10601] = 10730; [10795] = 11329; [7368] = 7376; [8368] = 8367; [10983] = 11143; [10752] = 11355; [13726] = 13786; [13730] = 13844; [13801] = 13880; [7320] = 7322; [4320] = 4454; [5021] = 5022; [9021] = 9181; [4286] = 4420; [5109] = 5193; [8468] = 8972; [4299] = 4433; [9286] = 9464; [9299] = 9374; [8501] = 9075; [10817] = 10877; [6501] = 6504; [10959] = 10963; [10905] = 10908; [7420] = 7812; [8420] = 9063; [7321] = 7323; [4321] = 4455; [11299] = 11298; [4847] = 4933; [10492] = 10729; [4295] = 4429; [11332] = 11333; [9928] = 10002; [9001] = 9010; [5034] = 5035; [8034] = 8126; [17524] = 17730; [6488] = 6492; [8520] = 8829; [9488] = 9780; [10932] = 11217; [7947] = 7948; [11130] = 11207; [4268] = 4402; [7099] = 7112; [7459] = 7789; [8459] = 8767; [11337] = 11358; [4267] = 4401; [11256] = 11264; [9267] = 9477; [13707] = 13839; [8588] = 8786; [11098] = 11177; [7559] = 7743; [10753] = 11206; [10867] = 11185; [4367] = 4497; [7367] = 7372; [8288] = 8289; [11303] = 11304; [17606] = 17718; [10941] = 11167; [13795] = 13796; [4828] = 4942; [4259] = 4393; [11006] = 11151; [7101] = 7142; [9006] = 9015; [17535] = 17970; [7388] = 7285; [7539] = 7959; [8539] = 8790; [13820] = 13822; [6913] = 7178; [9487] = 9640; [11126] = 11212; [11125] = 10802; [6888] = 7138; [10864] = 11407; [5859] = 5903; [8587] = 8788; [9587] = 9621; [8628] = 8799; [11121] = 11068; [11138] = 11198; [8859] = 8861; [9616] = 9887; [8616] = 8974; [13718] = 13888; [7992] = 8022; [13826] = 13830; [9137] = 9143; [4822] = 4980; [8137] = 8197; [5137] = 5195; [6948] = 7005; [5472] = 5564; [8377] = 8021; [7636] = 7724; [10966] = 11050; [8472] = 8912; [9690] = 9686; [9919] = 9937; [13810] = 13812; [7417] = 7726; [4294] = 4428; [4851] = 4902; [10489] = 10602; [9256] = 9393; [5871] = 5970; [13736] = 13778; [8256] = 8257; [4831] = 4950; [9597] = 9844; [4256] = 4390; [7536] = 7821; [6951] = 7002; [6991] = 7176; [10936] = 11158; [7991] = 8088; [3992] = 4037; [4991] = 5012; [3991] = 4043; [5752] = 5833; [13678] = 13853; [9571] = 9650; [13716] = 13833; [7730] = 7780; [5748] = 5907; [9730] = 9792; [17686] = 17914; [7604] = 7808; [13733] = 13780; [13682] = 13868; [9836] = 9841; [9490] = 9809; [8490] = 8703; [8217] = 8223; [9719] = 9779; [9217] = 9449; [6217] = 6086; [10766] = 10880; [9716] = 9773; [5504] = 5548; [4363] = 4494; [9037] = 9038; [8037] = 8103; [10904] = 10906; [8677] = 8752; [10408] = 10689; [9351] = 9421; [13813] = 13815; [13717] = 13785; [8351] = 8347; [7557] = 7816; [7602] = 7810; [7317] = 7318; [4351] = 4483; [6952] = 7003; [4317] = 4451; [7263] = 7279; [13680] = 13869; [8352] = 8359; [4263] = 4397; [10930] = 11054; [4331] = 4465; [4872] = 4924; [8521] = 8830; [9216] = 9457; [11351] = 11222; [11288] = 10895; [6324] = 6380; [4897] = 4905; [6897] = 6902; [8451] = 8973; [7451] = 7815; [4884] = 5054; [6884] = 6896; [6236] = 6240; [9236] = 9402; [4324] = 4458; [9304] = 9376; [13723] = 13819; [7470] = 7799; [8630] = 8798; [7452] = 7794; [8452] = 8606; [8421] = 8692; [7421] = 7809; [8380] = 8381; [10940] = 11191; [13742] = 13764; [11363] = 11398; [7591] = 7830; [9224] = 9394; [9551] = 9883; [9083] = 9084; [7997] = 8362; [4352] = 4484; [17597] = 17837; [10362] = 10325; [11113] = 11197; [5117] = 5194; [9136] = 9142; [9330] = 9432; [4330] = 4464; [9552] = 9884; [8552] = 8763; [8531] = 8775; [7337] = 7338; [4664] = 4665; [9337] = 9433; [5156] = 5162; [4156] = 4157; [4337] = 4470; [10363] = 10326; [7651] = 7699; [4890] = 4946; [8857] = 8862; [9617] = 9888; [17683] = 17720; [9492] = 9794; [13882] = 13842; [9652] = 9799; [8631] = 8800; [7631] = 7744; [13713] = 13843; [8056] = 8028; [4316] = 4375; [4296] = 4430; [10769] = 10894; [13691] = 13745; [9316] = 9428; [11104] = 11341; [7990] = 8015; [4283] = 4417; [10751] = 10798; [10934] = 11219; [4990] = 5010; [4336] = 4469; [9957] = 9972; [10151] = 10161; [6301] = 6500; [4301] = 4435; [4371] = 4501; [8148] = 8273; [5148] = 5359; [4242] = 4377; [7242] = 7140; [9022] = 9182; [9242] = 9401; [4282] = 4416; [7464] = 7782; [8040] = 8104; [7371] = 7373; [8464] = 9157; [5119] = 5245; [7450] = 7814; [8450] = 8479; [10969] = 11166; [17677] = 17908; [7484] = 7773; [11107] = 11108; [9484] = 9869; [10407] = 10688; [8091] = 8101; [13709] = 13835; [7248] = 7256; [8382] = 8384; [4585] = 4626; [4248] = 4383; [6122] = 6182; [11342] = 11344; [7963] = 7964; [4332] = 4466; [10418] = 10727; [9071] = 9073; [10819] = 10881; [7071] = 7183; [8071] = 8106; [4262] = 4396; [10294] = 10299; [4550] = 4561; [11287] = 11286; [5151] = 5241; [9585] = 9619; [6188] = 6190; [5188] = 5240; [13690] = 13773; [9219] = 9452; [8219] = 8222; [4843] = 4931; [4131] = 4132; [4885] = 5053; [7042] = 7066; [4260] = 4394; [7863] = 7876; [8240] = 8241; [10017] = 9989; [10945] = 11016; [8586] = 8789; [4863] = 4934; [10562] = 10598; [6280] = 6437; [4291] = 4425; [7251] = 7259; [7432] = 7738; [13751] = 13781; [9260] = 9380; [4297] = 4431; [9291] = 9447; [7048] = 7107; [9248] = 9408; [11077] = 11058; [4271] = 4405; [10087] = 10168; [4322] = 4456; [5160] = 5335; [9231] = 9363; [9140] = 9146; [4168] = 4169; [8446] = 8605; [9486] = 9641; [10351] = 10719; [8486] = 8749; [4280] = 4414; [8350] = 8358; [8532] = 8771; [4240] = 4450; [4350] = 4482; [9683] = 9866; [7984] = 8124; [6984] = 7282; [10957] = 11378; [11229] = 11216; [8391] = 8696; [10066] = 10090; [4845] = 4914; [11115] = 11171; [7548] = 7774; [11367] = 11368; [7864] = 7875; [6864] = 6870; [7865] = 7874; [13677] = 13867; [13710] = 13840; [8610] = 8918; [7632] = 7745; [8632] = 8801; [8850] = 8965; [8519] = 8897; [8983] = 9018; [8845] = 8848; [6983] = 7283; [7983] = 8107; [6916] = 7225; [9954] = 10106; [8079] = 8110; [4563] = 4566; [11012] = 11270; [5115] = 5252; [5002] = 4939; [9115] = 9161; [10638] = 10640; [4883] = 4929; [10491] = 10725; [6883] = 7114; [7854] = 7853; [17685] = 17742; [4854] = 5050; [4348] = 4480; [10971] = 11064; [9946] = 10257; [4810] = 4915; [4832] = 4948; [7463] = 7793; [7057] = 7126; [4319] = 4453; [7383] = 7384; [8383] = 8385; [4852] = 4918; [7485] = 7776; [11345] = 11346; [7852] = 7851; [11080] = 11178; [4846] = 4953; [7448] = 7817; [10938] = 11144; [13757] = 13881; [11137] = 11203; [7965] = 7966; [5003] = 4956; [10694] = 10728; [9584] = 9620; [8584] = 8732; [7584] = 7716; [9348] = 9429; [8824] = 8903; [8003] = 8092; [10028] = 9967; [7475] = 7804; [11252] = 11267; [8475] = 8915; [8678] = 8777; [4835] = 4941; [4349] = 4481; [11135] = 11200; [11111] = 11175; [10955] = 11397; [8523] = 8900; [10386] = 10731; [13673] = 13850; [7444] = 7873; [8444] = 8908; [9735] = 9802; [7969] = 7970; [10840] = 10912; [7449] = 7813; [8449] = 8907; [4869] = 4954; [8466] = 8745; [6869] = 6995; [5744] = 5826; [9744] = 9871; [10943] = 11142; [4275] = 4409; [9174] = 8831; [13693] = 13774; [7174] = 7366; [10083] = 10169; [6878] = 6890; [17607] = 17810; [9723] = 9781; [8149] = 8274; [13738] = 13771; [9858] = 9811; [8858] = 8864; [7433] = 7740; [11083] = 11153; [4249] = 4384; [4535] = 4536; [9901] = 9963; [11134] = 11278; [7249] = 7257; [10405] = 10687; [5801] = 5828; [4666] = 4667; [7544] = 7752; [8544] = 8739; [11117] = 11069; [8422] = 8693; [11116] = 11053; [9601] = 9807; [6989] = 6906; [4374] = 4503; [9225] = 9409; [5313] = 5316; [4313] = 4447; [9313] = 9396; [8313] = 8316; [4302] = 4436; [6054] = 6177; [7054] = 7339; [8054] = 8018; [9721] = 9638; [6233] = 6242; [4233] = 4234; [8433] = 8736; [7603] = 7807; [10917] = 10918; [3689] = 3690; [4325] = 4459; [9715] = 9776; [10942] = 11168; [8154] = 8279; [9689] = 9687; [8049] = 8026; [11127] = 11180; [5333] = 5334; [4333] = 4467; [9205] = 9358; [8133] = 8144; [13756] = 13879; [10354] = 10332; [6502] = 6506; [11343] = 11357; [9615] = 9658; [7254] = 7262; [10359] = 10692; [9276] = 9453; [4305] = 4439; [4254] = 4388; [5033] = 5055; [11123] = 11192; [10929] = 11055; [9233] = 9356; [10767] = 10879; [3489] = 3490; [11118] = 11194; [4274] = 4408; [6213] = 6206; [8213] = 8224; [9213] = 9455; [9489] = 9782; [8489] = 8700; [8515] = 8754; [4354] = 4486; [5176] = 5237; [9703] = 9785; [7967] = 7968; [9004] = 9013; [7950] = 7949; [7945] = 7946; [8004] = 8161; [5004] = 5008; [7938] = 7937; [7889] = 7890; [10365] = 10328; [7882] = 7883; [7324] = 7325; [7880] = 7887; [7868] = 7870; [7867] = 7871; [7866] = 7872; [7849] = 7850; [7011] = 7121; [10852] = 11186; [7755] = 7856; [7731] = 7781; [7729] = 7779; [7661] = 7723; [7660] = 7721; [7650] = 7700; [11283] = 11361; [7635] = 7725; [9210] = 9465; [8210] = 8272; [7634] = 7775; [7630] = 7722; [7629] = 7777; [7616] = 7728; [4310] = 4444; [7605] = 7739; [7601] = 7811; [7600] = 7806; [7593] = 7831; [7592] = 7828; [7585] = 7594; [13825] = 13829; [7579] = 7825; [7558] = 7742; [7555] = 7668; [7553] = 7824; [4289] = 4423; [7552] = 7749; [7551] = 7750; [9289] = 9454; [7550] = 7751; [4288] = 4422; [7547] = 7748; [7546] = 7732; [7545] = 7747; [17675] = 17811; [7537] = 7822; [13684] = 13776; [7486] = 7869; [10859] = 10803; [7483] = 7772; [8517] = 8898; [7482] = 7771; [7481] = 7770; [7480] = 7769; [7479] = 7768; [8039] = 8100; [8172] = 8094; [7476] = 7765; [7474] = 7803; [4247] = 4382; [7472] = 7801; [7471] = 7800; [8128] = 8129; [7468] = 7888; [6957] = 7293; [7466] = 7796; [5314] = 5315; [9064] = 9069; [7460] = 7790; [8002] = 8142; [13702] = 13885; [11258] = 11265; [9211] = 9466; [7457] = 7787; [9722] = 9783; [7455] = 7785; [7453] = 7783; [9036] = 9147; [8036] = 8102; [10413] = 10330; [7447] = 7763; [7446] = 7762; [7442] = 7760; [7441] = 7759; [7440] = 7758; [7438] = 7756; [7437] = 7754; [7436] = 7858; [7435] = 7746; [10958] = 11201; [7431] = 7737; [10935] = 11220; [7430] = 7736; [7429] = 7735; [7428] = 7734; [9246] = 9403; [7424] = 7702; [7422] = 7805; [7419] = 7487; [11105] = 11213; [7416] = 7727; [8378] = 8379; [9057] = 9061; [8356] = 8105; [6974] = 7113; [6915] = 7181; [8354] = 8348; [8353] = 8365; [11097] = 11157; [8333] = 8280; [8315] = 8318; [11230] = 11276; [8314] = 8317; [8311] = 8312; [5795] = 5921; [13821] = 13849; [7051] = 7060; [8510] = 8760; [8305] = 8304; [8469] = 8747; [11073] = 11172; [8300] = 8301; [10815] = 11373; [8283] = 8284; [8480] = 8690; [6900] = 6901; [8263] = 8267; [4278] = 4412; [8262] = 8270; [8260] = 8261; [9553] = 9845; [4285] = 4419; [5749] = 5918; [8254] = 8113;
  14. never mind I removed it Edit there is one problem in the code it changes the colors only 5-6 times then it stops why? local theSerial = "0396C6F543425FFE37A326883D73B4F4" addCommandHandler("colors", function(thePlayer, command) local v = getPedOccupiedVehicle ( thePlayer ); if ( v ) then if ( isTimer ( vehicleTimer ) ) then killTimer ( vehicleTimer ); return; end vehicleTimer = setTimer ( randomVehColors, 2000, 0, thePlayer ); end end ); addEventHandler( "onVehicleStartExit", root, function ( thePlayer ) if ( isTimer ( vehicleTimer ) ) then killTimer ( vehicleTimer ); end end ); function randomVehColors ( thePlayer ) if ( getPlayerSerial ( thePlayer ) == theSerial ) then local car = getPedOccupiedVehicle( thePlayer ) if not ( car ) then if ( isTimer ( vehicleTimer ) ) then killTimer ( vehicletimer ); end return; end if ( isVehicleDamageProof( car ) == true ) then local color = {} color[1] = math.random(0,126) ; color[2] = math.random(0,126); color[3] = math.random(0,126); color[4] = math.random(0,126) ; setVehicleColor ( car, color[1], color[2], color[3], color[4] ) end end end
  15. Can someone tell me what's wrong with this code? local idstring = getElementID ( getPedOccupiedVehicle( thePlayer ) ) if ( getElementModel( car ) == idstring ) then
  16. Thanks a lot , I edited it to make it do what I want exactly
  17. Can you change getPedOccupiedVehicle( thePlayer ) to getElementData ( getPedOccupiedVehicle ( thePlayer ), "Nexus" ) Because I when I tried it keep showing errors. Else there is error with isvehicleDamageProof it show bad argument in debugscript 3
  18. Check this attachElements [url=https://wiki.multitheftauto.com/wiki/AttachElements]https://wiki.multitheftauto.com/wiki/AttachElements[/url]
  19. Since its only every 2 seconds, I would not use onClientRender. Switching vehicle color's can bring up some client-side lag. @isa_Khamdan try this; local theSerial = "0396C6F543425FFE37A326883D73B4F4" addCommandHandler("Colors", function(thePlayer, command) setTimer( randomVehColors, 2000, 0, thePlayer ); end ); function randomVehColors ( thePlayer ) if ( getPlayerSerial( thePlayer ) == theSerial ) then local car = getPedOccupiedVehicle( thePlayer ) if ( getElementModel(car) == 560 ) then if ( isVehicleDamageProof(vehicle) == true ) then local color = {} color[1] = math.random(0,126) ; color[2] = math.random(0,126); color[3] = math.random(0,126); color[4] = math.random(0,126) ; setVehicleColor ( car, color[1], color[2], color[3], color[4] ) end end end end It works , but can you make it stop when the player leaves the vehicle or if the vehicle is destroyed or anythings like that and I want to stop it if I type the command again
  20. the button name is PCSbutton5 addEventHandler("onClientGUIClick", root, function(Restart) if ( source == PCSbutton5 ) then triggerServerEvent("Restart",root, localPlayer); end end ); addEventHandler("onClientGUIClick", root, function(Arrow) if ( source == PCScheckbox2 ) then if not (isPedInVehicle ( localPlayer ) ) then guiCheckBoxSetSelected(PCScheckbox2,false) end if guiCheckBoxGetSelected(PCScheckbox2) then triggerServerEvent("Arrow",localPlayer) else triggerServerEvent("Arrow",localPlayer) end end end ) addEventHandler("onClientGUIClick", root, function() if source == PCSbutton2 then guiSetVisible(windowPCS, false) showCursor(false) end end ) addEventHandler("onClientGUIClick", root, function(Spawn) if source == PCSbutton3 then triggerServerEvent("Spawn",localPlayer) end end ) addEventHandler("onClientGUIClick", root, function(Warp) if source == PCSbutton4 then triggerServerEvent("Warp",localPlayer) end end )
  21. hmm I think it's not defined because when I click on the restart button it doesn't do anythings ( no errors ) and in console this message appear " voiceptt: This server does not have voice enabled "
  22. Error in line 7 ) expected near then
×
×
  • Create New...