Jump to content

YourMind

Members
  • Posts

    347
  • Joined

  • Last visited

Everything posted by YourMind

  1. --client local sx, sy = guiGetScreenSize() function centerTheGUI( guiElement ) local width, height = guiGetSize( guiElement, false ) local x, y = sx / 2 - width / 2, sy / 2 - height / 2 guiSetPosition( guiElement, x, y, false ) end GUIEditor = { memo = {}, button = {}, window = {}, tab = {}, checkbox = {}, label = {}, tabpanel = {}, } GUIEditor.window[1] = guiCreateWindow(114, 60, 500, 468, "CPT Zombie / The Walking Dead v2", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible (GUIEditor.window[1],false) guiSetAlpha(GUIEditor.window[1], 0.96) centerTheGUI( GUIEditor.window[1] ) GUIEditor.label[2] = guiCreateLabel(19, 41, 112, 44, "Username:", false, GUIEditor.window[1]) GUIEditor.memo[4] = guiCreateMemo(84, 35, 170, 33, "", false, GUIEditor.window[1]) GUIEditor.memo[6] = guiCreateMemo(84, 35, 170, 33, "", false, GUIEditor.window[1]) GUIEditor.memo[7] = guiCreateMemo(84, 35, 170, 33, "", false, GUIEditor.window[1]) GUIEditor.memo[8] = guiCreateMemo(84, 35, 170, 33, "", false, GUIEditor.window[1]) GUIEditor.memo[9] = guiCreateMemo(84, 35, 170, 32, "", false, GUIEditor.window[1]) GUIEditor.memo[10] = guiCreateMemo(83, 75, 172, 33, "", false, GUIEditor.window[1]) GUIEditor.label[4] = guiCreateLabel(19, 85, 64, 16, "Password:", false, GUIEditor.window[1]) GUIEditor.button[3] = guiCreateButton(53, 122, 114, 36, "Login", false, GUIEditor.window[1]) GUIEditor.button[4] = guiCreateButton(195, 122, 114, 36, "Create an Account", false, GUIEditor.window[1]) GUIEditor.button[10] = guiCreateButton(336, 122, 114, 36, "Forgot Password?", false, GUIEditor.window[1]) GUIEditor.checkbox[5] = guiCreateCheckBox(272, 45, 165, 17, "Remember Username", true, false, GUIEditor.window[1]) GUIEditor.checkbox[7] = guiCreateCheckBox(272, 81, 165, 17, "Remember Password", true, false, GUIEditor.window[1]) GUIEditor.label[5] = guiCreateLabel(145, 180, 308, 19, "Welcome to CPT! Play fair, have fun.", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[5], 9, 104, 169) GUIEditor.tabpanel[4] = guiCreateTabPanel(9, 211, 482, 248, false, GUIEditor.window[1]) GUIEditor.tab[6] = guiCreateTab("Updates", GUIEditor.tabpanel[4]) GUIEditor.memo[19] = guiCreateMemo(1, 2, 479, 220, "The opening of the server on Friday Programming (Hardgamer+Fawad)\nMaud was making weapons relased 3/3/2016 v2 \nTo buy zones talk Hardgamer in skype CPT Zombie Go to skype and payment method onecard .\nit has been making the beginnign 2/3/2016 v2 . \nmaking auto shop v2 by (Fawad) . \nmod was making click x by Hardgamer. \n", false, GUIEditor.tab[6]) GUIEditor.tab[7] = guiCreateTab("Todays Stats", GUIEditor.tabpanel[4]) GUIEditor.memo[23] = guiCreateMemo(1, 2, 479, 220, "1 - Not to sabotage the player\n2 - Do not try hack thie server is protected \n3 - Do not try to enter any headquatres For not looged in preison for 4 hours \n4 - Not insulting players \n5 - Emphasis will be from him or give money to one's predcessor and his friend did not attribut you screenshot chaat and send to skype CPT Zombie if you did not return the money .", false, GUIEditor.tab[7]) addEventHandler("onClientGUIClick",root, function () if source == GUIEditor.button[3] then local uss,passs = guiGetText (GUIEditor.memo[9]) , guiGetText (GUIEditor.memo[10]) triggerServerEvent("onLogin",localPlayer,uss,passs) elseif source == GUIEditor.button[4] then local uss,passs = guiGetText (GUIEditor.memo[9]) , guiGetText (GUIEditor.memo[10]) triggerServerEvent("onReg",localPlayer,uss,passs) end end ) addEvent("Hidewindow",true) addEventHandler("Hidewindow",root, function () guiSetVisible(GUIEditor.window[1],false) showCursor(false) showChat(true) fadeCamera(true,5) setCameraTarget (localPlayer) end ) addEvent("show",true) addEventHandler("show",root, function () guiSetVisible(GUIEditor.window[1],true) showCursor(true) showChat(true) end ) --server addEvent("onLogin", true) addEventHandler("onLogin",root, function (user, pass) local account = getAccount ( user, pass ) if account then local log = logIn (source,account,pass) if log then outputChatBox ( "You Logged in Sucessfuly!", source, 255, 255, 0 , true ) triggerClientEvent (source, "Hidewindow", source) else outputChatBox ( "Login Error!", source, 255, 0, 0 ) end else outputChatBox ( "Wrong username or password!", source, 255, 0, 0 ) end end ) -- addEvent("onReg", true) addEventHandler("onReg",root, function (user, pass) if not getAccount (user,pass) then local acc = addAccount (user,pass) if acc then local account = getAccount ( user, pass ) outputChatBox ("You've registered successfully!",source,0,255,0) else outputChatBox ("Error creating account !",source,255,0,0) end else outputChatBox ("This account is already exists !",source,255,0,0) end end ) addEventHandler ("onPlayerJoin",root, function () l = source repeat until setTimer(function() triggerClientEvent (l,"show",l) end,2000,1) end )
  2. function Begin( ) local Player = getRandomPlayer () blip = createBlipAttachedTo ( player, 47) setElementData( Player , 'pplayer', true) outputChatBox( '*kill'..getPlayerName( Player ) ..' To Win $50000', root, 128, 128, 128) end Begin() addEventHandler("onPlayerWasted",root, function( _, Killer ) if ( Killer and Killer ~= source and getElementType( Killer ) == "player") then givePlayerMoney( Killer, 50000 ) destroyElement(blip) setElementData( source, 'pplayer', false) outputChatBox('* '..getPlayerName( Killer )..' Killed ' ..getPlayerName( source )..' and win $50000.',root, 128, 128, 128 ) setTimer( Begin,60000,1) end end )
  3. طيب جرب setTimer ( function () local theCol = getElementData(root, "BlockExportCol") function isInColExport () if isElement(theCol) and isElementWithinColShape(localPlayer,theCol) then return true else return false end end function ClientExplosionCFunction() if isInColExport () then cancelEvent () end end addEventHandler("onClientExplosion", root, ClientExplosionCFunction) end , 1000, 1 ) GUIEditor = { label = {} } Window_VS = guiCreateWindow(108, 108, 596, 401, ":: Vehicle Systeam ::", false) guiWindowSetSizable(Window_VS, false) guiSetVisible(Window_VS ,false) Grid_VS = guiCreateGridList(9, 24, 314, 350, false, Window_VS) guiGridListAddColumn(Grid_VS, "Vehicle", 0.3) guiGridListAddColumn(Grid_VS, "Price", 0.3) guiGridListAddColumn(Grid_VS, "Healthy", 0.3) Button_VS_sn = guiCreateButton(393, 24, 179, 38, "Spawn Vehicle", false, Window_VS) guiSetProperty(Button_VS_sn, "NormalTextColour", "FFAAAAAA") Button_VS_dy = guiCreateButton(393, 72, 179, 38, "Destroy Car", false, Window_VS) guiSetProperty(Button_VS_dy, "NormalTextColour", "FFAAAAAA") Button_VS_lk = guiCreateButton(393, 116, 179, 38, "Lock/Unlock Vehicle", false, Window_VS) guiSetProperty(Button_VS_lk, "NormalTextColour", "FFAAAAAA") Button_VS_lt = guiCreateButton(393, 160, 179, 38, "Light/Unlight Vehicle", false, Window_VS) guiSetProperty(Button_VS_lt, "NormalTextColour", "FFAAAAAA") Button_VS_bp = guiCreateButton(393, 203, 179, 38, "Mark/Unmark Vehicle", false, Window_VS) guiSetProperty(Button_VS_bp, "NormalTextColour", "FFAAAAAA") Button_VS_Spc = guiCreateButton(393, 245, 179, 38, "Spectate Vehicle", false, Window_VS) guiSetProperty(Button_VS_Spc, "NormalTextColour", "FFAAAAAA") Button_VS_sl = guiCreateButton(393, 293, 179, 38, "Sell Vehicle", false, Window_VS) guiSetProperty(Button_VS_sl, "NormalTextColour", "FFAAAAAA") Button_VS_close = guiCreateButton(393, 336, 179, 38, "X", false, Window_VS) guiSetProperty(Button_VS_close, "NormalTextColour", "FFAAAAAA") GUIEditor.label[1] = guiCreateLabel(10, 374, 201, 17, "#Created By FawaD | v3.4.1", false, Window_VS) guiLabelSetColor(GUIEditor.label[1], 255, 0, 0) function updateGridList() local data = getElementData(localPlayer, "VehicleInfo") if data then local rw, cl = guiGridListGetSelectedItem(Grid_VS) guiGridListClear(Grid_VS) for i, data in ipairs (data) do local carName = getVehicleNameFromModel(data["Model"]) local ID = data["ID"] local Cost = data["Cost"] local HP = math.floor(data["HP"]) local PreCost = math.ceil(Cost*.9*HP/100/10) local row = guiGridListAddRow(Grid_VS) guiGridListSetItemText(Grid_VS, row, 1, carName, false, true) guiGridListSetItemData(Grid_VS, row, 1, ID) guiGridListSetItemText(Grid_VS, row, 2, PreCost, false, true) guiGridListSetItemText(Grid_VS, row, 3, HP.." HP", false, true) end guiGridListSetSelectedItem(Grid_VS, rw, cl) end end bindKey("F4", "down", function() if getElementInterior(localPlayer) == 0 and getElementDimension(localPlayer) == 0 then if not getElementData(localPlayer, "MissionWarProtection") then guiSetVisible(Window_VS, not guiGetVisible(Window_VS)) guiSetVisible (Window_CHK, false) showCursor(guiGetVisible(Window_VS)) end end end ) triggerServerEvent("onOpenGui", localPlayer) addEventHandler("onClientElementDataChange", root, function(dd) if getElementType(source) == "player" and source == localPlayer and dd == "VehicleInfo" then local data = getElementData(source, dd) if data then updateGridList() end end end) function WINDOW_CLICK_VEHICLE (button, state, absoluteX, absoluteY) local id = guiGridListGetSelectedItem(Grid_VS) local ID = guiGridListGetItemData(Grid_VS, id, 1) if source == Button_VS_close then guiSetVisible(Window_VS, false) showCursor(false) end if (source == Grid_VS) then if id == -1 and idd then guiGridListSetSelectedItem(Grid_VS, idd, 1) return false else idd = guiGridListGetSelectedItem(Grid_VS) end elseif id == -1 then elseif (source == Button_VS_sn) then if not isInColExport () then triggerServerEvent("SpawnMyVehicle", localPlayer, ID) end elseif (source == Button_VS_dy) then triggerServerEvent("DestroyMyVehicle", localPlayer, ID) elseif (source == Button_VS_lt) then triggerServerEvent("LightsMyVehicle", localPlayer, ID) elseif (source == Button_VS_bp) then triggerServerEvent("BlipMyVehicle", localPlayer, ID) elseif (source == Button_VS_lk) then triggerServerEvent("LockMyVehicle", localPlayer, ID) elseif (source == Button_VS_sl) then guiSetVisible(Window_CHK, true) local carName = guiGridListGetItemText(Grid_VS, guiGridListGetSelectedItem(Grid_VS), 1) local carprice = guiGridListGetItemText(Grid_VS, guiGridListGetSelectedItem(Grid_VS), 2) guiSetText(Label_CHK, 'Are you sure you want to sell this Vehicle "'..carName..'" for $'..carprice) elseif source == Button_CHK_Y then triggerServerEvent("SellMyVehicle", localPlayer, ID) guiSetVisible(Window_VS, false) guiSetVisible(Window_CHK, false) showCursor(false) elseif source == Button_CHK_N then guiSetVisible (Window_CHK, false) elseif source == Button_VS_Spc then if getElementInterior(localPlayer) == 0 then if getElementData(localPlayer,"Stats") < 2 then SpecVehicle(ID) end end elseif source == Button_VS_Fix then triggerServerEvent("FixMyVehicle", localPlayer, ID) elseif source == Button_VS_Warp then if not isInColExport () then triggerServerEvent("WarpMyVehicle", localPlayer, ID) end end end addEventHandler("onClientGUIClick", resourceRoot, WINDOW_CLICK_VEHICLE) function SpecVehicle(id) if spc then removeEventHandler("onClientPreRender", root, Sp) setCameraTarget(localPlayer) if isTimer(freezTimer) then killTimer(freezTimer) end freezTimer = setTimer(function() setElementFrozen(localPlayer, false) end, 2500, 1) spc = false return end for i, vehicle in ipairs(getElementsByType("vehicle")) do if getElementData(vehicle, "Owner") == localPlayer and getElementData(vehicle, "ID") == id then cVeh = vehicle spc = true addEventHandler("onClientPreRender", root, Sp) guiSetVisible(Window_VS, false) showCursor(false) break end end end function Sp() if isElement(cVeh) then local x, y, z = getElementPosition(cVeh) setElementFrozen(localPlayer, true) setCameraMatrix(x, y-1, z+15, x, y, z) else removeEventHandler("onClientPreRender", root, Sp) setCameraTarget(localPlayer) if isTimer(freezTimer) then killTimer(freezTimer) end freezTimer = setTimer(function() setElementFrozen(localPlayer, false) end, 2500, 1) spc = false end end ShopMarkersTable = {} local ShopTable = { [1] = {ID = {{491, 1441400} ,{540, 1436800} ,{401, 1430000} ,{546, 1527700} ,{505, 1414000} ,{500, 1402600} ,{463, 1659300} ,{492, 1459300} ,{547, 1429600} ,{586, 1629600} ,{467, 1354300} ,{479, 1244800} ,{404, 1059900} ,{410, 946200} ,{471, 593600} ,{418, 300000} }, vPosX = 2134, vPosY = -1170, vPosZ = 28.15, PosX = 2133, PosY = -1149, PosZ = 23.4, CamX = 2134.1, CamY = -1160, CamZ = 35, lookAtX = 2133.3, lookAtY = -1168, lookAtZ = 28}, [2] = {ID = {{516, 1819800} ,{458, 1815300} ,{580, 1801600} ,{421, 1801600} ,{527, 1667300} ,{581, 2151400} ,{409, 1744500} ,{585, 1696600} ,{474, 1573800} ,{419, 1539500} ,{436, 1539500} ,{545, 1530400} ,{466, 1616700} ,{529, 1580200} ,{550, 1473400} ,{468, 1966500} }, vPosX = 552, vPosY = -1288, vPosZ = 18, PosX = 562, PosY = -1270, PosZ = 16, CamX = 552, CamY = -1275.82, CamZ = 21.61, lookAtX = 552, lookAtY = -1276.77, lookAtZ = 21.29}, [3] = {ID = {{533, 1973100} ,{555, 1943400} ,{507, 2041200} ,{521, 2427500} ,{461, 2427500} ,{566, 1995500} ,{551, 1972700} ,{400, 1970400} ,{558, 1863600} ,{549, 1824800} ,{579, 1902000} ,{576, 1797400} ,{526, 1781400} ,{517, 1772300} ,{575, 1763200} ,{561, 1822100} }, vPosX = 1942.5, vPosY = 2052, vPosZ = 11, PosX = 1946, PosY = 2068, PosZ = 10, CamX = 1930.36, CamY = 2052.78, CamZ = 14.71, lookAtX = 1931.36, lookAtY = 2052.78, lookAtZ = 14.43}, [4] = {ID = {{536, 2201300} ,{567, 2258000} ,{602, 2135100} ,{534, 2128300} ,{426, 2214600} ,{439, 2114600} ,{412, 2114600} ,{587, 2087200} ,{565, 2084900} ,
  4. --client local sx, sy = guiGetScreenSize() function centerTheGUI( guiElement ) local width, height = guiGetSize( guiElement, false ) local x, y = sx / 2 - width / 2, sy / 2 - height / 2 guiSetPosition( guiElement, x, y, false ) end GUIEditor = { staticimage = {}, edit = {}, button = {}, window = {}, label = {} } GUIEditor.window[1] = guiCreateWindow(60, 103, 705, 421, ":: Login System ::", false) guiWindowSetSizable(GUIEditor.window[1], false) centerTheGUI( GUIEditor.window[1] ) GUIEditor.staticimage[1] = guiCreateStaticImage(9, 22, 675, 189, ":Shop/images/adham.png", false, GUIEditor.window[1]) GUIEditor.label[1] = guiCreateLabel(184, 217, 328, 15, "Welcome @ To Server, Please Login to Enter the game", false, GUIEditor.window[1]) GUIEditor.label[2] = guiCreateLabel(170, 246, 93, 24, "Username:", false, GUIEditor.window[1]) GUIEditor.edit[1] = guiCreateEdit(232, 242, 239, 28, "", false, GUIEditor.window[1]) GUIEditor.edit[2] = guiCreateEdit(232, 280, 239, 28, "", false, GUIEditor.window[1]) GUIEditor.label[3] = guiCreateLabel(170, 280, 93, 24, "Password:", false, GUIEditor.window[1]) GUIEditor.button[1] = guiCreateButton(127, 314, 173, 47, "Login", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "sa-header") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") GUIEditor.button[2] = guiCreateButton(372, 318, 173, 47, "Register", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[2], "sa-header") guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA") GUIEditor.label[4] = guiCreateLabel(522, 396, 355, 15, "#Created By #[L]e3bA | v3.4.1", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[4], 255, 0, 0) guiSetVisible (GUIEditor.window[1],false) addEventHandler("onClientGUIClick",root, function () if source == GUIEditor.button[1] then local uss,passs = guiGetText(GUIEditor.edit[1]),guiGetText(GUIEditor.edit[2]) triggerServerEvent("onLogin",localPlayer,uss,passs) elseif source == GUIEditor.button[2] then local uss,passs = guiGetText(GUIEditor.edit[1]),guiGetText(GUIEditor.edit[2]) triggerServerEvent("onReg",localPlayer,uss,passs) end end ) addEvent("Hidewindow",true) addEventHandler("Hidewindow",root, function () guiSetVisible(GUIEditor.window[1],false) showCursor(false) showChat(true) fadeCamera(true,5) setCameraTarget (localPlayer) end ) addEvent("show",true) addEventHandler("show",root, function () guiSetVisible(GUIEditor.window[1],true) showCursor(true) showChat(true) end ) --server addEvent("onLogin", true) addEventHandler("onLogin",root, function (user, pass) local account = getAccount ( user, pass ) if ( account ~= true ) then local log = logIn (source,account,pass) if log then outputChatBox ( "You Logged in Sucessfuly!", source, 255, 255, 0 , true ) triggerClientEvent (source, "Hidewindow", source) else outputChatBox ( "Login Error!", source, 255, 0, 0 ) end else outputChatBox ( "Wrong username or password!", source, 255, 0, 0 ) end end ) -- addEvent("onReg", true) addEventHandler("onReg",root, function (user, pass) if not getAccount (user,pass) then local acc = addAccount (user,pass) if acc then local account = getAccount ( user, pass ) outputChatBox ("You've registered successfully!",source,0,255,0) else outputChatBox ("Error creating account !",source,255,0,0) end else outputChatBox ("This account is already exists !",source,255,0,0) end end ) addEventHandler ("onPlayerJoin",root, function () l = source repeat until setTimer(function() triggerClientEvent (l,"show",l) end,2000,1) end )
  5. setTimer ( function () local theCol = getElementData(root, "BlockExportCol") function isInColExport () if isElement(theCol) and isElementWithinColShape(localPlayer,theCol) then return true else return false end end function ClientExplosionCFunction() if isInColExport () then cancelEvent () end end addEventHandler("onClientExplosion", root, ClientExplosionCFunction) end , 1000, 1 ) GUIEditor = { label = {} } addEventHandler("onClientResourceStart", resourceRoot, function() Window_VS = guiCreateWindow(108, 108, 596, 401, ":: Vehicle Systeam ::", false) guiWindowSetSizable(Window_VS, false) guiSetVisible(Window_VS ,false) Grid_VS = guiCreateGridList(9, 24, 314, 350, false, Window_VS) guiGridListAddColumn(Grid_VS, "Vehicle", 0.3) guiGridListAddColumn(Grid_VS, "Price", 0.3) guiGridListAddColumn(Grid_VS, "Healthy", 0.3) Button_VS_sn = guiCreateButton(393, 24, 179, 38, "Spawn Vehicle", false, Window_VS) guiSetProperty(Button_VS_sn, "NormalTextColour", "FFAAAAAA") Button_VS_dy = guiCreateButton(393, 72, 179, 38, "Destroy Car", false, Window_VS) guiSetProperty(Button_VS_dy, "NormalTextColour", "FFAAAAAA") Button_VS_lk = guiCreateButton(393, 116, 179, 38, "Lock/Unlock Vehicle", false, Window_VS) guiSetProperty(Button_VS_lk, "NormalTextColour", "FFAAAAAA") Button_VS_lt = guiCreateButton(393, 160, 179, 38, "Light/Unlight Vehicle", false, Window_VS) guiSetProperty(Button_VS_lt, "NormalTextColour", "FFAAAAAA") Button_VS_bp = guiCreateButton(393, 203, 179, 38, "Mark/Unmark Vehicle", false, Window_VS) guiSetProperty(Button_VS_bp, "NormalTextColour", "FFAAAAAA") Button_VS_Spc = guiCreateButton(393, 245, 179, 38, "Spectate Vehicle", false, Window_VS) guiSetProperty(Button_VS_Spc, "NormalTextColour", "FFAAAAAA") Button_VS_sl = guiCreateButton(393, 293, 179, 38, "Sell Vehicle", false, Window_VS) guiSetProperty(Button_VS_sl, "NormalTextColour", "FFAAAAAA") Button_VS_close = guiCreateButton(393, 336, 179, 38, "X", false, Window_VS) guiSetProperty(Button_VS_close, "NormalTextColour", "FFAAAAAA") GUIEditor.label[1] = guiCreateLabel(10, 374, 201, 17, "#Created By FawaD | v3.4.1", false, Window_VS) guiLabelSetColor(GUIEditor.label[1], 255, 0, 0) end ) function updateGridList() local data = getElementData(localPlayer, "VehicleInfo") if data then local rw, cl = guiGridListGetSelectedItem(Grid_VS) guiGridListClear(Grid_VS) for i, data in ipairs (data) do local carName = getVehicleNameFromModel(data["Model"]) local ID = data["ID"] local Cost = data["Cost"] local HP = math.floor(data["HP"]) local PreCost = math.ceil(Cost*.9*HP/100/10) local row = guiGridListAddRow(Grid_VS) guiGridListSetItemText(Grid_VS, row, 1, carName, false, true) guiGridListSetItemData(Grid_VS, row, 1, ID) guiGridListSetItemText(Grid_VS, row, 2, PreCost, false, true) guiGridListSetItemText(Grid_VS, row, 3, HP.." HP", false, true) end guiGridListSetSelectedItem(Grid_VS, rw, cl) end end bindKey("F4", "down", function() if getElementInterior(localPlayer) == 0 and getElementDimension(localPlayer) == 0 then if getElementData(localPlayer, "MissionWarProtection") and getElementData(localPlayer, "MissionProtection")then return end guiSetVisible(Window_VS, not guiGetVisible(Window_VS)) guiSetVisible (Window_CHK, false) showCursor(guiGetVisible(Window_VS)) end end) triggerServerEvent("onOpenGui", localPlayer) addEventHandler("onClientElementDataChange", root, function(dd) if getElementType(source) == "player" and source == localPlayer and dd == "VehicleInfo" then local data = getElementData(source, dd) if data then updateGridList() end end end) function WINDOW_CLICK_VEHICLE (button, state, absoluteX, absoluteY) local id = guiGridListGetSelectedItem(Grid_VS) local ID = guiGridListGetItemData(Grid_VS, id, 1) if source == Button_VS_close then guiSetVisible(Window_VS, false) showCursor(false) end if (source == Grid_VS) then if id == -1 and idd then guiGridListSetSelectedItem(Grid_VS, idd, 1) return false else idd = guiGridListGetSelectedItem(Grid_VS) end elseif id == -1 then elseif (source == Button_VS_sn) then if not isInColExport () then triggerServerEvent("SpawnMyVehicle", localPlayer, ID) end elseif (source == Button_VS_dy) then triggerServerEvent("DestroyMyVehicle", localPlayer, ID) elseif (source == Button_VS_lt) then triggerServerEvent("LightsMyVehicle", localPlayer, ID) elseif (source == Button_VS_bp) then triggerServerEvent("BlipMyVehicle", localPlayer, ID) elseif (source == Button_VS_lk) then triggerServerEvent("LockMyVehicle", localPlayer, ID) elseif (source == Button_VS_sl) then guiSetVisible(Window_CHK, true) local carName = guiGridListGetItemText(Grid_VS, guiGridListGetSelectedItem(Grid_VS), 1) local carprice = guiGridListGetItemText(Grid_VS, guiGridListGetSelectedItem(Grid_VS), 2) guiSetText(Label_CHK, 'Are you sure you want to sell this Vehicle "'..carName..'" for $'..carprice) elseif source == Button_CHK_Y then triggerServerEvent("SellMyVehicle", localPlayer, ID) guiSetVisible(Window_VS, false) guiSetVisible(Window_CHK, false) showCursor(false) elseif source == Button_CHK_N then guiSetVisible (Window_CHK, false) elseif source == Button_VS_Spc then if getElementInterior(localPlayer) == 0 then if getElementData(localPlayer,"Stats") < 2 then SpecVehicle(ID) end end elseif source == Button_VS_Fix then triggerServerEvent("FixMyVehicle", localPlayer, ID) elseif source == Button_VS_Warp then if not isInColExport () then triggerServerEvent("WarpMyVehicle", localPlayer, ID) end end end addEventHandler("onClientGUIClick", resourceRoot, WINDOW_CLICK_VEHICLE) function SpecVehicle(id) if spc then removeEventHandler("onClientPreRender", root, Sp) setCameraTarget(localPlayer) if isTimer(freezTimer) then killTimer(freezTimer) end freezTimer = setTimer(function() setElementFrozen(localPlayer, false) end, 2500, 1) spc = false return end for i, vehicle in ipairs(getElementsByType("vehicle")) do if getElementData(vehicle, "Owner") == localPlayer and getElementData(vehicle, "ID") == id then cVeh = vehicle spc = true addEventHandler("onClientPreRender", root, Sp) guiSetVisible(Window_VS, false) showCursor(false) break end end end function Sp() if isElement(cVeh) then local x, y, z = getElementPosition(cVeh) setElementFrozen(localPlayer, true) setCameraMatrix(x, y-1, z+15, x, y, z) else removeEventHandler("onClientPreRender", root, Sp) setCameraTarget(localPlayer) if isTimer(freezTimer) then killTimer(freezTimer) end freezTimer = setTimer(function() setElementFrozen(localPlayer, false) end, 2500, 1) spc = false end end ShopMarkersTable = {} local ShopTable = { [1] = {ID = {{491, 1441400} ,{540, 1436800} ,{401, 1430000} ,{546, 1527700} ,{505, 1414000} ,{500, 1402600} ,{463, 1659300} ,{492, 1459300} ,{547, 1429600} ,{586, 1629600} ,{467, 1354300} ,{479, 1244800} ,{404, 1059900} ,{410, 946200} ,{471, 593600} ,{418, 300000} }, vPosX = 2134, vPosY = -1170, vPosZ = 28.15, PosX = 2133, PosY = -1149, PosZ = 23.4, CamX = 2134.1, CamY = -1160, CamZ = 35, lookAtX = 2133.3, lookAtY = -1168, lookAtZ = 28}, [2] = {ID = {{516, 1819800} ,{458, 1815300} ,{580, 1801600} ,{421, 1801600} ,{527, 1667300} ,{581, 2151400} ,{409, 1744500} ,{585, 1696600} ,{474, 1573800} ,{419, 1539500} ,{436, 1539500} ,{545, 1530400} ,{466, 1616700} ,{529, 1580200} ,{550, 1473400} ,{468, 1966500} }, vPosX = 552, vPosY = -1288, vPosZ = 18, PosX = 562, PosY = -1270, PosZ = 16, CamX = 552, CamY = -1275.82, CamZ = 21.61, lookAtX = 552, lookAtY = -1276.77, lookAtZ = 21.29}, [3] = {ID = {{533, 1973100} ,{555, 1943400} ,{507, 2041200} ,{521, 2427500} ,{461, 2427500} ,{566, 1995500} ,{551, 1972700} ,{400, 1970400} ,{558, 1863600} ,{549, 1824800} ,{579, 1902000} ,{576, 1797400} ,{526, 1781400} ,{517, 1772300} ,{575, 1763200} ,{561, 1822100} }, vPosX = 1942.5, vPosY = 2052, vPosZ = 11, PosX = 1946, PosY = 2068, PosZ = 10, CamX = 1930.36, CamY = 2052.78, CamZ = 14.71, lookAtX = 1931.36, lookAtY = 2052.78, lookAtZ = 14.43}, [4] = {ID = {{536, 2201300} ,{567, 2258000} ,{602, 2135100} ,{534, 2128300} ,{426, 2214600} ,{439, 2114600} ,{412, 2114600} ,{587, 2087200} ,
  6. YourMind

    خطأء

    function convertNumber ( number ) local formatted = number while true do formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2') if ( k==0 ) then break end end return formatted end exports.scoreboard:addScoreboardColumn('Money',3) function updatePlayersMoney ( ) for index, player in ipairs ( getElementsByType "player" ) do setElementData ( player, "Money", convertNumber ( getPlayerMoney ( player ) ).."$" ) end end setTimer ( updatePlayersMoney, 500, 0 )
  7. --client addEventHandler ("onClientGUIClick",yourbutton, function () triggerServerEvent ("noTeam",localPlayer) end ) --server addEvent ("noTeam",true) addEventHandler ("noTeam",root, function () if getPlayerTeam (source) then setPlayerTeam ( source, nil ) end end )
  8. gui تقصد لما شخص يدوس علي زر من ازرار الـ يطلع من التيم ؟
  9. ياريت تطرح اكوادك ? gridlist ولا button ايه نوعه ؟ يعني take jop و جيب رقم ايدي الشخصية
  10. برمجة حاجة زي كدة صعبة لازملها حساب SQL و حفظ table.sort و حاجات غيرهم كتير زي الترتيب هاتكون صعبة عليك جداً لو انت مبتدأ في البرمجة مش اي حد يقدر يعمل حاجة زي دي
  11. يعطيك العافية بس سؤال وانا بلجو ينط؟ يعني ؟ اكيد تقدر تنط اكتر من نطة في الثانية لو عايز تعديل اؤمرني
  12. بالنسبة لأول مود انا فاضي فعملتهولك كلينت function jump() if isPedInVehicle (localPlayer) then local vehicle = getPedOccupiedVehicle (localPlayer) local xx,yy,zz = getElementVelocity (vehicle) setElementVelocity (vehicle,xx,yy,zz + 0.5) end end bindKey ("rshift","down",jump) ينط من زرار الشيفت اللي علي اليمين تقدر تغيره
  13. شكراً لك ما انتبهت هل هناك اخطاء غيره؟ انا مش ملاحظ اي اخطاء غير اللي فوق جرب انت بنفسك و لو في خطأ نصلحهولك
  14. addEvent("windowopen",true) addEventHandler("winodwopen",root غير متطابقتين سطر 72 و 73 كلينت
  15. GUIEditor = { label = {}, } GUIEditor.label[1] = guiCreateStaticImage(467, 447, 189, 75, "r.png", false) GUIEditor.label[2] = guiCreateStaticImage(218, 447, 189, 75, "q.png", false) GUIEditor.label[3] = guiCreateStaticImage(327, 532, 221, 93, "s.png", false) GUIEditor.label[4] = guiCreateStaticImage(279, 379, 159, 51, "CL.png", false) guiSetVisible(GUIEditor.label[1],false) guiSetVisible(GUIEditor.label[2],false) guiSetVisible(GUIEditor.label[3],false) guiSetVisible(GUIEditor.label[4],false) mrss = createMarker (377.54077,-1887.06738,7.83594,"cylinder",1,52,38,162,255) function hit () triggerServerEvent("hitt",localPlayer) playSound("lol.mp3") guiSetVisible(GUIEditor.label[1],true) guiSetVisible(GUIEditor.label[2],true) guiSetVisible(GUIEditor.label[3],true) guiSetVisible(GUIEditor.label[4],true) showCursor(true) end addEventHandler("onClientMarkerHit",mrss,hit) function off () if source == GUIEditor.label[4] then playSoundFrontEnd(10) guiSetVisible(GUIEditor.label[1],false) guiSetVisible(GUIEditor.label[2],false) guiSetVisible(GUIEditor.label[3],false) guiSetVisible(GUIEditor.label[4],false) showCursor(false) triggerServerEvent("stop",localPlayer) end end addEventHandler("onClientGUIClick",root,off) function oo () if source == GUIEditor.label[2] then triggerServerEvent("mony",localPlayer) playSoundFrontEnd(10) end end addEventHandler("onClientGUIClick",root,oo) function skibb () if source == GUIEditor.label[1] then playSoundFrontEnd(10) triggerServerEvent("sss",localPlayer) end end addEventHandler("onClientGUIClick",root,skibb) في الكلينت الفرق بس localplayer المفروض تكون localPlayer
  16. انت شلت خاصية اختيار الشخصية بشكل عشوائي من 0 الى 46 اعتقد سكنات من صفر الي 46 مش موجودين بالكامل و متسلسلين بعضهم موجود بالفعل لكن غير متسلسلين
  17. function skinnn () if getPlayerMoney (source) >= 500 then takePlayerMoney(source, 500) setElementModel(source,46) outputChatBox("تم شراء بنجاح",source,0,255,0) else outputChatBox ("ليس لديك مالاً كافي",source,255,0,0) end end addEvent("mony",true) addEventHandler("mony",root,skinnn) function rrr () if getPlayerMoney (source) >= 500 then takePlayerMoney(source, 500) setElementModel(source,46) outputChatBox("تم شراء بنجاح",source,0,255,0) else outputChatBox ("ليس لديك مالاً كافي",source,255,0,0) end end addEvent("sss",true) addEventHandler("sss",root,rrr) function mm () setElementPosition(source,395.46591,-1858.81592,13.60156) setCameraMatrix(source,395.64987,-1868.80786,13.60156,395.46591,-1858.81592,13.60156) end addEvent("hitt",true) addEventHandler("hitt",root,mm) function stopp () setCameraTarget(source,source) end addEvent("stop",true) addEventHandler("stop",root,stopp)
  18. اكيد اعمل التالي لما لاعب يفتح النافذة بتاعت الفي اي بي الاول يتحقق بالأكونت داتا بتاعت الاعب اللي فتح النافذة لو مش موجودة نافذة الفي اي بي تختفي و نافذة التفعيل تظهر لو موجودة نافذة التفعيل تختفي و نافذة الفي اي بي تظهر طبعاً نافذة التفعيل هايكون فيها ايديت لما لاعب يدوس علي زرار التفعيل و شوف انت هاتعمل كود التفعيل ايه string.find استخدم تحقيق و يظهرله نافذة الفي اي بي الرئيسية account data لو الاعب دخل الكود صح يعمله
  19. getAccountData string.find setAccountData
  20. طيب اطرح اللي عملته اكواد الحفظ و اظهار النافذة لما شخص يدخل السيرفر
  21. هو مش محدد عايز ايه (بالظبط
  22. --server addEventHandler ( "onPlayerWasted", root, function ( _, attacker ) if ( attacker ~= false and attacker ~= source ) then setElementHealth ( attacker, getElementHealth ( attacker ) + 35 ) triggerClientEvent(source,"dienoob",source) outputChatBox ( "[--", attacker, 0, 255, 0, true ) end end ) --client image = guiCreateStaticImage(93,439,44,35,"heart.png",false) guiSetVisible (image,false) function trolled() guiSetVisible (image,true) sound = playSound("Heartbeat.mp3", false) setSoundVolume(sound, 1) setTimer(closewin, 3000, 1) end addEvent("dienoob", true) addEventHandler("dienoob", getRootElement(), trolled) function closewin() guiSetVisible(image, false) end
  23. آسف علي التأخير تخيل الكهرباء كل دة كانت قاطعة عندي -- المهم لو دة جيم مود و اول لما الاعب يخش السيرفرر تفضل addEventHandler ("onClientGUIClick",log, -- زرار تسجيل الدخول function () -- عدل علي الباقي بالشكل اللي انت عايزه local username = guiGetText (Name) local password = guiGetText (Pass) triggerServerEvent ("LOGINTRIGGER",localPlayer,username,password) if guiCheckBoxGetSelected (save) then -- لو الاعب حاط علامة صح triggerServerEvent ("saveLogPass",localPlayer,username,password) -- الداتا تتحفظ else -- لو مفيش علامة صح triggerServerEvent ("deleteLogPass",localPlayer) -- نشيل الداتا لمنع التكرار end end ,false) addEvent ("SHOWwINTRIGGER",true) addEventHandler ("SHOWwINTRIGGER",root, function (SQLData) -- اكوادك -- مثال guiSetVisible (yourwindow,true) showCursor (true) guiSetInputEnabled (true) -- if type(SQLData) == "table" and #SQLData ~= 0 then for i,k in ipairs (SQLData) do guiSetText (Name,k.ID) guiSetText (Pass,k.PW) end -- guiCheckBoxSetSelected (save,true) -- else -- لو مفيش داتا متسجلة او الاعب ماحطش علامة صح علي البتاعة او مش عارف اسمها ايه -- النافذة تظهرله عادي و علامة الصح تتشال guiCheckBoxSetSelected (save,false) -- guiSetVisible (yourwindow,true) showCursor (true) guiSetInputEnabled (true) end end ) --server addEventHandler ("onResourceStart",resourceRoot, function () executeSQLQuery ("CREATE TABLE IF NOT EXISTS `accountsave` (serial,ID,PW)") end ) addEvent ("saveLogPass",true) addEventHandler ("saveLogPass",root, function (username,password) local yyy = executeSQLQuery ('SELECT * FROM `accountsave` WHERE serial =?',getPlayerSerial(source)) if ( type (yyy) == "table" and #yyy == 0 or not yyy ) then executeSQLQuery ('INSERT INTO `accountsave` (serial,ID,PW) VALUES (?,?,?)',getPlayerSerial(source),username,password) else executeSQLQuery ("UPDATE `accountsave` SET ID=?, PW=? WHERE serial=?",username,password,getPlayerSerial(source)) end end ) addEvent ("deleteLogPass",true) addEventHandler ("deleteLogPass",root, function (username,password) executeSQLQuery ("DELETE FROM `accountsave` WHERE serial",getPlayerSerial(source)) end ) addEventHandler ("onPlayerJoin",root, -- اظهار لوحة التسجيل في حدث لما الاعب يدخل السيرفر function () local SQLData = executeSQLQuery ('SELECT * FROM `accountsave` WHERE serial =?',getPlayerSerial(source)) -- ايجاد الداتا -- تقدر تحط اكواد هنا triggerClientEvent (source,"SHOWwINTRIGGER",source,SQLData) -- تريجر اظهار النافذة end ) انتا فهمت انا عايز اعمل ايه انا عامل شيك بوكس و عاوز لما اكتب الباس و الحساب فلاديت بوكس يتحفظو يعني لما اخروج و ارجع الاقيهم مكتوبين جوا الاديت بوكس يامعلم انت مش فاهم الاكواد بتاعتي اقرأهم و عن تجربة ليا مفيش مشاكل SQL دة لما الاعب يدوس علي زرار التسجيل و هو حاط علامة صح علي الايديت بوكس النظام يحفظ اللي مكتوب في الايديت لو مش حاط علامة صح يمسح الداتا عشان منع التكرار دة لما يسجل الدخول انما لما ييجي يخش مرة تانية الاعب يعمل تريجر و يجيب بينات الحفظ لو في بينات محفوظة فعلاً النافذة تظهر و علامة الصح تبقي موجودة في الشيك بوكس guieditو اليوزر و الباسورد يتحطوا علي ال لو مفيش بينات محفوظة علامة الصح تتشال و النافذة تظهرله عادي يكون فاضي guiedit و ال المشكلة فيك انت مش فاهم انا عملت ايه انا اقصد تضيف الاكواد دي عندك مش اقصد هي دي كل الاكواد و لو مش عارف تتصرف اطرح الاكواد كلها عشان اساعدك ان شاء الله
×
×
  • Create New...