
Best-Killer1
Members-
Posts
203 -
Joined
-
Last visited
Everything posted by Best-Killer1
-
You're welcome pfff karim other problem Group (civilians clan) if be crim can take turfs and The Service (Squads Can Be Criminal = Can take turfs too ) can help me agian ?
-
Pro <3 Thanx For Help me in everythings
-
This Is The Problem idk pff i know only this -- Group payout timer function sendTurfPayout ( ) local groupTurfs = { } for i, v in pairs ( turfLocs ) do if ( not groupTurfs [ v.owner ] ) then groupTurfs [ v.owner ] = 0 end if ( not v.attackers ) then groupTurfs [ v.owner ] = groupTurfs [ v.owner ] + 1 end end for i, v in pairs ( getElementsByType ( 'player' ) ) do local g = exports.SAEGGroups:getPlayerGroup ( v ) if ( g and groupTurfs [ g ] and groupTurfs [ g ] > 0 ) then local c = groupTurfs [ g ] * tonumber ( get ( "*PAYOUT_CASH" ) ) givePlayerMoney ( v, c ) exports.SAEGMessages:sendClientMessage ( "Turfing: Here is $"..tostring(c).." for having "..tostring ( groupTurfs [ g ] ).." turfs ($700/turf)", v, 0, 255, 0 ) end end end
-
You're welcome, About your other problem,I have no idea about your clan bank system so you have to post the code where the issue is exist. This server_c cood : ------------------------------ -- Gui Elements -- ------------------------------ sx_, sy_ = guiGetScreenSize ( ) sx, sy = sx_ / 1280, sy_ / 720 local group = nil local gList = nil function createGroupGui ( ) exports.saegmessages:sendClientMessage ( "Loading interface, please wait...", 255, 255, 0 ); gui = { main ={ }, info = { create = { }, invites = { }, motd = { } }, list = { }, admin = { admin = { }, info = { }, members = { }, ranks = { }, logs = { } }, my = { basic = { }, logs_ = { }, bank_ = { }, members_ = { }, ranks_ = { }, motd = { } } } -- main local sx__, sy__ = sx, sy local sx, sy = 1, 1 gui.main.window = guiCreateWindow((sx_/2-(sx*660)/2), (sy_/2-(sy*437)/2), sx*660, sy*437, "Group system", false) gui.main.info = guiCreateButton(sx*10, sy*26, sx*128, sy*40, "Information", false, gui.main.window) gui.main.list = guiCreateButton(sx*148, sy*26, sx*128, sy*40, "Group list", false, gui.main.window) gui.main.my = guiCreateButton(sx*286, sy*26, sx*128, sy*40, "My group", false, gui.main.window) gui.main.admin = guiCreateButton(sx*500, sy*26, sx*128, sy*40, "Groups Manager", false, gui.main.window) gui.main.line = guiCreateLabel(0, 74, sx*660, 24, string.rep ( "_", 200 ), false, gui.main.window) gui.main.admin.visible = ( getElementData ( localPlayer, "staffLevel" ) or 0 ) > 2 guiWindowSetSizable(gui.main.window, false) -- information gui.info.account = guiCreateLabel(sx*42, sy*136, sx*269, sy*20, "Account name: none", false, gui.main.window) gui.info.group = guiCreateLabel(sx*42, sy*156, sx*269, sy*20, "Group name: none", false, gui.main.window) gui.info.rank = guiCreateLabel(sx*42, sy*176, sx*269, sy*20, "Your group rank: none", false, gui.main.window) gui.info.create_ = guiCreateButton ( sx*42, sy*280, sx*130, sy*40, "Create a group", false, gui.main.window ) gui.info.mInvites = guiCreateButton ( 180, 280, 130, 40, "My Invites", false, gui.main.window ) gui.info.gMotd = guiCreateButton ( 318, 280, 130, 40, "Group MOTD", false, gui.main.window ) -- info -> create gui.info.create.window = guiCreateWindow(sx*383, sy*227, sx*500, sy*283, "Create Group", false) guiWindowSetSizable(gui.info.create.window, false) gui.info.create.l1 = guiCreateLabel(sx*22, sy*40, sx*184, sy*20, "Group Name:", false, gui.info.create.window) gui.info.create.name = guiCreateEdit(sx*207, sy*40, sx*219, sy*20, "", false, gui.info.create.window) gui.info.create.l2 = guiCreateLabel(sx*22, sy*78, sx*184, sy*20, "Group Color:", false, gui.info.create.window) gui.info.create.cr = guiCreateEdit(sx*207, sy*78, sx*54, sy*20, "0", false, gui.info.create.window) gui.info.create.cg = guiCreateEdit(sx*261, sy*78, sx*54, sy*20, "0", false, gui.info.create.window) gui.info.create.cb = guiCreateEdit(sx*315, sy*78, sx*54, sy*20, "0", false, gui.info.create.window) gui.info.create.cpick = guiCreateButton(sx*370, sy*78, sx*56, sy*20, "cpicker", false, gui.info.create.window) gui.info.create.l3 = guiCreateLabel(sx*23, sy*122, sx*184, sy*20, "Group Type:", false, gui.info.create.window) gui.info.create.type = guiCreateComboBox(sx*204, sy*122, sx*216, sy*93, "", false, gui.info.create.window) gui.info.create.create = guiCreateButton(sx*333, sy*215, sx*87, sy*27, "Create", false, gui.info.create.window) gui.info.create.close = guiCreateButton(sx*238, sy*215, sx*87, sy*27, "Close", false, gui.info.create.window) guiEditSetReadOnly(gui.info.create.cb, true) guiEditSetReadOnly(gui.info.create.cr, true) guiEditSetReadOnly(gui.info.create.cg, true) guiComboBoxAddItem(gui.info.create.type, "Gang") guiComboBoxAddItem(gui.info.create.type, "Service") guiComboBoxAddItem(gui.info.create.type, "Group") -- info -> my invites gui.info.invites.window = guiCreateWindow(345, 146, 640, 378, "My group invites", false) guiWindowSetSizable(gui.info.invites.window, false) gui.info.invites.label = guiCreateLabel(38, 33, 504, 21, "My group invites", false, gui.info.invites.window) gui.info.invites.list = guiCreateGridList(21, 54, 599, 267, false, gui.info.invites.window) guiGridListAddColumn(gui.info.invites.list, "Group", 0.3) guiGridListAddColumn(gui.info.invites.list, "Time", 0.3) guiGridListAddColumn(gui.info.invites.list, "From", 0.3) guiGridListSetSortingEnabled ( gui.info.invites.list, false ) gui.info.invites.accept = guiCreateButton(21, 331, 117, 31, "Accept", false, gui.info.invites.window) gui.info.invites.deny = guiCreateButton(140, 331, 117, 31, "Deny", false, gui.info.invites.window) gui.info.invites.close = guiCreateButton(503, 331, 117, 31, "Close", false, gui.info.invites.window ) -- info -> motd gui.info.motd.window = guiCreateWindow(392, 169, 528, 410, "Group MOTD", false) guiWindowSetSizable(gui.info.motd.window, false) gui.info.motd.motd = guiCreateMemo(9, 26, 509, 340, "", false, gui.info.motd.window) gui.info.motd.cancel = guiCreateButton(374, 370, 144, 30, "Close", false, gui.info.motd.window) -- list gui.list.list = guiCreateGridList(sx*10, sy*108, sx*640, sy*319, false, gui.main.window) guiGridListAddColumn(gui.list.list, "Group", 0.32) guiGridListAddColumn(gui.list.list, "Group founder", 0.32) guiGridListAddColumn(gui.list.list, "Group type", 0.15) guiGridListAddColumn(gui.list.list, "Members", 0.1) guiGridListSetSortingEnabled ( gui.list.list, false ) -- my gui.my.info = guiCreateButton(10, 120, 128, 40, "Basic information", false, gui.main.window) gui.my.members = guiCreateButton(147, 122, 128, 40, "Members", false, gui.main.window) gui.my.ranks = guiCreateButton(285, 122, 128, 40, "Ranks", false, gui.main.window) gui.my.bank = guiCreateButton(424, 122, 128, 40, "Bank", false, gui.main.window) gui.my.logs = guiCreateButton(10, 170, 128, 40, "Logs", false, gui.main.window) gui.my.modColor = guiCreateButton(147, 170, 128, 40, "Change Color", false, gui.main.window) gui.my.modMotd = guiCreateButton(285, 170, 128, 40, "Change MOTD", false, gui.main.window) gui.my.leave = guiCreateButton(10, 270, 128, 40, "Leave Group", false, gui.main.window) gui.my.delete = guiCreateButton(147, 270, 128, 40, "Delete Group", false, gui.main.window) -- my -> Basic information gui.my.basic.window = guiCreateWindow(509, 233, 317, 160, "Group Information", false) guiWindowSetSizable(gui.my.basic.window, false) gui.my.basic.group = guiCreateLabel(15, 31, 241, 19, "Group: none", false, gui.my.basic.window) gui.my.basic.founder = guiCreateLabel(15, 51, 241, 19, "Origianl founder: none", false, gui.my.basic.window) gui.my.basic.founded = guiCreateLabel(15, 71, 241, 19, "Founded on: none", false, gui.my.basic.window) gui.my.basic.close = guiCreateButton(15, 100, 91, 32, "Close", false, gui.my.basic.window) -- my -> Logs gui.my.logs_.window = guiCreateWindow(341, 142, 634, 392, "Group Logs", false) guiWindowSetSizable(gui.my.logs_.window, false) gui.my.logs_.list = guiCreateGridList(9, 25, 615, 311, false, gui.my.logs_.window) guiGridListAddColumn(gui.my.logs_.list, "Time", 0.28) guiGridListAddColumn(gui.my.logs_.list, "Account", 0.2) guiGridListAddColumn(gui.my.logs_.list, "Log", 0.7) guiGridListSetSortingEnabled ( gui.my.logs_.list, false ) gui.my.logs_.close = guiCreateButton(488, 346, 136, 33, "Close", false, gui.my.logs_.window) gui.my.logs_.clear = guiCreateButton(342, 346, 136, 33, "Clear", false, gui.my.logs_.window) -- my -> Bank gui.my.bank_.window = guiCreateWindow(481, 270, 306, 141, "Group Bank", false) guiWindowSetSizable(gui.my.bank_.window, false) gui.my.bank_.balance = guiCreateLabel(14, 26, 372, 24, "Group Bank: $0", false, gui.my.bank_.window) gui.my.bank_.amount = guiCreateEdit(14, 55, 120, 23, "0", false, gui.my.bank_.window) gui.my.bank_.dep = guiCreateRadioButton(144, 40, 75, 23, "Deposit", false, gui.my.bank_.window) guiRadioButtonSetSelected(gui.my.bank_.dep, true) gui.my.bank_.go = guiCreateButton(16, 88, 120, 28, "Go", false, gui.my.bank_.window) gui.my.bank_.close = guiCreateButton(140, 88, 120, 28, "Close", false, gui.my.bank_.window) gui.my.bank_.with = guiCreateRadioButton(144, 63, 75, 23, "Withdraw", false, gui.my.bank_.window) -- my -> Ranks gui.my.ranks_.window = guiCreateWindow(551, 195, 378, 387, "Group Rank Manager", false) guiWindowSetSizable(gui.my.ranks_.window, false) gui.my.ranks_.lbl_1 = guiCreateLabel(21, 30, 220, 22, "Rank Name:", false, gui.my.ranks_.window) gui.my.ranks_.name = guiCreateEdit(21, 55, 282, 25, "", false, gui.my.ranks_.window) gui.my.ranks_.name.setMaxLength = 35 gui.my.ranks_.scroll = guiCreateScrollPane(28, 93, 313, 238, false, gui.my.ranks_.window) gui.my.ranks_.lbl_2 = guiCreateLabel(8, 9, 248, 17, "Members", false, gui.my.ranks_.scroll) guiSetFont(gui.my.ranks_.lbl_2, "default-bold-small") gui.my.ranks_['perm_member_invite'] = guiCreateCheckBox(17, 28, 273, 15, "Invite Members", false, false, gui.my.ranks_.scroll) gui.my.ranks_['perm_member_kick'] = guiCreateCheckBox(17, 43, 273, 15, "Kick Players", false, false, gui.my.ranks_.scroll) gui.my.ranks_['perm_member_setrank'] = guiCreateCheckBox(17, 58, 273, 15, "Set Members Ranks", false, false, gui.my.ranks_.scroll) gui.my.ranks_['perm_member_viewlog'] = guiCreateCheckBox(17, 73, 273, 15, "View Player Group Logs", false, false, gui.my.ranks_.scroll) gui.my.ranks_.lbl_3 = guiCreateLabel(10, 88, 248, 17, "Group Bank", false, gui.my.ranks_.scroll) guiSetFont(gui.my.ranks_.lbl_3, "default-bold-small") gui.my.ranks_['perm_bank_withdraw'] = guiCreateCheckBox(17, 105, 273, 15, "Withdraw from bank", false, false, gui.my.ranks_.scroll ) gui.my.ranks_['perm_bank_deposit'] = guiCreateCheckBox(17, 120, 273, 15, "Deposit to bank", true, false, gui.my.ranks_.scroll) gui.my.ranks_.lbl_4 = guiCreateLabel(10, 135, 248, 17, "Group Logs", false, gui.my.ranks_.scroll ) guiSetFont(gui.my.ranks_.lbl_4, "default-bold-small") gui.my.ranks_['perm_logs_view'] = guiCreateCheckBox(17, 152, 273, 15, "View group logs", true, false, gui.my.ranks_.scroll) gui.my.ranks_['perm_logs_clear'] = guiCreateCheckBox(17, 167, 273, 15, "Clear group logs", false, false, gui.my.ranks_.scroll) gui.my.ranks_.lbl_5 = guiCreateLabel(10, 182, 248, 17, "Group Ranks", false, gui.my.ranks_.scroll) guiSetFont(gui.my.ranks_.lbl_5, "default-bold-small") gui.my.ranks_['perm_ranks_create'] = guiCreateCheckBox(17, 199, 273, 15, "Create Ranks", false, false, gui.my.ranks_.scroll) gui.my.ranks_['perm_ranks_delete'] = guiCreateCheckBox(17, 214, 273, 15, "Delete Ranks", false, false, gui.my.ranks_.scroll) gui.my.ranks_.lbl_6 = guiCreateLabel(10, 229, 248, 17, "Group Settings", false, gui.my.ranks_.scroll) guiSetFont(gui.my.ranks_.lbl_6, "default-bold-small") gui.my.ranks_['perm_group_modify_color'] = guiCreateCheckBox(20, 246, 273, 15, "Modify Group MOTD", false, false, gui.my.ranks_.scroll) gui.my.ranks_['perm_group_modify_motd'] = guiCreateCheckBox(20, 261, 273, 15, "Modify Group Color", false, false, gui.my.ranks_.scroll) gui.my.ranks_.add = guiCreateButton(241, 341, 99, 28, "Add Rank", false, gui.my.ranks_.window) gui.my.ranks_.close = guiCreateButton(132, 341, 99, 28, "Cancel", false, gui.my.ranks_.window) -- my -> Members gui.my.members_.window = guiCreateWindow(345, 146, 640, 378, "My group members", false) guiWindowSetSizable(gui.my.members_.window, false) gui.my.members_.label = guiCreateLabel(38, 33, 504, 21, "My group members", false, gui.my.members_.window) gui.my.members_.list = guiCreateGridList(21, 54, 599, 267, false, gui.my.members_.window) guiGridListAddColumn(gui.my.members_.list, "Username", 0.3) guiGridListAddColumn(gui.my.members_.list, "Rank", 0.3) guiGridListAddColumn(gui.my.members_.list, "Online", 0.3) guiGridListSetSortingEnabled ( gui.my.members_.list, false ) gui.my.members_.log = guiCreateButton(21, 331, 117, 31, "This Players Log", false, gui.my.members_.window) gui.my.members_.srank = guiCreateButton(140, 331, 117, 31, "Set Rank", false, gui.my.members_.window) gui.my.members_.kick = guiCreateButton(259, 331, 117, 31, "Kick", false, gui.my.members_.window) gui.my.members_.invite = guiCreateButton(378, 331, 117, 31, "Invite", false, gui.my.members_.window) gui.my.members_.close = guiCreateButton(503, 331, 117, 31, "Close", false, gui.my.members_.window ) --> my -> Members -> Player Log gui.my.members_.lWindow = guiCreateWindow(341, 142, 634, 392, "Player Log", false) guiWindowSetSizable(gui.my.members_.window, false) gui.my.members_.lList = guiCreateGridList(9, 25, 615, 311, false, gui.my.members_.lWindow) guiGridListAddColumn(gui.my.members_.lList, "Time", 0.28) guiGridListAddColumn(gui.my.members_.lList, "Account", 0.2) guiGridListAddColumn(gui.my.members_.lList, "Log", 0.7) guiGridListSetSortingEnabled ( gui.my.members_.lList, false ) gui.my.members_.lClose = guiCreateButton(488, 346, 136, 33, "Close", false, gui.my.members_.lWindow) -- my -> Members -> Set rank gui.my.members_.rWindow = guiCreateWindow(502, 128, 266, 414, "Group Rank", false) guiWindowSetSizable(gui.my.members_.rWindow, false) gui.my.members_.rRanks = guiCreateComboBox(14, 66, 236, 304, "", false, gui.my.members_.rWindow) gui.my.members_.rUpdate = guiCreateButton(18, 35, 113, 25, "Update", false, gui.my.members_.rWindow) gui.my.members_.rClose = guiCreateButton(137, 35, 113, 25, "Cancel", false, gui.my.members_.rWindow) -- my -> Members -> Invite gui.my.members_.iWindow = guiCreateWindow(339, 162, 611, 296, "Invite Players", false) guiWindowSetSizable(gui.my.members_.iWindow, false) gui.my.members_.iList = guiCreateGridList(9, 22, 592, 223, false, gui.my.members_.iWindow) guiGridListAddColumn(gui.my.members_.iList, "Player", 0.9) gui.my.members_.iLabel = guiCreateLabel(16, 254, 102, 27, "Search Player:", false, gui.my.members_.iWindow) guiLabelSetVerticalAlign(gui.my.members_.iLabel, "center") gui.my.members_.iFilter = guiCreateEdit(118, 253, 184, 28, "", false, gui.my.members_.iWindow) gui.my.members_.iClose = guiCreateButton(531, 255, 70, 25, "Close", false, gui.my.members_.iWindow) gui.my.members_.iInvite = guiCreateButton(451, 256, 70, 25, "Invite", false, gui.my.members_.iWindow) -- my -> change motd gui.my.motd.window = guiCreateWindow(392, 169, 528, 410, "", false) guiWindowSetSizable(gui.my.motd.window, false) gui.my.motd.motd = guiCreateMemo(9, 26, 509, 340, "", false, gui.my.motd.window) gui.my.motd.update = guiCreateButton(374, 370, 144, 30, "Update", false, gui.my.motd.window) gui.my.motd.cancel = guiCreateButton(220, 370, 144, 30, "Cancel", false, gui.my.motd.window) -- Administration Panel (NG 1.1.4) gui.admin.window = guiCreateWindow(386, 123, 608, 421, "SAEG Group Manager (Staff)", false) guiWindowSetSizable(gui.admin.window, false) gui.admin.admin.groupList = guiCreateGridList(9, 21, 401, 390, false, gui.admin.window) guiGridListSetSortingEnabled ( gui.admin.admin.groupList, false ); guiGridListAddColumn ( gui.admin.admin.groupList, "Group", 0.5 ); guiGridListAddColumn ( gui.admin.admin.groupList, "Founder", 0.3 ); guiGridListAddColumn ( gui.admin.admin.groupList, "Members", 0.15 ); gui.admin.admin.groupInfo = guiCreateButton(412, 26, 186, 29, "Basic Information", false, gui.admin.window) gui.admin.admin.groupMembers = guiCreateButton(412, 65, 186, 29, "Members", false, gui.admin.window) gui.admin.admin.groupRanks = guiCreateButton(412, 104, 186, 29, "Ranks", false, gui.admin.window) gui.admin.admin.groupLogs = guiCreateButton(412, 143, 186, 29, "Logs", false, gui.admin.window) gui.admin.admin.closeWindow = guiCreateButton(412, 382, 186, 29, "Close", false, gui.admin.window) gui.admin.admin.deleteGroup = guiCreateButton(412, 182, 186, 29, "Delete Group", false, gui.admin.window) guiSetProperty(gui.admin.admin.deleteGroup, "NormalTextColour", "FFFF0000") -- manager->Basic Information gui.admin.info.window = guiCreateWindow(445, 148, 559, 399, "Group Information", false) guiWindowSetSizable(gui.admin.info.window, false) gui.admin.info.list = guiCreateGridList(9, 29, 540, 314, false, gui.admin.info.window) guiGridListAddColumn(gui.admin.info.list, "Data Set", 0.4) guiGridListAddColumn(gui.admin.info.list, "Value", 0.5) gui.admin.info.close = guiCreateButton(10, 353, 164, 36, "Close", false, gui.admin.info.window) -- manager->members gui.admin.members.window = guiCreateWindow(445, 148, 559, 399, "Group Members", false) guiWindowSetSizable(gui.admin.members.window, false) gui.admin.members.list = guiCreateGridList(9, 29, 540, 314, false, gui.admin.members.window) guiGridListAddColumn(gui.admin.members.list, "Account", 0.3) guiGridListAddColumn(gui.admin.members.list, "Rank", 0.3) guiGridListAddColumn(gui.admin.members.list, "Joined", 0.3) gui.admin.members.close = guiCreateButton(10, 353, 164, 36, "Close", false, gui.admin.members.window) -- manager->ranks gui.admin.ranks.window = guiCreateWindow(445, 148, 559, 399, "Group Members", false) guiWindowSetSizable(gui.admin.ranks.window, false) gui.admin.ranks.list = guiCreateGridList(9, 29, 540, 314, false, gui.admin.ranks.window)
-
there's no function named isPlayerInTeamTurfing you have to get player team and check it if equal to Criminal team or any team name you want Now only criminal team is able to turf ,copy the code carefully. local _setElementData = setElementData function setElementData ( element, group, value ) return _setElementData ( element, group, value, true ) end local turfLocs = { } function createTurf ( x, y, z, width, height, owner, forcedId ) local owner = tostring ( owner or "server" ) local r, g, b = exports.SAEGGroups:getGroupColor ( owner ) if not r then r = 255 end if not g then g = 255 end if not b then b = 255 end if ( owner == "server" ) then r, g, b = 255, 255, 255 end local rad = createRadarArea ( x, y, width, height, r, g, b, 170, getRootElement ( ) ) local col = createColCuboid ( x, y, z-5, width, height, 35) if ( not forcedId or turfLocs [ id ] ) then id = 0 while ( turfLocs [ id ] ) do id = id + 1 end else id = forcedId end turfLocs[id] = { } turfLocs[id].col = col turfLocs[id].radar = rad turfLocs[id].owner = owner or "server" turfLocs[id].attackers = nil turfLocs[id].attackProg = 0 turfLocs[id].prepProg = 0 setElementData ( turfLocs[id].col, "SAEGTurf:TurfId", id ) setElementData ( turfLocs[id].col, "SAEGTurf:TurffingTable", turfLocs [ id ] ) addEventHandler ( "onColShapeHit", turfLocs[id].col, onColShapeHit ) addEventHandler ( "onColShapeLeave", turfLocs[id].col, onColShapeLeave ) return turfLocs[id]; end function updateTurfGroupColor ( group ) local r, g, b = exports.saeggroups:getGroupColor ( group ) for i, v in pairs ( turfLocs ) do if ( v.owner == group ) then setRadarAreaColor ( v.radar, r, g, b, 120 ) end end end function onColShapeHit ( player ) if ( player and isElement ( player ) and getElementType ( player ) == "player" and not isPedInVehicle ( player ) ) then local gang = exports.saeggroups:getPlayerGroup ( player ) if getTeamName(getPlayerTeam(player)) ~= "Criminal" then outputChatBox("You must be criminal.",255,0,0) return end triggerClientEvent ( player, "SAEGTurfs:onClientEnterTurfArea", player, turfLocs [ id ] ) if ( not gang ) then return exports.SAEGMessages:sendClientMessage ( "You're not in a gang, you cannot turf.", player, 255, 255, 0 ) end local id = tonumber ( getElementData ( source, "SAEGTurf:TurfId" ) ) if ( turfLocs[id].owner == gang ) then return end if ( turfLocs[id].attackers and turfLocs[id].attackers ~= gang ) then return exports.SAEGMessages:sendClientMessage ( "The "..tostring(turfLocs[id].attackers).." gang is already trying to take this turf. Try again later.", player, 255, 0, 0 ) end if ( not turfLocs[id].attackers ) then exports.SAEGMessages:sendClientMessage ( "You have started to prepare a turf war. Find cover, call backup, and wait for it to begin.", player, 255, 255, 0 ) local x, y, z = getElementPosition ( source ) exports.SAEGGroups:outputGroupMessage ( getPlayerName ( player ).." is preparing a turf war with "..tostring(turfLocs[id].owner).." in "..getZoneName(x,y,z)..", "..getZoneName(x,y,z,false).."! Get there to help him, the war will start in 2 minutes!", gang, 255, 255, 0 ) setRadarAreaFlashing ( turfLocs[id].radar, true ) turfLocs[id].attackers = gang turfLocs[id].attackProg = 0 turfLocs[id].prepProg = 0 setElementData ( turfLocs[id].col, "SAEGTurf:TurffingTable", turfLocs [ id ] ) end end end function onColShapeLeave ( player ) if ( player and getElementType ( player ) == "player" ) then triggerClientEvent ( player, "SAEGTurfs:onClientExitTurfArea", player, turfLocs [ getElementData ( source, "SAEGTurf:TurfId" ) ] ) end end setTimer ( function ( ) for id, data in pairs ( turfLocs ) do if ( data.attackers ) then local players = { attackers = { }, owners = { } } local isGangInTurf = false local isOwnerInTurf = false for i, v in pairs ( getElementsWithinColShape ( data.col, "player" ) ) do local g = exports.SAEGGroups:getPlayerGroup ( v ) if ( g == data.attackers ) then isGangInTurf = true table.insert ( players.attackers, v ) elseif ( g == data.owner ) then isOwnerInTurf = true table.insert ( players.owners, v ) end end local x, y, z = getElementPosition ( data.col ) if ( isOwnerInTurf and isGangInTurf ) then exports.SAEGGroups:outputGroupMessage ( "The turf war in "..getZoneName ( x,y,z )..", "..getZoneName ( x,y,z, false ).." is paused due to both gangs in the turf", turfLocs[id].attackers, 255, 255, 255 ) exports.SAEGGroups:outputGroupMessage ( "The turf war in "..getZoneName ( x,y,z )..", "..getZoneName ( x,y,z, false ).." is paused due to both gangs in the turf", turfLocs[id].owner, 255, 255, 255 ) else -- Add Points To Attackers if ( isGangInTurf ) then -- Prep the war if ( turfLocs[id].attackProg == 0 ) then turfLocs[id].prepProg = data.prepProg + 2 if ( turfLocs[id].prepProg >= 100 ) then turfLocs[id].prepProg = 0 turfLocs[id].attackProg = 1 beginTurfWarOnTurf ( id ) end -- Attack War else turfLocs[id].attackProg = turfLocs[id].attackProg + 1 if ( turfLocs[id].attackProg == 100 ) then exports.SAEGGroups:outputGroupMessage ( "Your gang has captured a turf in "..getZoneName ( x,y,z )..", "..getZoneName ( x,y,z, false ).." from the "..turfLocs[id].owner.." gang! Great job!", turfLocs[id].attackers, 0, 255, 0) exports.SAEGGroups:outputGroupMessage ( "Your gang lost a turf in "..getZoneName ( x,y,z )..", "..getZoneName ( x,y,z, false ).." to the "..turfLocs[id].attackers.." gang.", turfLocs[id].owner, 255, 0, 0) setTurfOwner ( id, turfLocs[id].attackers ) end end -- Take points from attackers else -- Prepare war if ( turfLocs[id].attackProg == 0 ) then turfLocs[id].prepProg = data.prepProg - 2 if ( turfLocs[id].prepProg <= 0 ) then exports.SAEGGroups:outputGroupMessage ( "Your gang lost the turf preparation war in "..getZoneName(x,y,z)..", "..getZoneName ( x,y,z, false ).." to the "..turfLocs[id].owner.." gang!", turfLocs[id].attackers, 255, 0, 0 ) exports.SAEGGroups:outputGroupMessage ( "Your gang has defended the turf in "..getZoneName(x,y,z)..", "..getZoneName(x,y,z,false).."!", turfLocs[id].owner..", from the "..turfLocs[id].attackers.." gang, when it was being preped for a war", 0, 255, 0 ) setTurfOwner ( id, turfLocs[id].owner ) end -- Attacking war else turfLocs[id].attackProg = data.attackProg - 1 if ( turfLocs[id].attackProg <= 0 ) then exports.SAEGGroups:outputGroupMessage ( "Your gang lost the turf war in "..getZoneName(x,y,z)..", "..getZoneName ( x,y,z, false ).." to the "..turfLocs[id].owner.." gang!", turfLocs[id].attackers, 255, 0, 0 ) exports.SAEGGroups:outputGroupMessage ( "Your gang has defended the turf in "..getZoneName(x,y,z)..", "..getZoneName(x,y,z,false).." from the "..turfLocs[id].attackers.." gang", turfLocs[id].owner, 0, 255, 0 ) setTurfOwner ( id, turfLocs[id].owner ) end end end end for i, v in pairs ( players ) do for k, p in pairs ( v ) do triggerClientEvent ( p, "SAEGTurfs:upadateClientInfo", p, turfLocs [ id ] ) end end end end end, 800, 0 ) addEvent ( "SAEGTurfs:onTurfProgressChange", true ) --[[ addCommandHandler ( "attackprog", function ( p ) local gangAttacks = { } local g = exports.SAEGGroups:getPlayerGroup ( p ) if ( not g ) then return exports.SAEGMessages:sendclientMessage ( "You're not in a gang", p, 255, 255, 0) end for i, v in pairs ( turfLocs ) do if ( v.attackers and v.attackers == g ) then gangAttacks [ i ] = true end end if ( table.len ( gangAttacks ) == 0 ) then return exports.SAEGMessages:sendClientMessage ( "Your gang isn't involved in any gang wars right now.", p, 255, 255, 0 ) end for id, _ in pairs ( gangAttacks ) do local x ,y, z = getElementPosition ( turfLocs[id].col ) outputChatBox ( "----Turf War Status---", p, 255, 255, 255, false ) outputChatBox ( "Current owner: "..turfLocs[id].owner, p, 255, 255, 255, false ) outputChatBox ( "Attacker: "..turfLocs[id].attackers, p, 255, 255, 255, false ) outputChatBox ( "Prep Progress: "..turfLocs[id].prepProg.."%", p, 255, 255, 255, false ) outputChatBox ( "Attack Progress: "..turfLocs[id].attackProg.."%", p, 255, 255, 255, false ) outputChatBox ( "Turf Location: "..getZoneName ( x, y, z )..", "..getZoneName ( x, y, z, true ), p, 255, 255, 255, false ) outputChatBox ( "Turf Server-ID: "..id, p, 255, 255, 255, false ) end end )]] function table.len ( tb ) local c = 0 for i, v in pairs ( tb ) do c = c + 1 end return c end function beginTurfWarOnTurf ( id ) local d = turfLocs [ id ] local x, y, z = getElementPosition ( d.col ) exports.SAEGGroups:outputGroupMessage ( "Your gang has begun a turf war in "..getZoneName ( x, y, z)..", "..getZoneName ( x, y, z, true ).." against the "..d.owner.." gang! Get there an help!", d.attackers, 255, 255, 0 ) exports.SAEGGroups:outputGroupMessage ( "One of your turfs in "..getZoneName ( x, y, z)..", "..getZoneName ( x, y, z, true ).." is being attacked by the "..d.attackers.." gang!", d.owners, 255, 0, 0 ) setRadarAreaColor ( d.radar, 255, 255, 255, 170 ) end function setTurfOwner ( id, owner ) setRadarAreaFlashing ( turfLocs[id].radar, false ) turfLocs[id].owner = owner turfLocs[id].attackers = nil turfLocs[id].attackProg = 0 local r, g, b = exports.SAEGGroups:getGroupColor ( owner ) setRadarAreaColor ( turfLocs[id].radar, r, g, b, 120 ) saveTurfs ( ) end function getTurfs ( ) return turfLocs end function saveTurfs ( ) for id, data in pairs ( turfLocs ) do exports.NGSQL:db_exec ( "UPDATE turfs SET owner=? WHERE id=?", data.owner, id ) end return true end addEventHandler( "onResourceStart", resourceRoot, function ( ) exports.NGSQL:db_exec ( "CREATE TABLE IF NOT EXISTS turfs ( id INT, owner VARCHAR(50), x FLOAT, y FLOAT, z FLOAT, width INT, height INT )" ) local query = exports.NGSQL:db_query ( "SELECT * FROM turfs" ) if ( #query == 0 ) then local data = { { -1867.8, -107.43, 15.1, 58, 65 }, { -1866.5, -26.36, 15.29, 49, 200 }, { -1811.33, 743.43, 20, 85, 85 }, { -1991.5, 862.62, 34, 79, 42 }, { -2799.25, -200.6, 7.19, 83, 120 }, { -2136.84, 120.12, 30, 120, 190 }, { -2516.52, 718.16, 27.97, 118, 80 }, { -2516.41, 578.19, 16.62, 100, 100 }, { -2596.49, 818.05, 49.98, 59, 80 }, { -2453.17, 947.58, 45.43, 54, 80 },
-
How I can add isPlayerInTeamTurfing in this script (not my own script ) local _setElementData = setElementData function setElementData ( element, group, value ) return _setElementData ( element, group, value, true ) end local turfLocs = { } function createTurf ( x, y, z, width, height, owner, forcedId ) local owner = tostring ( owner or "server" ) local r, g, b = exports.SAEGGroups:getGroupColor ( owner ) if not r then r = 255 end if not g then g = 255 end if not b then b = 255 end if ( owner == "server" ) then r, g, b = 255, 255, 255 end local rad = createRadarArea ( x, y, width, height, r, g, b, 170, getRootElement ( ) ) local col = createColCuboid ( x, y, z-5, width, height, 35) if ( not forcedId or turfLocs [ id ] ) then id = 0 while ( turfLocs [ id ] ) do id = id + 1 end else id = forcedId end turfLocs[id] = { } turfLocs[id].col = col turfLocs[id].radar = rad turfLocs[id].owner = owner or "server" turfLocs[id].attackers = nil turfLocs[id].attackProg = 0 turfLocs[id].prepProg = 0 setElementData ( turfLocs[id].col, "SAEGTurf:TurfId", id ) setElementData ( turfLocs[id].col, "SAEGTurf:TurffingTable", turfLocs [ id ] ) addEventHandler ( "onColShapeHit", turfLocs[id].col, onColShapeHit ) addEventHandler ( "onColShapeLeave", turfLocs[id].col, onColShapeLeave ) return turfLocs[id]; end function updateTurfGroupColor ( group ) local r, g, b = exports.saeggroups:getGroupColor ( group ) for i, v in pairs ( turfLocs ) do if ( v.owner == group ) then setRadarAreaColor ( v.radar, r, g, b, 120 ) end end end function onColShapeHit ( player ) if ( player and isElement ( player ) and getElementType ( player ) == "player" and not isPedInVehicle ( player ) ) then local gang = exports.saeggroups:getPlayerGroup ( player ) triggerClientEvent ( player, "SAEGTurfs:onClientEnterTurfArea", player, turfLocs [ id ] ) if ( not gang ) then return exports.SAEGMessages:sendClientMessage ( "You're not in a gang, you cannot turf.", player, 255, 255, 0 ) end local id = tonumber ( getElementData ( source, "SAEGTurf:TurfId" ) ) if ( turfLocs[id].owner == gang ) then return end if ( turfLocs[id].attackers and turfLocs[id].attackers ~= gang ) then return exports.SAEGMessages:sendClientMessage ( "The "..tostring(turfLocs[id].attackers).." gang is already trying to take this turf. Try again later.", player, 255, 0, 0 ) end if ( not turfLocs[id].attackers ) then exports.SAEGMessages:sendClientMessage ( "You have started to prepare a turf war. Find cover, call backup, and wait for it to begin.", player, 255, 255, 0 ) local x, y, z = getElementPosition ( source ) exports.SAEGGroups:outputGroupMessage ( getPlayerName ( player ).." is preparing a turf war with "..tostring(turfLocs[id].owner).." in "..getZoneName(x,y,z)..", "..getZoneName(x,y,z,false).."! Get there to help him, the war will start in 2 minutes!", gang, 255, 255, 0 ) setRadarAreaFlashing ( turfLocs[id].radar, true ) turfLocs[id].attackers = gang turfLocs[id].attackProg = 0 turfLocs[id].prepProg = 0 setElementData ( turfLocs[id].col, "SAEGTurf:TurffingTable", turfLocs [ id ] ) end end end function onColShapeLeave ( player ) if ( player and getElementType ( player ) == "player" ) then triggerClientEvent ( player, "SAEGTurfs:onClientExitTurfArea", player, turfLocs [ getElementData ( source, "SAEGTurf:TurfId" ) ] ) end end setTimer ( function ( ) for id, data in pairs ( turfLocs ) do if ( data.attackers ) then local players = { attackers = { }, owners = { } } local isGangInTurf = false local isOwnerInTurf = false for i, v in pairs ( getElementsWithinColShape ( data.col, "player" ) ) do local g = exports.SAEGGroups:getPlayerGroup ( v ) if ( g == data.attackers ) then isGangInTurf = true table.insert ( players.attackers, v ) elseif ( g == data.owner ) then isOwnerInTurf = true table.insert ( players.owners, v ) end end local x, y, z = getElementPosition ( data.col ) if ( isOwnerInTurf and isGangInTurf ) then exports.SAEGGroups:outputGroupMessage ( "The turf war in "..getZoneName ( x,y,z )..", "..getZoneName ( x,y,z, false ).." is paused due to both gangs in the turf", turfLocs[id].attackers, 255, 255, 255 ) exports.SAEGGroups:outputGroupMessage ( "The turf war in "..getZoneName ( x,y,z )..", "..getZoneName ( x,y,z, false ).." is paused due to both gangs in the turf", turfLocs[id].owner, 255, 255, 255 ) else -- Add Points To Attackers if ( isGangInTurf ) then -- Prep the war if ( turfLocs[id].attackProg == 0 ) then turfLocs[id].prepProg = data.prepProg + 2 if ( turfLocs[id].prepProg >= 100 ) then turfLocs[id].prepProg = 0 turfLocs[id].attackProg = 1 beginTurfWarOnTurf ( id ) end -- Attack War else turfLocs[id].attackProg = turfLocs[id].attackProg + 1 if ( turfLocs[id].attackProg == 100 ) then exports.SAEGGroups:outputGroupMessage ( "Your gang has captured a turf in "..getZoneName ( x,y,z )..", "..getZoneName ( x,y,z, false ).." from the "..turfLocs[id].owner.." gang! Great job!", turfLocs[id].attackers, 0, 255, 0) exports.SAEGGroups:outputGroupMessage ( "Your gang lost a turf in "..getZoneName ( x,y,z )..", "..getZoneName ( x,y,z, false ).." to the "..turfLocs[id].attackers.." gang.", turfLocs[id].owner, 255, 0, 0) setTurfOwner ( id, turfLocs[id].attackers ) end end -- Take points from attackers else -- Prepare war if ( turfLocs[id].attackProg == 0 ) then turfLocs[id].prepProg = data.prepProg - 2 if ( turfLocs[id].prepProg <= 0 ) then exports.SAEGGroups:outputGroupMessage ( "Your gang lost the turf preparation war in "..getZoneName(x,y,z)..", "..getZoneName ( x,y,z, false ).." to the "..turfLocs[id].owner.." gang!", turfLocs[id].attackers, 255, 0, 0 ) exports.SAEGGroups:outputGroupMessage ( "Your gang has defended the turf in "..getZoneName(x,y,z)..", "..getZoneName(x,y,z,false).."!", turfLocs[id].owner..", from the "..turfLocs[id].attackers.." gang, when it was being preped for a war", 0, 255, 0 ) setTurfOwner ( id, turfLocs[id].owner ) end -- Attacking war else turfLocs[id].attackProg = data.attackProg - 1 if ( turfLocs[id].attackProg <= 0 ) then exports.SAEGGroups:outputGroupMessage ( "Your gang lost the turf war in "..getZoneName(x,y,z)..", "..getZoneName ( x,y,z, false ).." to the "..turfLocs[id].owner.." gang!", turfLocs[id].attackers, 255, 0, 0 ) exports.SAEGGroups:outputGroupMessage ( "Your gang has defended the turf in "..getZoneName(x,y,z)..", "..getZoneName(x,y,z,false).." from the "..turfLocs[id].attackers.." gang", turfLocs[id].owner, 0, 255, 0 ) setTurfOwner ( id, turfLocs[id].owner ) end end end end for i, v in pairs ( players ) do for k, p in pairs ( v ) do triggerClientEvent ( p, "SAEGTurfs:upadateClientInfo", p, turfLocs [ id ] ) end end end end end, 800, 0 ) addEvent ( "SAEGTurfs:onTurfProgressChange", true ) --[[ addCommandHandler ( "attackprog", function ( p ) local gangAttacks = { } local g = exports.SAEGGroups:getPlayerGroup ( p ) if ( not g ) then return exports.SAEGMessages:sendclientMessage ( "You're not in a gang", p, 255, 255, 0) end for i, v in pairs ( turfLocs ) do if ( v.attackers and v.attackers == g ) then gangAttacks [ i ] = true end end if ( table.len ( gangAttacks ) == 0 ) then return exports.SAEGMessages:sendClientMessage ( "Your gang isn't involved in any gang wars right now.", p, 255, 255, 0 ) end for id, _ in pairs ( gangAttacks ) do local x ,y, z = getElementPosition ( turfLocs[id].col ) outputChatBox ( "----Turf War Status---", p, 255, 255, 255, false ) outputChatBox ( "Current owner: "..turfLocs[id].owner, p, 255, 255, 255, false ) outputChatBox ( "Attacker: "..turfLocs[id].attackers, p, 255, 255, 255, false ) outputChatBox ( "Prep Progress: "..turfLocs[id].prepProg.."%", p, 255, 255, 255, false ) outputChatBox ( "Attack Progress: "..turfLocs[id].attackProg.."%", p, 255, 255, 255, false ) outputChatBox ( "Turf Location: "..getZoneName ( x, y, z )..", "..getZoneName ( x, y, z, true ), p, 255, 255, 255, false ) outputChatBox ( "Turf Server-ID: "..id, p, 255, 255, 255, false ) end end )]] function table.len ( tb ) local c = 0 for i, v in pairs ( tb ) do c = c + 1 end return c end function beginTurfWarOnTurf ( id ) local d = turfLocs [ id ] local x, y, z = getElementPosition ( d.col ) exports.SAEGGroups:outputGroupMessage ( "Your gang has begun a turf war in "..getZoneName ( x, y, z)..", "..getZoneName ( x, y, z, true ).." against the "..d.owner.." gang! Get there an help!", d.attackers, 255, 255, 0 ) exports.SAEGGroups:outputGroupMessage ( "One of your turfs in "..getZoneName ( x, y, z)..", "..getZoneName ( x, y, z, true ).." is being attacked by the "..d.attackers.." gang!", d.owners, 255, 0, 0 ) setRadarAreaColor ( d.radar, 255, 255, 255, 170 ) end function setTurfOwner ( id, owner ) setRadarAreaFlashing ( turfLocs[id].radar, false ) turfLocs[id].owner = owner turfLocs[id].attackers = nil turfLocs[id].attackProg = 0 local r, g, b = exports.SAEGGroups:getGroupColor ( owner ) setRadarAreaColor ( turfLocs[id].radar, r, g, b, 120 ) saveTurfs ( ) end function getTurfs ( ) return turfLocs end function saveTurfs ( ) for id, data in pairs ( turfLocs ) do exports.NGSQL:db_exec ( "UPDATE turfs SET owner=? WHERE id=?", data.owner, id ) end return true end addEventHandler( "onResourceStart", resourceRoot, function ( ) exports.NGSQL:db_exec ( "CREATE TABLE IF NOT EXISTS turfs ( id INT, owner VARCHAR(50), x FLOAT, y FLOAT, z FLOAT, width INT, height INT )" ) local query = exports.NGSQL:db_query ( "SELECT * FROM turfs" ) if ( #query == 0 ) then local data = { { -1867.8, -107.43, 15.1, 58, 65 }, { -1866.5, -26.36, 15.29, 49, 200 }, { -1811.33, 743.43, 20, 85, 85 }, { -1991.5, 862.62, 34, 79, 42 }, { -2799.25, -200.6, 7.19, 83, 120 }, { -2136.84, 120.12, 30, 120, 190 }, { -2516.52, 718.16, 27.97, 118, 80 }, { -2516.41, 578.19, 16.62, 100, 100 }, { -2596.49, 818.05, 49.98, 59, 80 }, { -2453.17, 947.58, 45.43, 54, 80 }, { -2740.6, 344.59, 4.41, 68, 61 }, { -2696.24, 227.35, 4.33, 39.5, 50.5 },
-
How I Can Create Turf Please (/addturf height width) Not Work
-
Already Doné But Thanx Bro
-
You have to script your own topbar system or search for it in the community,then exports it to the math script. I Have My Own TopBar But idk How To exports it ahaha (Karim + JR10 Helpful me Thanx Guys <3 )
-
Other thing guys pls How I can Show The Messages in Bar pls
-
Fixed Fixed <3 thanx all <3
-
Lmao,What JR10 wrote for you isn't wrong, you can't wait 2 minutes untill the message output? do you know how to read the codes or just copying / posting? Here's the full code edit the timer with your mili seconds setTimer(function() reward = math.random ( 2000, 5000 ) qn1 = math.random ( 10, 100 ) qn2 = math.random ( 10, 100 ) qn3 = math.random ( 10, 100 ) theQuestion = qn1 + qn2 - qn3 answerTime = setTimer ( noAnswer, 30* 1000, 1 ) outputChatBox ( "Math: First one to answer " .. qn1 .. " + " .. qn2 .. " - " .. qn3 .. " will win $" .. reward, root, 0, 255, 0 ) end, 1000, 0) -- it's 1000 mili seconds, mean each 1second it will output a message , edite it with your choice. function noAnswer ( ) outputChatBox ( "Math: Nobody won the answer was " .. theQuestion, root, 0, 255, 0 ) theQuestion = nil end addEventHandler ( "onPlayerChat", root, function ( answer ) if ( theQuestion and tonumber ( answer ) == theQuestion ) then theQuestion = nil outputChatBox ( "Math: " .. getPlayerName ( source ) .. " #00FF00answered " .. answer .. " and won $" .. reward, root, 0, 255, 0, true ) givePlayerMoney ( source, reward ) if ( isTimer ( answerTime ) ) then killTimer ( answerTime ) end end end ) See -.- : Loading script failed: SAEGPlayerFunctions\server\math.lua:13: ')' expected (to close '(' at line 2) near 'function' pfff
-
Not Work pff bro i get the script from : https://community.multitheftauto.com/in ... ls&id=6126 Try To make it when you have time and send to me it pls <3 really i need it urgent
-
Can explain to me how ?
-
i want add timer for Question (auto ask) and Add the message in bar post to me the code pls i'm learing scripting pls <3 this is the Cood timeToAnswer = 30 -- 30 seconds addCommandHandler ( "math", function ( player ) if ( isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( player ) ), aclGetGroup ( "Level 5" ) ) ) then reward = math.random ( 2000, 5000 ) qn1 = math.random ( 10, 100 ) qn2 = math.random ( 10, 100 ) qn3 = math.random ( 10, 100 ) theQuestion = qn1 + qn2 - qn3 answerTime = setTimer ( noAnswer, timeToAnswer * 1000, 1 ) outputChatBox ( "Math: First one to answer " .. qn1 .. " + " .. qn2 .. " - " .. qn3 .. " will win $" .. reward, root, 0, 255, 0 ) else outputChatBox ( "You can't use this command", player, 255, 0, 0 ) end end ) function noAnswer ( ) outputChatBox ( "Math: Nobody won the answer was " .. theQuestion, root, 0, 255, 0 ) theQuestion = nil end addEventHandler ( "onPlayerChat", root, function ( answer ) if ( theQuestion and tonumber ( answer ) == theQuestion ) then theQuestion = nil outputChatBox ( "Math: " .. getPlayerName ( source ) .. " #00FF00answered " .. answer .. " and won $" .. reward, root, 0, 255, 0, true ) givePlayerMoney ( source, reward ) if ( isTimer ( answerTime ) ) then killTimer ( answerTime ) end end end )
-
how i can change it to 0:0 example : 210:50
-
play time work with hours/days/months but i want it work with hours/minuts example : 240:14 this the cod What i need change ?
-
i check it ... just warning : showplayerhudcomponent' expected hud component at argument 1, got string 'oxygen'
-
the hud showing boffer logined this is the problem
-
pfff same problem Thanx Everyone JR10 pls try to see anyway for fix it please
-
This The New Code (Radar Fixed but the hud still showing) local newFont = dxCreateFont( "font/font.ttf", 15 ) local newFont2 = dxCreateFont( "font/font.ttf", 9 ) local newFont3 = dxCreateFont( "font/font.ttf", 24 ) local LOCAL_PLAYER = getLocalPlayer() pos = getElementPosition(LOCAL_PLAYER) showPlayerHudComponent("radar",true) showPlayerHudComponent ("weapon", false ) showPlayerHudComponent ( "ammo", false ) showPlayerHudComponent ("vehicle_name", false ) addEventHandler ( "onPlayerJoin", getRootElement(), hudChanger ) function dxtest() local playerX, playerY, playerZ = getElementPosition( LOCAL_PLAYER ) -- Get player's coordinates. local playerZoneName = getZoneName( playerX, playerY, playerZ ) local health = string.format("%03d", (getElementHealth(LOCAL_PLAYER))) local armor = math.floor (getPedArmor(LOCAL_PLAYER)) local stat = getPedStat(LOCAL_PLAYER,24) local time = getRealTime() local hr,mins = getTime() local time3 = hr..":"..(((mins <10) and "0"..mins) or mins) local hours = time.hour local minutes = time.minute local sWidth,sHeight = guiGetScreenSize() dxDrawImage((740/1024)*sWidth, (8/768)*sHeight, (283/1024)*sWidth, (120/768)*sHeight, "outras/background.png",0,0,0,tocolor(0,0,0,255)) dxDrawImage((868/1024)*sWidth, (60/768)*sHeight, (148/1024)*sWidth, (38/768)*sHeight, "outras/background.png",0,0,0,tocolor(255,255,255,255)) dxDrawImage((873/1024)*sWidth, (63/768)*sHeight, (22/1024)*sWidth, (33/768)*sHeight, "outras/$.png",0,0,0,tocolor(255,255,255,255)) dxDrawImage((765/1024)*sWidth, (25/768)*sHeight, (85/1024)*sWidth, (85/768)*sHeight, "img/"..getPedWeapon(getLocalPlayer())..".png") local moneycount = getPlayerMoney(getLocalPlayer()) local money = ' ' ..moneycount -- Money dxDrawText(tostring (money),(886/1024)*sWidth, (63/768)*sHeight, (310/1024)*sWidth, (60/768)*sHeight, tocolor(255,255,255,255), (sWidth/1024)*1.10, newFont,"left","top",false,false,false) dxDrawText("SAEG:RPG",(910/1024)*sWidth, (98/768)*sHeight, (310/1024)*sWidth, (135/768)*sHeight, tocolor(0,102,0,255), (sWidth/1000)*1.25, newFont2,"left","top",false,false,false) --dxDrawText("000",(900/1024)*sWidth, (13/768)*sHeight, (310/1024)*sWidth, (60/768)*sHeight, tocolor(255,255,255,150), (sWidth/1024)*0.90, newFont3,"left","top",false,false,false) dxDrawText(tostring (armor).." %",(875/1024)*sWidth, (24/768)*sHeight, (310/1024)*sWidth, (60/768)*sHeight, tocolor(255,255,255,255), (sWidth/1024)*0.40, newFont3,"left","top",false,false,false) dxDrawImage((845.7/1024)*sWidth, (24/768)*sHeight, (30/1024)*sWidth, (20/768)*sHeight, "outras/armor.png") dxDrawText(tostring (health).." %",(950/1024)*sWidth, (19/768)*sHeight, (310/1024)*sWidth, (60/768)*sHeight, tocolor(255,255,255,255), (sWidth/1024)*0.60, newFont3,"left","top",false,false,false) dxDrawImage((920.7/1024)*sWidth, (19/768)*sHeight, (30/1024)*sWidth, (30/768)*sHeight, "outras/HP.png") --dxDrawText(tostring (armor).." %",(906/1024)*sWidth, (73/768)*sHeight, (310/1024)*sWidth, (60/768)*sHeight, tocolor(255,255,255,255), (sWidth/1024)*0.90, "pricedown","left","top",false,false,false) --dxDrawText(time3,(875/1024)*sWidth, (30/768)*sHeight, (310/1024)*sWidth, (60/768)*sHeight, tocolor(255,255,0,255), (sWidth/1024)*1.20, "pricedown","left","top",false,false,false) --dxDrawText("r$: "..money,(800/1024)*sWidth, (140/768)*sHeight, (310/1024)*sWidth, (60/768)*sHeight, tocolor(34,178,170,255), (sWidth/1024)*1.10, "pricedown","left","top",false,false,false) end addEventHandler("onClientHUDRender",getRootElement(), dxtest) root = getResourceRootElement() function changeit() showPlayerHudComponent("money",false) showPlayerHudComponent("area_name",false) showPlayerHudComponent("health",false) showPlayerHudComponent("clock",false) showPlayerHudComponent("armour",false) showPlayerHudComponent("oxygen",false) end addEventHandler("onClientResourceStart",root, changeit) function inCar() triggerEvent("onEnter",getLocalPlayer(),inCar) end addEventHandler("onClientVehicleEnter",getRootElement(),inCar) function outOfCar() removeEventHandler("onEnter",getLocalPlayer(),outOfCar) end addEventHandler("onClientVehicleExit",getRootElement(),outOfCar) function carHealth() local sWidth,sHeight = guiGetScreenSize() if isPedInVehicle(getLocalPlayer()) then vehicle = getPedOccupiedVehicle(getLocalPlayer()) health = math.ceil(getElementHealth(vehicle) / 10) speedx, speedy, speedz = getElementVelocity ( vehicle) actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5) kmh = math.ceil(actualspeed * 180) end end addEvent("onEnter",false) addEventHandler("onEnter",getRootElement(),carHealth) addEventHandler("onClientHUDRender",getRootElement(),carHealth) function drawWeaponImageOnChange( prevSlot, newSlot ) if getElementData(getLocalPlayer(), "loggedin") == 1 then local weapon = getPedWeapon(getLocalPlayer(), newSlot) local ammoInClip = getPedAmmoInClip(getLocalPlayer()) local ammo = getPedTotalAmmo(getLocalPlayer()) - ammoInClip if (newSlot ~= 0 and newSlot ~= 1 and newSlot ~= 10 and newSlot ~= 11 and newSlot ~= 12) then if not isElement(weaponAmmo) then weaponAmmo = guiCreateLabel(screenX - 180, screenYStart + 86, 100, 100, tostring(ammo) .." - ".. tostring(ammoInClip), false) guiSetFont(weaponAmmo, "default-bold-small") else guiSetText(weaponAmmo, tostring(ammo) .." - ".. tostring(ammoInClip)) end else if isElement(weaponAmmo) then destroyElement(weaponAmmo) end end end end addEventHandler("onClientPlayerWeaponSwitch", getLocalPlayer(), drawWeaponImageOnChange) if fileExists("client.lua") then fileDelete("client.lua") end