Jump to content

Captain Cody

Members
  • Posts

    2,753
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by Captain Cody

  1. LOLOOLOLOOLOOLOOLOLOLL you helped me put weapon storage into house system I was using but didnt put it on your own LOLOLOLOLOOLOLOL
  2. Server Back up Network Issues with host, Problem resoved
  3. if thats the case I'll set it up for my server ik it says not made for public servers yet but If you make it so we can disable and enable what we want I can make it work just fine
  4. Captain Cody

    [Server]

    I can set it up for you havent been working with linux much but Ik a thing or two
  5. Server offline until farther notice, Main host network went out.
  6. I donno theres ways around the lag, Not really known to me but I've seen it done though its a sweet script 4.5/5
  7. Ok sweet, server went down for a bit so I have no way of testing it I need to make sure before I finnish
  8. Is it possiable to Load only a TXD file im editing bill boards but im not sure if it will work just to load the TXD file
  9. so you expect every one who gets this to get new computer?
  10. I got a house system Anubhav "left server" edited it so you can store weapons when I go to open panel it doesnt open Debugscript : http://postimg.org/image/3qfv9q44d/ and the script thats doing it : local sql = { Query = executeSQLQuery }; addEventHandler( 'onResourceStart', resourceRoot, function() sql.Query( "CREATE TABLE IF NOT EXISTS house_data (\ ID INTEGER, en_X REAL, en_Y REAL, en_Z REAL,\ en_tX REAL, en_tY REAL, en_tZ REAL,\ ex_X REAL, ex_Y REAL, ex_Z REAL,\ ex_tX REAL, ex_tY REAL, ex_tZ REAL,\ int INTEGER, dim INTEGER, cost INTEGER, owner TEXT, key TEXT )" ); sql.Query( 'CREATE TABLE IF NOT EXISTS house_weapons (hID INT, weapons TEXT, ammo TEXT)') for i, v in ipairs( getElementsByType( 'player' ) ) do setElementData( v, 'k_len', tonumber( get( 'keyLength' ) ) ); local acc = getPlayerAccount( v ); if not isGuestAccount( acc ) then setElementData( v, 'HS_accountName', getAccountName( acc ) ); end; setElementData( v, 'mrk_in', nil ); end; local hr = sql.Query( "SELECT * FROM house_data" ); for i = 1, #hr do createHouse( false, hr[i].ID, hr[i].owner, hr[i].key, hr[i].en_X, hr[i].en_Y, hr[i].en_Z, hr[i].en_tX, hr[i].en_tY, hr[i].en_tZ, hr[i].ex_X, hr[i].ex_Y, hr[i].ex_Z, hr[i].ex_tX, hr[i].ex_tY, hr[i].ex_tZ, hr[i].int, hr[i].dim, hr[i].cost ); end; end ); function log(text) if fileExists( "logs.txt" ) then local file = fileOpen( "logs.txt" ) local read = fileRead( "logs.txt", fileGetSize(file) ) fileWrite(file, read.."\n"..text) fileClose( file ) else local file = fileCreate( "logs.txt" ) local file2 = fileOpen( "logs.txt" ) fileWrite(file2, text) fileClose( file2 ) end end addEventHandler( 'onResourceStop', resourceRoot, function() for i, v in ipairs( getElementsByType( 'player' ) ) do setElementData( v, 'k_len', nil ); setElementData( v, 'HS_accountName', nil ); end; end ); addEventHandler( 'onPlayerJoin', root, function() setElementData( source, 'k_len', tonumber( get( 'keyLength' ) ) ); end ); addEventHandler( 'onPlayerLogin', root, function( _, acc ) setElementData( source, 'HS_accountName', getAccountName( acc ) ); end ); addEventHandler( 'onPlayerLoout', root, function( _, acc ) setElementData( source, 'HS_accountName', nil ); end ); addCommandHandler( 'hpanel', function( player ) if isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( 'Admin' ) ) or hasObjectPermissionTo( player, 'function.banPlayer', false ) then if not getElementData( player, 'HP_Opened' ) and not getElementData( player, 'mrk_in' ) then triggerClientEvent( player, 'HP_SetVisible', root, true ); log(getPlayerName(player).." opened house creating panel! Acc-name:"..getAccountName(getPlayerAccount(client))) end; else log(getPlayerName(player).." access denied for house creating panel!") outputChatBox( '* Access denied for this command!', player, 255, 36, 51 ); end; end ); addEvent( 'onPlayerAttemptCreateHouse', true ); addEventHandler( 'onPlayerAttemptCreateHouse', root, function( rt ) createHouse( true, #sql.Query( "SELECT * FROM house_data" ) + 1, '', '', unpack( rt ) ); log(getPlayerName(client).." created a house! Acc name: "..getAccountName(getPlayerAccount(client))) outputChatBox( '* The new house has been created successfully!', client, 255, 255, 0 ); end ); function createHouse( add, ID, owner, key, eX, eY, eZ, etX, etY, etZ, exX, exY, exZ, extX, extY, extZ, int, dim, cost ) if add then sql.Query( "INSERT INTO house_data ( ID, en_X, en_Y, en_Z, en_tX, en_tY, en_tZ, ex_X, ex_Y, ex_Z, ex_tX, ex_tY, ex_tZ, int, dim, cost, owner, key ) VALUES ( "..ID..", "..eX..", "..eY..", "..eZ..", "..etX..", "..etY..", "..etZ..", "..exX..", "..exY..", "..exZ..", "..extX..", "..extY..", "..extZ..", "..int..", "..dim..", "..cost..", '', '' )" ); end; local m_Enter = createMarker( eX, eY, eZ - 1, 'cylinder', 1.25, 0, 153, 255, 150 ); setElementData( m_Enter, 'HS_INFO', { etX, etY, etZ, int, dim, cost, owner, key, ID } ); if getElementData( m_Enter, 'HS_INFO' )[7] ~= '' then setMarkerColor( m_Enter, 255, 51, 36, 150 ); end; addEventHandler( 'onMarkerHit', m_Enter, function( player ) if getElementType( player ) == 'player' and not getPedOccupiedVehicle( player ) then if not getElementData( player, 'HP_Opened' ) then if not isGuestAccount( getPlayerAccount( player ) ) then setElementData( player, 'mrk_in', getElementData( source, 'HS_INFO' )[9] ); onPlayerHouseMarkerHit( player, source, true ); setPedFrozen( player, true ); else outputChatBox( '* You must be logged in to get in this house!', player, 255, 51, 36 ); end; end; end; end ); addEventHandler( 'onMarkerLeave', m_Enter, function( player ) if getElementType( player ) == 'player' and not getPedOccupiedVehicle( player ) then setElementData( player, 'mrk_in', nil ); end; end ); local m_Exit = createMarker( exX, exY, exZ - 1, 'cylinder', 1.25, 0, 153, 255, 150 ); setElementData( m_Exit, 'parent', m_Enter ); setElementInterior( m_Exit, int ); setElementDimension( m_Exit, dim ); setElementData( m_Exit, 'extX', extX ); setElementData( m_Exit, 'extY', extY ); setElementData( m_Exit, 'extZ', extZ ); addEventHandler( 'onMarkerHit', m_Exit, function( player, dim ) if getElementType( player ) == 'player' and dim then toggleAllControls( player, false ); fadeCamera( player, false ); setTimer( function( player, mrk ) if getPedOccupiedVehicle( player ) then removePedFromVehicle( player ); end; local x, y, z = getElementData( mrk, 'extX' ), getElementData( mrk, 'extY' ), getElementData( mrk, 'extZ' ); setElementPosition( player, x, y, z ); setElementInterior( player, 0 ); setElementDimension( player, 0 ); toggleAllControls( player, true ); setElementData( player, 'house_id_p', nil ) fadeCamera( player, true ); end, 1200, 1, player, source ); end; end ); end; function onPlayerHouseMarkerHit( player, mrk, cursor ) local acc = getPlayerAccount( player ); if isGuestAccount( acc ) then outputChatBox( '* You must be logged in to get in this house!', player, 255, 51, 36 ); setElementData( player, 'mrk_in', nil ); setPedFrozen( player, false ); log(getPlayerName(player).." access denied to enter a house.") return false; end; local tts = { [1] = true, [2] = false, [3] = false, [4] = true, [5] = false, [6] = false }; if isObjectInACLGroup( 'user.'..getAccountName( acc ), aclGetGroup( 'Admin' ) ) or hasObjectPermissionTo( player, 'function.banPlayer', false ) then tts[6] = true; end; local owner = getElementData( mrk, 'HS_INFO' )[7]; local accName = getAccountName( acc ); if owner == accName then tts[1] = false; tts[2] = true; tts[3] = true; tts[4] = true; tts[5] = true; end; if owner ~= accName and owner ~= '' then tts[1] = false; end; if owner == '' then if isObjectInACLGroup( 'user.'..getAccountName( acc ), aclGetGroup( 'Admin' ) ) or hasObjectPermissionTo( player, 'function.banPlayer', false ) then tts[4] = true; else tts[4] = false; end; end; tts[7] = getElementData( mrk, 'HS_INFO' )[9]; tts[8] = getElementData( mrk, 'HS_INFO' )[7]; tts[9] = getElementData( mrk, 'HS_INFO' )[6]; log(getPlayerName(player).." opened house managment window. Acc:"..accName) triggerClientEvent( player, 'openHouseManagementWnd', root, tts, cursor ); end; addEvent( 'HOUSE_Buy', true ); addEventHandler( 'HOUSE_Buy', root, function( cost, key ) local accName = getAccountName( getPlayerAccount( client ) ); local houseCounter = 0; for i, v in ipairs( getElementsByType( 'marker', getResourceRootElement() ) ) do if getElementData( v, 'HS_INFO' ) then local owner = getElementData( v, 'HS_INFO' )[7]; if owner == accName then houseCounter = houseCounter + 1; end; end; end; if getPlayerMoney( client ) >= tonumber( cost ) then outputChatBox( '* Key has been set to #00FF00'..key, client, 255, 51, 36, true ); outputChatBox( '* Congratulations! You have bought a house!', client, 255, 255, 0 ); log(getPlayerName(client).." bought a house") sql.Query( "UPDATE house_data SET owner = '"..accName.."', key = '"..key.."' WHERE ID = ?", getElementData( client, 'mrk_in' ) ); takePlayerMoney( client, cost ); local mrk = getHouseByID( getElementData( client, 'mrk_in' ) ); local t = {}; for i = 1, 6 do t[i] = getElementData( mrk, 'HS_INFO' )[i]; end; t[7] = accName; t[8] = key; t[9] = getElementData( client, 'mrk_in' ); setElementData( mrk, 'HS_INFO', { t[1], t[2], t[3], t[4], t[5], t[6], t[7], t[8], t[9] } ); setMarkerColor( mrk, 255, 51, 36, 150 ); setTimer( onPlayerHouseMarkerHit, 50, 1, client, mrk, true ); else log(getPlayerName(client).." doesn't have enough money to buy a house. House-id:"..getElementData( client, 'mrk_in' )..", accname:"..getAccountName(getPlayerAccount(client))) outputChatBox( '* You do not have enough money!', client, 255, 51, 36 ); onPlayerHouseMarkerHit( client, getHouseByID( getElementData( client, 'mrk_in' ) ), true ); end; end ); addEvent( 'HOUSE_Sell', true ); addEventHandler( 'HOUSE_Sell', root, function() sql.Query( "UPDATE house_data SET owner = '', key = '' WHERE ID = ?", getElementData( client, 'mrk_in' ) ); local mrk = getHouseByID( getElementData( client, 'mrk_in' ) ); givePlayerMoney( client, getElementData( mrk, 'HS_INFO' )[6] / 2 ); local t = {}; for i = 1, 6 do t[i] = getElementData( mrk, 'HS_INFO' )[i]; end; t[7] = ''; t[8] = ''; t[9] = getElementData( client, 'mrk_in' ); log(getPlayerName(client).." sold his house to bank! HOUSE-ID:"..t[9].." PLAYER ACC:"..getAccountName(getPlayerAccount(client))) setElementData( mrk, 'HS_INFO', { t[1], t[2], t[3], t[4], t[5], t[6], t[7], t[8], t[9] } ); setMarkerColor( mrk, 0, 153, 255, 150 ); setTimer( onPlayerHouseMarkerHit, 50, 1, client, mrk, false ); end ); addEvent( 'HOUSE_Enter', true ); addEventHandler( 'HOUSE_Enter', root, function() setPedFrozen( client, false ); local mrk = getHouseByID( getElementData( client, 'mrk_in' ) ); local t = {}; for i = 1, 5 do t[i] = getElementData( mrk, 'HS_INFO' )[i]; end; fadeCamera( client, false ); toggleAllControls( client, false ); setTimer( function( player, t ) if getPedOccupiedVehicle( player ) then removePedFromVehicle( player ); end; setElementInterior( player, t[4], t[1], t[2], t[3] ); setElementDimension( player, t[5] ); toggleAllControls( player, true ); fadeCamera( player, true ); outputChatBox("House ID: #"..getElementData( player, 'mrk_in' ), player )
  11. Wats the code i worked with 50p spawn menu before
  12. K as bind key? Donno why people do that lock = L
  13. I can make skin mods for a price
  14. hes asking how to do it, Dont no why every one has to be jerks, Just help a guy out
  15. Danm looks good too bad you had to be a @ss to my staff
  16. Differnce between coping and editing "With permission"
  17. I did check debugscript and I fixed it already just forgot to post it here
  18. Captain Cody

    Hud

    Anubhav has been scripting for my server and told me edit the hud he made for it but hes at school and I cannot figure out what is wrong with it tables = { health="", } addEventHandler("onClientResourceStart", resourceRoot, function() screenW, screenH = guiGetScreenSize() end ) 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 function getPedMaxHealth(ped) -- Output an error and stop executing the function if the argument is not valid assert(isElement(ped) and (getElementType(ped) == "ped" or getElementType(ped) == "player"), "Bad argument @ 'getPedMaxHealth' [Expected ped/player at argument 1, got " .. tostring(ped) .. "]") -- Grab his player health stat. local stat = getPedStat(ped, 24) -- Do a linear interpolation to get how many health a ped can have. -- Assumes: 100 health = 569 stat, 200 health = 1000 stat. local maxhealth = 100 + (stat - 569) / 4.31 -- Return the max health. Make sure it can't be below 1 return math.max(1, maxhealth) end addEventHandler("onClientRender", root, function() setPlayerHudComponentVisible( "money", false ) setPlayerHudComponentVisible( "armour", false ) setPlayerHudComponentVisible( "clock", false ) setPlayerHudComponentVisible( "health", false ) setPlayerHudComponentVisible( "ammo", false ) setPlayerHudComponentVisible( "weapon", false ) local hp = tostring(math.floor(getElementHealth( localPlayer ))).."%" local money = tostring(convertNumber( getPlayerMoney( localPlayer ))) local h, m = getTime() local ammo = tostring(getPedTotalAmmo(localPlayer) - getPedAmmoInClip(localPlayer).."-"..getPedAmmoInClip(localPlayer)) dxDrawText("HEALTH: "..hp, 280, (screenH - 42) / 1.09, (280) + 423, ( (screenH - 42) / 1.09) + 42, tocolor(255, 0, 0, 255), 1.00, "pricedown", "left", "top", true, true, true, true, false) dxDrawText("HEALTH: "..hp, 281, 862, 538, 904, tocolor(0, 0, 0, 255), 1.00, "pricedown", "center", "top", true, true, true, true, false) dxDrawText("MONEY: $"..money, 281, 862, 538, 904, tocolor(0, 0, 0, 255), 1.00, "pricedown", "center", "top", true, true, true, true, false) dxDrawText("MONEY: $"..money, 280, (screenH - 42) / 1.14, (280) + 257, ( (screenH - 42) / 1.14) + 42, tocolor(0, 100, 0, 154), 1.00, "pricedown", "center", "top", true, true, true, true, false) dxDrawText("TIME: "..h..":"..m, 277, 828, 416, 860, tocolor(0, 0, 0, 255), 1.00, "pricedown", "left", "top", true, true, true, true, false) dxDrawText("TIME: "..h..":"..m, 276, (screenH - 32) / 1.2, (276) + 139, ( (screenH - 32) / 1.2) + 32, tocolor(56, 56, 56, 255), 1.00, "pricedown", "left", "top", true, true, true, true, false end )
×
×
  • Create New...