Jump to content

LoPollo

Members
  • Posts

    353
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by LoPollo

  1. LoPollo

    help

    Show us your code, i'm not good with SQL but as far as i know you can use the SQL order by or if you are storing the result of query (if you are querying) in a table you can sort the table also what do you mean with "from largest to smallest"? What kind of data are you working on?
  2. nope, i edited the above reply adding the code to be more clear
  3. Source does not exists inside the timer (line 4 server) You must pass the source as a parameter to the timer
  4. The problem is (as you may think) that whatever is in the second argument of the function isObjectInACLGroup at line 98 of the resource admintag, file server.lua, is returning (probably) false. Can you give us the code of that file (server.lua)? At least the portion around that line including also the functions there called. This way we can see where the cause of the error "start", and how to fix/handle it. Also, by reading the wiki, i can assume that at the second argument there's a call to the function aclGetGroup, which Returns false/nil if it [the acl group] did not exist or [the function itslef] failed for some reason.
  5. Yep there were lots of errors, i tested this (still with mta gui funcs) This is not usable, the goal was to make sure there were not errors in the "logic" part. From this you can (convert to dx and) attach the handlers and manage the window (e.g. hide/show, other buttons, change names)
  6. I did not test the code so expect errors, there are for sure. Also the example is made with the normal gui, the "conversion" is based on what you are working on, so i leave this to you Most of the code is copied from the wiki, i hope i named all the variables and not forgot anything And most important i hope it can give you an idea on how to do it
  7. Each group node is children of the catalog, so if you get the children of catalog you get these, with which you can make the gridlist with their names. When an element of the gridlist is clicked, you can get the children of the corrispondent xmlnode and update the gridlist with the anims. Correct me if i'm wrong or not understood correctly
  8. LoPollo

    [HELP]Turf

    Next time use a spoiler, so the lines number are displayer and it's easier for everyone to help. Also are there errors? copy and paste if there are. I'm too lazy to read this all
  9. I don't think you will find someone that will make your script. Also this kind of scripts is present in the community. I also searched and found something, just the first i found of many nice scripts. Most script are not compiled, so you can see how they did what they wanted to: basically i'm telling you to learn how to script in LUA and create your own resources, it's faster than writing in the forum most of the time! It will solve a lot of your problems, and you will not fully depend on other scripters. The above script, if i'm right, gives to all the players the command, and not only admins: this something you can do to start scripting. The "structure" of the scripts can be easily learned even from the existing script itself, or from the LUA tutorials and manuals online. For MTA specific function there's the wiki. Here you will be able to find every function that you can use to manipulate the game. I know this is not exactly what you were asking for (an already completed script) but this way it will be much easier for you in the future. Hope you understand and good scripting! Obviously for every doubt we are still here!
  10. Sure If i didn't forgot anything it should work
  11. Line 3: if you have a team (and you said you were in criminal team) the condition is true and then the code is executed, check again that line Edit: i suggest you to fix the tabbings to align the ends to their respective statement if these are presents in your script
  12. Line 17: expors .SAEGGroups:getGroups There's a space between the "expors" and ".SAEGGroups...", also expors should be exports
  13. It should show N/A only the first time , when there's no data. After the handler function at line 14 updates the data (when currenttick - starttick >= 1000) getElementData at line 87 should return the value of the measurement and then draw the value on the screen is there any error threw clientside? If an error happened it shouldn't draw anything at all... still have you checked the clientscript.log? I don't know where to see cause the script seems ok Do you know what? i'm an idiot You must have used the code i gave you, where i added an "else" setting the "N/A". so the N/A is displayed for every frame which is not the first after every second. Thus to correct the problem delete the else and cut the line with setElementData(player,"FPS","N/A") pasting it in a function, called when the resource starts (preferred), or simply outside any function at the start of the script after declaring variables (i.e. between line 12 and 13 of the code) Otherwise you can replace line 87 with this: dxDrawText ( getElementData(getLocalPlayer(),"FPS") or "N/A", posx2-12, posy2-6, x, y, tocolor ( 255, 255, 255, 255 ), 1.4, "default-bold" )
  14. I never used db, so do not expect too much from me about this argument. However i only found executeSQLQuery, which is different from "executesqlQuery" (first line). Still if it does not throw an error when it's called at line 4 i don't think this is an issue
  15. in the client it's triggered onPlayerAttemptCreateHouseVip while in the server the event is called onPlayerAttemptcreateHouseVip It seems like it's case sensitive: Create ~= create Let us know if it was the problem, editing the "c" solved the problem in a compact copy of you script i used to test
  16. is this what are you searching for? if all this stuff must be done serverside (as i think reading your example), simply create a table that stores all these timers that you handle on player connect/quit, if the function is clientside it's as easy as creating one timer clientside. Another way to do it if the function HP() you are calling is serverside is creating timers clientside, and then triggering the event fom the client instead of managing server-side all the timers that triggers the event. Hope i've been clear and understood what you mean.
  17. getElementData(getLocalPlayer(),"FPS") will return false if the data does not exists. --line 20 of the code if currenttick - starttick >= 1000 then setElementData(player,"FPS",counter) counter = 0 starttick = false end The data doesn't exist for the first second since no measurement has been made. There are 2 solutions: 1. at line 87 check if the data exist before calling dxDrawText; 2. replace the code i copied above with this to create dummy data and avoid the error: --line 20 of the code if currenttick - starttick >= 1000 then setElementData(player,"FPS",counter) counter = 0 starttick = false else setElementData(player,"FPS","N/A") end I did not test anything, let me know if this help
  18. --Line 4 elseif not getControlState("fire") and not getControlState("aim_weapon") then --delete the not of aim_weap elseif not getControlState("fire") and getControlState("aim_weapon") then This will make you stop aiming when you stop fire... but there are still 2 problems: 1. this will also prevent you from aiming normally (e.g. clicking RMB) 2. this does not check for a keychange (e.g. while firing the rmb get pressed, after relasing lmb you will stop aiming even if the rb is pressed) So i think the best method would be checking the keys bound to the controls "fire" and "aim_weapon" and handle the press and relase of these keys.
  19. Arrays in lua start at index 1, so at line 13 when you are outputting deliver[0] the value will be nil Also change at line 7 the random argument to 1,5 Another optional thing is to convert the while loop at line 6 with a for loop The code should be this (not tested): local pizzas = {"Hawaii", "Sonkás", "Sajtos", "Tonhalas", "Négysajtos"} local deliver = {} function starter() for counter=1,5 do table.insert(deliver, tostring(pizzas[math.random(1,5)])) end setTimer( function() outputChatBox("Megkaptad a rendelést, most szállítsd le a következő pizzákat: "..tostring(deliver[1])..", "..tostring(deliver[2])..", "..tostring(deliver[3])..", "..tostring(deliver[4])..", "..tostring(deliver[5]).."!") end, 5000, 1) end addCommandHandler("deliver", starter) Note that in deliver there could be duplicates of one item of pizzas, and some items could not appear. Not sure if this is a problem for you anyway, maybe this is what you want. Just wanted to make sure you know this. Hope it solved your problem
  20. addEventHandler("onClientVehicleCollision", root, function(theHitElement, force, bodypart, collisionX, collisionY, collisionZ, normalX, normalY, normalZ, hitElementForce, model) if source == getPedOccupiedVehicle(localPlayer) then outputChatBox( "DBG ["..getTickCount().."]: Collision") end end ) Using this function when i collide with my BMX with objects i always get the message in the chatbox. No matter if while jumping, falling etc. Tested with a BMX (lol) in Santa Maria Beach area. In the wiki page (i think when i am tired i am blind) there's this: Issue ID Description #7422 onClientVehicleCollision doesnt trigger when hitting some frozen objects But i do not think this related to your problem. So this bring me to think that maybe there's a condition in your event that prevents some code to be executed. Could you post your handler function?
  21. What do you mean? The handler does not always detect collision, maybe with a particular kind of object? Do you think it could be a bug? I can't see any issue in the wiki page Process line of sight require coordinates to work, how do you think you will get them?
  22. LoPollo

    Zonename

    For sure there's an error, so @Best-Killer must have checked the console/server log, while there's a file where you can see the errors in client-side, check: MTA San Andreas 1.5\MTA\logs\clientscript.log Also tell us if the script works when you can
  23. LoPollo

    Zonename

    shouldn't addEventHandler be attached to something? i guess localPlayer but not sure
  24. LoPollo

    Zonename

    If there are no errors clientside as you said, i would check if the function gets really called (both this and the client side handler), and if the function gets called try checking all variables or excluding them (ie append to the if statement an "or true") if that won't cause problems. This may be not helpful, i'm not expert, but till others reply to this you can try what i said
  25. Using onClientVehicleExit works! As you said it gets called when falling from the bike. Thanks for you help too!
×
×
  • Create New...