-
Posts
925 -
Joined
-
Last visited
Everything posted by norby89
-
uhrm shouldn't that be.. function addRednessOnDamage(pID,loss) fadeCamera(pID, false, 1.0, 255, 0, 0) local tmpLoss = tonumber(loss) [color=#FF0000] local tmpNumber = nil[/color] [color=#FF0000] if 0.0 < tmpLoss and tmpLoss < 5.0 then[/color] tmpNumber = 150 [color=#FF0000] elseif 5.0 < tmpLoss and tmpLoss < 15.0 then[/color] tmpNumber = 250 [color=#FF0000] elseif 15.0 < tmpLoss and tmpLoss < 40.0 then[/color] tmpNumber = 450 elseif 40.0 < tmpLoss then tmpNumber = 700 else tmpNumber = 150 end setTimer(fadeCamera, tmpNumber, 1, pID, true, 0.5) end also when you have local variables inside an 'if' they will be lost once it goes out
-
for infinite calls use 0 in setTimer, and yes you can use colors function delayedChat ( text, showTo, r, g, b ) outputChatBox ( "Delayed text: " .. text, showTo, r, g, b ) end setTimer ( delayedChat, 1000, 0, "Hello, World!", getRootElement(), 255, 0, 0 )
-
I'm pretty sure it works as I tested it myself, are you sure you were at the right bombshop? it should be near 1850 -1850 14
-
you can find it here viewtopic.php?f=69&t=21248
-
scriptb is for deathmessages seen on the right, while the other one is the UT script
-
joins #mta!
-
you could also use setElementVelocity to get the same effect, or why not, make the vehicle jump even higher
-
try this one quest viewtopic.php?f=69&t=21248
-
the ones on the main page are a bit outdated, you can download the up to date versions here, in case you're wondering where's #4 and #9, well one is hay which is included in dp1 and the other was take down from the site PS) I gave them a quick try, they seem to be working though I can't guarantee that they work 100% fine, if you spot any errors please post them here
-
first of all I'd like to tell ya, great job! it certainly stops your headache when you can't run the game in window mode. I'd also have a few suggestions: you disable MTA controls (toggleAllControls) when the editor is showing because pressing certain keys, like 't' for chatbox makes typing really hard bind the editor to a key for easier access (shouldn't be a problem) and one thing that would be really neat, line numbers, would be useful when you're debugging and you're trying to find the bad argument at line 1069 P: keep up the good work! EDIT: regarding the first 2 suggestions, if somebody wants to update their script, just replace this function in the ScriptEditor.lua file: local createEditor = function() if not(editorWindow) then --Constructor toggleAllControls ( false, false, true ) -- or toggleAllControls ( false, true, true ), I don't think it makes any difference though editorWindow = guiCreateWindow(0.2, 0.2, HEIGHT, WIDTH, "In-Game Script Editor", true) guiCreateLabel(0.05, 0.06, 1, 1, "Script Path:", true, editorWindow) editPath = guiCreateEdit(0.04, 0.1, 0.6, 0.08, INITIAL_DIR, true, editorWindow) local openBtn = guiCreateButton(0.75, 0.1, 0.2, 0.1, "Load Script", true, editorWindow) local dialogBtn = guiCreateButton(0.65, 0.1, 0.1, 0.1, "...", true, editorWindow) scriptBox = guiCreateMemo(0.02, 0.26, 0.96, 0.55, "", true, editorWindow) local reloadBtn = guiCreateButton(0.75, 0.88, 0.2, 0.1, "Save & Reload", true, editorWindow) local saveBtn = guiCreateButton(0.50, 0.88, 0.2, 0.1, "Save Script", true, editorWindow) addEventHandler("onClientGUIClick", reloadBtn, reloadScript) addEventHandler("onClientGUIClick", saveBtn, saveScript) addEventHandler("onClientGUIClick", openBtn, openScript) addEventHandler("onClientGUIClick", dialogBtn, toogleDialog) bindKey("F1", "down", scriptInput) createDialog() showCursor(true) else --Show/Hide toggleAllControls ( true ) showCursor(not(guiGetVisible(editorWindow))) guiSetVisible(editorWindow, not(guiGetVisible(editorWindow))) guiSetVisible(dialog.window, false) end end bound the f4 key to show/hide the editor: bindKey ( "f4", "down", createEditor )
-
you can ignore that error, or if you want it to disappear use this updated script: -- :: MTA Scripting Tutorial I - User selectable warp points -- [url=http://www.mtasa.com/tutorial1.html]http://www.mtasa.com/tutorial1.html[/url] -- -- (C) The MTA Team, 2007 -- [url=http://www.mtasa.com]http://www.mtasa.com[/url] function Script_onMapLoad () for index, player in ipairs ( getElementsByType ( "player" ) ) do --For each player in the server, bindKey ( player, "i", "down", modeIO ) --Bind the player's "i" key to the function "modeIO" when the key is pressed end end addEventHandler ( "onMapLoad", getRootElement(), Script_onMapLoad ) --This event tells what happens when the map loads. function Script_onPlayerJoin () bindKey ( source, "i", "down", modeIO ) --Bind the player's "i" key to the function "modeIO" when the key is pressed end addEventHandler ( "onPlayerJoin", getRootElement(), Script_onPlayerJoin ) --This event tells what happens when a player joins. function modeIO ( source, key, keyState ) --This function toggles the cursor on/off if isCursorShowing ( source ) then --If cursor was already showing, showCursor ( source, false ) --then hide it; else --if it wasn't showing, showCursor ( source, true ) --then show it. end end function Script_onPlayerClick ( key, keyState, element, x, y, z ) if keyState == "up" then return end --Don't do anything if he's releasing the button. if key == "left" then --If it's left-click: local theMarker = getElementData ( source, "teleport" ) if theMarker then destroyElement ( getElementData ( source, "teleport" ) ) --Destroy his teleport point, if any end theMarker = createMarker ( x, y, z, "cylinder", 2, 0, 255, 0, 50 ) --Create a cylindric marker setElementData ( theMarker, "type", "teleport" ) --Mark the cylinder as a teleport setElementData ( source, "teleport", theMarker ) --Link the creator to the teleport setElementData ( theMarker, "owner", source ) --Link the teleport to its creator elseif key == "right" then --If it's right-click local theMarker = getElementData ( source, "destination" ) if theMarker then destroyElement ( getElementData ( source, "destination" ) ) --Destroy his destination point, if any end theMarker = createMarker ( x, y, z+1, "corona", 1, 0, 255, 255, 50 ) --Create a glowing corona setElementData ( theMarker, "type", "destination" ) --Mark the corona as a destination point setElementData ( source, "destination", theMarker ) --Link the creator to the teleport setElementData ( theMarker, "owner", source ) --Link the teleport to its creator elseif key == "middle" then --If it's middle-click setElementPosition ( source, x, y, z+1 ) --Teleport the player to where he clicked. end end addEventHandler ( "onPlayerClick", getRootElement(), Script_onPlayerClick ) --This event tells what happens when a player clicks on the screen with the cursor. function Script_onMarkerHit ( player ) if getElementData ( source, "type" ) == "teleport" then --If the marker is a teleport point, local owner = getElementData ( source, "owner" ) --Get the owner linked to the teleport point. local destination = getElementData ( owner, "destination" ) --Get the destination point linked to the owner. if destination then --If destination point exists, local x, y, z = getElementPosition ( destination ) --Get the destination point's position. setElementPosition ( player, x, y, z ) --Put the player there. end end end addEventHandler ( "onMarkerHit", getRootElement(), Script_onMarkerHit ) --This event tells what happens if a player steps inside a marker. function Script_onPlayerQuit ( reason ) destroyElement ( getElementData ( source, "teleport" ) ) --Destroy his teleport point, if any destroyElement ( getElementData ( source, "destination" ) ) --Destroy his destination point, if any end addEventHandler ( "onPlayerQuit", getRootElement(), Script_onPlayerQuit ) --This event tells what happens if a player disconnects.
-
in this release you can't, maybe in the future
-
Are u sure? i think it's: irc.multitheftauto.com & channel #mta the servers are linked, so both would work
-
you should stop broph when playing any gamemode, to do that type '/stop broph'
-
^
-
it's not that easy as you may think, MTA has changed a lot since MTA:Race, it has become better, more flexible but you can't just take the old Race and put it in DM 1 step backward? I see it as 3 steps forward it uses a better platform, bugs can get fixed faster and you can get help too! you shouldn't look at Race in DM as a finished product (yet), MTA:Race has gone through a lot of testing that's why it's so stable, the great thing is that now you can help as well to make the gamemode better, since Race in DM is a script it's much easier to add features or to eliminate bugs, you don't have to wait ages till the team releases a patch or a new version [TFG]Cookie: the idea is you can have your own server, with your own customized version, your own features so you can change it the way you like it, don't like the huge bars? make them smaller, you want races with drivebys? give them guns for now report anything wrong you find, in how Race used to work, what's missing from it, if you got any suggestions or an advice post em here EDIT: the sliding is a MTA bug, hopefully it will be fixed in the next release
-
yep, that's right, for example command/event handlers, setTimers, bindKeys have been changed, you don't pass a string (the function name) anymore but a pointer to the function, also the functions need to be written before the event handlers I noticed another mistake (since MTA now uses a newer version of LUA), you should update your script to make sure it works correctly function Script_onMapLoad () for index, player in ipairs ( getElementsByType ( "player" ) ) do --For each player in the server, bindKey ( player, "i", "down", modeIO ) --Bind the player's "i" key to the function "modeIO" when the key is pressed end end
-
sure -- :: MTA Scripting Tutorial I - User selectable warp points -- [url=http://www.mtasa.com/tutorial1.html]http://www.mtasa.com/tutorial1.html[/url] -- -- (C) The MTA Team, 2007 -- [url=http://www.mtasa.com]http://www.mtasa.com[/url] function Script_onMapLoad () for index, player in getElementsByType ( "player" ) do --For each player in the server, bindKey ( player, "i", "down", modeIO ) --Bind the player's "i" key to the function "modeIO" when the key is pressed end end addEventHandler ( "onMapLoad", getRootElement(), Script_onMapLoad ) --This event tells what happens when the map loads. function Script_onPlayerJoin () bindKey ( source, "i", "down", modeIO ) --Bind the player's "i" key to the function "modeIO" when the key is pressed end addEventHandler ( "onPlayerJoin", getRootElement(), Script_onPlayerJoin ) --This event tells what happens when a player joins. function modeIO ( source, key, keyState ) --This function toggles the cursor on/off if isCursorShowing ( source ) then --If cursor was already showing, showCursor ( source, false ) --then hide it; else --if it wasn't showing, showCursor ( source, true ) --then show it. end end function Script_onPlayerClick ( key, keyState, element, x, y, z ) if keyState == "up" then return end --Don't do anything if he's releasing the button. if key == "left" then --If it's left-click: destroyElement ( getElementData ( source, "teleport" ) ) --Destroy his teleport point, if any local theMarker = createMarker ( x, y, z, "cylinder", 2, 0, 255, 0, 50 ) --Create a cylindric marker setElementData ( theMarker, "type", "teleport" ) --Mark the cylinder as a teleport setElementData ( source, "teleport", theMarker ) --Link the creator to the teleport setElementData ( theMarker, "owner", source ) --Link the teleport to its creator elseif key == "right" then --If it's right-click destroyElement ( getElementData ( source, "destination" ) ) --Destroy his destination point, if any local theMarker = createMarker ( x, y, z+1, "corona", 1, 0, 255, 255, 50 ) --Create a glowing corona setElementData ( theMarker, "type", "destination" ) --Mark the corona as a destination point setElementData ( source, "destination", theMarker ) --Link the creator to the teleport setElementData ( theMarker, "owner", source ) --Link the teleport to its creator elseif key == "middle" then --If it's middle-click setElementPosition ( source, x, y, z+1 ) --Teleport the player to where he clicked. end end addEventHandler ( "onPlayerClick", getRootElement(), Script_onPlayerClick ) --This event tells what happens when a player clicks on the screen with the cursor. function Script_onMarkerHit ( player ) if getElementData ( source, "type" ) == "teleport" then --If the marker is a teleport point, local owner = getElementData ( source, "owner" ) --Get the owner linked to the teleport point. local destination = getElementData ( owner, "destination" ) --Get the destination point linked to the owner. if destination then --If destination point exists, local x, y, z = getElementPosition ( destination ) --Get the destination point's position. setElementPosition ( player, x, y, z ) --Put the player there. end end end addEventHandler ( "onMarkerHit", getRootElement(), Script_onMarkerHit ) --This event tells what happens if a player steps inside a marker. function Script_onPlayerQuit ( reason ) destroyElement ( getElementData ( source, "teleport" ) ) --Destroy his teleport point, if any destroyElement ( getElementData ( source, "destination" ) ) --Destroy his destination point, if any end addEventHandler ( "onPlayerQuit", getRootElement(), Script_onPlayerQuit ) --This event tells what happens if a player disconnects. tell me if it works
-
you can, but it needs a few tweaks here and there
-
thing is the tutorials are a bit outdated
-
uhh Im having a few dumps too Can i send em to you ali?
-
don't know then, I and others seem to have the fps stuck at 47
-
well you can have a resource that gives players an 'ID' and use that to PM, votekick ppl etc