Jump to content

xTravax

Members
  • Posts

    665
  • Joined

  • Last visited

Everything posted by xTravax

  1. -- custom functions function dxDrawCircle( posX, posY, radius, width, angleAmount, startAngle, stopAngle, color, postGUI ) if ( type( posX ) ~= "number" ) or ( type( posY ) ~= "number" ) then return false end local function clamp( val, lower, upper ) if ( lower > upper ) then lower, upper = upper, lower end return math.max( lower, math.min( upper, val ) ) end radius = type( radius ) == "number" and radius or 50 width = type( width ) == "number" and width or 5 angleAmount = type( angleAmount ) == "number" and angleAmount or 1 startAngle = clamp( type( startAngle ) == "number" and startAngle or 0, 0, 360 ) stopAngle = clamp( type( stopAngle ) == "number" and stopAngle or 360, 0, 360 ) color = color or tocolor( 255, 255, 255, 200 ) postGUI = type( postGUI ) == "boolean" and postGUI or false if ( stopAngle < startAngle ) then local tempAngle = stopAngle stopAngle = startAngle startAngle = tempAngle end for i = startAngle, stopAngle, angleAmount do local startX = math.cos( math.rad( i ) ) * ( radius - width ) local startY = math.sin( math.rad( i ) ) * ( radius - width ) local endX = math.cos( math.rad( i ) ) * ( radius + width ) local endY = math.sin( math.rad( i ) ) * ( radius + width ) dxDrawLine( startX + posX, startY + posY, endX + posX, endY + posY, color, width, postGUI ) end return true end --using custom functions partial circle pHealth = 100 setTimer(function() pHealth = getElementHealth(localPlayer) outputChatBox(pHealth) end,50,1) function onDamage() pHealth = getElementHealth(source) end addEventHandler ( "onClientPlayerDamage", getLocalPlayer(),onDamage) function healthHud( ) if getElementData(localPlayer,"UI") == "hidden" then return end --local circle = getElementHealth(localPlayer) dxDrawCircle( 200, 200, 52, 5, 1, 0, pHealth*3.6,tocolor(0,0,0,255) ) dxDrawCircle( 200, 200, 44, 1, 1, 0, pHealth*3.6,tocolor(0,0,0,255) ) dxDrawCircle( 200, 200, 50, 5, 1, 0, pHealth*3.6,tocolor(255,0,0,255) ) end addEventHandler( "onClientRender", root,healthHud) function onDeath() pHealth = 0 removeEventHandler("onClientRender",root,healthHud) end addEventHandler("onClientPlayerWasted",getLocalPlayer(),onDeath) function onSpawn() addEventHandler("onClientRender",root,healthHud) pHealth = getElementHealth(source) end addEventHandler("onClientPlayerSpawn",getLocalPlayer(),onSpawn) so its just a basic simple health circled hud and perfomancebrowser is reporting that this script is using 20-30% of client(me) cpu and when looking at server i have no idea why, no debugscript 3 errors. is it problem in me or i have to optimize the script somehow?
  2. usb3 driver said same error again(my pc doesnt meet minimum requirements) mta diag installed UNSTABLE version of mta and therefore made me not able to play nor host any server. pastebin is in your pm inbox in this forum
  3. i can't find anything in there,dump wasn't saved nor i can get it with some other programs which i have tried but it's not always the BSOD but also the freezing; every driver freezes i believe that freezing is a cause of my BSOD-s but sometimes BSOD triggers before everything freezes and sometimes not.
  4. xTravax

    The last reply

    I just ignored your reply, coz u just killed our fun!!! (You did that second time ) how can u have fun spamming alphabet crap over and over again?
  5. sorry for doublepost, i have rewritten the script and got this function createPaintballEffect(weapon,ammo,ammoInClip,hitX,hitY,hitZ,hitElement) local daMarker = createMarker(hitX,hitY,hitZ,"corona",0.2,math.random(0,255),math.random(0,255),math.random(0,255),255) outputDebugString("made a marker") if getElementType(hitElement) == "player" or getElementType(hitElement) == "ped" or getElementType(hitElement) == "object" or getElementType(hitElement) == "vehicle" then attachElements(daMarker,hitElement) else return end setTimer(destroyElement,5000,1,daMarker) end addEventHandler("onClientPlayerWeaponFire",root,createPaintballEffect) it works fine but it outputs to debug that element is nil when i dont hit any object or vehicle or player or ped i thought ' else return end ' would prevent the debug messages? whats alternative to stop this debug warnings? also only attached markers are getting destroyed..
  6. i have made a resource which should work perfectly but for unknown reasons it doesnt function createPaintballEffect(hitElement,hitX,hitY,hitZ) daMarker = createMarker(hitX,hitY,hitZ,"corona",0.2,math.random(0,255),math.random(0,255),math.random(0,255),255) outputDebugString("made a marker") if getElementType(hitElement) == "player" or getElementType(hitElement) == "ped" or getElementType(hitElement) == "object" or getElementType(hitElement) == "vehicle" then attachElements(daMarker,hitElement) outputDebugString("attached elements") setTimer(destroyElement,5000,1,daMarker) else outputDebugString("wtf") return end end addEventHandler("onClientWeaponFire",root,createPaintballEffect) custom and built in debug methods dont show anything.
  7. towncivillian can you please reply? since i installed those 2 out of 4 drivers you sent me i got bluescreens again and its very annoying and you are barely even replying to threads in here
  8. hello umm if i had something like this playerData = { {1,20}, {2,40}, {3,60}, {4,80}, {5,100} } function testFunction(thePlayer,commandName,id) for index,pdata in ipairs(playerData) do if id then -- give money depending on id(1,2,3,4 or 5) else outputChatBox("id required!") return end end end addCommandHandler("mooney",testFunction) this is just an example. how could i make it that when i write /mooney 3 that it automatically finds the 2nd value in table which is 60 and gives me 60 dollars?
  9. the pc i got was bought in 2012 at that time it was a very good gaming pc which could run everything on ultra settings and now it can run only on high settings but not rly ultra unless i overclock afaik but idk nor i wanna do that and umm this is a game from 2005 so well it shouldn't lag especially when my pc is from 2012 so it surely can handle the game itself anyway towncivillian i have PM-ed u the pastebin link
  10. what do i do then?there must be a solution
  11. i have made 2 separate resources test2 has an export in it(shared one) and when export gets triggered it outputs a message test1 has a timer of 5 seconds to trigger exported function and it triggered it and loaded the code(outputted a message) which i wanted it to do exports should work no matter when a resource has been started. only thing that matters is that 2 resources(the one triggering) and the one who will get triggered need to be running. also iyyama having an event handler in a function which has shared exported function wouldn't mess up anything, it's just an additional time when a code can run i still dont understand why isnt my other(real) resource getting triggered
  12. @king not sure how can any serverside script mess up my client side as theres not a single part of code which would do that and im calling client function from other script with this client file script iyyama(usually people read first post at topics afaik) [cspawn]\cspawn\script.lua thats an example where a script would be in cspawn is resource name and this is the other client function which im triggering with exports if getElementDimension(localPlayer) == 3 then button = guiCreateButton( 0.45, 0.5, 0.1, 0.1, "Spawn!", true ) fadeCamera ( false ) showCursor ( true ) else outputChatBox("bspawn_c: wrong dimension ") return end function otherTestFunction ( ) if getElementDimension(localPlayer) == 3 then outputChatBox("a") outputDebugString("aa") else outputChatBox("bspawn_c10: wrong dimension ") return end --triggerServerEvent ( "spawnButtonForPlayer",localPlayer ) --showCursor ( false ) --guiSetVisible(button,false) end addEventHandler ( "onClientGUIClick", button, otherTestFunction, false )
  13. its exactly that line,both resources are running and always gives that error IIYAMA, i really dont know how could you miss my DEBUGSCRIPT 3 LINE on my FIRST POST in this topic obviously i know how to use it. why to script if scripting basics aren't learned? anyway i dont need a script to check if a resource is running because simply i have already checked that long time ago and this thing still does not work..
  14. I have experienced this only when someone would fist me from 80 m away and i'd get killed by m4
  15. tried that and nothing debugscript 3 ERROR:failed to call 'cspawn:otherTestFunction' ERROR: attemp to call a nil value
  16. why do u need that function? that function works fine without any errors but exports arent triggering it because call fails for unknown reason
  17. its running and its exactly that function name and theres no other error than the one that i posted here
  18. what kind of problem? if you mean that the function itself doesnt work, it does but it doesnt activate when im trying to activate it via exports
  19. hey im trying to call another script from another resource so that i can spawn a player when i want without using original resource to spawn it -- client exports.cspawn:otherTestFunction(localPlayer) -- meta function="otherTestFunction" type="client" /> debugscript 3: call: failed to call: cspawn:otherTestFunction please help idk what im doing wrong
  20. i know how to do that already, i meant the thing where projectile is being created according to crosshair position
  21. hello i saw some development video from 2007 and i dont have any idea how to do something similiar what functions would i need to make something similiar? ( the rocket launcher on car )
×
×
  • Create New...