Jump to content

'LinKin

Members
  • Posts

    636
  • Joined

  • Last visited

Everything posted by 'LinKin

  1. So ASC Ascendent order DESC Descendent order LIMIT : Number of results to display? (i.e. 1st ten tops = LIMIT 10) Thanks a lot Solid and Bonsai, let's live together bons))
  2. Thanks Solid, problem solved. @Bonsai: I totally agree with you, but I think that it is up to each programmer to choose whether or not to use tools that make his job easier. Tools are made with a purpose, to save time, to make things easier. In my case, I don't have that much time to make it line by line. However, I have to add some lines by hand into the script. Thanks for your input
  3. I believe at solidsnake's post. It must be that
  4. Hi, I created a comboBox with GUI Editor resource, and I added some Items. But now I'm testing the GUI and when I click on the arrow of the comboBox, it doesn't display anything! Like if it were empty. What's the problem?
  5. Hello, I use the SQL functions by default for MTA. I have a table. I want it so that when a player clicks Tops>SelectedValue* Note: SelectedValue is the column which you want to recieve tops of. (1st, 2nd, 3rd, Playtime, etc..) It shows the Top 10 players regarding the SelectedValue. How can I make this? Sort the table by the selected column and printing the first 10 lines? Or anyother way? Thanks
  6. For instance, The things that I create inside a window are relative to it right? So I'd just have to position the Window using those maths formulas with guiGetScreenSize
  7. Hello, I'm using this resource to make a GUI. But I've one question; Is the position of the elements 'global' for all resolutions? I've taken a look at the code and it doesn't seem like if the position was calculated according to the resolution. How can I calculate it so that the GUI's elements position is the same for every resolution? Thanks
  8. Hello, Can someone tell me what is the maximum value for the INT type in the default MTA SQL database? Thanks.
  9. Hi, How can I save a float number (xx.xx) in a SQL database? (The default of MTA) Thanks.
  10. Hello, Does the number returned by getTickCount differs between server and client? I mean, for example: I have this client side addEvent("onClientStartRecordDistance", true) addEventHandler("onClientStartRecordDistance", root, function() myX, myY, myZ = getElementPosition(getPedOccupiedVehicle(localPlayer)) local startTime = getTickCount() setElementData(localPlayer, "startTime", startTime) addEventHandler("onClientRender", root , recordDistance) end) addEvent("onClientStopRecordDistance", true) addEventHandler("onClientStopRecordDistance", root, function() local endTime = getTickCount() setElementData(localPlayer, "endTime", endTime) removeEventHandler("onClientRender", root , recordDistance) end) and serverside addEventHandler("onPlayerQuit", root, function() triggerClientEvent(source, "onClientStopRecordDistance", source) end) But, the event is not triggered, I guess it is because the Client file stops existing when he quits. So I want to know if I can set these variables startTime and endTime serverside. Would the number returned by getTickCount() be the same server and client side?
  11. Hi, For example I have this: Function bla() local car = getPedOccupiedVehicle(localPlayer) if isElementInWater(car) == false then return end -- random code below end If the if condition is true (car is not in water) so it returns, so the code below the function is not processed But what happens if I have something like this Function if not isGuestAccount(player) then if isElementInWater(car) then return end -- random code end -- more random code end So, if the condition is true and it returns, would the 'more random code' be proccessed?
  12. Hello, I want an advice from a more experienced person regarding the following situation: Should I update the 'playtime' column in a SQL database (default from mta registry.db) each second? Imagine there are 30 players in the server, and each one requiring his own update (addition + 1 sec) in their 'playtime' column every second. Is there some crash risk? Or should I use get/setElementData. So that when a player joins the server, it gets his playtime (previously stored in SQL db). And store it into the ElementData. And after he quits, take the value from the ElementData and store it into the SQL db. Is this one more safe? Thanks.
  13. I've learnt something new Thank you again
  14. Oh, I just noticed that the event you called was onPlayerJoin. Sorry my bad, I thought it was onPlayerLogin. But now, is it mandatory to add the event onPlayerCommand inside onPlayerLogin event? Why not simply; addEventHandler("onPlayerCommand", root, function(cmd) if cmd == 'login' etc... end)
  15. Worked, thank you. Btw: Why does the event onPlayerLogin triggers whenever a player joins the server? I don't have any autologin script or stuff like that.
  16. 'LinKin

    MTA 1.3.5

    Hello, There's a new update for mta (1.3.5) so in order to be able to use onClientVehicleDamage, the client version must be min. 1.3.5; For this reason, I changed the minclientversion parameter in mtaserver.conf and set it to the lattest version and build. 1.3.5-9.06121.0 But, a couple of people and myself experimented a 'wierd' situation when the server asked to update MTA, and we clicked OK, it said: No update avalable/n visit: mtasa.com I had to download the .exe and reinstall my mta.
  17. Hello, I want to allow players to login just via the login panel. So that if they click 'play as guest', it doesn't allow them to login later in-game. I've not done any login-panel yet, but I've seen some scripts from the community and they use a function called logIn(acc, pass). But, if I do cancelEvent() in onPlayerLogin, that function will not trigger (cause the event is cancelled) So, how can I remove or change the /login command ? Thanks.
  18. Hello, I want to add to my stats script the following stats; Avg Distance driven per map Avg Speed per map I think this is kind of hard to script, that's why I'm asking here, what can I use? Any suggestions while scripting it? Which events to use? Thanks, LinKin.
  19. But what about a vehicle?
  20. Hi, I was wondering if there exists any function that says wheter or not a player/element is on the air. Just like isElementInWater works. Thanks.
  21. Yeah, just noticed that So it would work (the function that calls itself). Thanks Bons you sucka)
  22. Thanks, I made this code by myself, it does the same thing (format ms) But I still don't really know how to refresh/update the time spent on server for a player each passed minute. I'm thinking about making a function that calls itself; for example, client-side (For avoiding a table containing timers and some other stuff) addEvent("onClientPlayerLogin", true) -- I will trigger this event with onPlayerLogin in the server-side file. function startTimer() setTimer(checkTimePlayed, 60000, 1) loginTime = getTickCount() end addEventHandler("onClientPlayerLogin", root, startTimer) function checkTimePlayed () local currentTime = getTickCount() local playTime = -- I will manage to get the playtime stored in the SQL db local newTime = currentTime - loginTime local finalTime = playTime + newTime -- updateSQL (I will call a server function to update the SQL column with the new value (finalTime)) -- This is what I mean; to set a timer that calls the same function each minute. setTimer(checkTimePlayed, 60000, 1) end Would that work?
×
×
  • Create New...