Jump to content

Kazafka

Members
  • Posts

    143
  • Joined

  • Last visited

Everything posted by Kazafka

  1. Today, I've made a event, for checking if player have mooved. At first, after success of detecting players' moovement, it was displaying a message for player, who have mooved.Then, I tried to trigger the event, and the problems started. Any idea? Code's here: ----------------------------------------- ---------------VaporZ (c)---------------- ----------------------------------------- toggleOnPlayerMove = true addEventHandler("onResourceStart", root, function() if(toggleOnPlayerMove == true) then addEvent("onPlayerMove", true) setTimer( function() for _, player in ipairs(getElementsByType("player")) do local x, y, z = getElementPosition(player) setTimer( function() local x_, y_, z_ = getElementPosition(player) if(x ~= x_) and (y ~= y_) and (z ~= z_) then triggerEvent("onPlayerMove", root, player) end end, 1, 1) end end, 1, 0) end end) function dispMsg(player) outputChatBox("You've mooved!", player, math.random(1, 255), math.random(1, 255), math.random(1, 255), true) end addEventHandler("onPlayerMove", root, dispMsg) It is just giving me no errors and no message. Idk wut is wrong.
  2. This function is for creating idle animations, on player's afk/idle. Aaand, u need to probably put this one in "onResourceStart" event, remember, to make it work. Here it comes: setTimer( function() for _, player in ipairs(getElementsByType("player")) do if(getPlayerIdleTime(player) > 10000) then local veh = getPedOccupiedVehicle(player) if veh then setPedAnimation(player, "car", "Sit_relaxed", -1, false, false, true, true, 250, false) else local anim = math.random(1, 5) if(anim == 1) then setPedAnimation(player, "playidles", "stretch", -1, false, false, false, false) elseif(anim == 2) then setPedAnimation(player, "playidles", "strleg", -1, false, false, false, false) elseif(anim == 2) then setPedAnimation(player, "playidles", "time", -1, false, false, false, false) elseif(anim == 2) then setPedAnimation(player, "playidles", "shldr", -1, false, false, false, false) elseif(anim == 2) then setPedAnimation(player, "playidles", "shift", -1, false, false, false, false) end end end end end 5000, 0) That's what I wanted to create, mentioning my latest post
  3. Im not raged i just wanted to make this message like important, etc. xDDD
  4. I meant, i've created my function for idle animations, not ready-to-use animations. And how can I reset players' idle time. So? WUTEVA, I DON'T NEED HELP WITH THIS ANYMORE!
  5. Okay, I've learnt to make infinte timers, for my idle animation script, so how (if it is possible), can I reset idle time of a player, because animation is playing each 30s not each 60s. Any help? *!!!EXCEPT DISCONNECTING!!!*
  6. And that's it? That's it? Looping timers is that simple? Goddamnit... thanks btw!
  7. I mean, does anyone have a script, that checks if player is afk? Like, you know it is (kinda infinite) loop, and checks if player is afk. Any advance?
  8. at least put download link here? have no sense without it
  9. U know wut? Imma so dumbo, that I shouldn't programm at all <s <script src="cars.Lua" type="client"/> <!-- Goddamn C L I E N T --> Goddamn C L I E N T anyways, Imma too dumb to programm, and I've got the problem solved. Sorry, that u spent for me that time, that you could spend with ur family or etc. SORRY FOR @stPatrick, too Sorry guys
  10. I tried to load a file, that is in a subfolder, nothing's happening, no errors in console. What's the problem (all code below)? Line of code in script, to load xml file: xml = xmlLoadFile("cars/saved.xml") meta.xml: <file src="cars/saved.xml"/> What's wrong? BTW, everything exists. IDK what's wrong with this, everything's is existing, file is assigned into xml. I clearly don't know what's worng.
  11. NAAAH! I want to load xml file in subfolder, but with script, that is in the same folder, as meta.xml! Aaaaand this: xml = xmlLoadFile("VaporCars/saved.xml") Doesn't work! "[...] Now you know!" ~ BELL BIV DEVOE - Poison
  12. <meta> <!-- Blah blah blah (info) and this: --> <script src="cars.Lua" type="client"/> <script src="bank.Lua" type="client"/> <script src="fshop.Lua" type="server"/> <script src="gunshop.Lua" type="server"/> <file src="VaporCars/shops.xml"/> <file src="VaporCars/saved.xml"/> <file src="Bank/accounts.xml"/> <file src="Bank/atms.xml"/> <file src="Gunshop/prices.xml"/> </meta> This? Is this possible? Kinda.
  13. But, how do I load a xml file, wich is in another folder, from a script, that is in default resource folder?
  14. This is the dumbest question I've ever asked on this forum, but I have problem even not only with this. So, how can I add scripts from different folders in my meta.xml? And in these scripts, how can I load xml files from different folders, too? Any idea? If yes, please, show me example I know, that I would use xml = xmlLoadFile("filename.xml") But how to load xml in different folders? Same <script src="script.Lua" type="server"/> But how to tell MTA to load script from different folder?
  15. ahh, that's right. Imma so dumb
  16. Lua: addCommandHandler("usun.pojazd", function(player) local veh = getPedOccupiedVehicle(player) if veh then if(getElementData(veh, "owner") == getPlayerName(player)) then local xml = xmlLoadFile("saved.xml") if xml then local branch = xmlFindChild(xml, "vehs", 0) local table_ = xmlNodeGetChildren(branch) local customID = getElementData(veh, "id") for i, node in ipairs(table_) do if(customID == xmlNodeGetAttribute(node, "customID")) then xmlDestroyNode(node) end end xmlSaveFile(xml) xmlUnloadFile(xml) end destroyElement(veh) local vT = getAttachedElements(veh) destroyElement(vT[1]) outputChatBox("#007FFF[VaporCars] #4a4a4aCar successfully #007FFFdeleted#4a4a4a!", player, 255, 255, 255, true) end end end)
  17. This one got me on disappointment, It is like 10th time! When I delete a vehicle from my user's list (my vehicle system, "VaporCars", 99% of completement) script SHOULD remove a blip, that is moving within a car, but it says, that this car, that I'm in, is a boolean. Any idea? Code: --Attached elements: BLIP --Im in car: YES --Player is: ME local veh = getPedOccupiedVehicle(player) local vehTable = getAttachedElements(veh) destroyElement(vehTable[1]) --Why this ain't work?
  18. ahh LOL I don't have brain since it's weekend I've completely got into my vehicle system script, wich goes really good. Thanks! XD
  19. So, usually, in default MTA servers u have /nick command, I guess. Where can I disable it?
  20. Ey yo everybody! How's ur day? I have a question. How can I disable these region informations, that are displayed at the bottom of screen? I have I speedometer, that have included region info into it. So, how can I? And basically, where?
×
×
  • Create New...