-
Posts
551 -
Joined
-
Last visited
Everything posted by AGENT_STEELMEAT
-
It's not going to do anything, thats just a basic way to request the settings. You need to adapt it for your needs.
-
UNTESTED, but: --client --'theSetting' is the name of the setting you want to retrieve (as a string) function clientGet(theSetting) triggerServerEvent("onClientRequestSettings", getLocalPlayer(), theSetting) end --server function sendSettings(theSetting) value = get(theSetting) if value then triggerClientEvent(source, "receiveSettings", source, value) else triggerClientEvent(source, "receiveSettings", source, false) end addEventHandler("onClientRequestSettings", getRootElement(), sendSettings) --the client requests the setting, then the server sends it back, but it needs a place to go. thats up to you.
-
If you all are still lookin for help, I might be able to help out a bit on the side, but not on a full-time basis. Let me know if interested.
-
Ain't much else it could be, R*'s MP dosent have the chatbox there, while IVMP dosen't have any weapons sync and the playernames are always in yellow, rather than orange (and, the video was released before there was smooth vehicle sync).
-
Rather than the general "wait and see" stuff that frustrates everyone, how about a 15-second clip of the status of MTA : IV? Just something to give us hope, beacuse IVMP makes me wanna punch a dolphin in a blowhole.
-
It's better to destroy the GUI when not in use, rather than show/hide it constantly. Just sayin'
-
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() unbindKey("t") unbindKey("y") end ) Not tested, might have a typo or two.
-
If you use my safezones resource (or any other resource that calls cancelEvent() when a player takes damage, the anticheat will kick the player. The only way around this is to set up a no-zombie-spawn area (in slothman's resource) and map some barriers around said area (so they can't walk in). That, are I suppose I could mod my resource to destroy any peds that walk into a safezone with "zombie" in their element data (right?).
-
Hey, I'm having trouble getting onClientGUIDoubleClick to trigger. When a user double clicks a row in the gridlist (taxiGridList), it should output the ID number (column 1) to the chatbox (as a test). It's not doing anything atm. Any ideas? http://pyropaste.com/Q3a25c11V
-
Notepad++, or the unofficial MTA script editor.
-
[REL] SafeZones |v.4 added and works!|
AGENT_STEELMEAT replied to AGENT_STEELMEAT's topic in Resources
Excellent idea, but sounds a bit complicated. I'll give it a shot. -
[REL] SafeZones |v.4 added and works!|
AGENT_STEELMEAT replied to AGENT_STEELMEAT's topic in Resources
v4 of this resource adds the important feature of adding multiple safezones. Simply edit the table in the server-side script with the syntax provided in the file. Also, I've fixed the vehicle damage prevention code (stupid mistake). Special thanks goes out to all the people on #mta.scripting and the MTA scripting forums for all the help. -
I want to read all the info from a table, and create the zones accordingly to allow for multiple zones. So far, it seems as if it is all being read, but nothing is happening. No errors, but no zones. Any ideas? --{x, y, width, height, red, green, blue, alpha, name, id} local zones = { {1684, -2008, 200, 200, 0, 255, 0, 0, "LSspawn", 1}, {0, 0, 200, 200, 0, 255, 0, 0, "test", 2} } function buildSafeZones() for theKey, theZone in ipairs(zones) do local x = zones[1] local y = zones[2] local width = zones[3] local height = zones[4] local red = zones[5] local green = zones[6] local blue = zones[7] local alpha = zones[8] local name = zones[9] local id = zones[10] colShape[id] = createColRectangle ( x, y, width, height ) radarArea[id] = createRadarArea (x, y, width, height, red, green, blue, alpha) setElementData(colShape[id],"type","safezone") setElementData(radarArea[id],"type","safezone") end end function cancelVehicleDamage() cancelEvent() end function greenzoneEnter ( hitElement, matchingDimension ) if getElementType( hitElement ) == "player" then if getElementData(source,"type") == "safezone" then --hidden to prevent piracy end end end addEventHandler ( "onColShapeHit", getRootElement(), greenzoneEnter ) function greenzoneExit ( hitElement, matchingDimension ) if getElementType( hitElement ) == "player" then if getElementData(source,"type") == "safezone" then --hidden to prevent piracy end end end addEventHandler ( "onColShapeLeave", getRootElement(), greenzoneExit )
-
Fail. I blame sleep deprivation. EDIT It's reading the table, but not creating the zones. I think I need to change stuff related to event handlers and such, but I'm not sure how. Anyone want to help me out on this? I'm confused >.<
-
Umm, there aren't really any strings there, and I added the tonumber() operator to try and fix the problem.
-
Sorry, I already fixed the issue. I went through all the resource's scripts and balanced the showCursor and setGuiInputEnabled lines. Thanks for the help anyway!
-
Hey all, I have a simple function that will create a colShape and a radarArea from some definitions in a table. I've tried the code below, but get the following error: [22:44:34] WARNING: Bad argument @ 'createColPolygon' (string-defined function) [22:44:34] WARNING: Bad argument @ 'createRadarArea' (string-defined function) [22:44:34] WARNING: Bad argument @ 'addEventHandler' (string-defined function) [22:44:34] WARNING: Bad argument @ 'addEventHandler' (string-defined function) --{x, y, width, height, red, green, blue, alpha} local zones = { {1684, -2008, 200, 200, 0, 255, 0, 0}, {0, 0, 200, 200, 0, 255, 0, 0}} function buildSafeZones() for theKey, theZone in ipairs(zones) do local x = tonumber(zones[1]) local y = tonumber(zones[2]) local width = tonumber(zones[3]) local height = tonumber(zones[4]) local red = tonumber(zones[5]) local green = tonumber(zones[6]) local blue = tonumber(zones[7]) local alpha = tonumber(zones[8]) createColRectangle ( X, Y, Width, Height ) createRadarArea (X, Y, Width, Height, R, G, B, A) end end tysm once again.
-
Did not work. Oddly enough, I tried on a different computer and the GUI hides just fine. This is confusing.
-
I have a client-side script that brings up a GUI to select a spawn point and show a MOTD. After that player clicks a button, the server spawns the player, then triggers the client event to clean up the GUI and such. Everything is working other that the GUI refusing to hide. Any ideas? function initiateSpawn() --after player login , this is called addEventHandler("onClientRender", getRootElement(), spawnTitle) --add the MOTD createTeleportWindow() -- add the teleport menu end addEvent("startSpawn", true) -- event that is called by the login addEventHandler("startSpawn", getLocalPlayer(), initiateSpawn) function createTeleportWindow() -- create the spawn menu selectMenu = guiCreateWindow(0, 0.75, 1, 0.25, "Select a City to start!", true) buttonLS = guiCreateButton(0.125, 0.25, 0.25, 0.5, "Los Santos", true, selectMenu) buttonSF = guiCreateButton(0.375, 0.25, 0.25, 0.5, "San Fierro", true, selectMenu) buttonLV = guiCreateButton(0.625, 0.25, 0.25, 0.5, "Las Venturas", true, selectMenu) addEventHandler("onClientGUIClick", root, handleSpawn) showCursor(true) end function handleSpawn(button,state) --handler that is called by the spawn menu if button == "left" and state == "up" then if source == buttonLS then removeEventHandler("onClientRender", getRootElement(), spawnTitle) guiSetVisible(selectMenu, false) triggerServerEvent( "spawnMe", getLocalPlayer(), 1) elseif source == buttonSF then removeEventHandler("onClientRender", getRootElement(), spawnTitle) guiSetVisible(selectMenu, false) triggerServerEvent( "spawnMe", getLocalPlayer(), 2) elseif source == buttonLV then removeEventHandler("onClientRender", getRootElement(), spawnTitle) guiSetVisible(selectMenu, false) triggerServerEvent( "spawnMe", getLocalPlayer(), 3) end end end function spawnTitle() -- a MOTD using dxDraw (this works fine), based on wiki example local screenWidth, screenHeight = guiGetScreenSize() local MOTDText = [[ Welcome to ------! Latest news: - New GUIs are complete and look a lot nicer than the old ones. - Fixed the webadmin stuff for easy administration (by me -- s:P --> ). New features will be coming as I have time to add them. Meanwhile, I have decided to enable the freeroam GUI for you convenience. Remember that this is a TEMPORARY luxury! Thank you all for your continued patience while we continue development. ------ ]] local x,y = guiGetScreenSize() -- Get players resolution. dxDrawText( "Read the MOTD, or select a city to spawn in!", screenWidth/10, screenHeight/10, screenWidth, screenHeight, tocolor ( 0, 255, 255, 255 ), 1.5, "pricedown" ) dxDrawRectangle ( x/4, y/4, screenWidth/2, screenHeight/2, tocolor ( 0, 0, 0, 175 ) ) -- Create our black transparent MOTD background Rectangle. dxDrawText ( "Message of the Day:", x/3.5, y/3.6, x, y, tocolor ( 255, 255, 255, 255 ), 1, "bankgothic" ) -- Create Welcome title. dxDrawLine ( x/3.59, y/3.275, x/1.348, y/3.275, tocolor ( 0, 0, 255, 255 ), 2 ) -- Create underline shadow. dxDrawText ( MOTDText, x/3.6, y/3, x, y, tocolor ( 255, 255, 255, 255 ), 1, "clear" ) end function startNormalPlay() showPlayerHudComponent("ammo", true) showPlayerHudComponent("area_name", true) showPlayerHudComponent("armour", true) showPlayerHudComponent("breath", true) showPlayerHudComponent("clock", true) showPlayerHudComponent("health", true) showPlayerHudComponent("money", true) showPlayerHudComponent("radar", true) showPlayerHudComponent("vehicle_name", true) showPlayerHudComponent("weapon", true) setCameraTarget(getLocalPlayer()) showChat(true) showCursor ( false ) guiSetVisible(selectMenu, false) outputChatBox("test") end addEvent("readyToPlay", true) addEventHandler("readyToPlay", getRootElement(), startNormalPlay)
-
So, you want to load the .col and .dff, then play an animation? I'm having trouble understanding you.
-
Looks like I'm a bit late, but I do know one possible issue with newer setups. When I built my newest machine, I was able to run GTA IV at 60+ FPS on all high settings, yet MTA would run at about 15. There seems to be an issue were sometimes the CPU doesn't come out of idle mode and won't "hit the gas" to run MTA at a decent framerate. I solved this by installing a windows sidebar widget were I can change my windows power profile on-the-fly, so I can set it to "high" for gaming and "low" for idling. I suggest you either find a widget like this, or you can change your settings in "Power Managment" in the Control Panel.
-
its in the same sub-folder with all the other files, but not in the actual resources directory (the meta is correct, im sure)
-
Yes,
-
bad argument @ 'xmlNodeGetChildren' and bad argument #1 to "pairs" (expected table, got boolean)
-
I've tried that.
