Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/06/20 in all areas

  1. Recently @Tut and I were experimenting about lightmapping with a light map and a shader (Very different from vertex lighting) and i want to share our experience with that. Initially we only wanted to make the 2nd UV channel work with objects but then i remembered about @Ren_712 lightmapped "Dust" map from counter strike and i wanted to re-create that effect. I thought his instructions were a bit unclear, so i write it down here again. If an Admin reads this, please move this topic to User Guides, i think thats better than this scripting tutorial section. This is the original resource of Ren: https://community.multitheftauto.com/index.php?p=resources&s=details&id=12151 In 3ds max, first you need an object that you want to assign the 2nd UV map to. Doesnt matter what object. -Create the "unwrap uvw" modifier -Select "2" as Map Channel in the modifier -In the following Dialog, "Move" or "Abandon" the UV coordinates of Channel 1 to the new Channel 2, you will most likely need to use "Flatten mapping" anyway -Do whatever you need with the new UVs (Flatten mapping makes everything fit on 1 texture = no more "tiling") -Create the lightmap with whatever tool (Radiosity?) that can render the light onto a grayscale lightmap image. This image will later produce light with our 2nd flattened UV map. -Right click on the object and "Convert to -> Editable mesh", this collapses everything nicely and saves your changes. -Finish your object and then export it with rwio or Kams max scripts. This is the lightmap shader created by Ren, its nothing special and i simplified the code a little bit and i added some comments: https://www.dropbox.com/s/zrfk7nahdduq938/light.fx?dl=0 Now all you need to do is assign the lightmap shader to your object with the following simple code: local lshader = dxCreateShader("light.fx") if lshader then local lightTexture = dxCreateTexture("your_lightmap.png", "argb") if lightTexture then dxSetShaderValue(lshader, "lightTexture", lightTexture) engineApplyShaderToWorldTexture(lshader, "*", THE_TARGET_OBJECT_THAT_NEEDS_LIGHT) end end
    3 points
  2. https://wiki.multitheftauto.com/wiki/EngineSetObjectGroupPhysicalProperty https://wiki.multitheftauto.com/wiki/EngineSetModelPhysicalPropertiesGroup Some new functions you can try.
    2 points
  3. Just do: tabla = {} Before loop.
    1 point
  4. Thank you very much for sharing that information!
    1 point
  5. مفيش مانع فكدة طبعا انت أكيد خدت شوية وقت عالأقل حتي في تظبيط التيبل عالعموم شكرا علي مجهودك وشكرا علي لتعديل Edit : تم التعديل في الويكي GetSkinNameFromID
    1 point
  6. 1 point
  7. This rectangle exist out of 7 parts. - 4 corners - 1 big rectangle, the middle, from left to right - 2 small rectangles, top and bottom You can animate the big rectangle it's width and height. (+ Position, if not animated from left-top) The 2 small rectangles, their width and position. And the corners, their position. But make sure to align the components perfectly with the pixels on the screen. Half pixels might cause artifacts.
    1 point
  8. Cara, se vc não sabe fazer painel em DX, faça em CEGUI pois é mais fácil.
    1 point
  9. @IIYAMA Oh! you are right and those id functions is better in this case but i forgot since i used to use setElementData to save more data to one element.
    1 point
  10. function getFixedNumberFromString(str,form) return (form[string.gsub(string.match(str,"%W+"),"%s+",'')] and tonumber(string.match(str,"%d+")..form[string.gsub(string.match(str,"%W+"),"%s+",'')]) ) or false end --example local format = { ['K']='000', ['الف']='000', } local num = getFixedNumberFromString("50K",format) print(num)--printing 50000 local num = getFixedNumberFromString("50الف",format) print(num)--printing 50000
    1 point
  11. function getElementsNearPlayer(plr,d,ty) local ta = {} local x , y , z = getElementPosition(plr) for k,v in ipairs(getElementsByType((ty and ty or 'player')))do if v ~= plr then local x1 , y1 , z1 = getElementPosition( v ) local di = getDistanceBetweenPoints3D ( x , y , z , x1 , y1 , z1 ) if dist <= d then table.insert( ta , v) end end end return ta end
    1 point
  12. @Sisqo0 Did you know that there are id functions available? Which are very similar to those that are used in html/css/js. https://wiki.multitheftauto.com/wiki/SetElementID https://wiki.multitheftauto.com/wiki/GetElementByID
    1 point
  13. getElementPosition setElementPosition createVehicle addCommandHandler You can give the vehicle you spawned a special id so you can get it back. setElementData(vehicle, "ID", num) getElementData(vehicle, "ID")
    1 point
  14. Utilize essa função para obter jogadores que possuem determinada accountData. function getPlayersFromAccountData (data) if (not data) then return false end -- Se não tiver data no parâmetro, retorna false. local dataPlayers = {} -- Inicia uma table vazia. for i, player in ipairs (getElementsByType ("player")) do -- Para cada jogador conectado no servidor, faça: if (getAccountData (getPlayerAccount(player), data)) then -- Se o jogador possui a accountData específica, então: table.insert (dataPlayers, player) -- Adiciona esse jogador na table dataPlayers end end return dataPlayers -- Retorna uma lista de jogadores que possuem a accountData específica. Retornará uma lista vazia se ninguém possuir tal accountData. end E depois no seu script, passe um loop por essa tabela, mandando a mensagem pra cada jogador nela. local helpers = getPlayersFromAccountData ("Helper") if (#helpers > 0) then -- Se existe algum jogador com essa accountData, então: for i, player in ipairs (helpers) do -- Para cada jogador na lista, manda isso no chat dele: outputChatBox ("Mensagem exclusiva para helpers.", player) end end
    1 point
  15. can you show me an example right vedio or something and i will understand what you mean
    1 point
  16. i think the problem not from the events try to get the speed of the vehicle GetElementSpeed SetElementSpeed because i used the event onClientVehicleCollision before but i force the velocity on the object with some maths not the vehicle
    1 point
  17. addEventHandler("onClientVehicleCollision", root, function(collider,force, bodyPart, x, y, z, nx, ny, nz) local theVehicle = getPedOccupiedVehicle (localPlayer) if (theVehicle) and (source == theVehicle) then local SX , SY , SZ = getElementVelocity ( source ) setTimer( setElementVelocity, 100, 1, source , SX , SY , SZ ) end end) it's important to check if the ped in vehicle or not
    1 point
  18. عجبني المونتاج ? . بالتوفيق سيرفر جميل
    1 point
  19. getSkinNameFromID (Client : Function) Syntax : string getSkinNameFromID() Return : يعود باسم السكن من خلال الايد Function : ids = { {'CJ',0}, {'Truth',1}, {'Maccer',2}, {'Casual JeanJacket',7}, {'Business Lady',9}, {'Old Fat Lady',10}, {'Card Dealer 1',11}, {'Classy Gold Hooker',12}, {'Homegirl',13}, {'Floral Shirt',14}, {'Plaid Baldy',15}, {'Earmuff Worker',16}, {'Black suit',17}, {'Black Beachguy',18}, {'Beach Gangsta',19}, {'Fresh Prince',20}, {'Striped Gangsta',21}, {'Orange Sportsman',22}, {'Skater Kid',23}, {'LS Coach',24}, {'Varsity jacket',25}, {'Hiker',26}, {'Construction 1',27}, {'Black Dealer',28}, {'White Dealer',29}, {'Religious Essey',30}, {'Fat Cowgirl',31}, {'Eyepatch',32}, {'Bounty Hunter',33}, {'Marlboro Man',34}, {'Fisherman',35}, {'Mailman',36}, {'Baseball Dad',37}, {'Old Golf Lady',38}, {'Old Maid',39}, {'Classy Dark Hooker',40}, {'Tracksuit Girl',41}, {'Porn Producer',43}, {'Tatooed Plaid',44}, {'Beach Mustache',45}, {'Dark Romeo',46}, {'Top Button Essey',47}, {'Ninja Sensei',49}, {'Mechanic',50}, {'Black Bicyclist',51}, {'White Bicyclist',52}, {'Golf Lady',53}, {'Hispanic Woman',54}, {'Rich Bitch',55}, {'Legwarmers 1',56}, {'Chinese Businessman',57}, {'Chinese Plaid',58}, {'Chinese Romeo',59}, {'Chinese Casual',60}, {'Pilot',61}, {'Pajama Man 1',62}, {'Trashy Hooker',63}, {'Transvestite',64}, {'Varsity Bandits',66}, {'Red Bandana',67}, {'Preist',68}, {'Denim Girl',69}, {'Scientist',70}, {'Security Guard',71}, {'Bearded Hippie',72}, {'Flag Bandana',73}, {'Skanky Hooker',75}, {'Businesswoman 1',76}, {'Bag Lady',77}, {'Homeless Scarf',78}, {'Fat Homeless',79}, {'Red Boxer',80}, {'Blue Boxer',81}, {'Fatty Elvis',82}, {'Whitesuit Elvis',83}, {'Bluesuit Elvis',84}, {'Furrcoat Hooker',85}, {'Firecrotch',87}, {'Casual Old Lady',88}, {'Cleaning Lady',89}, {'Barely Covered',90}, {'Sharon Stone',91}, {'Rollergirl',92}, {'Hoop Earrings 1',93}, {'Andy Capp',94}, {'Poor Old Man',95}, {'Soccer Player',96}, {'Baywatch Dude',97}, {'Rollerguy',99}, {'Biker Blackshirt',100}, {'Jacker Hippie',101}, {'Baller Shirt',102}, {'Baller Jacket',103}, {'Baller Sweater',104}, {'Grove Sweater',105}, {'Grove Tropbutton',106}, {'Grove Jersey',107}, {'Vagos Topless',108}, {'Vagos Pants',109}, {'Vagos Shorts',110}, {'Russian Muscle',111}, {'Russian Hitman',112}, {'Russian Boss',113}, {'Aztecas Stripes',114}, {'Aztecas Jacket',115}, {'Aztecas Shorts',116}, {'Triad 1',117}, {'Triad 2',118}, {'Triad 3',119}, {'Sinacco Suit',120}, {'Da Nang Army',121}, {'Da Nang Bandana',122}, {'Da Nang Shades',123}, {'Sinacco Muscle',124}, {'Mafia Enforcer',125}, {'Mafia Wiseguy',126}, {'Mafia Hitman',127}, {'Native Rancher',128}, {'Native Librarian',129}, {'Native Ugly',130}, {'Native Sexy',131}, {'Native Geezer',132}, {'Furys Trucker',133}, {'Homeless Smoker',134}, {'Skullcap Hobo',135}, {'Old Rasta',136}, {'Boxhead',137}, {'Bikini Tattoo',138}, {'Yellow Bikini',139}, {'Buxom Bikini',140}, {'Cute Librarian',141}, {'African 1',142}, {'Sam Jackson',143}, {'Drug Worker 1',144}, {'Drug Worker 2',145}, {'Drug Worker 3',146}, {'Sigmund Freud',147}, {'Businesswoman 2',148}, {'Businesswoman 2 b',149}, {'Businesswoman 3',150}, {'Melanie',151}, {'Schoolgirl 1',152}, {'Foreman',153}, {'Beach Blonde',154}, {'Pizza Guy',155}, {'Old Reece',156}, {'Farmer Girl',157}, {'Farmer',158}, {'Farmer Redneck',159}, {'Bald Redneck',160}, {'Smoking Cowboy',161}, {'Inbred',162}, {'Casino Bouncer 1',163}, {'Casino Bouncer 2',164}, {'Agent Kay',165}, {'Agent Jay',166}, {'Chicken',167}, {'Hotdog Vender',168}, {'Asian Escort',169}, {'PubeStache Tshirt',170}, {'Card Dealer 2',171}, {'Card Dealer 3',172}, {'Rifa Hat',173}, {'Rifa Vest',174}, {'Rifa Suspenders',175}, {'Style Barber',176}, {'Vanilla Ice Barber',177}, {'Masked Stripper',178}, {'War Vet',179}, {'Bball Player',180}, {'Punk',181}, {'Pajama Man 2',182}, {'Klingon',183}, {'Neckbeard',184}, {'Nervous Guy',185}, {'Teacher',186}, {'Japanese Businessman 1',187}, {'Green Shirt',188}, {'Valet',189}, {'Barbara Schternvart',190}, {'Helena Wankstein',191}, {'Michelle Cannes',192}, {'Katie Zhan',193}, {'Millie Perkins',194}, {'Denise Robinson',195}, {'Aunt May',196}, {'Smoking Maid',197}, {'Ranch Cowgirl',198}, {'Heidi',199}, {'Hairy Redneck',200}, {'Trucker Girl',201}, {'Beer Trucker',202}, {'Ninja 1',203}, {'Ninja 2',204}, {'Burger Girl',205}, {'Money Trucker',206}, {'Grove Booty',207}, {'Noodle Vender',209}, {'Sloppy Tourist',210}, {'Staff Girl',211}, {'Tin Foil Hat',212}, {'Hobo Elvis',213}, {'Caligula Waitress',214}, {'Explorer',215}, {'Turtleneck',216}, {'Staff Guy',217}, {'Old Woman',218}, {'Lady In Red',219}, {'African 2',220}, {'Beardo Casual',221}, {'Beardo Clubbing',222}, {'Greasy Nightclubber',223}, {'Elderly Asian 1',224}, {'Elderly Asian 2',225}, {'Legwarmers 2',226}, {'Japanese Businessman 2',227}, {'Japanese Businessman 3',228}, {'Asian Tourist',229}, {'Hooded Hobo',230}, {'Grannie',231}, {'Grouchy lady',232}, {'Hoop Earrings 2',233}, {'Buzzcut',234}, {'Retired Tourist',235}, {'Happy Old Man',236}, {'Leopard Hooker',237}, {'Amazon',238}, {'Hugh Grant',240}, {'Afro Brother',241}, {'Dreadlock Brother',242}, {'Ghetto Booty',243}, {'Lace Stripper',244}, {'Ghetto Ho',245}, {'Cop Stripper',246}, {'Biker Vest',247}, {'Biker Headband',248}, {'Pimp',249}, {'Green Tshirt',250}, {'Lifeguard',251}, {'Naked Freak',252}, {'Bus Driver',253}, {'Biker Vest b',254}, {'Limo Driver',255}, {'Shoolgirl 2',256}, {'Bondage Girl',257}, {'Joe Pesci',258}, {'Chris Penn',259}, {'Construction 2',260}, {'Southerner',261}, {'Pajama Man 2 b',262}, {'Asian Hostess',263}, {'Whoopee the Clown',264}, {'Tenpenny',265}, {'Pulaski',266}, {'Hern',267}, {'Dwayne',268}, {'Big Smoke',269}, {'Sweet',270}, {'Ryder',271}, {'Forelli Guy',272}, {'Medic 1',274}, {'Medic 2',275}, {'Medic 3',276}, {'Fireman LS',277}, {'Fireman LV',278}, {'Fireman SF',279}, {'Cop 1',280}, {'Cop 2',281}, {'Cop 3',282}, {'Cop 4',283}, {'Cop 5',284}, {'SWAT',285}, {'FBI',286}, {'Army',287}, {'Cop 6',288}, {'Rose',290}, {'Kent Paul',291}, {'Cesar',292}, {'OG Loc',293}, {'Wuzi Mu',294}, {'Mike Toreno',295}, {'Jizzy',296}, {'Madd Dogg',297}, {'Catalina',298}, {'Claude from GTA 3',299}, {'Ryder',300}, {'Ryder Robber',301}, {'Emmet',302}, {'Andre',303}, {'Kendl',304}, {'Jethro',305}, {'Zero',306}, {'T-bone Mendez',307}, {'Sindaco Guy',308}, {'Janitor',309}, {'Big Bear',310}, {'Big Smoke with Vest',311}, {'Physco',312}, } function getSkinNameFromID(id) local name = tonumber(id) if not(name)then outputDebugString("Failed to get the SkinName got a non numerical Value",2) return false end for _,v in ipairs(ids) do if v[2] == name then return v[1] end end outputDebugString('Failed to get the SkinName For ID ('..name..') wrong ID or not Found in the Table',1) return false end Example1 : skin عند استعمال الامر يظهر في الشات إسم السكن اذا صح التحقق والعكس يقوم باخراج رسالة خطا بالشات addCommandHandler('skin', function() local name = getSkinNameFromID(getElementModel(localPlayer)) if name then outputChatBox('SkinName : ('..name..') of ID ('..getElementModel(localPlayer)..')',255,255,0) else outputChatBox('Failed to get the SkinName : Wrong ID or not Found in the Table',255,255,0) end end) Example2 : name عند استعمال الامر Maccer او CJ يقوم بالتحقق اذا كان السكن الخاص باللاعب اذا كان التحقق صحيح يظهر رسالة انك تملك سكن سي جي او ماسير العكس يظهر رسالة خطأ addCommandHandler('name', function() local name = getSkinNameFromID(getElementModel(localPlayer)) if name == 'CJ' then outputChatBox('You Have CJ Skin!',0,255,0) elseif name == 'Maccer' then outputChatBox('You Have Maccer Skin!',0,255,0) else outputChatBox('You Havenot CJ or Maccer Skin!',255,0,0) end end) Example3 : هنا مثال يشرح كيفية التحقق باستخدام الرقم وليس عبر جلب موديل اللاعب name الامر مسافة والرقم مثال name 7 وبيعطيك اسم الشخصية الخاصة برقم 7 العكس يعطيك رسالة خطأ function skinNameID ( commandName,id ) if (id) and tonumber(id) then local skinname = getSkinNameFromID(id) if skinname then outputChatBox('SkinName : ('..name..') of ID : ('..id..')',255,0,0) else outputChatBox('Failed to get the SkinName : Wrong ID or not Found in the Table',255,255,255) end end end addCommandHandler ( "name", skinNameID ) رابط الوظيفة في الويكي GetSkinNameFromID
    1 point
  20. 1) Create any object (better something collision-less) and make it invisible (setElementAlpha) 2) Attach your vehicle to that object 3) Use moveObject function on that object.
    1 point
  21. Please stop pretending that you're a random guy, we handled your appeal at https://forum.multitheftauto.com/topic/122733-ban-appeal/ and had to delete a lot of spam when you started pretending again. We will continue cleaning it up, bye
    0 points
×
×
  • Create New...