Jump to content

Blaawee

Members
  • Posts

    857
  • Joined

  • Last visited

Everything posted by Blaawee

  1. client: GUIEditor = { tab = {}, progressbar = {}, tabpanel = {}, button = {}, window = {}, memo = {} } function spawnPanel() GUIEditor.window[1] = guiCreateWindow(234, 105, 317, 372, "Zombie Infestation |DayZ| (PH SERVER)", false) guiWindowSetMovable(GUIEditor.window[1], false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFF0000") GUIEditor.memo[1] = guiCreateMemo(9, 20, 298, 105, "Welcome to Zombie Infestation |DayZ|\nBelow are the list of teams that will be available for you.\nRead every team's description.\nJoin the team you want to fight against the massive army of zombies.", false, GUIEditor.window[1]) guiMemoSetReadOnly(GUIEditor.memo[1], true) GUIEditor.tabpanel[1] = guiCreateTabPanel(9, 131, 298, 224, false, GUIEditor.window[1]) GUIEditor.tab[1] = guiCreateTab("Team 1", GUIEditor.tabpanel[1]) GUIEditor.memo[2] = guiCreateMemo(0, 0, 298, 107, "~MILITARY~\nOne of the deadliest gang in Las Venturas.\nPowerful weapons.\nLocated at west of Las Venturas in military base.\n\nGANG WAR : ON", false, GUIEditor.tab[1]) guiMemoSetReadOnly(GUIEditor.memo[2], true) GUIEditor.button[1] = guiCreateButton(41, 117, 216, 55, "CHOOSE MILITARY", false, GUIEditor.tab[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FF06FF00") GUIEditor.tab[2] = guiCreateTab("Team 2", GUIEditor.tabpanel[1]) GUIEditor.memo[3] = guiCreateMemo(0, 0, 298, 142, "~LV MAFIA~\nOne of the deadliest gang in Las Venturas.\nConsist of 3 mob families :\n1) Forelli Family (Leader)\n2) Leone Family\n3) Sindacco Family\nRichest team in Las Venturas.\nLocated center of LV on the main streets.\n\nGANG WAR : ON", false, GUIEditor.tab[2]) guiMemoSetReadOnly(GUIEditor.memo[3], true) GUIEditor.button[2] = guiCreateButton(23, 152, 251, 42, "CHOOSE LV MAFIA", false, GUIEditor.tab[2]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFBA00FF") GUIEditor.tab[3] = guiCreateTab("Team 3", GUIEditor.tabpanel[1]) GUIEditor.memo[4] = guiCreateMemo(0, 0, 298, 133, "~DEADMAN.INC~\nKnown as Varrios Los Aztecas.\nThey are veterans in carjacking and gun running.\nThey are the rival of military in taking territory over the west of Las Venturas.\nLocated at west of Las Venturas near LV Airport.\n\nGANG WAR : ON", false, GUIEditor.tab[3]) guiMemoSetReadOnly(GUIEditor.memo[4], true) GUIEditor.button[3] = guiCreateButton(44, 139, 209, 60, "CHOOSE DEADMAN.INC", false, GUIEditor.tab[3]) guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FF0000FF") GUIEditor.tab[4] = guiCreateTab("Team 4", GUIEditor.tabpanel[1]) GUIEditor.memo[5] = guiCreateMemo(0, 0, 298, 112, "~ZOMBIELAND KILLERS~\nTheir job is only killing zombies.\nThey earn cash by killing zombies.\nSafe from gangwar.\n\nGANG WAR : OFF", false, GUIEditor.tab[4]) guiMemoSetReadOnly(GUIEditor.memo[5], true) GUIEditor.button[4] = guiCreateButton(27, 124, 243, 59, "CHOOSE ZOMBIELAND KILLERS", false, GUIEditor.tab[4]) guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FFFFFB00") guiSetAlpha(GUIEditor.progressbar[1], 0.00) showCursor(true) end addEvent ("onClientPlayerLogin",true) addEventHandler ("onClientPlayerLogin", root, spawnPanel) function teamM() if ( source == GUIEditor.button[1] ) then triggerServerEvent("team1",source) guiSetVisible(GUIEditor.window[1],false) showCursor(false) end end addEventHandler ("onClientGUIClick", guiRoot, teamM) server: function panel() triggerClientEvent (source,"onClientPlayerLogin",source) end addEventHandler("onPlayerLogin", root, panel) function teamm () setPlayerTeam(source,team1) spawnPlayer (source, 202.39999389648, 1858.4000244141, 13.10000038147, 0, 312, 0, 0) fadeCamera (source, true) setCameraTarget (source, source) giveWeapon ( source, 30, 1000 ) giveWeapon ( source, 32, 1000 ) end addEvent("team1", true) addEventHandler("team1", root, teamm)
  2. I guess you should use fadeCamera setCameraTarget
  3. radius = 10 addEventHandler( "onClientRender", root, function( ) radius = math.rad( 90 - radius ) setCameraMatrix( math.cos( radius ), math.sin( radius ), 50, 0, 0, 0 ) end )
  4. for _,resources in pairs( getResources( ) ) do local name = getResourceInfo( resources, "name" ) or "" end Maybe some of your resources info Undefined
  5. Blaawee

    Help?

    I guess he didn't use 'setPedAnimation' function.
  6. I don't want to be rude. No codes. No help.
  7. Search for old topics about interpolateBetween
  8. Here is an example connection = {} connection_mt = { __index = connection } local validDatabaseType = { mysql = true, sqlite = true } function connection:create( databaseType, host, username, password, options ) if databaseType and type( databaseType ) ~= 'string' then outputDebugString ( 'Bad argument @argument #1 Must be string. ', 0, 112, 112, 112 ); return end if not validDatabaseType[ databaseType ] then outputDebugString ( 'Bad argument @argument #1 Unvalid datebase type. ', 0, 112, 112, 112 ); return end if databaseType == 'sqlite' then username = ''; password = ''; else username = username; password = password; end local connet = { type = databaseType, host = host, username = username, password = password, options = options or '', connection = dbConnect( databaseType, host, username, password, options ) }; setmetatable( connet, connection_mt ); return connet; end function connection:exec( query, ... ) if query and type( query ) == 'string' then return dbExec( self.connection, query, ... ); end end local myConnetion = connection:create( 'sqlite', 'path' ) myConnetion:exec( 'blablabla', blablabla )
  9. Is this hard for you ? addCommandHandler('nextmap', function( player, command, ... ) local query = #{...}>0 and table.concat({...},' ') or nil if not query then if g_ForcedNextMap then outputRace( 'Next map is ' .. getMapName( g_ForcedNextMap ), player ) else outputRace( 'Next map is not set', player ) end return end local admin = false local accName = getAccountName( getPlayerAccount( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then admin = true end if not _TESTING and admin == false then return end local map, errormsg = findMap( query ) if not map then outputRace( errormsg, player ) return end if g_ForcedNextMap == map then outputRace( 'Next map is already set to ' .. getMapName( g_ForcedNextMap ), player ) return end g_ForcedNextMap = map outputChatBox('Next map set to ' .. getMapName( g_ForcedNextMap ) .. ' by ' .. getPlayerName( player ), g_Root, 0, 240, 0) end )
  10. That's really awesome. Easy to use and too much helpful.
  11. function createJob( x, y, z, jobName, teamName, pedID, desc, skins, occupation ) x, y, z = tonumber( x ), tonumber( y ), tonumber( z ) marker = createMarker( x, y, z, "cylinder" ) ped = createPed(pedID, x,y,z ) setTimer( addEventHandler, 5000, 1, "onClientMarkerHit", marker, showJobWindow ) triggerServerEvent("startJobScript", getLocalPlayer() ) end addEvent("createJob", true) addEventHandler("createJob", root, createJob)
  12. Look for 'updatePlayerBlips' function at the freeroam resource. Maybe you will find out what do you need.
  13. You mean that you want to change the black rectangle with an img ? If so replace the dxDrawRectangle with dxDrawImage Edit : @Line340 Replace it with this function dxDrawImage( ( sX / 2 ) - ( scoreboardDimensions.width / 2 ), ( sY / 2 ) - ( scoreboardDimensions.height / 2 ), scoreboardDimensions.width, scoreboardDimensions.height, 'imgPath', 0, 0, 0, tocolor( 255, 255, 255 ), drawOverGUI ) And don't forget to include the Img path.
  14. What about these functions : fileSetPos fileGetPos
  15. Blaawee

    countdown

    Incase if you would like to change the format to minutes and seconds like this 3:00 . I think this usefull function will do the job function msToTimeStr( ms ) if not ms then return '' end local s = math.floor( ms / 1000 ) local seconds = tostring( math.fmod( s, 60 ) ) if #seconds == 1 then seconds = '0' .. seconds end local minutes = tostring( math.floor( s / 60 ) ) if #minutes == 1 then minutes = '0' .. minutes end return minutes .. ':' .. seconds end Example: function justForTest() end function msToTimeStr( ms ) if not ms then return '' end local s = math.floor( ms / 1000 ) local seconds = tostring( math.fmod( s, 60 ) ) if #seconds == 1 then seconds = '0' .. seconds end local minutes = tostring( math.floor( s / 60 ) ) if #minutes == 1 then minutes = '0' .. minutes end return minutes .. ':' .. seconds end myTimer = setTimer( justForTest, 180*1000, 1 ) addEventHandler( "onClientRender", root, function( ) if isTimer( myTimer ) then remaining, _, _ = getTimerDetails(myTimer) remaining = msToTimeStr( remaining ) if remaining then dxDrawText( remaining, 100, 350, 300, 350, tocolor( 255, 255, 0 ), 1, 'arial' ) end end end )
  16. Blaawee

    anti-flood

    local ads = { 'AD1', 'AD2', 'AD3', 'AD4', 'AD5', } addEventHandler( "onPlayerChat", root, function( msg, type ) for _,v in ipairs( ads ) do if string.find( msg, v ) then cancelEvent( ) if type == 0 then banPlayer ( source, false, false, true ) else return end end end end ) Give it admin rights .
  17. Blaawee

    Freeroam

    Well, let me try to help you. First of all, replace the whole code with the old one in client side part : --------------------------- -- Walking Style Window --------------------------- function applyWalkStyle( leaf ) if type( leaf ) ~= 'table' then leaf = getSelectedGridListLeaf( wndWalking, 'walkStyle' ) if not leaf then return end end server.setPedWalkingStyle( g_Me, leaf.id ) end function stopWalkStyle() server.setPedWalkingStyle( g_Me, 0 ) end wndWalking = { 'wnd', text = 'Walking style', width = 250, controls = { { 'lst', id = 'walkStyle', width = 230, height = 290, columns = { { text = 'Walking', attr = 'name' } }, rows = { xml = 'walkstyle.xml', attrs = { 'id', 'name' } }, onitemdoubleclick = applyWalkStyle }, { 'btn', id = 'set', onclick = applyWalkStyle }, { 'btn', id = 'stop', onclick = stopWalkStyle }, { 'btn', id = 'close', closeswindow = true } } } function setWalkStyleCommand( cmd, id ) id = id and tonumber( id ) if id then server.setPedWalkingStyle( id ) end end addCommandHandler( 'setwalkstyle', setWalkStyleCommand ) addCommandHandler( 'walkstyle', setWalkStyleCommand ) Secondly, replace the .xml file with this one : type="walkingstyle"> "0" name="MOVE_DEFAULT" /> "54" name="MOVE_PLAYER" /> "55" name="MOVE_PLAYER_F" /> "56" name="MOVE_PLAYER_M" /> "57" name="MOVE_ROCKET" /> "58" name="MOVE_ROCKET_F" /> "59" name="MOVE_ROCKET_M" /> "60" name="MOVE_ARMED" /> "61" name="MOVE_ARMED_F" /> "62" name="MOVE_ARMED_M" /> "63" name="MOVE_BBBAT" /> "64" name="MOVE_BBBAT_F" /> "65" name="MOVE_BBBAT_M" /> "66" name="MOVE_CSAW" /> "67" name="MOVE_CSAW_F" /> "68" name="MOVE_CSAW_M" /> "69" name="MOVE_SNEAK" /> "70" name="MOVE_JETPACK" /> "118" name="MOVE_MAN" /> "119" name="MOVE_SHUFFLE" /> "120" name="MOVE_OLDMAN" /> "121" name="MOVE_GANG1" /> "122" name="MOVE_GANG2" /> "123" name="MOVE_OLDFATMAN" /> "124" name="MOVE_FATMAN" /> "125" name="MOVE_JOGGER" /> "126" name="MOVE_DRUNKMAN" /> "127" name="MOVE_BLINDMAN" /> "128" name="MOVE_SWAT" /> "129" name="MOVE_WOMAN" /> "130" name="MOVE_SHOPPING" /> "131" name="MOVE_BUSYWOMAN" /> "132" name="MOVE_SEXYWOMAN" /> "133" name="MOVE_PRO" /> "134" name="MOVE_OLDWOMAN" /> "135" name="MOVE_FATWOMAN" /> "136" name="MOVE_JOGWOMAN" /> "137" name="MOVE_OLDFATWOMAN" /> "138" name="MOVE_SKATE" /> ** And DONT FORGET To rename the .xml file to " walkstyle.xml " Thirdly, open the server side and replace this codes with the old one : g_RPCFunctions = { addPedClothes = { option = 'clothes', descr = 'Modifying clothes' }, addVehicleUpgrade = { option = 'upgrades', descr = 'Adding/removing upgrades' }, fadeVehiclePassengersCamera = true, fixVehicle = { option = 'repair', descr = 'Repairing vehicles' }, giveMeVehicles = { option = 'createvehicle', descr = 'Creating vehicles' }, giveMeWeapon = { option = 'weapons.enabled', descr = 'Getting weapons' }, givePedJetPack = { option = 'jetpack', descr = 'Getting a jetpack' }, killPed = { option = 'kill', descr = 'Killing yourself' }, removePedClothes = { option = 'clothes', descr = 'Modifying clothes' }, removePedFromVehicle = true, removePedJetPack = { option = 'jetpack', descr = 'Removing a jetpack' }, removeVehicleUpgrade = { option = 'upgrades', descr = 'Adding/removing upgrades' }, setElementAlpha = { option = 'alpha', descr = 'Changing your alpha' }, setElementPosition = true, setElementInterior = true, setMyGameSpeed = { option = 'gamespeed.enabled', descr = 'Setting game speed' }, setMySkin = { option = 'setskin', descr = 'Setting skin' }, setPedAnimation = { option = 'anim', descr = 'Setting an animation' }, setPedFightingStyle = { option = 'setstyle', descr = 'Setting fighting style' }, setPedGravity = { option = 'gravity.enabled', descr = 'Setting gravity' }, setPedStat = { option = 'stats', descr = 'Changing stats' }, setTime = { option = 'time.set', descr = 'Changing time' }, setTimeFrozen = { option = 'time.freeze', descr = 'Freezing time' }, setVehicleColor = true, setVehicleHeadLightColor = true, setVehicleOverrideLights = { option = 'lights', descr = 'Forcing lights' }, setVehiclePaintjob = { option = 'paintjob', descr = 'Applying paintjobs' }, setVehicleRotation = true, setWeather = { option = 'weather', descr = 'Setting weather' }, spawnMe = true, warpMe = { option = 'warp', descr = 'Warping' }, -- setPedWalkingStyle = { option = 'walkstyle', descr = 'Setting walk style' }, -- } g_OptionDefaults = { walkstyle = true, alpha = true, anim = true, clothes = true, createvehicle = true, gamespeed = { enabled = true, min = 0.0, max = 3 }, gravity = { enabled = true, min = 0, max = 0.1 }, jetpack = true, kill = true, lights = true, paintjob = true, repair = true, setskin = true, setstyle = true, spawnmaponstart = true, spawnmapondeath = true, stats = true, time = { set = true, freeze = true }, upgrades = true, warp = true, weapons = { enabled = true, vehiclesenabled = true, disallowed = {} }, weather = true, welcometextonstart = true, vehicles = { maxidletime = 60000, idleexplode = true, maxperplayer = 2, disallowed = {} } } Add to the meta file : "walkstyle.xml" type="client" /> Note, I have not try this But i'm sure it will work .
  18. will it's not. addEvent("addNotification",true) addEventHandler("addNotification",getRootElement(), function(text, typ) text = string.gsub(text,"#%x%x%x%x%x%x","") local num = 0 if text == "" or text == nil or not typ then return else for i = 0, #message+1 do if message[num] then num = num+1 else message[num] = {} message[num].text = text message[num].val = true if typ == 1 then message[num].filepath = "success.png" elseif typ == 2 then message[num].filepath = "error.png" elseif typ == 3 then message[num].filepath = "info.png" elseif typ == 4 then message[num].filepath = "warning.png" end setTimer(notifyremove,5000,1,num) end end end end) -- -- -- function renderNotifications() for id, v in pairs(message) do if v.val == true then dxDrawImageSection(x-dxGetTextWidth(v.text, 1, "default-bold")-50, 35*id, dxGetTextWidth(v.text, 1, "default-bold")+50, 32, 0, 0, dxGetTextWidth(v.text, 1, "default-bold")+50, 32, v.filepath, 0, 0, 0, tocolor(255,255,255,255), true ) dxDrawText(v.text,x-dxGetTextWidth(v.text,1,"default-bold")-5, 9+35*id, dxGetTextWidth(v.text, 1, "default-bold"), 32, tocolor(255,255,255,255), 1, "default-bold", "left", "top", false, false ,true, true) end end end
  19. I would to complete the arguments. you have to complete dxDrawImageSection arguments and make sure the "postgui" true.
  20. Blaawee

    help radar

    This might help you viewtopic.php?f=91&t=65746&p=619388&hilit=dxSetShaderTransform&sid=50a5002b669ef97d724d2848a19d8175#p619388
  21. Blaawee

    help radar

    Will, you can do it with shader. dxCreateShader dxCreateRenderTarget dxSetRenderTarget dxSetShaderValue dxSetShaderTransform dxDrawImage
  22. How ? There is no rotation argument on dxDrawRectangle i think. With some math it can be done.. well, show to us what you can do.
  23. What about to add an image like a mask maybe this will be usefull.
×
×
  • Create New...