-
Posts
1,165 -
Joined
-
Last visited
-
Days Won
3
Everything posted by ALw7sH
-
What we should do? What's the problem ? And any errors ? ( debugscript )
-
أنا معى ان روكستار تضم مبرمجين ام تي اي بشكل رسمي GTA ووتبنى ام تي اي وتكلفهم بأصدارات جديده للأصدارات الجديده من سلسلة Let me dream : d
-
قريبا مود مدرسة تعليم قيادة السيارات (الرخصة) من قبلي
ALw7sH replied to I_Mr.[T]he[P]rInCe's topic in المساهمات
ماشاء الله من وين جايب الفكرة الجديدة -
the porblem may be from another script, so you should check your other scripts
-
--[[ original script by iAnnAs (iannas ben ahmed) --]] function saveClothes() local account = getPlayerAccount(source) if ( not isGuestAccount(account) ) and ( getElementModel(source) == 0 ) then local texture = {} local model = {} for i=0, 17, 1 do local clothesTexture, clothesModel = getPedClothes(source, i) if ( clothesTexture ~= false ) then table.insert(texture, clothesTexture) table.insert(model, clothesModel) else table.insert(texture, " ") table.insert(model, " ") end end local allTextures = table.concat(texture, ",") local allModels = table.concat(model, ",") outputDebugString("Clothessaver: Saved clothes") setAccountData(account, "Clothessaver:Texture", allTextures) setAccountData(account, "Clothessaver:Model", allModels) texture = {} model = {} end end addEventHandler("onPlayerQuit", getRootElement(), saveClothes) function setClothes() local account = getPlayerAccount(source) if ( not isGuestAccount(account) ) then if ( getElementModel(player) == 0 ) then local textureString = getAccountData(account, "Clothessaver:Texture") local modelString = getAccountData(account, "Clothessaver:Model") local textures = split(textureString, 44) local models = split(modelString, 44) for i=0, 17, 1 do if ( textures[i+1] ~= " " ) then addPedClothes(source, textures[i+1], models[i+1], i) end end exports.CSTtexts:sendMessage("Your CJ Clothes were added Back", 0, 255, 0, true) textures = {} models = {} end end end addEventHandler("onPlayerLogin", getRootElement(), setClothes) function loadClothes(player) local account = getPlayerAccount(player) if ( not isGuestAccount(account) ) then if ( getElementModel(player) == 0 ) then local textureString = getAccountData(account, "Clothessaver:Texture") local modelString = getAccountData(account, "Clothessaver:Model") local textures = split(textureString, 44) local models = split(modelString, 44) for i=0, 17, 1 do if ( textures[i+1] ~= " " ) then addPedClothes(player, textures[i+1], models[i+1], i) end end exports.CSTtexts:sendMessage("Your CJ Clothes were added Back", 0, 255, 0, true) textures = {} models = {} else exports.CSTtexts:sendMessage("Your skin must be skin 0 (CJ Skin)", 255, 0, 0, true) end else outputChatBox("Please login!", player, 255, 0, 0) end end addCommandHandler("loadClothes", loadClothes) function saveClothes(player) local account = getPlayerAccount(player) if ( not isGuestAccount(account) ) then if ( getElementModel(player) == 0 ) then local texture = {} local model = {} for i=0, 17, 1 do local clothesTexture, clothesModel = getPedClothes(player, i) if ( clothesTexture ~= false ) then table.insert(texture, clothesTexture) table.insert(model, clothesModel) else table.insert(texture, " ") table.insert(model, " ") end end local allTextures = table.concat(texture, ",") local allModels = table.concat(model, ",") outputDebugString("Clothessaver: Saved clothes") setAccountData(account, "Clothessaver:Texture", allTextures) setAccountData(account, "Clothessaver:Model", allModels) texture = {} model = {} else exports.CSTtexts:sendMessage("Your skin must be skin 0 (CJ Skin)", 255, 0, 0, true) end else outputChatBox("Please login!", player, 255, 0, 0) end end addCommandHandler("saveClothes", saveClothes) addEventHandler("onElementModelChange",root, function(old,new) if ( getElementType(source) == "player" ) then if ( new == 0 ) then executeCommandHandler("loadClothes",source) end end end )
-
_, player ممكن يكون أي كلمتين او حرفين تغييرهم مايأثر في شي ipairs و pairs ممكن يكون
-
onPlayerDamage can't be canceled instead on cancling onPlayerDamage you have to cancle onClientPlayerDamage
-
ترتيب الاكواد مو لازم يكون 100% بالضبط في كل كود بس اكيد انت تعرف انه السكربت يبدأ القرائة من فوق لتحت يعني اذا جيت تسوي سكربت مثلاً مايصير تسوي كذا setPlayerMoney(player,playerMoney-500) local playerMoney = getPlayerMoney(player) local player = getRandomPlayer() الكود صح تقريباً بس الخطأ الوحيد اني كتبته من تحت لفوق زي كذا بيجيك اخطاء انه بلاير + بلاير موني ماهم معرفين انت تبتدي تقول للسكربت الي تبيه بالترتيب اول شي يجيب فلوس اللاعب بعدين يشوف اذا فلوس اللاعب نفس او اكثر من رقم معين اذا كانت نفس او اعلى تسحب من فلوس اللاعب الرقم المعين local moneyToTake = 500 local player = getRandomPlayer() local playerMoney = getPlayerMoney(player) if playerMoney >= moneyToTake then takePlayerMoney(player,moneyToTake) end
-
الافضل انه ما يسوي تايمر لانه بالتايمر لو كتب حرف ينتضر بين 50 الى 0.1 جزء من الثانية addEventHandler("onClientRender",root, function() dxDrawImage(.....) local editText = guiGetText(edit) dxDrawText(editText,.....) end )
-
حنا مابنجرب كل كود انت تسويه لول debugscript خش اللوكال سيرفر وجرب الكود وانت فاك اذا لقيت مشكله حاول تصلحها ماقدر تعال هنا حط المشكله والكود
-
وش الخطا في الكود عشان نصلحه لول debugscript
-
مايحتاج تسوي تريقر روت دام انت بتخفي الصوره للاعب واحد فقط triggerClientEvent(source,"hideLoginWindow",source) وعشان تتأكد انه التريقر يوصل ضيف ذا السطر بأستقبال التريقر وشوف يطلع شي بالديبق او لا outputDebugString("hideLoginWindow Has been triggered")
-
ماهو لاعب onResourceStart السورس حق السورس حق ذا الايفنت يكون السكربت الي اشتغل + الاكواد بيكون عندك مشكله فيها لو تبي تعدلها لازم تسوي لوب داخل ذا الايفنت اون ريسورس ستارت لاكن الي يخش السيرفر بعدين مابيجيب الايبي حقه ف الافضل انك تستخدم في كلاينت سايد onClientResourceStart لانه الكلاينت يشتغل كل مايدخل اللاعب السيرفر او انك تشغل السكربت وتسوي تريقر لسيرفر سايد تحط المنت داتا للاعب بالايبي حقه وتعدل اكواد الرندر تخليها كذا addEventHandler("onClientRender", root, function (text) local myIP = getElementData(localPlayer,"IP") dxDrawText("Your IP : "..(myIP or "N/A"), 10, 357, 348, 377, tocolor(math.random(150,255), 0, 0, 255), 1, dxfont_0, "left", "top", false, false, true, false, false) end )
-
There's no function to do that, but it's still not impossible to be honest i dont really know exactly how because haven't tried to think about that before and idont think anyone gonna tell you how if he know so start to think how to make in your way (sorry if this is useless reply)
-
Can you show me your full client code?
-
use dxCreateRenderTarget dxSetRenderTarget then draw the render target with dxDrawImageSection
-
local markers = {} function attchMarkerToAllVehicle () for i, vehicle in pairs(getElementsByType("vehicle")) do if not markers[vehicle] then local marker = createMarker( 0,0,0,"cylinder",1.5,255,255,0,170) attachElements ( marker, vehicle, 0, 0, 0 ) markers[vehicle] = marker end end end setTimer(attchMarkerToAllVehicle,1000,0) addEventHandler("onVehicleRespawn",root, function() if not markers[source] then local marker = createMarker( 0,0,0,"cylinder",1.5,255,255,0,170) attachElements ( marker, source, 0, 0, 0 ) markers[source] = marker end end ) function destroyMarker() if getElementType(source) == "vehicle" then if markers[source] and isElement(markers[source]) then destroyElement (markers[source]) markers[source] = nil end end end addEventHandler("onElementDestroy", getRootElement(),destroyMarker)
-
Have you read the description ? *****Bugs***** If your camera switches back to the plane without reason, than type in "/fixAc130". I hope this will fix that problem!
-
local default = { interior = 0, dimension = 0, skin = 0, x = 0, y = 0, z = 5, rot = 90, } function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local x,y,z = getElementPosition (source) setAccountData ( playeraccount, "s.HandMoney", getPlayerMoney ( source ) ) setAccountData (playeraccount, "s.skin", tostring (getPedSkin (source))) setAccountData (playeraccount, "s.x", x) setAccountData (playeraccount, "s.y", y) setAccountData (playeraccount, "s.z", z) setAccountData (playeraccount, "s.int", getElementInterior (source)) setAccountData (playeraccount, "s.dim", getElementDimension (source)) setAccountData (playeraccount, "s.rot", getPedRotation (source)) setAccountData (playeraccount, "s.weap0", getPedWeapon ( source, 0 )) setAccountData (playeraccount, "s.weap1", getPedWeapon ( source, 1 )) setAccountData (playeraccount, "s.weap2", getPedWeapon ( source, 2 )) setAccountData (playeraccount, "s.ammo2", getPedTotalAmmo ( source, 2 )) setAccountData (playeraccount, "s.weap3", getPedWeapon ( source, 3 )) setAccountData (playeraccount, "s.ammo3", getPedTotalAmmo ( source, 3 )) setAccountData (playeraccount, "s.weap4", getPedWeapon ( source, 4 )) setAccountData (playeraccount, "s.ammo4", getPedTotalAmmo ( source, 4 )) setAccountData (playeraccount, "s.weap5", getPedWeapon ( source, 5 )) setAccountData (playeraccount, "s.ammo5", getPedTotalAmmo ( source, 5 )) setAccountData (playeraccount, "s.weap6", getPedWeapon ( source, 6 )) setAccountData (playeraccount, "s.ammo6", getPedTotalAmmo ( source, 6 )) setAccountData (playeraccount, "s.weap7", getPedWeapon ( source, 7 )) setAccountData (playeraccount, "s.ammo7", getPedTotalAmmo ( source, 7 )) setAccountData (playeraccount, "s.weap8", getPedWeapon ( source, 8 )) setAccountData (playeraccount, "s.ammo8", getPedTotalAmmo ( source, 8 )) setAccountData (playeraccount, "s.weap9", getPedWeapon ( source, 9 )) setAccountData (playeraccount, "s.ammo9", getPedTotalAmmo ( source, 9 )) setAccountData (playeraccount, "s.weap10", getPedWeapon ( source, 10 )) setAccountData (playeraccount, "s.weap11", getPedWeapon ( source, 11 )) setAccountData (playeraccount, "s.weap12", getPedWeapon ( source, 12 )) end end addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) local root = getRootElement() addEventHandler("onPlayerLogin", root, function() local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local playermoney = getAccountData ( playeraccount, "s.HandMoney" ) if ( playermoney ) then setPlayerMoney ( source, playermoney ) end local playerInt = getAccountData (playeraccount, "s.int") or default.interior local playerDim = getAccountData (playeraccount, "s.dim") or default.dimension local playerSkin = getAccountData (playeraccount, "s.skin") or default. local playerX = getAccountData (playeraccount, "s.x") or default.x local playerY = getAccountData (playeraccount, "s.y") or default.y local playerZ = getAccountData (playeraccount, "s.z") or default.z local playerRot = getAccountData (playeraccount, "s.rot") or default.rot spawnPlayer(source, playerX, playerY, playerZ, playerRot, playerSkin, playerInt, playerDim) fadeCamera (source, true) setCameraTarget (source, source) local weap0 = getAccountData(playeraccount, "s.weap0") local weap1 = getAccountData(playeraccount, "s.weap1") local weap2 = getAccountData(playeraccount, "s.weap2") local ammo2 = getAccountData(playeraccount, "s.ammo2") local weap3 = getAccountData(playeraccount, "s.weap3") local ammo3 = getAccountData(playeraccount, "s.ammo3") local weap4 = getAccountData(playeraccount, "s.weap4") local ammo4 = getAccountData(playeraccount, "s.ammo4") local weap5 = getAccountData(playeraccount, "s.weap5") local ammo5 = getAccountData(playeraccount, "s.ammo5") local weap6 = getAccountData(playeraccount, "s.weap6") local ammo6 = getAccountData(playeraccount, "s.ammo6") local weap7 = getAccountData(playeraccount, "s.weap7") local ammo7 = getAccountData(playeraccount, "s.ammo7") local weap8 = getAccountData(playeraccount, "s.weap8") local ammo8 = getAccountData(playeraccount, "s.ammo8") local weap9 = getAccountData(playeraccount, "s.weap9") local ammo9 = getAccountData(playeraccount, "s.ammo9") local weap10 = getAccountData(playeraccount, "s.weap10") local weap11 = getAccountData(playeraccount, "s.weap11") local weap12 = getAccountData(playeraccount, "s.weap12") if ( weap2 ) then giveWeapon ( source, weap0, 1 ) end if ( weap2 ) then giveWeapon ( source, weap1, 1 ) end if ( weap2 ) then giveWeapon ( source, weap2, ammo2 ) end if ( weap3 ) then giveWeapon ( source, weap3, ammo3 ) end if ( weap4 ) then giveWeapon ( source, weap4, ammo4 ) end if ( weap5 ) then giveWeapon ( source, weap5, ammo5 ) end if ( weap6 ) then giveWeapon ( source, weap6, ammo6 ) end if ( weap7 ) then giveWeapon ( source, weap7, ammo7 ) end if ( weap8 ) then giveWeapon ( source, weap8, ammo8 ) end if ( weap9 ) then giveWeapon ( source, weap9, ammo9 ) end if ( weap2 ) then giveWeapon ( source, weap10, 1 ) end if ( weap2 ) then giveWeapon ( source, weap11, 1 ) end if ( weap2 ) then giveWeapon ( source, weap12, 1 ) end end end )
-
I have tested it, it works pefrect
-
you mean change it when player click on button after it have been created already?
-
local markers = {} function attchMarkerToAllVehicle () for i, vehicle in pairs(getElementsByType("vehicle")) do if not markers[vehicle] then local marker = createMarker( 0,0,0,"cylinder",1.5,255,255,0,170) attachElements ( marker, vehicle, 0, 0, 0 ) markers[vehicle] = marker end end end setTimer(attchMarkerToAllVehicle,1000,0) function destroyMarker() if getElementType(source) == "vehicle" then if markers[source] and isElement(markers[source]) then destroyElement (markers[source]) end end end addEventHandler("onElementDestroy", getRootElement(),destroyMarker)
-
formatDecimal فائدة الوظيفة: تقدر تختصر الارقام العشريه تاخذ منها مثلاً اول اثنين او ثلاثه او الي تبي Syntax: number formatDecimal( float number, float decimal ) Required Arguments: Number: الرقم الي تبي تحذف منه ارقام عشرية Decimal: كم رقم عشري تبي Function: function formatDecimal(number, decimal) if (number and type(number) == "number") then if (decimal and type(decimal) == "number") then if tostring(number):find(".") then local num = split(tostring(number),".") return tonumber(tostring(num[1]).."."..tostring(num[2]):sub(1,decimal)) else outputDebugString("Bad argument @ 'decimal' [Expected decimal number at argument 1]",2) end else outputDebugString("Bad argument @ 'decimal' [Expected number at argument 2, got "..type(decimal).."]",2) end else outputDebugString("Bad argument @ 'decimal' [Expected number at argument 1, got "..type(number).."]",2) end end Example: print(formatDecimal(1.35431,2)) -- 1.35 print(formatDecimal(1.2456784524,5)) -- 1.24567