Jump to content

NeO_DUFFMAN

Members
  • Posts

    44
  • Joined

  • Last visited

About NeO_DUFFMAN

  • Birthday 30/10/1996

Details

  • Location
    Mumbai, India.

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

NeO_DUFFMAN's Achievements

Rat

Rat (9/54)

0

Reputation

  1. HOLY MOTHER OF GOD! You know i've always felt that something like this has always been missing in MTA. I for one find it quite annoying to find a server of my choice without having to join at least three to four servers before that. And this kind of happened recently when i thought about checking out a DayZ server but after seeing so many servers out there, i eventually gave up and continued playing at the server that i usually play in. So yeah, this is definitely a really good suggestion and i really hope it's taken into consideration Btw, how about allowing players to vote for the servers and getting awarded with in-game prizes? Pretty much like how players vote for minecraft servers. I feel it's better this way to track the popularity and the likability of the server on a daily basis
  2. Like i had mentioned in skype, i would use dxDrawImageSection and then animate it using interpolateBetween. And to make it loop after it completes one cycle, i reset the tick count to make it start all over again. This is the first time i have attempted something like this so i might be wrong about this or there might be a much simpler and better alternative. But anyway, it worked for me. Check out the code and give it a try :3 local visibleState = false function handleRender() local now = getTickCount() local elapsedTime = now - start local duration = 2000 local progress = elapsedTime / duration local a = interpolateBetween (0,0,0,500,0,0, progress, "Linear") dxDrawImageSection(20,500,200,20,a,0,500,32,"bar.png",180) if elapsedTime >= 2000 then start = getTickCount();now = getTickCount() return end end bindKey("m","down", function() if visibleState == false then start = getTickCount() visibleState = true addEventHandler("onClientRender",root,handleRender) else start = getTickCount() visibleState = false removeEventHandler("onClientRender",root,handleRender) end end) The image that i have used:
  3. Oh my bad. Anyway, try this: setTimer(function () for i,v in ipairs(getElementsByType("player")) do if isPlayerInTeam( v, "Police" ) and getPlayerWantedLevel(v) <= 6 then setPlayerWantedLevel (v,0) end end end,50,0)
  4. local chat = true function chatDis(thePlayer) if not chat then outputChatBox("#E3E8B7Chat is already disabled",thePlayer,255,255,255,true) return end local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then outputChatBox("#E3E8B7The chat has been disabled by "..getPlayerName(thePlayer)..".",root,255, 255, 255, true) chat = false end end addCommandHandler("chatoff", chatDis) function chatEn(thePlayer) if chat then outputChatBox("#E3E8B7Chat is already enabled",thePlayer,255,255,255,true) return end local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then outputChatBox("#E3E8B7The chat has been enabled by "..getPlayerName(thePlayer)..".",root,255, 255, 255, true) chat = true end end addCommandHandler("chaton",chatEn) addEventHandler("onPlayerChat",root, function (message,messageType) if messageType == 0 or messageType == 1 and not chat then cancelEvent() end end) Ohh boy...guess it would be nice to know if someone else is already posting in a particular topic
  5. No i do get what you're trying to do. As per the code that i've given you, if the source(attacker) is not in the police team but if the target is then the source's wanted level will be increased. Isn't that what you want? Btw, wiki says that onPlayerTarget also gets triggered when the player is no longer aiming at something. I'm a little skeptical about my approach now. Ill try coming up with an alternative :3
  6. Firstly, source and thePlayer are not defined and secondly that is not the correct syntax for setTimer. Anyway, i have never used this event before but i guess this should do the job. Hope it works for you lol. addEventHandler ( "onPlayerTarget",root, function (target) if not getElementType(target) == "player" then return end -- Ignore if the target is not a player if (getPlayerTeam(target) == getTeamFromName("Police")) and (getPlayerTeam(source) ~= getTeamFromName("Police")) then -- If the target is in the police team but the attacker isn't setPlayerWantedLevel(source,getPlayerWantedLevel(source)+1) end end)
  7. Thanks again. You have helped me tremendously and i couldn't have asked for more. Cheers man!
  8. Thanks a lot Citizen. I really appreciate how you have answered all of my queries with such detail and with examples. Also, i'm going to take a note of all those tips that you have given me for use in the future. Atm, ill try working my way up by sorting out the loading-saving bit of the system within mta itself. Alright then, i'm going to use a single db file to sort out everything. Doubt i'll be keeping more than 15 tables so i'm glad you said 30+ lol. That seems like a simpler way of finding a particular entry in another table using a common id from the first table. So i'll store the index (from the result of the first table) as the foreign id in other tables right ? [Edit: Nevermind, i quickly tested this out and it worked just like i thought it would] Phew! In that case i guess i shouldn't be worrying. But do you think i should perhaps make a backup of the db every 30 minutes or perhaps 1 hour in case the server crashes ? ( Also, are there any chances of DB files getting corrupted somehow?) Yeah i guess that was completely unnecessary and irrelevant lol.... Lastly, i was going through a SQLite tutorial on the forum and i came across this post of Callum. Not sure what he meant by appending 'LIMIT 1' to the end of the query cause i couldn't test this out in w3school's editor since it kept on giving me a syntax error. But apparently the MySQL syntax for this is - SELECT column_name(s) FROM table_name LIMIT number; If you're only expecting one result, you should append 'LIMIT 1' to the end of the query, so that SQL will stop looping the database once it has 1 result. This can majorly improve performance. So in case i want SQL to stop looping once i've have got my result, how can i do this by using 'LIMIT 1' ?
  9. Greetings! Just need few answers to few of my queries. But before i get to the questions, i would like to briefly explain what my motive is. So basically, i am trying to construct a fairly stable SQLite database management system kind of thingy. I have been going through the w3schools website for the past 3-4 days just to be sure of what i'm doing. Don't want to attempt doing something way out of my comprehension and then regretting even trying it out lol. Anyway, enough trashtalk. Here are my questions: Q1) How would you want to organize your db files ? Would you allot all the tables to a single db file or would you segregate various tables among several db files and then use a unique identifier (Preferably an index value? :3) to make sure that a particular entry pertaining to say 'x' db file has a sort of connection with that in 'y' db file. Q2) Should i be concerned about any limit in particular about the columns that i keep in a particular table? Well, i know there is no limit as such, but would you want to advice me to restrict the number of columns just to make sure that it doesn't alter my server's efficiency and performance ? Q3) I have a very simple minded plan to sort out all the loading and saving of the data. I'm thinking about retrieving all the data from the db and then saving it as the player's element data. As a security measure, i will not allow any synchronization between the client and the server in this regard. So yeah, this is pretty much a basic approach so my question is that does this seem good enough or whether there is/are any alternative(s) to deal with something like this ? Q4) Now i'm sure that the size of the db file depends on the playerbase but approximately what size should i expect for a server with a decent amount of players? Q5) Do you have tips or suggestions that you would like to give me ? Q6) Lastly, what does the fox really say? [ Feel free to ignore this one lol ] - NeO_DUFFMAN [ Ex Level 8 Admin @ Team NeO Server ]
  10. Getting a server with a decent number of slots is quite cheap but getting a scripter to code the entire gamemode, userpanel and a couple of other stuff is comparatively quite expensive
  11. As you can see there is no function defined for your onClientPreRender event. So what you got to do is that define the function something like this: function yourFunctionName () -- script stuff end addEventHandler("onClientPreRender", root,yourFunctionName) Now since you've defined your function, you can use removeEventHandler. I doubt there is any other way of getting this done. Is there ? :3 Probably someone else might come up with an alternative. Well, you could also define a particular global or local variable such as (local allowRender or allowRender = false) in the beggining of your code and accordingly play around by using the two boolean values to use it in place of removeEventHandler. But this seems ineffecient as hell doesn't it cause your function will be attached to the onClientPreRender event permanently plus it's a silly thing to do imo. I can't think of anything other than that lol. And for your 2nd issue, export your defined function and then either use "call" or "exports" to call it from another resource.
  12. NeO_DUFFMAN

    Please help me :)

    I highly doubt it. But why do you want it to be decrypted ? Give your players some privacy lol. But if you're really hellbent on being able to see the account's password, then you would have to create your own account system. And trust me, it's super easy to make one with SQLite. You can also use cancelEvent() to get rid of the login, logout and register commands.
  13. NeO_DUFFMAN

    Please help me :)

    Yeah sqlitebrowser shows the player's ip as his password. Probably cause it's encrypted or something. I don't know tbh lol.
  14. Damn this is something really unique. Way to go Woovie!
×
×
  • Create New...