Jump to content

ViRuZGamiing

Members
  • Posts

    1,050
  • Joined

  • Last visited

Everything posted by ViRuZGamiing

  1. use setWeaponProperty clientside
  2. tested it, if isElement(hitElement) then if getElementType (hitElement) == "player" then Also a few suggestions / ideas perhaps, wouldn't it be better to just create a marker client side and destroy it when finished instead of having it all time invisible. Also you're doing 4 if's to check for element and destroy it, You can put those in an table and then loopthrough it with (for key, value in table do) Kind regards
  3. Where is EndDesMarker declared
  4. Can you show the code you now have
  5. Just so he knows what he did, the source from onMarkerHit isn't the player but the marker itself
  6. elemenyType on line 3 should be elementType, typo
  7. createTeam addCommandHandler setPlayerTeam use these, then use playerSource from the handler to set the team.
  8. if isTimer(t1) then killTimer(t1) end same goes for t2
  9. I did help, and I helped many others. After I gave you all you needed you kept bumping the post with question marks. Also don't tell me what this forum's about I've been around long enough to know this. If you are really here to learn, start learning, cause you said I was being rude but I really ment that you should start learning it. You can keep making forum posts with code that has to be fixed for you.
  10. You might wanna start looking into learning how to script first.
  11. ViRuZGamiing

    Skin

    You have a " after localPlayer on line 12
  12. ViRuZGamiing

    Skin

    local skin addEventHandler("onMarkerHit", entryMarker, function(hitElement) if (getElementType(hitElement) == "player") then skin = getElementModel(hitElement) --remove skin here (what I don't really understand what you mean by that) end end) addEventHandler("onMarkerHit", exitMarker, function(hitElement) if (getElementType(hitElement) == "player") then setElementModel(hitElement, skin) end end)
  13. Haven't seen this happen yet, my specs: Win10 16GB RAM GTX850M i7-4710HQ Win10 has become my favorite OS after they fixed the bugs from the beginning (when I totally hated Win10 and went back to Win7)
  14. ViRuZGamiing

    metatables

    Have you read this? https://www.lua.org/pil/13.html Kind regards
  15. How I'd go about it is make an array and a index variable. muteTimeIndex = 0 muteTimes = {1, 2, 5, 10, 15, 30, 60, 120, 180, 240, 300, 360} --in minutes needs conversion to ms --onMute muteTimeIndex = muteTimeIndex + 1 muteTimes[muteTimeIndex] there might be a better way but this would be mine
  16. oh yeah lol sublime text derped
  17. So I'd would be like this right; local filepath = "command-log.txt" local file local months = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", } addEventHandler( "onResourceStart", getResourceRootElement(getThisResource()), function () if (not fileExists(filepath)) then fileCreate(filepath) else file = fileOpen(filepath) end end) addEventHandler("onPlayerCommand", root, function (cmdname) fileSetPos(file, fileGetSize(file)) if (cmdname ~= "stopanim") then local time = getRealTime() fileWrite(file,"["..time.monthday.." "..months[time.month].." "..(time.year+1900).." | "..time.hour..":"..time.minute..":"..time.second.."] "..getPlayerName(source)..": "..cmdname.."\n") fileFlush(file) end end) addEventHandler("addEventHandler", getResourceRootElement(getThisResource()), function () fileClose(file) end)
  18. I wrote you a little script. local filepath = "command-log.txt" local file addEventHandler("onPlayerCommand", root, function (cmdname) if (not fileExists(filepath)) then fileCreate(filepath) end file = fileOpen(filepath) fileSetPos(file, fileGetSize(file)) fileWrite(file, getPlayerName(source).." typed command "..cmdname.."\n") fileFlush(file) fileClose(file) end) Just because I was interested in testing this out. Text document looks sorta like this: Viruz typed command stop Viruz typed command start Viruz typed command debugscript or this format I've just made; looks like this: [24 April 2016 | 11:27:35] Viruz: debugscript
  19. OutputServerLog take a look into this event 'OnPlayerCommand'
  20. You can capture clicks on dx elements by checking the mouse click position compaired to the dx element's position. Example; https://forum.multitheftauto.com/viewto ... 91&t=88456
  21. getLocalPlayer has to be getLocalPlayer() or localPlayer
  22. then you can declare the alpha as 0 the first time. function animB(posX,posY,sizeX,sizeY,r,g,b) if (aFinal == nil) then aFinal = 0 end if isCursorHover(posX,posY,sizeX,sizeY) then aFinal = math.min(aFinal + 20, 255) dxDrawRectangle(posX,posY,sizeX,sizeY,tocolor(r,g,b,aFinal)) else aFinal = math.min(aFinal - 20, 0) dxDrawRectangle(posX,posY,sizeX,sizeY,tocolor(r,g,b,aFinal)) end end
  23. Not 100% but I think you can do: if (aFinal == nil) then aFinal = 0 end tested in LUA Demo
  24. can't you just add this on line 2: local aFinal = 0
×
×
  • Create New...