Jump to content

Best-Killer

Members
  • Posts

    494
  • Joined

  • Last visited

Everything posted by Best-Killer

  1. like this : local x,y = guiGetScreenSize() function drawStuff() local bg = dxDrawRectangle ( x*500, y*250, x*500, y*500, tocolor ( 0, 0, 0, 155 ) ) local line1 = dxDrawLine ( x*600, y*500, x*300, y*250, tocolor(0,0,0,255)) end addEventHandler("onClientRender", root, drawStuff) addCommandHandler ("asdasd", drawStuff) and this for make it show at same position in all res local x,y = guiGetScreenSize() local sx, sy = x/1280, y/720 ----- put your res here function drawStuff() local bg = dxDrawRectangle ( sx*500, sy*250, sx*500, sy*500, tocolor ( 0, 0, 0, 155 ) ) local line1 = dxDrawLine ( sx*600, sy*500, sx*300, sy*250, tocolor(0,0,0,255)) end addEventHandler("onClientRender", root, drawStuff) addCommandHandler ("asdasd", drawStuff)
  2. I'm sorry that I don't have an answer for you, but that's epic. To be honest, I think this isn't one animation. Guess it are 2 different animations while they are attached to each other. Because the arms aren't rigs so they should be attached to each other which will look ugly. One player will lose control...
  3. function creatMarkerSystem() local GetAllMarker = exports.NGSQL:db_query ( "SELECT * FROM marker_system " ) if ( type ( GetAllMarker ) == "table" and #GetAllMarker > 0 ) then for i = 1, #GetAllMarker do local n = {GetAllMarker[i]["Name"], GetAllMarker[i]["posX"], GetAllMarker[i]["posY"], GetAllMarker[i]["posZ"], GetAllMarker[i]["Alpha"], GetAllMarker[i]["Color"], GetAllMarker[i]["Vehicles"], GetAllMarker[i]["Rotation"], GetAllMarker[i]["Data"]} for ii = 1, #n do n[ ii ] = tostring( n[ ii ] ) end color = fromJSON(n[6]) local marker = createMarker( n[2], n[3], n[4]-1, 'cylinder', 1.25, color[1], color[2], color[3], 255 ) if marker then markers[marker] = {n[1], n[7], n[8], n[9], n[10]} addEventHandler("onMarkerHit", marker, onSpawnerMarkerHit) setElementData(marker, 'id', i ) setElementData(marker,"teamMarker",true) end end end end function onSpawnerMarkerHit(hitPlayer, matchingDimension) if not matchingDimension then return end if getElementType(hitPlayer) == "player" then if isPedInVehicle(hitPlayer) then return end local team = getElementData(source,"teamMarker") if not team then return end local tName = getElementData(hitPlayer,tostring(markers[source][4])) if not tName then return end for i,v in pairs(markers[source][1]) do if v == tName then triggerClientEvent(hitPlayer,"showvehicle",hitPlayer,markers[source][2],source) end end end end Line 28
  4. function drawlist() dxDrawImage(x*1102, y*531, x*178, y*237, "list.png",0,0,0,tocolor(255,255,255,255)) dxDrawImage(x*1064, y*611, x*38, y*77, "hide.png",0,0,0,tocolor(255,255,255,255)) dxDrawRectangle(x*1064, y*611, x*38, y*77, tocolor(0, 0, 0, 0), false) end function drawshow() dxDrawRectangle(x*1242, y*611, x*38, y*77, tocolor(0, 0, 0, 0), false) dxDrawImage(x*1242, y*611, x*38, y*77, "show.png",0,0,0,tocolor(255,255,255,255)) end addEventHandler("onClientPreRender", root, drawshow)
  5. nope just image gui for kills list , anyway to fix this big problem ?
  6. nope , the dximage deleted but the dxdrawtext didn't
  7. addEvent( 'setData', true ) addEventHandler ( 'setData', root, function (data) table.sort ( data, function (a,b) return ( tonumber(a.clan_kills) or 0 ) > ( tonumber(b.clan_kills) or 0 )end) for k,v in ipairs ( data ) do function drawtext () test = tostring(v.clan_name).." - "..tostring(v.clan_kills).."kills" dxDrawText(test, x*1110, (y*552)+(y*(20*k)), x*1280, y*570, tocolor(255, 255, 255, 255), x*1.00, "default-bold", "left", "top", false, false, false, false, false) end addEventHandler("onClientPreRender", root, drawtext) if k == 10 then break end end end) function onButtonClick(button, buttonState) if (button == "left" and buttonState == "up") then if isMouseSetColor (x*1242, y*611, x*38, y*77) then removeEventHandler("onClientPreRender", root, drawshow) addEventHandler("onClientPreRender", root, drawlist) triggerServerEvent( 'getData', localPlayer ) elseif isMouseSetColor (x*1064, y*611, x*38, y*77) then removeEventHandler("onClientPreRender", root, drawtext) removeEventHandler("onClientPreRender", root, drawlist) addEventHandler("onClientPreRender", root, drawshow) end end end addEventHandler("onClientClick", getRootElement(), onButtonClick) 0 errors but the dxrawtext not removed why ?? help
  8. helped me too much thx <3
  9. I don't understand You ! can you explain better ?
  10. Best-Killer

    Qustion

    how i make dx gridlist ?? or somthing idk what means of it what i want !! i'm making top players kills dx i did everything the dx gui & functions & events but now i don't know how to make dxgridlist means : Player name , Kills i think it's need dxDrawText but how to make it with lines max 10 like this : player1 , kills 20 player2 , kills 30 player3 , kills 40 .......... ect
  11. oh sory i don't see what you posted lol function test () 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 index, clan in pairs(exports.SAEGClans:getClanList(groupTurfs)) do local clanList = tostring(clan["clan_name"]) if ( groupTurfs [ clanList ] or 0 ) then outputChatBox ( "Test : "..clanList.."->"..tostring(groupTurfs [ clanList ]).. "") end end end addCommandHandler("ct",test) now i'm geting full clans list with how much have turfs , i want if clan don't have turfs it's don't show in that chat ! Please help !
  12. function test () 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 index, clan in pairs(exports.SAEGClans:getClanList(groupTurfs)) do local clanList = tostring(clan["clan_name"]) if ( groupTurfs [ clanList ] or 0 ) then outputChatBox ( "I Test : " ..tostring(groupTurfs [ clanList ]).. " apples and oranges.",) end end end addCommandHandler("ct",test) function getClanList() local data = executeSQLQuery("SELECT * FROM clans") return data end what i'm trying to do ? now i'm geting : how much the clan have turfs i want get , the clan name & How much the clan have turfs
  13. ah sory , i have just how much have turfs without clanName
  14. function test () 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 index, clan in pairs(exports.SAEGClans:getClanList(groupTurfs)) do local clanList = tostring(clan["clan_name"]) if ( groupTurfs [ clanList ] or 0 ) then outputChatBox ( "Test : " ..tostring(groupTurfs [ clanList ]).. "",) end end end addCommandHandler("ct",test) with that i'm geting how much the name have turf if it's have but i'm not geting the clan name ! what i have do now guys
  15. Hello Guys !! This is Nerd Gaming Turfs sys 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 and not g and not b ) then owner = "server" else if ( not r ) then r = 255; end if ( not g ) then g = 255; end if ( not b ) then b = 255; end 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) local id = 0; if ( forcedId ) then if ( turfLocs [ forcedId ] ) then destroyTurf ( forcedId ); end id = forcedId; else while ( turfLocs [ id ] ) do id = id + 1; end 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 destroyTurf ( id ) if ( turfLocs [ id ] ) then removeEventHandler ( "onColShapeHit", turfLocs[id].col, onColShapeHit ) removeEventHandler ( "onColShapeLeave", turfLocs[id].col, onColShapeLeave ) destroyElement ( turfLocs[id].col ); destroyElement ( turfLocs[id].radar ); outputDebugString ( "SAEGTurf: Turf #"..tostring(id).." has been destroyed (Owner: "..turfLocs[id].owner..")" ); turfLocs[id] = nil; return true; end return false; end function addTurf( player, cmd, width, height ) if ( exports.SAEGAdministration:isPlayerStaff ( player ) and exports.SAEGAdministration:getPlayerStaffLevel ( player, 'int' ) >= 4 ) then if ( not width ) then return exports.SAEGMessages:sendClientMessage ( "Missing width argument, correct syntax: /addturf width height", player, 225, 0, 0) end if ( not height ) then return exports.SAEGMessages:sendClientMessage ( "Missing height argument, correct syntax: /addturf width height", player, 225, 0, 0) end if ( type ( width ) == 'number' and type ( height ) == 'number' ) then local x, y, z = getElementPosition ( player ) createTurf ( x, y, z, width, height, "server", id ) exports.NGSQL:db_query ( "INSERT INTO turfs(`id`, `owner`, `x`, `y`, `z`, `width`, `height`) VALUES (?, ?, ?, ?, ?, ?, ?)", id, 'server', math.floor(x), math.floor(y), math.floor(z), tonumber(width), tonumber(height)) exports.SAEGMessages:sendClientMessage( "SAEGTurf: A new turf was added successfully", player, 0, 255, 0 ) else exports.SAEGMessages:sendClientMessage( "SAEGTurf: Expected numbers for width and/or height", player, 0, 255, 0 ) end end end addCommandHandler( "addturf", addTurf ) function deleteturf( player, cmd ) if ( exports.SAEGAdministration:isPlayerStaff ( player ) and exports.SAEGAdministration:getPlayerStaffLevel ( player, 'int' ) >= 5 ) then local x, y, z = getElementPosition(player) local counter = 0 for w, area in ipairs(getElementsByType("radararea")) do local ax, ay, az = getElementPosition ( area ) if ax > (x-5) and ax < (x+5) and ay > (y-5) and ay < (y+5) then destroyElement(area) counter = counter + 1 end end for w, colshape in ipairs(getElementsByType("colshape")) do local ax,ay,az = getElementPosition(colshape) if ax > (x-5) and ax < (x+5) and ay > (y-5) and ay < (y+5) and getElementData( colshape, "NGTurf:TurfId") then destroyElement(colshape) end end if counter > 0 then exports.SAEGMessages:sendClientMessage( "SAEGTurf: Turf was removed from database successfully", player, 0, 255, 0 ) exports.NGSQL:db_exec("DELETE FROM turfs WHERE X>? AND X<? AND Y>? AND Y<?", math.floor(x)-5, math.floor(x)+5, math.floor(y)-5, math.floor(y)+5 ) else exports.SAEGMessages:sendClientMessage( "NGTurf: No turfs was found within this range, stand near by the left corner of radar area", player, 255, 0, 0 ) end end end addCommandHandler( "deleteturf", deleteturf ) function updateTurfGroupColor ( group ) local r, g, b = exports.nggroups: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)) ~= "Criminals" then exports['SAEGMessages']:sendClientMessage("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 triggerClientEvent ( player, "SAEGTurfs:onClientEnterTurfArea", player, turfLocs [ id ] ) if ( not gang ) then return exports.NGMessages: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,true).."! 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.NGGroups: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, true ).." 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, true ).." 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, true ).." 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, true ).." 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, true ).." 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,true).."!", 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, true ).." to the "..turfLocs[id].owner.." gang!", turfLocs[id].attackers, 255, 0, 0 ) exports.SAEGroups:outputGroupMessage ( "Your gang has defended the turf in "..getZoneName(x,y,z)..", "..getZoneName(x,y,z,true).." 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 ) local r, g, b = exports.SAEGGroups:getGroupColor ( owner ) if ( owner == "server" ) then r, g, b = 255, 255, 255 end setRadarAreaFlashing ( turfLocs[id].radar, false ) turfLocs[id].owner = owner turfLocs[id].attackers = nil turfLocs[id].attackProg = 0 setRadarAreaColor ( turfLocs[id].radar, r or 255, g or 255, b or 255, 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, 117, 120 }, { -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 }, { -2397.31, 82.99, 35.3, 133, 160 }, { -2095.33, -280.06, 35.32, 84, 176 }, { -1980.58, 107.69, 27.68, 59, 62 }, { -2129.01, 741.71, 48, 112, 57 }, { -2243.24, 928.4, 66.65, 87, 154 }, { -1701.62, 743.44, 10, 129, 83 }, { -2696.23, -59.88, 4.73, 83, 89 }, { -2541.18, -720.16, 135, 55, 125 } } outputDebugString ( "NGTurf: 0 Turfs found -- Generating ".. tostring ( #data ) ) for i, v in pairs ( data ) do x = { ['x'] = v[1], ['y'] = v[2], ['z'] = v[3], ['width'] = v[4], ['height'] = v[5], ['owner'] = "server" } query[i] = x; exports.NGSQL:db_exec ( "INSERT INTO turfs ( id, owner, x, y, z, width, height ) VALUES ( ?, ?, ?, ?, ?, ?, ? )", tostring ( i ), "server", tostring ( x['x'] ), tostring ( x['y'] ), tostring ( x['z'] ), tostring ( x['width'] ), x['height'] ); end end for i, v in pairs ( query ) do local id, owner, x, y, z, width, height = tonumber ( v['id'] ), v['owner'], tonumber ( v['x'] ), tonumber ( v['y'] ), tonumber ( v['z'] ), tonumber ( v['width'] ), tonumber ( v['height'] ) createTurf ( x, y, z, width, height, owner, id ) end end ) -- 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 setTimer ( sendTurfPayout, (60*tonumber(get("*PAYOUT_TIME")))*1000, 0 ) i want add command /turfs when i use it i see in chatbox example : Last kings have 10 turfs Hooliganz Have 30 Turfs ...... i don't know what i have use to make it Note Give me examples for do it or if it's ez do it (if you have time , but make sure if it's ez pz if not give me examples to learn ) And thx all
  16. Try This : function savePlayerData(player) local account = getPlayerName(player) local x, y, z = getElementPosition(player) local money = getPlayerMoney(player) local health = getElementHealth(player) local armor = getPedArmor(player) local skin = getElementModel(player) local int = getElementInterior(player) local dim = getElementDimension(player) local weapons = { } local kills = tonumber(getElementData(player, "Kills")) or 0 local deaths = tonumber(getElementData(player, "Deaths")) or 0 local weaponstats = toJSON(weaponstats_) for i=1, 12 do weapons[i] = { getPedWeapon(player, i), getPedTotalAmmo(player, i)} end local weapons = toJSON(weapons) outputDebugString ( "GWsql: Tentando salvar a conta (Player: "..account..") userdata." ) return dbExec(db, "UPDATE accounts SET Money=?, Armour=?, Health=?, x=?, y=?, z=?, Skin=?, Interior=?, Dimension=?, Weapons=?, Kills=?, Deaths=?, weapstats=? AND WHERE user =?",money, armor, health, x, y, z, skin, int, dim, weapons, kills, deaths, weaponstats,account ) end
  17. ye , local jailedPlayers = { }
  18. Unjail Function : line 6 server side : onJailCopCriminals line 3
  19. so , what i have to use now
  20. coptargets = 0 --ADDS BLIPS AND MARKERS FOR POLICE STATIONS addEvent("copdirections", true) function copshops() if coptargets == 0 then coptargets = 1 blip1 = createBlip ( 2246.1008300781, 2453.1953125, 9.8203125, 30, 3, 0, 0, 255, 255, 50, getLocalPlayer() ) marker1 = createMarker ( 2246.1008300781, 2453.1953125, 9.8203125, "cylinder", 6, 0, 0, 255, 55, getLocalPlayer() ) colshape1 = createColSphere ( 2246.1008300781, 2453.1953125, 9.8203125, 6 ) setElementData ( colshape1, "purpose", "copshop" ) blip2 = createBlip ( -1406.9072265625, 2655.0927734375, 55.6875, 30, 3, 0, 0, 255, 255, 50, getLocalPlayer() ) marker2 = createMarker ( -1406.9072265625, 2655.0927734375, 55.6875, "cylinder", 6, 0, 0, 255, 55, getLocalPlayer() ) colshape2 = createColSphere ( -1406.9072265625, 2655.0927734375, 55.6875, 6 ) setElementData ( colshape2, "purpose", "copshop" ) blip3 = createBlip ( -209.9542, 977.7558, 18.188976, 30, 3, 0, 0, 255, 255, 50, getLocalPlayer() ) marker3 = createMarker ( -209.9542, 977.7558, 18.188976, "cylinder", 6, 0, 0, 255, 55, getLocalPlayer() ) colshape3 = createColSphere (-209.9542, 977.7558, 18.188976, 6 ) setElementData ( colshape3, "purpose", "copshop" ) blip4 = createBlip ( -1628.2619628906, 676.62005615234, 6.1901206970215, 30, 3, 0, 0, 255, 255, 50, getLocalPlayer() ) marker4 = createMarker ( -1628.2619628906, 676.62005615234, 6.1901206970215, "cylinder", 6, 0, 0, 255, 55, getLocalPlayer() ) colshape4 = createColSphere ( -1628.2619628906, 676.62005615234, 6.1901206970215, 6 ) setElementData ( colshape4, "purpose", "copshop" ) blip5 = createBlip ( 624.66278076172, -605.72027587891, 15.923292160034, 30, 3, 0, 0, 255, 255, 50, getLocalPlayer() ) marker5 = createMarker ( 624.66278076172, -605.72027587891, 15.923292160034, "cylinder", 6, 0, 0, 255, 55, getLocalPlayer() ) colshape5 = createColSphere ( 624.66278076172, -605.72027587891, 15.923292160034, 6 ) setElementData ( colshape5, "purpose", "copshop" ) blip6 = createBlip ( 1565.3386230469, -1628.5202636719, 12.382812, 30, 3, 0, 0, 255, 255, 50, getLocalPlayer() ) marker6 = createMarker ( 1565.3386230469, -1628.5202636719, 12.382812, "cylinder", 6, 0, 0, 255, 55, getLocalPlayer() ) colshape6 = createColSphere ( 1565.3386230469, -1628.5202636719, 12.382812, 6 ) setElementData ( colshape6, "purpose", "copshop" ) blip7 = createBlip ( -2164.3779296875, -2389.533203125, 29.617206573486, 30, 3, 0, 0, 255, 255, 50, getLocalPlayer() ) marker7 = createMarker ( -2164.3779296875, -2389.533203125, 29.617206573486, "cylinder", 6, 0, 0, 255, 55, getLocalPlayer() ) colshape7 = createColSphere ( -2164.3779296875, -2389.533203125, 29.617206573486, 6 ) setElementData ( colshape7, "purpose", "copshop" ) end end addEventHandler("copdirections", getRootElement(), copshops) addEvent ( "onPlayerStartArrested", true ) function copshophit (theshape) if isElement(theshape) then if (getElementData(theshape, "purpose") == "copshop" ) then if ( getElementType( source ) == "player" ) then if ( getElementData ( source, "SAEGJobs:ArrestingOfficer" ) ) then local mx, my, mz = getElementPosition(theshape) triggerServerEvent ("saegpolice:onJailCopCrimals", getLocalPlayer (), source, tostring(mx, my, mz) ) end end end end end addEventHandler ( "onClientElementColShapeHit", getRootElement(), copshophit) addEventHandler ( "onPlayerStartArrested", getRootElement(), copshophit) function onJailCopCriminals(mx, my, mz) for v, _ in pairs ( arresties ) do if ( getElementData ( v, "SAEGJobs:ArrestingOfficer" ) == source ) then setElementData ( v, "arrestpos", { mx, my, mz } ) releasePlayer ( v ) local time = math.floor ( ( getElementData ( v, "WantedPoints" ) * 2 ) or 50 ) local orgTime = time local vip = getElementData ( v, "VIP" ) if ( exports.SAEGVIP:getVipLevelFromName ( vip ) == 4 ) then time = time - ( time * 0.5 ) exports.SAEGMessages:sendClientMessage ( "You're serving 50% less jail time due to diamond VIP! (Original time: "..orgTime.." seconds)", v, 0, 255, 0 ) elseif ( exports.SAEGVIP:getVipLevelFromName ( vip ) == 3 ) then time = time - ( time * 0.25 ) exports.SAEGMessages:sendClientMessage ( "You're serving 25% less jail time due to gold VIP! (Original time: "..orgTime.." seconds)", v, 0, 255, 0 ) elseif ( exports.SAEGVIP:getVipLevelFromName ( vip ) == 2 ) then time = time - ( time * 0.15 ) exports.SAEGMessages:sendClientMessage ( "You're serving 15% less jail time due to silver VIP! (Original time: "..orgTime.." seconds)", v, 0, 255, 0 ) elseif ( exports.SAEGVIP:getVipLevelFromName ( vip ) == 1 ) then time = time - ( time * 0.05 ) exports.SAEGMessages:sendClientMessage ( "You're serving 5% less jail time due to bronze VIP! (Original time: "..orgTime.." seconds)", v, 0, 255, 0 ) end local time = math.floor ( time ) givePlayerMoney ( source, math.floor ( orgTime*2 ) ) exports['SAEGMessages']:sendClientMessage ( "You were paid $"..math.floor ( orgTime*2 ).." for arresting "..getPlayerName ( v ).."!", source, 0, 255, 0 ) exports['SAEGPolice']:jailPlayer ( v, time, false, source, "Police Arrest" ) updateJobColumn ( getAccountName ( getPlayerAccount ( source ) ), "Arrests", "AddOne" ) end end end addEvent ( "saegpolice:onJailCopCrimals", true ) addEventHandler ( "saegpolice:onJailCopCrimals", root, onJailCopCriminals ) Unjail Function function unjailPlayer ( p, mx, my, mz, triggerClient ) local p = p or source setElementDimension ( p, 0 ) setElementInterior ( p, 0 ) local mx, my, mz = unpack (getElementData(p,"arrestpos")) setElementPosition ( p, mx or 1176.38, my or -1326.82, mz or 14.02 ) exports['SAEGMessages']:sendClientMessage ( "You've been released from jail! Behave next time.", p, 0, 255, 0 ) jailedPlayers[p] = nil getElementData ( p, "WantedPoints", "0" ) setPlayerWantedLevel ( p, 0 ) setElementData ( p, "SAEGPolice:JailTime", nil ) setElementData ( p, "isGodmodeEnabled", nil ) exports['SAEGLogs']:outputActionLog ( getPlayerName ( p ).." has been unjailed" ) if ( triggerClient ) then triggerClientEvent ( p, 'SAEGJail:StopJailClientTimer', p ) end end addEvent ( "SAEGJail:UnjailPlayer", true ) addEventHandler ( "SAEGJail:UnjailPlayer", root, unjailPlayer ) Error Bad argument @ setElementPosition expected vector3 at argumnt 2 got player getElementData expected bool at argument 3 got string 0
  21. addEvent("clanSystem:returnLog",true) addEventHandler("clanSystem:returnLog",root, function (clanLog) guiGridListClear(clan_GUI["clan_log"]["grid"]) for index, logM in pairs(clanLog) do local row = guiGridListAddRow(clan_GUI["clan_log"]["grid"]) local info = split(logM["log_message"],string.byte(";")) local logMessage = info[1] .." ".. info[2] .." on ".. info[3] .." - ".. info[4] guiGridListSetItemText(clan_GUI["clan_log"]["grid"],row,1,tostring(logMessage),false,false) end end) attempt to concatenate field '?' a nill value (line
×
×
  • Create New...