-
Posts
7,337 -
Joined
-
Days Won
11
Everything posted by TAPL
-
setTimer(function() x, y, z = unpack(pbags[math.random(#pbags)]) baga = createPickup(x, y, z, 3, 1210) end, 50000, 1)
-
أنا سويت لك الكود كامل قارن الكود مع كودك و شوف الأخطاء Client Side: GUIEditor = { label = {}, button = {}, window = {}, edit = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(375, 163, 604, 407, "x~>|login penal by m7shsh07|<~x", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 1.00) showCursor(true) GUIEditor.label[1] = guiCreateLabel(255, 107, 240, 27, "user", false, GUIEditor.window[1]) GUIEditor.edit[1] = guiCreateEdit(212, 144, 153, 34, "", false, GUIEditor.window[1]) GUIEditor.label[2] = guiCreateLabel(255, 188, 255, 21, "pass", false, GUIEditor.window[1]) GUIEditor.edit[2] = guiCreateEdit(208, 219, 160, 33, "", false, GUIEditor.window[1]) GUIEditor.button[1] = guiCreateButton(168, 286, 87, 43, "login", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "default-bold-small") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFB10000") GUIEditor.button[2] = guiCreateButton(296, 288, 86, 41, "register", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[2], "default-bold-small") guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FF00B110") GUIEditor.label[3] = guiCreateLabel(9, 380, 246, 23, "by m7shsh07 v1.0 fix", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[3], "default-bold-small") guiLabelSetColor(GUIEditor.label[3], 55, 55, 55) end ) addEventHandler ("onClientGUIClick", getRootElement(), function() local userName = guiGetText(GUIEditor.edit[1]) local passWord = guiGetText(GUIEditor.edit[2]) if userName ~= "" and passWord ~= "" then if source == GUIEditor.button[1] then triggerServerEvent("Login-Register", localPlayer, "Login", userName, passWord) elseif source == GUIEditor.button[2] then triggerServerEvent("Login-Register", localPlayer, "Register", userName, passWord) end end end) function show() guiSetVisible(GUIEditor.window[1], not guiGetVisible(GUIEditor.window[1])) showCursor(guiGetVisible(GUIEditor.window[1])) end bindKey("f1", "down", show) Server Side: addEvent("Login-Register", true) addEventHandler("Login-Register", root, function(action, userName, passWord) if (action == "Login") then local account = getAccount(userName, passWord) if account then logIn(source, account, passWord) else outputChatBox ("Wrong username or password! | خطاء في الاسم او الباسورد", source, 255, 255, 0) end elseif (action == "Register") then if not getAccount(userName) then local accountAdded = addAccount(userName, passWord) if accountAdded then outputChatBox("Thank you|شكرا لك "..getPlayerName(source)..", you're now registred, you can login with /login | الان لقد اتممت التسجيل فضضلا اذهب لتسجيل الدخول", source, 0, 255, 0) else outputChatBox("Error creating account, contact the server admin | خطاء في صنع الحساب اذا لما تستطع صنع الحساب فل تتواصل مع الادمين ", source, 255, 0, 0) end else outputChatBox("اسم الحساب هذا مسجل من قبل", source, 255, 0, 0) end end end) ولا تنسى تضيفه في قروب ادمن لان التسجيل يحتاج صلاحيات
-
GUI هذا الفنكشن يجيب الكلام من الـ انت تحتاجه عشان تجيب الأسم و الباس الموجود في المربع الأبيض guiGetText
-
local myMarker = createMarker(2472.2741699219, -1667.9583740234, 13.313663482666, 'corona', 2.0, 255, 0, 0, 150) -- i make marker function MarkerHit( hitElement, matchingDimension ) local elementType = getElementType( hitElement ) outputChatBox( elementType.." test", hitElement, 255, 255, 0 ) -- Change this to hitElement so it outputs for hitElement fadeCamera(hitElement, false, 0.5) setTimer(fadeCamera, 1000, 1, hitElement, true) end addEventHandler( "onMarkerHit", myMarker, MarkerHit )
-
Add the resource to ACL, admin group.
-
This better. addCommandHandler("opengui", function() if guiGetVisible(b2.windows) then guiSetVisible(b2.windows, false) showCursor(false) else guiSetVisible(b2.windows, true) showCursor(true) end end) bindKey("F1", "down", "opengui")
-
local x,y = guiGetScreenSize( ) local left,top,right,bottom = x*351/1360,y*166/768,x*999/1360,y*454/768 function DrawTheText() if isTimer(tt) then _, count = getTimerDetails(tt) dxDrawText("Wait [ "..tostring(count).." ]",left,top,right,bottom, tocolor(0,255,0,255), 2.00, "default-bold", "center", "top", false, false, false, false, false) else removeEventHandler("onClientRender", root, DrawTheText) triggerServerEvent("give", getLocalPlayer()) end end local marker = createMarker(1956.6, -2486, 13.5-1, "cylinder", 2, 255, 0, 0) addEventHandler("onClientMarkerHit", marker, function (p) if p == localPlayer and not isTimer(tt) then tt = setTimer(function() end, 1000, 10) addEventHandler("onClientRender", root, DrawTheText) end end)
-
كودك صراحه هريسه انت مسوي ميمو حق مود تسجيل و تسجيل دخول المفروض تسوي ايدت + addEventHandler ("onClientGUIClick", getRootElement(), function () if source == GUIEditor.button[1] then logIn ( "logIn", true ) if source == GUIEditor.button[2] then registerPlayer ( "registerPlayer",true ) end end end ) من وين جايبهم سطر 4 و 6 قصدي يعني ليه كتبتهم زي كذا ايش كان مصدر معلوماتك + كيف تجيب الأسم و الباس؟ ما اشوف الفنكشن هذا في كودك guiGetText ينقل الى قسم البرمجة
-
Wrong path i guess, Jobs_System is the name of the script? You don't need to put the name of the script. local sound = playSound ("songs/MissionComplete.mp3")
-
getPlayerWantedLevel getPlayerTeam getTeamName cancelEvent onClientPlayerDamage
-
In order for the text to stay visible continuously, you need to call this function with the same parameters on each frame update (see onClientRender).
-
triggerClientEvent ("winSound", source) Should be: triggerClientEvent(source, "winSound", source) And please keep post in same topic when the code is related and please pick different topic name as i start to get confused because all your topics have same name ._.
-
جهاز؟ لا هنا موجود مثال على بيد يلحق اللاعب https://forum.multitheftauto.com/viewtopic.php?f=91&t=67785
-
اجل ليه حاط تريقر بالكلينت؟ ولا الكود مسروق؟
-
I changed the event name "Marker" to "briefcaseMarker" because you have another script while use same event name. Also i added element type checker, and added timer checker. player here not defined as you didn't pass it in triggerServerEvent. function onBtnClick(player) local atthedTo = exports.bone_attach:getElementBoneAttachmentDetails(bagb) if atthedTo == player then local money = math.random(1000, 2000) givePlayerMoney(player, money) destroyElement(bagb) triggerClientEvent(source,"WarningText",getRootElement(),"reward","You have rewarded from the dealer") else triggerClientEvent(source,"WarningText",getRootElement(),"reward","You Must get the briefcase of weapons First!") end end addEvent ("reward", true) addEventHandler ("reward", getRootElement(), onBtnClick) This is how it should be: function onBtnClick() local atthedTo = exports.bone_attach:getElementBoneAttachmentDetails(bagb) if atthedTo == source then local money = math.random(1000, 2000) givePlayerMoney(source, money) destroyElement(bagb) triggerClientEvent(source, "WarningText", source, "reward", "You have rewarded from the dealer") else triggerClientEvent(source, "WarningText", source, "reward", "You Must get the briefcase of weapons First!") end end addEvent("reward", true) addEventHandler ("reward", root, onBtnClick)
-
Server Side: local pbags = { {2293.154, 561.47, 7.78}, } briefcaseMarker = createMarker(2291.2, 537, 0.8, "cylinder", 1.5, 255, 0, 0) x, y, z = unpack(pbags[math.random(#pbags)]) baga = createPickup(x, y, z, 3, 1210) function Marker(player) if getElementType(player) == "player" then triggerClientEvent(player, "briefcaseMarker", player) end end addEventHandler("onMarkerHit", briefcaseMarker, Marker) function onPickupHit(player) if source == baga then if not isPedInVehicle(player) and not isPedDead(player) then bagb = createObject(1210, 0, 0, 0) exports.bone_attach:attachElementToBone(bagb,player,12,0,0.1,0.3,0,180,0) destroyElement(source) end end end addEventHandler("onPickupHit", root, onPickupHit) function onBtnClick() local atthedTo = exports.bone_attach:getElementBoneAttachmentDetails(bagb) if atthedTo == source then local money = math.random(1000, 2000) givePlayerMoney(source, money) destroyElement(bagb) triggerClientEvent(source, "WarningText", source, "reward", "You have rewarded from the dealer") else triggerClientEvent(source, "WarningText", source, "reward", "You Must get the briefcase of weapons First!") end end addEvent("reward", true) addEventHandler ("reward", root, onBtnClick) function onPlayerQuit() local atthedTo = exports.bone_attach:getElementBoneAttachmentDetails(bagb) if atthedTo == source then destroyElement(bagb) local x, y, z = getElementPosition(source) baga = createPickup(x, y, z, 3, 1210) end end addEventHandler("onPlayerQuit", root, onPlayerQuit) Client Side: --[[------------------------------------------------- Notes: > This code is using a relative image filepath. This will only work as long as the location it is from always exists, and the resource it is part of is running. To ensure it does not break, it is highly encouraged to move images into your local resource and reference them there. --]]------------------------------------------------- GUIEditor = { window = {}, staticimage = {}, label = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(319, 155, 640, 434, "Weapon Briefcase Dealer", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 1.00) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FF0B21F2") guiSetVisible (GUIEditor.window[1], false) Close = guiCreateButton(505, 372, 115, 45, "Close", false, GUIEditor.window[1]) guiSetFont(Close, "default-bold-small") guiSetProperty(Close, "NormalTextColour", "FF6A9470") GUIEditor.label[1] = guiCreateLabel(118, 47, 391, 16, "If you found a Briefcase of weapons get it here and get your Rewards!", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[1], 254, 0, 0) GUIEditor.staticimage[1] = guiCreateStaticImage(53, 84, 538, 153, ":Jobs_System/images/briefcase.png", false, GUIEditor.window[1]) Rewards = guiCreateButton(229, 276, 160, 67, "Get Your Rewards", false, GUIEditor.window[1]) Warning = guiCreateLabel(4, 240, 632, 34, "", false, GUIEditor.window[1]) guiSetFont(Warning, "default-bold-small") guiLabelSetColor(Warning, 253, 0, 5) guiLabelSetHorizontalAlign(Warning, "center", false) guiLabelSetVerticalAlign(Warning, "center") ---handlers addEventHandler ("onClientGUIClick", Rewards, onRewardButton, false) addEventHandler ("onClientGUIClick", Close, CloseBtn, false) end ) function Marker() guiSetVisible(GUIEditor.window[1], true) showCursor(true) end addEvent("briefcaseMarker", true) addEventHandler("briefcaseMarker", root, Marker) function onRewardButton(button,state) if (button == "left" and state == "up") then triggerServerEvent("reward", localPlayer) end end function Error_msg(Tab,Text) if Tab == "reward" then guiSetText (Warning, Text) if isTimer(iR) then killTimer(iR) end iR = setTimer(function() guiSetText(Warning, "") end, 25000, 1) end end addEvent("WarningText", true) addEventHandler("WarningText", getRootElement(), Error_msg) function CloseBtn() guiSetVisible(GUIEditor.window[1], false) showCursor(false) end And please when you copy the code, first hide the line number from the button (LINE NUMBER ON/OF) also use (SELECT ALL) so you don't get ugly space in your code each time you copy it.
-
addEventHandler("onClientPlayerDamage", localPlayer, function(attacker) if attacker and getElementType(attacker) == "player" and attacker ~= source then local sGroup = getElementData(source, "Group") local aGroup = getElementData(attacker, "Group") if sGroup and aGroup and sGroup == aGroup then cancelEvent() end end end)
-
"logRes"> "logRes"> "resource.cys-login"> "logRes"> "function.addAccount" access="true">
