-
Posts
230 -
Joined
-
Last visited
Everything posted by Banex
-
function getElementSpeed(theElement, unit) -- Check arguments for errors assert(isElement(theElement), "Bad argument 1 @ getElementSpeed (element expected, got " .. type(theElement) .. ")") assert(getElementType(theElement) == "player" or getElementType(theElement) == "ped" or getElementType(theElement) == "object" or getElementType(theElement) == "vehicle", "Invalid element type @ getElementSpeed (player/ped/object/vehicle expected, got " .. getElementType(theElement) .. ")") assert((unit == nil or type(unit) == "string" or type(unit) == "number") and (unit == nil or (tonumber(unit) and (tonumber(unit) == 0 or tonumber(unit) == 1 or tonumber(unit) == 2)) or unit == "m/s" or unit == "km/h" or unit == "mph"), "Bad argument 2 @ getElementSpeed (invalid speed unit)") -- Default to m/s if no unit specified and 'ignore' argument type if the string contains a number unit = unit == nil and 0 or ((not tonumber(unit)) and unit or tonumber(unit)) -- Setup our multiplier to convert the velocity to the specified unit local mult = (unit == 0 or unit == "m/s") and 50 or ((unit == 1 or unit == "km/h") and 180 or 111.84681456) -- Return the speed by calculating the length of the velocity vector, after converting the velocity to the specified unit return (Vector3(getElementVelocity(theElement)) * mult).length end for id, vehicle in ipairs(getElementsByType("vehicle")) do if getElementSpeed(vehicle, 1) > 120 then --[...] end end
-
addEvent("supersoldier",true) addEventHandler("supersoldier",root, function() local nLevel = tonumber( getElementData( source, "level" ) ) or 0 if ( nLevel < 20 ) then setElementModel( source, 285 ) else outputChatBox('You dont have the requirements of the supersoldier!', source, 255, 0, 0 ) end end)
-
seems that google translator failed again ... i think you should have some evidence that the resource is stolen
-
@#RooTs i do not understand why you laugh at people and call them nobs, while you can not scripting anything. @Shaman123 good work, but the design could be better.
-
xmlSaveFile
-
dxCreateTexture dxDrawMaterialLine3D
-
Boa Sorte!
-
Original: https://community.multitheftauto.com/ind ... ails&id=54 Sloten: https://community.multitheftauto.com/ind ... s&id=10696
-
Yes, these are the colors
-
https://wiki.multitheftauto.com/wiki/Sc ... troduction
-
an example of how you can do this: function getHealthColor() local healthRelative = health*rate/100 local health = getElementHealth(localPlayer) local rate = 500/getPedStat(localPlayer,24) local v = health*rate return (100-v)*2.55, (v*2.55), 0 end
-
https://wiki.multitheftauto.com/wiki/UtfLen
-
This began to happen to me and some of my friends after I restarted my server. After start some resources, when I do the same I got this error. After persists, opening the MTA and start resources, I can not join the server again. I believe that it is not for lack of video memory, because I was checking out at the time, and I had 1263 MB of video memory available
-
Error info: Version = 1.4-release-6977.0.000 Time = Wed Dec 24 14:49:55 2014 Module = C:\Windows\system32\KERNELBASE.dll Code = 0xE06D7363 Offset = 0x0000812F EAX=0022F3F0 EBX=0022F560 ECX=00000003 EDX=00000000 ESI=73CBC164 EDI=00000000 EBP=0022F440 ESP=0022F3F0 EIP=75B4812F FLG=00200216 CS=001B DS=0023 SS=0023 ES=0023 FS=003B GS=0000 MTADiag http://pastebin.mtasa.com/147840427
-
i already gave you the example of how to create the table, now it's up to you to work a bit and create the two tables that you want. Remember, we're not your slaves, we are here only to help correct their mistakes, or clarify your doubts. I already gave you an example of how to create a table, if you can not create several tables with this example, you probably should not be doing this sort of scripts yet. Remember to always search in the wiki for documentation! Or if you want someone create 54868741 tables and put them in your code, I think you should look for a paid scripter.
-
i do not understand your english very well, what you mean by "perfeiramente"? ok, if you say that my code is not working, try this way: local Positions2 = { { X=-2237.92749, Y=2328.21558, Z=6.4 }, { X=2577.23926, Y=-1119.34814, Z=80.5 } } for i,v in pairs(Positions2) do createMarker(v.X,v.Y,v.Z,"cylinder",1.5,230,0,85,225) end
-
i'm sure this will work well, but tell me if you have errors in debugscript
-
local Positions2 = { { -2237.92749, 2328.21558, 6.4 }, { 2577.23926, -1119.34814, 80.5 }, { 1532.44519, -1350.25830, 328 }, } --------------------------------- local Positions1 = { { -2227.85522, 2326.74170, 7.54688, 0, 0, 0 }, { 2592.02979, -1123.67065, 80.94149, 0, 0, 180 }, { 1544.21667, -1353.34680, 329.47424, 0, 0, 0 }, } local vehicleID = 487 -- maverick for k,v in ipairs (Positions2) do createBlip ( v[1], v[2], v[3], 5 ) maker = createMarker( v[1],v[2],v[3], "cylinder",1.5,230,0,85,225) end local Helli = { } function teste(hitElement) if ( isPedInVehicle ( hitElement ) ) then else if (source == maker) then if isElement ( Helli [ hitElement ] ) then destroyElement ( Helli [ hitElement ] ) end for k,v in ipairs (Positions1) do Helli [ hitElement ] = createVehicle ( vehicleID, v[1], v[2], v[3], v[4],v[5],v[6] ) end warpPlayerIntoVehicle ( hitElement, Helli [ hitElement ] ) end end end addEventHandler ("onMarkerHit",root,teste) addEventHandler ( "onVehicleExplode", resourceRoot, function ( ) destroyElement ( source ) end ) addEventHandler ( "onPlayerQuit", root, function ( ) if ( isElement ( Helli [ source ] ) ) then destroyElement ( Helli [ source ] ) end Helli [ source ] = nil end )
-
just decrease the size of ColCircle
-
@IIYAMA you're right, I do not really know where I was thinking that day. This should work: server side local Col = createColCuboid(1290.5771,2100,11.0156, 300, 100, 30) local pArea1 = createRadarArea( 1290.5771,2100,200, 150, 32, 32,32) local inColShape = { } function shapeHit( thePlayer ) givePlayerMoney (thePlayer , 1000 ) end addEventHandler('onColShapeHit', Col,shapeHit) function onWasted() if isElementWithinColShape( source, Col ) then inColShape[source] = true else inColShape[source] = false end end addEventHandler ( "onPlayerWasted", getRootElement(), onWasted ) function onSpawn() if inColShape[source] then setElementPosition(source, 1290.5771,2100,11.0156) end end addEventHandler ( "onPlayerSpawn", getRootElement(), onSpawn )
-
I did a test, and now I understand if I do not give any value to function then it will work as the pair function. Thanks to all
-
I do not understand how to use the variable, the two functions have the same variable, so if I use the variable of isPlayerMuted function, player.muted() without putting any argument as to whether the player is muted or not, I'll have a warning message in debugscript not to use the obligatory argument setPlayerMuted function?