-
Posts
7,337 -
Joined
-
Days Won
11
Everything posted by TAPL
-
You need save system such as SQLite, and good experience in scripting which you don't seems to have it, otherwise you wouldn't ask about full functions of gang system. Search in the community you will find what you looking for.
-
dbPoll is required to get the result of dbQuery.
-
اخ عناد وش فائدة كلمة break ?????????? احس مالها فائده ولكن ممكن تشرحها لاهنت لاحظ ان التيبل فيه 3 اسماء قروبات local Groups = { "Police.Manger", "Police", "Console", } هو راح يسوي لووب على كل القيم من اول قيم إلى آخر قيمة if isObjectInACLGroup ( "user." .. getAccountName ( acc ), aclGetGroup ( group ) ) then Police.Manger اول قيمة في التيبل Police.Manger افترض ان اللاعب كان في Console و Police في داعي ان يكمل التحقق على باقي القروبات؟ راح توقف اللوب لما التحقق يكون صحيح break اكيد مافيه داعي عشان كذا كلمة
-
هذا يحذف القيمة من التيبل يعني نفس الفنكشن هذا table.remove
-
I don't know, can you upload the resource on a website so i can test it?
-
It's the same, see the syntax for UPDATE: http://www.w3schools.com/sql/sql_update.asp UPDATE table_name SET column1=value1,column2=value2,... WHERE some_column=some_value; You will need to replace table_name with your table name, in your case the table is named accounts. You will replace to column1 with the column you want to update and value1 with the new value you want for the column, if you have more than one column to update you can put comma and put the column2 and value2 and so on, no need to repeat SET again. You do see in MTA we use ?, this is used to allow us to put the value after the comma as you can see here: dbExec(server, "UPDATE accounts SET x = ?, y = ?, z = ?, cx = ?, cy = ?, cz = ?, carid = ? WHERE serial = '"..serial.."'", tostring (a), tostring (b), tostring (c), tostring (x), tostring (y), tostring (z), tostring (vehname)) But we still can do like in the web site: dbExec(server, "UPDATE accounts SET x = '"..tostring(a)"', y = '"..tostring(b)"', z = '"..tostring(c)"', cx = '"..tostring(x)"', cy = '"..tostring(y)"', cz = '"..tostring(z)"', carid = '"..tostring(vehname)"' WHERE serial = '"..serial.."'") Try this, and make sure to fix your serial column as i said before, you must have 8 columns at table accounts. if data and type (data) == "table" and #data > 0 then dbExec(server, "UPDATE accounts SET x = ?, y = ?, z = ?, cx = ?, cy = ?, cz = ?, carid = ? WHERE serial = '"..serial.."'", tostring (a), tostring (b), tostring (c), tostring (x), tostring (y), tostring (z), tostring (vehname)) else dbExec(server, "INSERT INTO accounts VALUES (?, ?, ?, ?, ?, ?, ?)", tostring (a), tostring (b), tostring (c), tostring (x), tostring (y), tostring (z), tostring (vehname))
-
You should use dbExec for INSERT, also you have wrong syntax. if data and type (data) == "table" and #data > 0 then dbExec(server, "UPDATE accounts SET x = ?, y = ?, z = ?, cx = ?, cy = ?, cz = ?, carid = ? WHERE serial = '"..serial.."'", tostring (a), tostring (b), tostring (c), tostring (x), tostring (y), tostring (z), tostring (vehname)) else dbExec(server, "INSERT INTO accounts VALUES (?, ?, ?, ?, ?, ?, ?)", tostring (a), tostring (b), tostring (c), tostring (x), tostring (y), tostring (z), tostring (vehname)) Also you didn't insert any serial, you will have trouble because you have no serial column. So make sure to fix this one. And check this website constantly: http://www.w3schools.com/sql/sql_update.asp http://www.w3schools.com/sql/sql_insert.asp http://www.w3schools.com/sql/sql_where.asp
-
Change this line (7): if not getPlayerTeam(player) == CRIMETeam then To: if getPlayerTeam(player) ~= CRIMETeam then Or you also can put brackets too: if not (getPlayerTeam(player) == CRIMETeam) then
-
You have screenW, screenH defined? Can you show the meta? Try this anyway. guiCreateStaticImage((screenW - 150) / 2.9, (screenH - 150) / 1.25, 150, 150, "skins/"..tostring(getElementModel(localPlayer))..".png", false)
-
You can lower the marker height a little bit and try again and check if there any error on the /debugscript 3.
-
I know that and i asking you to show the server side as you're doing trigger from the server to the client side and from client side to server side of course this will affect the client side if you doing it wrong, also column is not defined and i can't see the function disattivaSelezionePersonaggio and where are you adding any row in the gird list.
-
Where is the server side? Where the function creaPg?
-
CRIME = createRadarArea(1264.73, -767.2, 200, -200, 255, 0, 0) createBlip(1293.5, -772.98, 95.96,16) marker = createMarker(1293.5, -772.98, 95.96,"cylinder", 2, 0, 0, 255, 255) local CRIMETeam = createTeam("CRIME", 255, 0, 0) function JoinCRIME(player) if not getPlayerTeam(player) == CRIMETeam then if isElementWithinMarker(player, marker) then setPlayerTeam(player, CRIMETeam) outputChatBox("#FF0000 [CRIME] #FFF000 Bem vindo a gang #FF0000 CRIME !", player, 0, 0, 0, true) end end end addCommandHandler("ingressar", JoinCRIME) function onSpawn() if getPlayerTeam(source) == CRIMETeam then setElementPosition(source, 1293.5, -772.98, 95.96) end end addEventHandler("onPlayerSpawn", root, onSpawn) addEventHandler("onMarkerHit", marker, function(player) if getElementType(player) == "player" then outputChatBox("#FF0000 [CRIME] #FFF000 Para entra a gang CRIME digita #00FF00 /ingressar", player, 0, 0, 0, true) end end) function sairDaGang(player) if getPlayerTeam(player) then setPlayerTeam(player, nil) outputChatBox("#FF0000[CRIME]#FFF000 Você saiu da gang", player, 255, 255, 255, true) else outputChatBox("#FF0000[CRIME]#FFF000 Você n?o tem gang", player, 255, 255, 255, true) end end addCommandHandler("gangabandonar", sairDaGang)
-
GUI Client side is not affected by other players, post your code so we can see what you're doing wrong.
-
بالضبط راح يطلع لك اخطاء يتطلب لاعب و إذا انت ما سويت تحقق من نوع العنصر الي دخل الماركر ان هو لاعب راح يطلع لك خطأ getPlayerTeam لان الفنكشن
-
createMarker getElementType getPlayerTeam getTeamFromName setElementPosition Event: "onMarkerHit"
-
ما راح يطلع خطأ ولا شي جربها بنفسك و شوف
-
هو الأثنين صح بس ما انحذف من التيبل element tree علشان لو البلب انحذف من الـ isElement انا تعمدت احط سطر حذف القيمة من التيبل خارج تحقق الفنكشن ما راح تكون فيه مشاكل لان حتى لو ما كان الألمنت موجود راح يحذف القيمة لما يخرج اللاعب من السيرفر
-
source مو thePlayer راح يكون اللاعب عندك و لا تنسى الأند حق الشرط
-
هذا السطر عشان يحذف القيمة من التيبل blip[source] = nil إذا ما حدفتها راح تبقى في التيبل و راح يكبر حجم التيبل تسبب لك مشاكل مع مرور الوقت بحيث ان اليوزر داتا مع مرور الوقت راح يكون متشابه و هنا تبدأ المشاكل إضافة إلى ان استهلاك الرامات راح يكون اعلى بسبب كبر حجم التيبل مع مرور الوقت
-
جرب ذا local lowerBound, upperBound = unpack(get("color_range")) blip = { }; addEventHandler ( "onResourceStart", resourceRoot, function() for i, player in ipairs ( getElementsByType ( "player" ) ) do processPlayer ( player ) end end ) function processPlayer(player) local player = source or player setTimer(function(player) if not isElement(blip[player]) then blip[player] = createBlipAttachedTo(player) end local theTeam = getPlayerTeam(player) if theTeam then local r, g, b = getTeamColor(theTeam) setPlayerNametagColor(player, r, g, b) setBlipColor(blip[player], r, g, b, 255) else local rr, gg, bb = math.random(lowerBound, upperBound), math.random(lowerBound, upperBound), math.random(lowerBound, upperBound) setPlayerNametagColor(player, rr, gg, bb) setBlipColor(blip[player], rr, gg, bb, 255) end end, 3000, 1, player) end addEventHandler ( "onPlayerLogin", root, processPlayer ) addEventHandler ( "onPlayerJoin", root, processPlayer ( source ) end ) addEventHandler ( "onPlayerQuit", root, function ( ) if isElement(blip[source]) then destroyElement(blip[source]) end blip[source] = nil end )
-
source is not defnied. function buyVeh ( ) Should be: function buyVeh ( source ) Also server side outputChatBox require visibleTo argument.
