Jump to content

King12

Members
  • Posts

    439
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by King12

  1. آما ذا هريسه -.- -- Server side function spawnvehicles(player) if getElementData(player,"spawningvehicle", true) then outputChatBox("You already spawned the car") return end local x, y, z = getElementPosition (player) SpawnVehicle = createVehicle ( 411, x+4, y+4, z ) if ( SpawnVehicle ) then setElementData(player, "spawningvehicle", true) end end function bindvehicle() bindKey(source, "8", "down", spawnvehicles, source) end addEventHandler("onPlayerJoin", root, bindvehicle) نفس طريقتك بس آنت مستخدم isElement ماكنت مفكر فيها قبل
  2. عندك مشكلة البند بس هذي الآرقمنتس حقت البيند bindKey ( player thePlayer, string key, string keyState, function handlerFunction, [ var arguments, ... ] ) زي ماتشوف الآرقمنت الرابع انت مخليه اسم التعريف حق السياره لكن مايمديك لآنه بس للفنكشن لازم تشيك ع كودي من جديد وتفهم طريقة آنشاء السياره تخلي تحقق الداتا آول شي علشان لو اللاعب ضغط الزر 8 بعدين ضغطه مره ثانيه يتحقق من الداتا اول شي برضه السياره لازم تكون داخل الفنكشن مع الداتا آنت جرب كودك وشف وش يصير لك والآفنت عندك خطاً ميه بالميه addEventHandler( "onPlayerJoin", root, BindVehicle, function BindVehicle( ) addEventHandler("onPlayerQuit", root, DestroyVehicle, function DestroyVehicle( ) -- يكون كذا addEventHandler( "onPlayerJoin", root, function ( ) addEventHandler("onPlayerQuit", root, function ( ) من ناحية آنه مايحتاج تحط آنشاء السياره وسيت آلمنت فوق آنا آفضل آنك تحطها علشان تضمن ان الست المنت داتا تفعل
  3. فهمتني غلط آنت فوق كاتب local vehicle = createVehicle ( id, x, y, z ) -- حط احداثيات السياره + الايدي وتحت معرف الاحداثيات + function (theplayer) local = x, y, z = getElementPosition ( theplayer ) -- كذا خطأ لازم يكون كذا x, y, z = getElementPosition (theplayer) -- بحكم آنك مخلي انشاء السياره خارج الفنكشن , عالعموم الكود خطأ بالكامل .... end .. بكذا راح تودي احداثيات اللاعب لأحداثيات السياره ولاتنسى علامة الزائد علشان تخلي السياره بعيده عن اللاعب
  4. addEventHandler("onPlayerJoin", root, function theplayer( ) local = x, y, z = getElementPosition ( ) local vehicle = createVehicle ( id, x, y, z ) -- حط احداثيات السياره + الايدي مايحتاج تقوله يحط الآحداثيات بس تعدل getElementPosition (player) والآفنت تشيل آسم الفنكشن وتخلي داخل القوسين player ومايحتاج التيبل وآفنت دخول اللاعب هذا سيرفر وانت كاتب كلاينت + مسوي آند زايده بالآخير الكود يكون كذا -- Server side function spawnvehicles(player) if getElementData(player,"spawningvehicle", true) then outputChatBox("You already spawned the car") return end local x, y, z = getElementPosition (player) SpawnVehicle = createVehicle ( 411, x+4, y+4, z ) if ( SpawnVehicle ) then setElementData(player, "spawningvehicle", true) end end function bindvehicle() bindKey(source, "8", "down", spawnvehicles, source) end addEventHandler("onPlayerJoin", root, bindvehicle) وهذا الكود تضيفه لو تبي اللاعب لما يخرج من السيرفر سيارته تروح ولما يدخل لازم يضغط رقم 8 مره ثانيه علشان يسوي السياره من جديد طبعاً تضيفه بآخر الكود اللي فوق function destroyvehicle() destroyElement(SpawnVehicle) end addEventHandler("onPlayerQuit", root, destroyvehicle) معليش يالغالي بس الكود حراق
  5. كل فلسفتي علشان آشرح الالمنت داتا بدال التريقر وانلخمت ض1 آعذرونا ياحلوين آخر مره حتى آنكم آفدتوني , يعطيكم آلف عافيه كنت آظن الالمنت داتا ماتطير لين ماتشيلها انت
  6. مادري بس يمكن واحد من الثلاث هذول https://wiki.multitheftauto.com/wiki/Ge ... ceFromName call تستخدم الآكسبورت للفنكشنز
  7. آيه قصدك هنا local nData = tostring( getElementData ( localPlayer, 'AdminGroup' ) ) كنت ماخذ الكود ونسيت آحذف التوسترنق ض1 بس مشكله الآلمنت داتا آنها ماتروح من الحساب الا لما آنت تشيلها
  8. That's actually what I've done : function anim1 ( block, anim ) if isPedInVehicle ( client ) then outputChatBox("You are in the vehicle, get out to set your animation",client,255,0,0,true) return end outputChatBox("Block = "..tostring(block)..", Anim = "..tostring(anim), client) setPedAnimation ( client, tostring(block), tostring(anim), true, false ) end addEvent("animaatio", true ) addEventHandler("animaatio",getRootElement(), anim1) Also this is my trigger function : addEventHandler("onClientGUIClick",root, function ( ) local valittu = guiGridListGetSelectedItem( AnimAllGrid ) if ( valittu ) then local block = guiGridListGetItemText(AnimAllGrid, valittu, AnimBestBlockCol ) local anim = guiGridListGetItemText(AnimAllGrid, valittu, AnimBestAnimCol ) if ( source == AnimPlayButton ) then triggerServerEvent("animaatio", localPlayer, block, anim) end end end ) Even your code outputs the same..
  9. وفيه بال setElementData getElementData آسهل للي مايفهم بالتريقر مثال من السيرفر addEventHandler ( "onPlayerLogin", root, function () if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) then setElementData(source, "AdminGroup", true) end end ) بعدين لما تبي تجيبها للكلينت مثال : function admins () local nData = tostring( getElementData ( localPlayer, 'AdminGroup' ) ) if nData == "true" then ... -- كودك end
  10. It's only triggering the block now, the anim isn't even outputting nil.. my chat:
  11. This is the new error, I've replaced your function and still nothing, but now when I put mine back it outputs this.. ERROR: ac_phone\phone-s.lua:10: attempt to concatenate local 'anim' ( a nil value ) My code : -- Client local AnimAllTab = guiCreateTab("All",tabPanel) local AnimAllGrid = guiCreateGridList( 0, 0, 1, 0.9,true,AnimAllTab) guiGridListSetSelectionMode(AnimAllGrid,2) local AnimBestNameCol = guiGridListAddColumn(AnimAllGrid,"Name",0.2) local AnimBestBlockCol = guiGridListAddColumn(AnimAllGrid,"Block",0.2) local AnimBestAnimCol = guiGridListAddColumn(AnimAllGrid,"Anim",0.2) local AnimPlayButton = guiCreateButton(0.33, 0.92, 0.34, 0.08,"Play",true,AnimAllTab) local row1 = guiGridListAddRow(AnimAllGrid) addEventHandler("onClientGUIClick",root,function(button) if(button=="left")then if(source==AnimPlayButton)then PLAY() end end end,true) function PLAY ( button ) local valittu = guiGridListGetSelectedItem( AnimAllGrid ) if ( valittu ) then local animi = guiGridListGetItemText(AnimAllGrid, valittu, AnimBestNameCol ) local block = guiGridListGetItemText(AnimAllGrid, valittu, AnimBestBlockCol ) local anim = guiGridListGetItemText(AnimAllGrid, valittu, AnimBestAnimCol ) triggerServerEvent("animaatio", getLocalPlayer(), tostring( block ),tostring( anim )) end end -- end -- end [lua] -- Server function anim1 ( source, block, anim ) outputChatBox("Block = "..block..", Anim = "..anim, client) setPedAnimation ( client, block, anim, true, true ) end addEvent("animaatio", true ) addEventHandler("animaatio",getRootElement(), anim1)
  12. Hey there, I'm really pissed off of this code, I couldn't check if the last parameter is true or false ( data ) addCommandHandler ("chgdata", function (player, cmd, target, data) local ThePlayer = getPlayerFromPartialName(tostring(target)) local value = setElementData(player, "AdminGroup", data) if data == "true" or "false" then outputChatBox("data of " ..getPlayerName(ThePlayer).." #ffffffhave been changed to "..data..".",source, 255,255,255, true) else outputChatBox("Wrong Syntax! use /chgdata = #00ff00true #ffffffor #ff0000false.",source, 255,0,0, true) end end )
  13. I just sent you a private message that contains my codes, check it please.
  14. https://community.multitheftauto.com/ind ... ls&id=9339
  15. Nope, because it's drawing the level value (number) instead of the image itself..
  16. I've changed resourceName, and still extracting my level as a text, maybe because it has tostring function?
  17. Still draws the number instead of the image..
  18. Hello, I've used this function getPlayerFromPartialName : function getPlayerFromPartialName(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end it worked fine with my AddCommandHandler event, but when it outputs the name, you will see the name you wrote. for example, my name is King12 if I write /setxp Ki 1000 it will output Ki only not my full name.. My codes : addCommandHandler ( "setlevel", function( thePlayer, _, playerName, Level ) local Level = tonumber ( Level ) or 0 local ThePlayer = getPlayerFromPartialName(playerName) if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Admin")) then if ( ThePlayer ) then setElementData( ThePlayer,"Level",Level ) outputChatBox ( "Succesfully set " ..playerName.. "#00C800's Level to "..Level.." !", getRootElement(), 0, 200, 0, true , source ) triggerClientEvent(ThePlayer, 'LevelSound', ThePlayer ) else outputChatBox ( "Couldn't find '" ..playerName1.. "#00C800'", getRootElement(), 200, 0, 0, true , source ) end end end )
  19. Hello, I've got these codes from the forums, but they just the level number not the image.. -- this line in dxscoreboard_client.lua #624 --
  20. -- Server side Resources = { "script3", -- resource name "script2", -- resource name "script1", -- resource name } Working = false Current = 1 loading = false function forceLoad() if Resources[Current] then outputDebugString("[Compiler] "..Resources[Current], 0,55,167,220) local xmlPatch = ":"..Resources[Current].."/meta.xml" local xmlFile = xmlLoadFile(xmlPatch) if xmlFile then --Map Scripts local index = 0 local scriptNode = xmlFindChild(xmlFile,'script',index) if scriptNode then repeat local scriptPath = xmlNodeGetAttribute(scriptNode,'src') or false local scriptType = xmlNodeGetAttribute(scriptNode,'type') or "server" if scriptPath and scriptType:lower() == "client" then if string.find(scriptPath:lower(), "luac") then outputDebugString("COMPILER SYSTEM: File "..scriptPath.." is already compiled",3,220,20,20) else local FROM=":"..Resources[Current].."/"..scriptPath local TO= ":"..Resources[Current].."/"..scriptPath.."c" fetchRemote( "https://luac.multitheftauto.com/?compile=1&debug=0&blockdecompile=0&encrypt=0", function(data) fileSave(TO,data) end, fileLoad(FROM), true ) xmlNodeSetAttribute(scriptNode,'src',scriptPath..'c') outputDebugString("COMPILER SYSTEM: ".. TO.." Compiled and Saved successfully",3,0,255,0) end end index = index + 1 scriptNode = xmlFindChild(xmlFile,'script',index) until not scriptNode end xmlSaveFile(xmlFile) xmlUnloadFile(xmlFile) else outputDebugString("COMPILER SYSTEM: Cant read xmlFile: meta.xml",3,220,20,20) return false end --startResource(getResourceFromName(Resources[Current])) end Current = Current + 1 setTimer(forceLoad, 1000,1) end addCommandHandler ( "compileall", forceLoad ) function fileLoad(path) local File = fileOpen(path, true) if File then local data = fileRead(File, 500000000) fileClose(File) return data end end function fileSave(path, data) local File = fileCreate(path) if File then fileWrite(File, data) fileClose(File) end end
  21. جرب تشغل صوت ثاني غير اللي عندك
×
×
  • Create New...