-
Posts
851 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Noki
-
Hello, I've been using the 'standard' method to make relative dx (see example 1), and I notice when I change my resolution or aspect ratio, it looks somewhat abnormal or weird. I was wondering if there is any better methods of creating relative dx. Example 1: local sX, sY = guiGetScreenSize() addEventHandler( "onClientRender", root, function () dxDrawText( "Hello world", sX * 0.9, sY * 0.9 ) end ) Note: I'm on my phone and I couldn't get a figure going so I wrote 0.9 to substitute for an actual decimal value that would be used. So, just ignore the actual number as it has no significance by itself. Thank you in advance.
-
GTA SA is a hitscan game. Meaning if your crosshair is on the player, the game will calculate that as a hit. Simply aim and click.
-
I put them in there before when the function always returned 0. The tonumber seemed to fix it then. But I removed them and it works fine now. Thank you once again.
-
Oh my god... I just... I spent hours trying to fix it... Haha, thank you anyway man.
-
local blip = {} function destroyBlipsAttachedTo( player ) -- Keep this just in case local attached = getAttachedElements( player ) if ( attached ) then for k, element in pairs ( attached ) do if getElementType( element ) == "blip" then destroyElement( element ) end end end end function applyBlips() for k, player in pairs ( getElementsByType( "player" ) ) do tR, tG, tB = getTeamColor( getPlayerTeam( player ) ) tR = tonumber( tR ) tR = tonumber( tG ) tR = tonumber( tB ) if not blip[player] then blip[player] = createBlipAttachedTo( player, 0, 2, tR, tG, tB, 255 ) else setBlipColor( blip[player], tR, tG, tB, 255 ) end end end addEventHandler( "onResourceStart", resourceRoot, applyBlips ) setTimer( applyBlips, 500, 0 ) function createBlips() if ( source ) then player = source end tR, tG, tB = getTeamColor( getPlayerTeam( player ) ) tR = tonumber( tR ) tR = tonumber( tG ) tR = tonumber( tB ) if not blip[player] then blip[player] = createBlipAttachedTo( player, 0, 2, tR, tG, tB, 255 ) else setBlipColor( blip[player], tR, tG, tB, 255 ) end end addEventHandler( "onPlayerSpawn", root, createBlips ) function destroyBlip() if ( source ) then player = source end if ( blip[player] and isElement( blip[player] ) ) then destroyElement( blip[player] ) blip[player] = nil end end addEventHandler( "onPlayerQuit", root, destroyBlip ) addEventHandler( "onPlayerWasted", root, destroyBlip ) Hello, For some reason, when my team is a greyscale colour (white, black, grey, silver etc) the blip displays correctly. But when my team is a colourful colour (like red, blue or green etc) the player blips display wrong. I'm not sure why it's doing this. My debug is completely clear and I honestly don't know what I'm doing wrong. The colour changes on team change (the 500ms timer and all) but the colour is incorrect. When I switch to a team (RGB: 255, 255, 0) it wouldn't display yellow, but green for some reason. Changing to a (RGB: 255, 0, 0) team makes my blip change to black. I don't have any conflicting resources (playerblips or customblips). Any help would be appreciated.
-
Selling scripts - IS OT NORMAL?
Noki replied to CyberMan's topic in Site/Forum/Discord/Mantis/Wiki related
Don't buy scripts that are compiled. -
Hi, On my server customblips (resource) seems to be hogging a lot of client CPU. How much client CPU does it use per client for you guys, if you're willing to share? I've got a decent amount of custom blips, but not too many (I think) as to give an average of 20% client CPU usage for that particular resource.
-
Using an MTA server as a botnet... Oh, it's almost like that scandal where ESEA made their client a bitcoin miner. It's so devious, but brilliant in its own creative way.
-
Incorrect. I've tried. When you try to join a server, you are automatically kicked. I think it is because all VMs share the same serial.
-
I've got the TP on a VM, but unfortunately you can't use MTA on VMs. So, I'm unsure of performance.
-
Which GTA IV multi player mod was the one mabako was involved in?
-
Thanks, CrystalMV. I never knew that all the previous variables would be overwritten. I moved the functions around and put 'addEventHandler' within the loops. It all works good now. Thank you once again.
-
What is it with you and firefighter jobs (if you know what I mean hehe)? But yeah, I have to agree with you. He doesn't respect his players, nor does he know how to decline an offer whilst showing professionalism. The fact he is just looking for scripts from other servers is quite sad. No originality or creativity.
-
smallAircraftMarkerTable = { --[[{ mX = 1984.7, mY = -2382, mZ = 12.5, mRZ = 90 }, { mX = -1246.24, mY = -96.19, mZ = 13, mRZ = 135 }, { mX = -1203.11, mY = -139.7, mZ = 13, mRZ = 135 },]] -- Tried and failed { 1984.7, -2315, 12.5, 90 }, { -1246.2402, -96.1916, 13, 135 }, { -1203.1144, -139.7044, 13, 135 } } largeAircraftMarkerTable = { { 2112.5559, -2440.1431, 12.5, 180 }, } for i, v in pairs ( smallAircraftMarkerTable ) do smallAircraftMarkers = createMarker( v[1], v[2], v[3], "cylinder", 2, 255, 255, 0 , 125 ) -- smallAircraftMarkers = createMarker( v.mX, v.mY, v.mZ, "cylinder", 2, 255, 255, 0 , 125 ) -- Fail SAspawnRotation = v[4] end for i, v in pairs ( largeAircraftMarkerTable ) do largeAircraftMarkers = createMarker( v[1], v[2], v[3], "cylinder", 2, 255, 255, 0, 125 ) LAspawnRotation = v[4] end smallAircraftID = { { "Beagle", 511 }, { "Cropduster", 512 }, { "Dodo", 593 }, { "Rustler", 476 }, { "Stuntplane", 513 }, { "Shamal", 519 } } largeAircraftID = { { "AT-400", 577 }, { "Andromada", 592 }, { "Nevada", 553 }, } spawnWindow = guiCreateWindow( 553, 179, 278, 336, "", false ) guiWindowSetSizable( spawnWindow, false ) guiSetVisible( spawnWindow, false ) spawnBtn = guiCreateButton( 19, 287, 108, 39, "Spawn", false, spawnWindow ) closeBtn = guiCreateButton( 150, 287, 108, 39, "Close", false, spawnWindow ) spawnGridlist = guiCreateGridList( 19, 31, 239, 246, false, spawnWindow ) spawnColumn = guiGridListAddColumn( spawnGridlist, "Aircraft", 0.9 ) addEventHandler( "onClientMarkerHit", smallAircraftMarkers, function () outputDebugString( "successfully hit" ) if isPedInVehicle( localPlayer ) then return end if not isPedOnGround( localPlayer ) then return end --setElementFrozen( localPlayer, true ) showCursor( true ) guiSetVisible( spawnWindow, true ) SAgridlist() end ) addEventHandler( "onClientMarkerHit", largeAircraftMarkers, function () if isPedInVehicle( localPlayer ) then return end if not isPedOnGround( localPlayer ) then return end --setElementFrozen( localPlayer, true ) showCursor( true ) guiSetVisible( spawnWindow, true ) LAgridlist() end ) function SAgridlist() guiSetText( spawnWindow, "Small Aircraft Spawn" ) guiGridListClear( spawnGridlist ) for i, v in pairs ( smallAircraftID ) do local row = guiGridListAddRow( spawnGridlist ) if row ~= nil and row ~= false and row ~= -1 then guiGridListSetItemText( spawnGridlist, row, spawnColumn, v[1], false, false ) guiGridListSetItemData( spawnGridlist, row, spawnColumn, v[2] ) end end end function LAgridlist() guiSetText( spawnWindow, "Large Aircraft Spawn" ) guiGridListClear( spawnGridlist ) for i, v in ipairs ( largeAircraftID ) do local row = guiGridListAddRow( spawnGridlist ) if row ~= nil and row ~= false and row ~= -1 then guiGridListSetItemText( spawnGridlist, row, spawnColumn, v[1], false, false ) guiGridListSetItemData( spawnGridlist, row, spawnColumn, v[2] ) end end end addEventHandler( "onClientGUIClick", guiRoot, function () if ( source == spawnBtn ) then local row = guiGridListGetSelectedItem( spawnGridlist ) if row ~= nil and row ~= false and row ~= -1 then local vehID = guiGridListGetItemData( spawnGridlist, row, spawnColumn ) if ( guiGetText( spawnWindow ) == "Small Aircraft Spawn" ) then triggerServerEvent( "spawnAircraft", localPlayer, vehID, SAspawnRotation ) elseif ( guiGetText( spawnWindow ) == "Large Aircraft Spawn" ) then triggerServerEvent( "spawnAircraft", localPlayer, vehID, LAspawnRotation ) else exports.dx:createNewDxMessage( "Something went wrong", 255, 255, 0 ) end else exports.dx:createNewDxMessage( "You did not select a vehicle from the list", 255, 255, 0 ) end elseif ( source == closeBtn ) then --setElementFrozen( localPlayer, false ) guiSetVisible( spawnWindow, false ) showCursor( false ) end end ) Only the last marker coordinate in the tables work. It will create the markers, but I'm not able to use the rest of the markers. Don't worry about the server-side as it has no effect on this issue and the script works fine besides the marker loop. Thanks.
-
-- client side function showClock() local h, m = getTime() local sX, sY = guiGetScreenSize() if m < 10 then m = "0"..m end if h < 10 then h = "0"..h end --[[dxDrawText( h..":"..m, 1169, 26, 1299, 83, tocolor(0, 0, 0, 255), 4.00, "default", "left", "top", false, false, false, true, false ) dxDrawText( h..":"..m, 1169, 24, 1299, 81, tocolor(0, 0, 0, 255), 4.00, "default", "left", "top", false, false, false, true, false ) dxDrawText( h..":"..m, 1167, 26, 1297, 83, tocolor(0, 0, 0, 255), 4.00, "default", "left", "top", false, false, false, true, false ) dxDrawText( h..":"..m, 1167, 24, 1297, 81, tocolor(0, 0, 0, 255), 4.00, "default", "left", "top", false, false, false, true, false ) dxDrawText( h..":"..m, 1168, 25, 1298, 82, tocolor(255, 255, 255, 255), 4.00, "default", "left", "top", false, false, false, true, false ) ]] dxDrawText( h..":"..m, sX * 0.8557, sY * 0.0338, sX * 0.9509, sY * 0.1080, tocolor(0, 0, 0, 255), 4.00, "default", "left", "top", false, false, false, true, false ) dxDrawText( h..":"..m, sX * 0.8557, sY * 0.0312, sX * 0.9509, sY * 0.1054, tocolor(0, 0, 0, 255), 4.00, "default", "left", "top", false, false, false, true, false ) dxDrawText( h..":"..m, sX * 0.8543, sY * 0.0338, sX * 0.9494, sY * 0.1080, tocolor(0, 0, 0, 255), 4.00, "default", "left", "top", false, false, false, true, false ) dxDrawText( h..":"..m, sX * 0.8543, sY * 0.0312, sX * 0.9494, sY * 0.1054, tocolor(0, 0, 0, 255), 4.00, "default", "left", "top", false, false, false, true, false ) dxDrawText( h..":"..m, sX * 0.8550, sY * 0.0325, sX * 0.9502, sY * 0.1067, tocolor(255, 255, 255, 255), 4.00, "default", "left", "top", false, false, false, true, false ) beingDrawn = true end addEvent( "renderClock", true ) addEventHandler( "renderClock", root, function ( ) addEventHandler( "onClientRender", root, showClock ) end ) addEventHandler( "onPlayerLogin", root, function () showPlayerHudComponent( source, "clock", false ) triggerClientEvent( "renderClock", resourceRoot, source ) end ) addEventHandler( "onResourceStart", root, function () triggerClientEvent( "renderClock", resourceRoot, root ) end ) Whenever the resource is started, or restarted, the clock doesn't display. I'm not exactly sure why. Any help would be appreciated. Thanks.
-
An MTA client for Android? Please... It hurts me to see threads like this.
-
Hi, I haven't scripted in MTA for at least 6 months or so. I'm quite rusty and I'm just getting back into the swing of things. Has there been any big change lately? I heard of OOP got introduced and so on. But, anything major happened that would require me to go back through all my resources and make changes? Thanks.
-
Then we'll add the CRYENGINE to MTA.. "Upgrading the game engine." aka creating a whole new game. No, just no.
-
It still exists, but it won't get enabled by most servers. That right there is the problem.
-
Mini-Missions, CIT, USG, FFS, DayZ ones. There are heaps, you just need to look carefully. Also, is there any specific game mode you're after?
-
People usually never use setGlitchEnabled. And I highly doubt they'd enable fast sprinting anyway.
-
What a shame... I loved being able to sprint with my mousewheel. MTA ruined right there.
-
He is still learning. So, it takes time to become good and make professional looking sites. What is viewed at as ugly, I view as progress.
-
Attempting to upload a new Resource.
Noki replied to Derek's topic in Site/Forum/Discord/Mantis/Wiki related
How big is your resource?
