-
Posts
138 -
Joined
-
Last visited
Everything posted by Army@1
-
A. Mom. Q.What you think of The Walking Dead Season 7?
-
The fade in timer probably doesn't let fade out take place. function player_Wasted ( ammo, attacker, weapon, bodypart ) if ( attacker ) then if ( getElementType ( attacker ) == "player" ) then fadeCamera ( attacker, false, 3.0, 200, 230, 230 ) setTimer ( fadeCameraDelayed, 3000, 1, attacker ) end end end addEventHandler ( "onPlayerWasted", getRootElement(), player_Wasted ) function fadeCameraDelayed(player) if (isElement(player)) then fadeCamera(player, true) end end
-
hptimer=false function HP() if(hptimer==false) then setElementData(source, "HP", 100) hptimer=true else outputChatBox("Please wait atleast 15 minutes.", 255, 0, 0) setTimer(function() hptimer=false end, 15*60*1000, 1) end end addEvent("HP", true) addEventHandler("HP", getRootElement(), HP)
-
Players can use it for unfair advantages and server owners may not like it. Ask the owner of the server in which you play.
-
Superb! Forum is dashing now, love the new features. Cheers MTA Team!
- 84 replies
-
- mtasa
- forum stuff
-
(and 5 more)
Tagged with:
-
hahaha, that was funny...
-
Actually, that is a easter egg but by RockStar Games.
-
Where did you get this from? setElementRotation(test, 0, 3.2, 96.7 - getPedCameraRotation(localPlayer)) That looks weird to me. Anyway, try this setElementRotation(test, 180 - getPedCameraRotation(localPlayer), 180 - getPedCameraRotation(localPlayer), 180 - getPedCameraRotation(localPlayer))
-
Haha, good idea. Don't worry, I don't have a server. at least for now
-
Try Using onClientRender for the latter. addEventHandler ( "onClientRender", root, function() z = getPedCameraRotation(localPlayer) ) setElementRotation(test, 0, 0, 360 - z)
-
It probably should. What did it output then?
-
This will round numbers to 10ths. In other words, 0.1, 25.9, 56.2, etc... sx, sy, sz = getElementVelocity (getPedOccupiedVehicle(localPlayer)) speed = round(((sx^2 + sy^2 + sz^2)^(0.5))*180, 1) Or, if you want just integers sx, sy, sz = getElementVelocity (getPedOccupiedVehicle(localPlayer)) speed = round(((sx^2 + sy^2 + sz^2)^(0.5))*180, 0)
-
function round(num, idp) local mult = 10^(idp or 0) return math.floor(num * mult + 0.5) end -- example print(round(5.14542123232, 1)) -- result: 5.1
-
Try replacing this line setElementRotation(test, 0,0, findRotation(x,y,rotX,rotY)) with this setElementRotation(test, 0, 0, 360 - getPedCameraRotation(localPlayer)) --or if the above doesn't work setElementRotation(test, 0, 0, getPedCameraRotation(localPlayer))
-
Add this to your script. function findRotation( x1, y1, x2, y2 ) local t = -math.deg( math.atan2( x2 - x1, y2 - y1 ) ) return t < 0 and t + 360 or t end And findRotation takes positions of elements as arguments.
-
local hijackT = { {1219.830078125, -1424.0595703125, 13.304864883423, 0, 0, 89.361419677734}, {1249.0126953125, -1257.7177734375, 13.140056610107, 0, 0, 273.76425170898}, {1421.8447265625, -1298.923828125, 13.5546875, 0, 0, 178.47839355469}, {1519.55859375, -1464.7626953125, 9.5, 0, 0, 180.64819335938}, {1785.525390625, -1247.564453125, 13.78784942627, 0, 0, 180.88441467285}, {1268.341796875, -900.681640625, 42.8828125, 0, 0, 179.04418945313}, {2716.43359375, -1846.7705078125, 9.527813911438, 0, 0, 157.59301757813}, {1973.1953125, -1222.4453125, 20.0234375, 0, 0, 93.596710205078}, {1683.5693359375, -2248.5478515625, -2.6734189987183, 0, 0, 88.921936035156}, {-2114.8369140625, -2410.1806640625, 31.281492233276, 0, 0, 317.65530395508}, {2379.2939453125, 75.5146484375, 27.221626281738, 0, 0, 271.45159912109}, {-1006.03515625, -643.421875, 32.0078125, 0, 0, 90.174407958984}, {343.966796875, -1810.021484375, 4.4992127418518, 0, 0, 0.94760131835938}, {2792.1806640625, -1429.37890625, 36.09375, 0, 0, 268.15014648438}, } local hijackCar = { {402}, {429}, {415}, {541}, {475}, {557}, {568}, {480}, {587}, {565}, {602}, {451}, {477}, } local hijackDT = { {2790.3515625, -2456.5908203125, 12.633037567139}, {-2535.45703125, -603.28125, 131.562}, {-1947.033203125, 1384.6689453125, 6.1842346191406}, {-309.84765625, 1531.3017578125, 74.359375}, {-1979.05078125, 433.1484375, 24.684421539307}, {2804.23828125, -1429.646484375, 39.05331802368}, {-2245.462890625, 2371.8662109375, 3.996054649353}, {-2088.697265625, -2334.876953125, 29.625}, {-2754.69140625, 374.138671875, 3.339025497436}, {1245.85546875, -2027.7939453125, 58.830238342285}, {-1407.2783203125, -312.3896484375, 12.992641448975}, } function startHijackTable() if (exports.CORteams:isPlayerInTeams(source, "Staff")) then random = math.random(#hijackT) model = math.random (#hijackCar) x, y, z, rx, ry, rz = hijackT[random][1], hijackT[random][2], hijackT[random][3], hijackT[random][4], hijackT[random][5], hijackT[random][6] hijackStart = createVehicle ( hijackCar[model][1], x,y,z,rx,ry,rz ) setVehicleDamageProof ( hijackStart, true ) x1, y1, z1 = getElementPosition ( hijackStart ) hijackBlip1 = createBlipAttachedTo (hijackStart, 53) setBlipVisibleDistance ( hijackBlip1, 12000000 ) exports.CORtexts:output ( "Hijack has been requested and placed on your map get it first!", root, 255, 0, 0, true ) end end setTimer(startHijackTable, 50, 1)
-
Good job, Dealman, thanks. I am messing with it and trying to separate --[[ ]] comment with [[ ]] message string but no luck. Do you have any idea?
-
You can simply do bindKey(hitElement, "f", "down", funcName, vehicle) by adding an argument, for vehicle, in funcName. if I understand you correctly.
-
And while we are taking about bone attachments... take a look at this topic: https://forum.multitheftauto.com/viewtopic.php?f=108&t=44422
-
Ah, thanks for clarification. On topic: Don't take this wrong but this is a tutorial but not a beginner one. Suggestions: Explain what datatypes are and how many are there. Give example codes of declaring and using datatypes. Comment and explain things in each line of example code. I do appreciate your intention though.
-
My bad, I didn't knew there were actually two timers... local tazerTimers = {} addEventHandler("onPlayerDamage", getRootElement(), function (attacker, weapon, _, loss) if (isElement(attacker) and getElementType(attacker) == "player" and weapon and attacker ~= source) then if ( not getPlayerTeam(attacker) ) then return end if ( getPlayerWantedLevel(source) == 0 ) then return end if ( getPlayerWantedLevel(source) >= 1 ) then if (weapon and weapon == 23) then if isTimer(tazerTimers[source]) then killTimer(tazerTimers[source]) tazerTimers[source] = nil end if (getPlayerTeam(attacker) and lawTeam[getTeamName(getPlayerTeam(attacker))]) then toggleAllControls ( source, false ) setPedAnimation(source, "ped", "KO_shot_stom") triggerClientEvent(root,"onStartTaserSound",root,attacker) tazerTimers[source] = setTimer(function(player) if ( isElement ( player ) ) then if isTimer(tazerTimers[player]) then killTimer(tazerTimers[player]) tazerTimers[player] = nil end setPedAnimation(player) toggleAllControls(player,true) end end,2500,1,source) triggerClientEvent (root, "destroySound", root) end end end end end)
-
Probably because you were not removing the previous table's timer's key. local tazerTimers = {} addEventHandler("onPlayerDamage", getRootElement(), function (attacker, weapon, _, loss) if (isElement(attacker) and getElementType(attacker) == "player" and weapon and attacker ~= source) then if ( not getPlayerTeam(attacker) ) then return end if ( getPlayerWantedLevel(source) == 0 ) then return end if ( getPlayerWantedLevel(source) >= 1 ) then if (weapon and weapon == 23) then if isTimer(tazerTimers[source]) then killTimer(tazerTimers[source]) end if (getPlayerTeam(attacker) and lawTeam[getTeamName(getPlayerTeam(attacker))]) then toggleAllControls ( source, false ) setPedAnimation(source, "ped", "KO_shot_stom") triggerClientEvent(root,"onStartTaserSound",root,attacker) tazerTimers[source] = setTimer(function(player) if ( isElement ( player ) ) then if isTimer(tazerTimers[player]) then killTimer(tazerTimers[player]) tazerTimers[player] = nil end setPedAnimation(player) toggleAllControls(player,true) end end,2500,1,source) triggerClientEvent (root, "destroySound", root) end end end end end)
-
Ah, I have already guessed that but certainty will help further in scripting. Haha, we learned something today.