papam77
Members-
Posts
517 -
Joined
-
Last visited
Everything posted by papam77
-
and tell me why this x/2,y/2,x/2,y/2
-
function draw() local x,y = guiGetScreenSize() x = 1920 y = 1080 dxDrawText ( "Ahoj",631.6,611.0,732.0,766.0,tocolor(0,255,255,255),1.0,"bankgothic","left","top",false,false,false) end addEventHandler ( "onClientResourceStart", draw ) So this will be for every resolution ?
-
Hello, i wanna do something with the dx, but i don't know how to make it relative, it's not same as gui. Can someone help me ?
-
I know about it, but it doesn't give me player color to the label
-
Hello how can get player color to label? I see in the label: EAG|#ffffffDeeJay I need to change the color as hex.
-
Code removed by Solidsnake14. It is getting player info but i don't know how. When i am in the Deathmatch it is writing that i am in the lobby. Why ? How can change it? To dimension Dimension 1 = Deathmatch Dimension 255 = Lobby
-
So i can't fix it ?
-
IMG http://www.upload.ee/image/3438277/upload.ee.png function serN(v) sN = v end addEvent("a", true) addEventHandler("a", root, serN) -- Country table -- countryTable = { ['AD'] = 'Andorra', ['AE'] = 'United Arab Emirates', ['AF'] = 'Afghanistan', ['AG'] = 'Antigua and Barbuda', ['AI'] = 'Anguilla', ['AL'] = 'Albania', ['AM'] = 'Armenia', ['AO'] = 'Angola', ['AP'] = 'ARIPO', ['AR'] = 'Argentina', ['AT'] = 'Austria', ['AU'] = 'Australia', ['AW'] = 'Aruba', ['AZ'] = 'Azerbaijan', ['BA'] = 'Bosnia and Herzegovina', ['BB'] = 'Barbados', ['BD'] = 'Bangladesh', ['BE'] = 'Belgium', ['BF'] = 'Burkina Faso', ['BG'] = 'Bulgaria', ['BH'] = 'Bahrain', ['BI'] = 'Burundi', ['BJ'] = 'Benin', ['BM'] = 'Bermuda', ['BN'] = 'Brunei Darussalam', ['BO'] = 'Bolivia', ['BQ'] = 'Bonaire', ['BR'] = 'Brazil', ['BS'] = 'Bahamas', ['BT'] = 'Bhutan', ['BV'] = 'Bouvet Island', ['BW'] = 'Botswana', ['BY'] = 'Belarus', ['BZ'] = 'Belize', ['CA'] = 'Canada', ['CD'] = 'Congo', ['CF'] = 'Central African Republic', ['CG'] = 'Congo', ['CH'] = 'Switzerland', ['CI'] = 'Cote dIvoire', ['CK'] = 'Cook Islands', ['CL'] = 'Chile', ['CM'] = 'Cameroon', ['CN'] = 'China', ['CO'] = 'Colombia', ['CR'] = 'Costa Rica', ['CU'] = 'Cuba', ['CV'] = 'Cape Verde', ['CW'] = 'Curacao', ['CY'] = 'Cyprus', ['CZ'] = 'Czech Republic', ['DE'] = 'Germany', ['DJ'] = 'Djibouti', ['DK'] = 'Denmark', ['DM'] = 'Dominica', ['DO'] = 'Dominican Republic', ['DZ'] = 'Algeria', ['EC'] = 'Ecuador', ['EE'] = 'Estonia', ['EG'] = 'Egypt', ['EH'] = 'Western Sahara', ['ER'] = 'Eritrea', ['ES'] = 'Spain', ['ET'] = 'Ethiopia', ['FI'] = 'Finland', ['FJ'] = 'Fiji', ['FK'] = 'Malvinas', ['FO'] = 'Faroe Islands', ['FR'] = 'France', ['GA'] = 'Gabon', ['GB'] = 'United Kingdom', ['GD'] = 'Grenada', ['GE'] = 'Georgia', ['GG'] = 'Guernsey', ['GH'] = 'Ghana', ['GI'] = 'Gibraltar', ['GL'] = 'Greenland', ['GM'] = 'Gambia', ['GN'] = 'Guinea', ['GQ'] = 'Equatorial Guinea', ['GR'] = 'Greece', ['GT'] = 'Guatemala', ['GW'] = 'Guinea-Bissau', ['GY'] = 'Guyana', ['HN'] = 'Honduras', ['HR'] = 'Croatia', ['HT'] = 'Haiti', ['HU'] = 'Hungary', ['ID'] = 'Indonesia', ['IE'] = 'Ireland', ['IL'] = 'Israel', ['IM'] = 'Isle of Man', ['IN'] = 'India', ['IQ'] = 'Iraq', ['IR'] = 'Iran', ['IS'] = 'Iceland', ['IT'] = 'Italy', ['JE'] = 'Jersey', ['JM'] = 'Jamaica', ['JO'] = 'Jordan', ['JP'] = 'Japan', ['KE'] = 'Kenya', ['KG'] = 'Kyrgyzstan', ['KH'] = 'Cambodia', ['KI'] = 'Kiribati', ['KM'] = 'Comoros', ['KN'] = 'Saint Kitts and Nevis', ['KP'] = 'Korea', ['KR'] = 'Korea', ['KW'] = 'Kuwait', ['KY'] = 'Cayman Islands', ['KZ'] = 'Kazakhstan', ['LA'] = 'Lao Peoples Republic', ['LB'] = 'Lebanon', ['LC'] = 'Saint Lucia', ['LI'] = 'Liechtenstein', ['LK'] = 'Sri Lanka', ['LR'] = 'Liberia', ['LS'] = 'Lesotho', ['LT'] = 'Lithuania', ['LU'] = 'Luxembourg', ['LV'] = 'Latvia', ['LY'] = 'Libyan Arab Jamahiriya', ['MA'] = 'Morocco', ['MC'] = 'Monaco', ['MD'] = 'Moldova', ['ME'] = 'Montenegro', ['MG'] = 'Madagascar', ['MK'] = 'Macedonia', ['ML'] = 'Mali', ['MM'] = 'Myanmar', ['MN'] = 'Mongolia', ['MO'] = 'Macao', ['MP'] = 'Northern Mariana Islands', ['MR'] = 'Mauritania', ['MS'] = 'Montserrat', ['MT'] = 'Malta', ['MU'] = 'Mauritius', ['MV'] = 'Maldives', ['MW'] = 'Malawi', ['MX'] = 'Mexico', ['MY'] = 'Malaysia', ['MZ'] = 'Mozambique', ['NA'] = 'Namibia', ['NE'] = 'Niger', ['NG'] = 'Nigeria', ['NI'] = 'Nicaragua', ['NL'] = 'Netherlands', ['NO'] = 'Norway', ['NP'] = 'Nepal', ['NR'] = 'Nauru', ['NZ'] = 'New Zealand', ['OM'] = 'Oman', ['PA'] = 'Panama', ['PE'] = 'Peru', ['PG'] = 'Papua New Guinea', ['PH'] = 'Philippines', ['PK'] = 'Pakistan', ['PL'] = 'Poland', ['PT'] = 'Portugal', ['PW'] = 'Palau', ['PY'] = 'Paraguay', ['QA'] = 'Qatar', ['RO'] = 'Romania', ['RS'] = 'Serbia', ['RU'] = 'Russian Federation', ['RW'] = 'Rwanda', ['SA'] = 'Saudi Arabia', ['SB'] = 'Solomon Islands', ['SC'] = 'Seychelles', ['SD'] = 'Sudan', ['SE'] = 'Sweden', ['SG'] = 'Singapore', ['SH'] = 'Saint Helena', ['SI'] = 'Slovenia', ['SK'] = 'Slovakia', ['SL'] = 'Sierra Leone', ['SM'] = 'San Marino', ['SN'] = 'Senegal', ['SO'] = 'Somalia', ['SR'] = 'Suriname', ['ST'] = 'Sao Tome and Principe', ['SV'] = 'Salvador', ['SX'] = 'Sint Maarten (Dutch part)', ['SY'] = 'Syrian Arab Republic', ['SZ'] = 'Swaziland', ['TC'] = 'Turks and Caicos Islands', ['TD'] = 'Chad', ['TG'] = 'Togo', ['TH'] = 'Thailand', ['TJ'] = 'Tajikistan', ['TL'] = 'TimorLeste', ['TM'] = 'Turkmenistan', ['TN'] = 'Tunisia', ['TO'] = 'Tonga', ['TR'] = 'Turkey', ['TT'] = 'Trinidad and Tobago', ['TV'] = 'Tuvalu', ['TW'] = 'Taiwan', ['TZ'] = 'Tanzania', ['UA'] = 'Ukraine', ['UG'] = 'Uganda', ['US'] = 'United States of America', ['UY'] = 'Uruguay', ['UZ'] = 'Uzbekistan', ['VA'] = 'Holy See', ['VC'] = 'Saint Vincent', ['VE'] = 'Venezuela', ['VG'] = 'Virgin Islands', ['VN'] = 'Viet Nam', ['VU'] = 'Vanuatu', ['WS'] = 'Samoa', ['YE'] = 'Yemen', ['ZA'] = 'South Africa', ['ZM'] = 'Zambia', ['ZW'] = 'Zimbabwe' } function getMaxPlayers() triggerServerEvent("sendMaxPlayers", localPlayer) end function getMyCash() triggerServerEvent("posliStatsS", root, getLocalPlayer()) end function getCashVysledek(penizky) kesh = penizky end addEvent("posliStatsC", true) addEventHandler("posliStatsC", root, getCashVysledek) function getServerName() triggerServerEvent("a", localPlayer) end local sw, sh = guiGetScreenSize() local showing = false local maxPlayers = getMaxPlayers() local serverName = getServerName() local country = {}
-
Ah i know where's the problem. Text is on the screen but under image. I have changed it: local player = getLocalPlayer() function multimode () showCursor ( true ) setFPSLimit ( source, 100 ) Name = guiCreateLabel(0.79, 0.01, 0.16, 0.04, "Name: "..getPlayerName( localPlayer ), true) guiSetFont(Name, "default-bold-small") guiLabelSetVerticalAlign(Name, "center") guiSetEnabled (Name, false ) local bg = { ["bg"] = guiCreateStaticImage(0.00, 0.00, 1.00, 1.00, "images/lobbyBG.png", true), } guiSetEnabled(bg["bg"],false) end addCommandHandler ("lobby", multimode ) How can add image under text?
-
http://www.upload.ee/image/3437000/doesntwork.png Doesn't work.
-
myonlake: I don't see the text on the screen
-
addEvent ("lobby", true) function lobby() -- Effects local bg = playSound("sound/sea.mp3", true) setSoundVolume(bg, 1.0) setElementDimension(player,255 ) showCursor ( source, true) -- Design local background = { ["lobby"] = guiCreateStaticImage(0.00, 0.00, 1.00, 1.00, "images/lobbyBG.png", true), ["sider"] = guiCreateStaticImage(0.00, 0.00, 1.00, 1.00, "images/sider.png", true), } guiSetEnabled(background["lobby"],false) guiSetEnabled(background["sider"],false) --Text Name = guiCreateLabel(0.79, 0.01, 0.16, 0.04, "Name:" ..getPlayerName(localPlayer), true) guiSetFont(Name, "default-bold-small") guiLabelSetVerticalAlign(Name, "center") end addEventHandler("lobby", getRootElement(), lobby) Full Code. Images work correctly.
-
Doesn't work.
-
function info(source) Name = guiCreateLabel(0.79, 0.01, 0.16, 0.04, "Name:" ..getPlayerName(localPlayer), true, background) guiSetFont(Name, "default-bold-small") guiLabelSetVerticalAlign(Name, "center") end But it doesn't write my name to the screen.
-
So local player = getRootElement() ?
-
function info() Name = guiCreateLabel(0.79, 0.01, 0.16, 0.04, "Name: "..getPlayerName( player ), true, background) guiSetFont(Name, "default-bold-small") guiLabelSetVerticalAlign(Name, "center") end Why i don't see it? What's wrong?
-
I was thinking that if is already created then will start function setTimer with Destroy
-
I made this function mapwindowa() if ( obrazek ) and ( nadpis ) and ( vpis ) then -- Check if is created setTimer ( function ( ) if isElement ( obrazek ) and isElement ( nadpis ) and isElement ( vpis ) then destroyElement ( obrazek ) destroyElement ( nadpis ) destroyElement ( vpis ) end end,2000,1 ) end if not obrazek and nadpis and vpis then -- Check if is created obrazek = guiCreateStaticImage(0.33, 0.05, 0.32, 0.11, "img/notif.png", true) nadpis = guiCreateLabel(0.00, 0.00, 1.00, 0.25, "Car Hide", true, obrazek) guiLabelSetHorizontalAlign(nadpis, "center", false) guiLabelSetVerticalAlign(nadpis, "center") vpis = guiCreateLabel(0.00, 0.28, 1.00, 0.72, "CarHide has been disabled...", true, obrazek) guiLabelSetHorizontalAlign(vpis, "center", false) guiLabelSetVerticalAlign(vpis, "center") playSound ("audio/notification.mp3", false) end end And doesn't work.
-
function mapwindowa() setTimer ( function ( ) if isElement ( obrazek ) and isElement ( nadpis ) and isElement ( vpis ) then destroyElement ( obrazek ) destroyElement ( nadpis ) destroyElement ( vpis ) end end,2000,1 ) if not obrazek and nadpis and vpis then obrazek = guiCreateStaticImage(0.33, 0.05, 0.32, 0.11, "img/notif.png", true) nadpis = guiCreateLabel(0.00, 0.00, 1.00, 0.25, "Car Hide", true, obrazek) guiLabelSetHorizontalAlign(nadpis, "center", false) guiLabelSetVerticalAlign(nadpis, "center") vpis = guiCreateLabel(0.00, 0.28, 1.00, 0.72, "CarHide has been disabled...", true, obrazek) guiLabelSetHorizontalAlign(vpis, "center", false) guiLabelSetVerticalAlign(vpis, "center") playSound ("audio/notification.mp3", false) end end But i need to destroy it after Press F1 now can't open it.
-
guiCreateStaticImage guiCreateLabel this i need to destroy
-
This window ! http://www.upload.ee/image/3432547/Hideeeeeeeeeee.png I need to destroy it after 2sec
-
But why it doesn't hide my window?
-
function mapwindowa() if not app then app = guiCreateStaticImage(0.33, 0.05, 0.32, 0.11, "img/notif.png", true) app = guiCreateLabel(0.00, 0.00, 1.00, 0.25, "Car Hide", true, app) guiLabelSetHorizontalAlign(app, "center", false) guiLabelSetVerticalAlign(app, "center") app1 = guiCreateLabel(0.00, 0.28, 1.00, 0.72, "CarHide has been disabled...", true, app) guiLabelSetHorizontalAlign(app1, "center", false) guiLabelSetVerticalAlign(app1, "center") playSound ("audio/notification.mp3", false) end end function mapwindowda() if not app2 then app2 = guiCreateStaticImage(0.33, 0.05, 0.32, 0.11, "img/notif.png", true) app2 = guiCreateLabel(0.00, 0.00, 1.00, 0.25, "Car Hide", true, app2) guiLabelSetHorizontalAlign(app2, "center", false) guiLabelSetVerticalAlign(app2, "center") app2 = guiCreateLabel(0.00, 0.28, 1.00, 0.72, "CarHide has been enabled...", true, app2) guiLabelSetHorizontalAlign(app2, "center", false) guiLabelSetVerticalAlign(app2, "center") playSound ("audio/notification.mp3", false) end end I changed it, now it works, but when i press F1 it's still on the screen, it must be destoryed after 2sec
-
And what i must use ?
-
local me = getLocalPlayer() local maxStreamedPlayers = 16 sx,sy = guiGetScreenSize() function isDM() for i, pu in pairs (getElementsByType("racepickup")) do local puType = getElementData(pu, "type") if (puType == "vehiclechange") then local puVehicle = tonumber(getElementData(pu, "vehicle")) if puVehicle == 425 then return true end end end return false end enabled = false function toggleHideAll() startTimess = getTickCount() setElementData(me, "hideAllPlayers", not getElementData(me, "hideAllPlayers"), false) if enabled == false then removeEventHandler("onClientRender",getRootElement(),mapwindowa) removeEventHandler("onClientRender",getRootElement(),carclose) removeEventHandler("onClientRender",getRootElement(),caropen) removeEventHandler("onClientRender",getRootElement(),wateropen) removeEventHandler("onClientRender",getRootElement(),waterclose) addEventHandler("onClientRender",getRootElement(),mapwindowda) else removeEventHandler("onClientRender",getRootElement(),mapwindowda) removeEventHandler("onClientRender",getRootElement(),carclose) removeEventHandler("onClientRender",getRootElement(),caropen) removeEventHandler("onClientRender",getRootElement(),wateropen) removeEventHandler("onClientRender",getRootElement(),waterclose) addEventHandler("onClientRender",getRootElement(),mapwindowa) end enabled = not enabled end addCommandHandler("hide", toggleHideAll) bindKey("F1", "down", toggleHideAll) function getPlayers() return getElementsByType("player") end streamedPlayers = {} function hidePlayer(player) local vehicle = getPedOccupiedVehicle(player) if vehicle then if getElementModel(vehicle) == 425 then showPlayer(player) return end if getElementDimension(vehicle) ~= 255 or getElementDimension(player) ~= 255 or getElementInterior(player) ~= 255 or getElementInterior(vehicle) ~= 255 then setElementDimension(vehicle, 255) setElementDimension(player, 255) setElementInterior(vehicle, 255) setElementInterior(player, 255) end end end function showPlayer(player) local vehicle = getPedOccupiedVehicle(player) if vehicle then if getElementDimension(vehicle) ~= 0 or getElementDimension(player) ~= 0 or getElementInterior(player) ~= 0 or getElementInterior(vehicle) ~= 0 then setElementDimension(vehicle, 0) setElementDimension(player, 0) setElementInterior(vehicle, 0) setElementInterior(player, 0) end end end setTimer( function() streamedPlayers = {} if getElementData(me, "state") ~= "alive" then for id, player in ipairs(getPlayers()) do if getElementData(player,"state") == "alive" then showPlayer(player) end end else if getElementData(me, "hideAllPlayers") and isDM() then for id, player in ipairs(getPlayers()) do if player ~= me then hidePlayer(player) end end return end local x2,y2,z2 = getElementPosition(me) for id, player in ipairs(getPlayers()) do if player ~= me then local x1,y1,z1 = getElementPosition(player) local d = getDistanceBetweenPoints3D(x1,y1,z1,x2,y2,z2 ) if d < 200 then table.insert(streamedPlayers, {player, d }) end end end if #streamedPlayers > maxStreamedPlayers then table.sort(streamedPlayers, function(a,b) return a[2] < b[2] end) for i = 1, maxStreamedPlayers do showPlayer(streamedPlayers[i][1]) end for i = maxStreamedPlayers+1, #streamedPlayers do hidePlayer(streamedPlayers[i][1]) end else for id, player in ipairs(getPlayers()) do if getElementData(player, "state") == "alive" then showPlayer(player) end end end end end, 500,0 ) function mapwindowa() deltaTime = (getTickCount()) - startTimess if deltaTime <= 1000 then beta = sy - ((deltaTime/1000)*100) elseif (deltaTime > 1000) and (deltaTime < 4000) then beta = sy-100 elseif (deltaTime >= 4000) and (deltaTime <= 6000) then beta = sy-((1-((deltaTime-4000)/800))*100) else removeEventHandler("onClientRender",getRootElement(),mapwindowa) end app = guiCreateStaticImage(0.33, 0.05, 0.32, 0.11, "img/notif.png", true) app = guiCreateLabel(0.00, 0.00, 1.00, 0.25, "Car Hide", true, app) guiLabelSetHorizontalAlign(app, "center", false) guiLabelSetVerticalAlign(app, "center") app = guiCreateLabel(0.00, 0.28, 1.00, 0.72, "CarHide has been disabled...", true, app) guiLabelSetHorizontalAlign(app, "center", false) guiLabelSetVerticalAlign(app, "center") playSound ("audio/notification.mp3", false) end function mapwindowda() deltaTime = (getTickCount()) - startTimess if deltaTime <= 1000 then beta = sy - ((deltaTime/1000)*100) elseif (deltaTime > 1000) and (deltaTime < 4000) then beta = sy-100 elseif (deltaTime >= 4000) and (deltaTime <= 6000) then beta = sy-((1-((deltaTime-4000)/800))*100) else removeEventHandler("onClientRender",getRootElement(),mapwindowda) end app2 = guiCreateStaticImage(0.33, 0.05, 0.32, 0.11, "img/notif.png", true) app2 = guiCreateLabel(0.00, 0.00, 1.00, 0.25, "Car Hide", true, app2) guiLabelSetHorizontalAlign(app2, "center", false) guiLabelSetVerticalAlign(app2, "center") app2 = guiCreateLabel(0.00, 0.28, 1.00, 0.72, "CarHide has been enabled...", true, app2) guiLabelSetHorizontalAlign(app2, "center", false) guiLabelSetVerticalAlign(app2, "center") playSound ("audio/notification.mp3", false) end This is my hide but when i press F1 it makes cca 100x image with texts and 100x playsound... Why ?
