-
Posts
7,337 -
Joined
-
Days Won
11
Everything posted by TAPL
-
ما يحتاج اروح اجرب شي امسك الكود هذا و روح حطه بالأدمنية في تاب ريسورس و اضغط زر سيرفر و انت مو راكب سيارة + وانت واقف على الأرض isPedOnGround(source) true بتشوف انه بيقول لك جرب نفس الكود مره ثانية بس المره ذي اركب سيارة عاد تطير ولا بالأرض ولا في المريخ مو مهم بس اضغط الزر سيرفر و شوف وش يقول لك false و طبعاً النتيجة مؤكده
-
https://forum.multitheftauto.com/viewtopic.php?f=91&t=37491
-
و من قال ان السيارة تطير لما تضغط شفت اساساً و السيارة ما تتحرك من مكانها نهائياً isPedOnGround انا جربت الكود مع الفنكشن السيارة تنقز مره وحده و لما تنزل للأرض تقدر تنقزها مره ثانية isVehicleOnGround بينما لما جربت مع الكود راجع معلوماتك
-
تقدر تسوي سباون للاعب و تحطه في العالم الوهمي و الأنترو بعد ان كنت تحتاجه و التيم المطلوب spawnPlayer
-
انت ما وضحت وش السالفه بالضبط المهم فنكشات العالم الوهمي ذي getElementDimension setElementDimension
-
This happen if they're both not in the same dimension.
-
صراحة انا ماشيكت ع الكود هذا لانه منتشر بالكوميونيتي ومجربه الكثير وكذا لأنه لو تلاحظ بالويكي مكتوب true رح يعطي false حسب خبرتي مارح يعطي + .true عشان كذا الفنكشن ما بيجيب النتيجة الصحيحة لذلكـ رح يعطي دائماً كلام الويكي واضح جداً
-
دائما false راح يعطي isPedOnGround اعتقد إذا كان راكب سيارة الفنكشن هذا isVehicleOnGround المفروض تستخدم هذا الفنكشن
-
You may need to use getElementData outside dxDrawText if you want the text show only if the element data is true. Something like: if getElementData(player, "invincible") then dxDrawText( 'GOD', px, py, px, py, tocolor( 255, 255, 255, 255 ), 1, "sans", "center", "center", false, false, false , true ); end
-
If you don't show full code, none can help you.
-
ACL Group Admin will be moven to staff team when login?
TAPL replied to Jullul7000's topic in Scripting
^^ You both wrong, onPlayerLogin doesn't have player parameter. local staff = createTeam("Staff", 255, 255, 255) addEventHandler("onPlayerLogin", root, function(_, acc) local accName = getAccountName(acc) if isObjectInACLGroup("user."..accName, aclGetGroup("Admin")) then setPlayerTeam(source, staff) end end) -
Server Side: gate = createObject(980, 2187.626953125, -2273.4443359375, 13.546875, 0, 0, 0) -- objID, X, Y, Z, Rotation X, Y, Z function gateOpen(source) local x, y, z = getElementPosition(source) local x1, y1, z1 = getElementPosition(gate) if getDistanceBetweenPoints3D(x, y, z, x1, y1, z1) <= 10 then moveObject(gate, 2000, 2188.8193359375, -2272.720703125, 28.495878219604, 0, 0, 130) --moves the gate to the open position. time, X, Y, Z, Rotation X, Y, Z end end addCommandHandler("go1", gateOpen)--Command /go1 to open gate function gateClose(source) local x, y, z = getElementPosition(source) local x1, y1, z1 = getElementPosition(gate) if getDistanceBetweenPoints3D(x, y, z, x1, y1, z1) <= 10 then moveObject(gate, 2000, 2187.626953125, -2273.4443359375, 13.546875, 0, 0, 0 ) --returns the gate to it's starting position. X, Y, Z, Rotation X, Y, Z end end addCommandHandler("gc1", gateClose)--Command /gc1 to close gate
-
https://forum.multitheftauto.com/viewtopic.php?f=91&t=64966 A good website for the SQL functions: http://www.w3schools.com/sql/sql_insert.asp
-
if (result and type(result) == "table" and #result > 0) then The if statement checks that the result aren't nil or false and it's a table and the table has one or more row.
-
--Check if the email already exists.. function emailExists(email) local query = dbQuery(accountsDatabase, "SELECT email FROM users WHERE email=?", email) local result = dbPoll(query, -1) if (result and type(result) == "table" and #result > 0) then return true else return false end end
-
Try this: setTimer(function() modelID = getElementModel(localPlayer) if not skinpic then skinpic = guiCreateStaticImage((screenW - 150) / 2.9, (screenH - 150) / 1.35, 150, 150, "skins/"..tostring(modelID)..".png", false) oModelID = modelID else if modelID ~= oModelID then guiStaticImageLoadImage(skinpic, "skins/"..tostring(modelID)..".png") oModelID = modelID end end end, 1000, 0)
-
guiStaticImageLoadImage setTimer
-
guiCreateGridList guiGridListAddColumn getElementsByType guiGridListAddRow getPlayerName guiGridListSetItemText guiCreateButton Event: "onClientGUIClick" guiGridListGetSelectedItem guiGridListGetItemText getPlayerFromName createBlipAttachedTo
-
اختصار للكومند قصدك؟ bindKey ينقل الى قسم البرمجة
-
You can selects multiple columns with one query, dbPoll is required to get the result. See the syntax here: http://www.w3schools.com/sql/sql_select.asp function spawnVeh() local serialz = getPlayerSerial(source) local result = dbPoll(dbQuery(server, "SELECT carid, cx, cy, cz FROM accounts WHERE serial = ?", serialz), -1) if result and type(result) == "table" and #result > 0 then veh = createVehicle(result[1]["carid"], result[1]["cx"], result[1]["cy"], result[1]["cz"]) end end addEventHandler("onPlayerJoin", root, spawnVeh)
-
Why you do update the serial if it already the same in the database? You should only insert it if it doesn't exists. function getSerial() local serialz = getPlayerSerial(source) local database = dbPoll(dbQuery(server, "SELECT serial FROM accounts WHERE serial = ?", serialz), -1) if database and type(database) == "table" and #database == 0 then dbExec ( server, "INSERT INTO accounts (serial) VALUES (?)", serialz) end end addEventHandler("onPlayerJoin", root, getSerial) There also another way, but i am not sure if it right or not, you can try it. function getSerial() local serialz = getPlayerSerial(source) dbExec(server, "INSERT INTO accounts (serial) VALUES (serialz) WHERE NOT EXISTS (SELECT serial FROM accounts WHERE serial = '"..serialz.."'") end addEventHandler("onPlayerJoin", root, getSerial)
