Jump to content

ReSe

Members
  • Posts

    23
  • Joined

  • Last visited

Everything posted by ReSe

  1. ReSe

    Image placing

    You have to declare size of your image. It's pixel size so if your width of screen is variable "x" and you would like to show image on center then you have to do some math: "x/2 - halfsizeofimage" Place img on center: local x, y = guiGetScreenSize() function showClientImage() guiCreateStaticImage( x/2-100, y/2-100, 200, 200, "logo1.png", false ) end addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource() ), showClientImage ) You should read description of guiCreateStaticImage function. First argument is horizontal position on screen, 2nd arg is vertical position, 3rd is width of ig, 4rd is height, ..."
  2. ReSe

    Image placing

    Hmm here's pic of your script. I guess your monitor have native resolution of 1080p. You should first get size of screen and then place an img //Ok here's code if you don't understand. That should make it working local x, y = guiGetScreenSize() function showClientImage() guiCreateStaticImage( x-100, y-100, 100, 100, "logo1.png", false ) end addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource() ), showClientImage )
  3. Do not exaggerate. A script that is huge doesn't mean it has more potential than a script with less lines but with the same functionality Did I say anything like that? I said it's huge and it have lot of potential. You should read my words twice. You must be kidding, how many loc per day do you write on average? 5? Hm.. Is your advanced script "Object-Oriented" or "Process-Oriented"? In case it is the second you cannot call it advanced imo 5 * 4 * 31 = 620 lines. That's like nothing. Man, there are days when you can stuck in some place trying to find best solution. Really don't "judge" if you didn't experience it. And no it's not process-oriented.
  4. No problem I can post some ss but the best way is to see it on DDAS server. I've create player panel based on dxGui resource. It's really huge script with a lot of potential. It was designed to work with DD/DM/Race. Different kind of achievements, statistics for every mode. That's the most advanced script I've made so far. Took me about 4 months. Mostly I've been making scripts to DD and DM modes. If you really would like to see some of my work here I would make a video and send you url from youtube
  5. You mean you would like to count players?
  6. It's pretty simple but I don't think anyone will do it for free. It needs good way to display requests for staff and a way to remove then from list. Best way is separate dxDraw window. Since im low on cash I would make it for few $$ Text me on skype if you're interested. skype: patryk_gs
  7. ReSe

    count dxdraw

    Mhm try to copy it one more time. Client i = nil local x, y = guiGetScreenSize() function triggerDraw(ID) i = ID if i == 3 then drawBegin() elseif i < 0 then drawStop() return end playSound( i..".mp3", false ) end addEvent ( "triggerclientforGridCountdown", true ) addEventHandler ( "triggerclientforGridCountdown", getRootElement(), triggerDraw ) function drawOnScreen() if not i then return end if i > 0 then dxDrawText("#FF0000==="..i.."===",0,0,x,y, tocolor(0,0,0,255), 2, "bankgothic", "center", "center", false, false, true, true) else dxDrawText("#FF0000Go Go Go!!!",0,0,x,y, tocolor(0,0,0,255), 2, "bankgothic", "center", "center", false, false, true, true) end end function drawBegin() addEventHandler( "onClientRender", getRootElement(), drawOnScreen) end function drawStop() removeEventHandler( "onClientRender", getRootElement(), drawOnScreen) end //Owh nvm
  8. ReSe

    count dxdraw

    You sure You've copy everything fine?
  9. ReSe

    count dxdraw

    I've fixed it already. Just change "soundID" with "i"
  10. ReSe

    count dxdraw

    If you want sound change triggerDraw function in client with that one function triggerDraw(ID) i = ID if i == 3 then drawBegin() elseif i < 0 then drawStop() return end sound = playSound( i..".mp3", false ) end addEvent ( "triggerclientforGridCountdown", true ) addEventHandler ( "triggerclientforGridCountdown", getRootElement(), triggerDraw )
  11. ReSe

    count dxdraw

    Server timers = {} function Countdown (player) if isTimer(timers[player]) then return end timers[player] = setTimer(function() timers[player] = nil end,30000,1) local name = getPlayerName(player) local r,g,b = getPlayerNametagColor (player) outputChatBox ( " ".. name .. ": #FF9600 Starts the Countdown !", getRootElement(), r, g, b, true ) local i = 4 setTimer( function() i=i-1 triggerClientEvent("triggerclientforGridCountdown", getRootElement(), i) if (i==0) then outputChatBox ( "#FF0000 Go Go Go!!!", getRootElement(), 255, 255, 255, true ) return elseif i > 0 then outputChatBox ( "#FF0000 ==="..i.."===", getRootElement(), 255, 255, 255, true ) end end, 1000, 5 ) setTimer (function() timers[player] = nil end, 30000, 1) end addCommandHandler( "countdown", Countdown ) Client i = nil local x, y = guiGetScreenSize() function triggerDraw(ID) i = ID if i == 3 then drawBegin() elseif i < 0 then drawStop() end end addEvent ( "triggerclientforGridCountdown", true ) addEventHandler ( "triggerclientforGridCountdown", getRootElement(), triggerDraw ) function drawOnScreen() if not i then return end if i > 0 then dxDrawText("#FF0000==="..i.."===",0,0,x,y, tocolor(0,0,0,255), 2, "bankgothic", "center", "center", false, false, true, true) else dxDrawText("#FF0000Go Go Go!!!",0,0,x,y, tocolor(0,0,0,255), 2, "bankgothic", "center", "center", false, false, true, true) end end function drawBegin() addEventHandler( "onClientRender", getRootElement(), drawOnScreen) end function drawStop() removeEventHandler( "onClientRender", getRootElement(), drawOnScreen) end
  12. ReSe

    count dxdraw

    You want to show it on screen? Not in chat?
  13. ReSe

    count dxdraw

    Server timers = {} function Countdown (player) if isTimer(timers[player]) then return end timers[player] = setTimer(function() timers[player] = nil end,30000,1) local name = getPlayerName(player) local r,g,b = getPlayerNametagColor (player) outputChatBox ( " ".. name .. ": #FF9600 Starts the Countdown !", getRootElement(), r, g, b, true ) local i = 4 setTimer( function() i=i-1 triggerClientEvent("triggerclientforGridCountdown", getRootElement(), i) if (i==0) then outputChatBox ( "#FF0000 Go Go Go!!!", getRootElement(), 255, 255, 255, true ) return end outputChatBox ( "#FF0000 ==="..i.."===", getRootElement(), 255, 255, 255, true ) end, 1000, 4 ) setTimer (function() timers[player] = nil end, 30000, 1) end addCommandHandler( "countdown", Countdown ) Client function triggerSound(soundID) sound = playSound( soundID..".mp3", false ) end addEvent ( "triggerclientforGridCountdown", true ) addEventHandler ( "triggerclientforGridCountdown", getRootElement(), triggerSound )
  14. Let us know what you want to achieve. If it's something basic Anyway you've double the thread.
  15. Hey! Im experianced 20 years old IT student. Im collecting money for life and new pc. In free time im programming in different languages and for about 2 and half year scripting for mta. Im a member of DDAS team, basically their scripter. I've done lot of projects in past, starting from small scripts to most advanced user panels based on modified dx-gui resource. You can check some of my scripts on DDAS servers. Website: teamddas.co.uk Anyway if you're looking for a scripter to your project or whatever you have in your mind you can contact me here or via skype: "patryk_gs" Of course remember I can't work for free but im sure we can always figure something out
  16. Ahh there's a little bug in code. In dxWindow.lua line: 104 should be "dxWindow" instead of "dxElement". It gives warning everytime Im using setMovable
  17. Really good tool. Im currently working on Player Panel for my server and im using it there. I've already found some minor bugs, like using hex codes in labels change their position a little. But that's not the problem. There's one think I really miss. There's no tabs, propably I will have to use visible option for every part in every "tab" I wanna make. So player click the button like "stats" and then it will set visible for parts only for that tab. I think it's only way to do that. You can't also make table with gui parts and then just hide whole group Also there can't be more then one rootPane. That sucks. Idk if there's a way around. That gui is not friendly for bigger projects like mine. I hope in future version we will see gui parts like tabs and edit fields. About edit field there's already way to make it working with buttons. It's just more work beacause you need to make it manually. Waiting for next realeases
  18. Ok nvm i got it Thanks for order by Gtx :]
  19. Ok i will try to use one of the examples. local result, numrows, errmsg = dbPoll ( qh, -1 ) local result, numrows, errmsg = dbPoll ( qh, -1 ) if numrows > 0 then for result, row in pairs ( result ) do -- by using a second loop (use it if you want to get the values of all columns the query selected): for column, value in pairs ( row ) do -- column = the mysql column of the table in the query -- value = the value of that column in this certain row end -- or without a second loop (use it if you want to handle every value in a special way): outputChatBox ( row["column"] ) -- it will output the value of the column "column" in this certain row end end How to get values in each row?
  20. Yea SQL have it It work nice But how get the position of our player ? local sortquery = dbQuery (playerstatistic, "SELECT * FROM PlayerPoints ORDER BY points DESC") local positon = dbPoll(sortquery,-1) I don't really understand table which is created by dbPoll, how can i read a number of a row from it ? I mean i will look for same accountname and get the row number of it
  21. What about that idea? To get number of bigger values then one player have ? I mean we search in SQL for bigger values then our player have and that's his rank + 1 Something like that: We have 10 players with points, 5 of them have more then we so our rank is 5 + 1 = 6 so we are 6th. Script count the number with more points and then we add + 1 to it and here we are How should our dbQuery look ?
  22. As i know it store information in SQL "internal.db" ^^
  23. Hey! Im going to create nice pointsystem but im already thinking how to sort it. Script save the AccountName and PointValue of players and must sort them from biggest PointValue because i would like to get player current rank in points. I think the best is SQLlite to do this what you think? Maybe it can be easiest with another one idk.
×
×
  • Create New...