-
Posts
128 -
Joined
-
Last visited
Everything posted by ManeXi
-
What does comparate this symbol: ~=
-
with fast run I guess you mean super sprint you can get IG write /start runcode and after that write /srun setGlitchEnabled ( "fastsprint", true ) If you want just active it via script write setGlitchEnabled ( "fastsprint", true ) In any serverside script
-
These days I have been taking a look to script made by experienced scripters of MTA and one of main differences I see between them and me it's that they are continiously using "return", can anyone explain me what does and what's the point of using it? for example in this useful function: function getPedMaxHealth(ped) assert(isElement(ped) and (getElementType(ped) == "ped" or getElementType(ped) == "player"), "Bad argument @ 'getPedMaxHealth' [Expected ped/player at argument 1, got " .. tostring(ped) .. "]") local stat = getPedStat(ped, 24) local maxhealth = 100 + (stat - 569) / 4.31 return math.max(1, maxhealth) end
-
Thanks alot now I have fixed it
-
When a player is on the login panel he is allowed to do /showchat or /showhud or opening F8 and writting "say (text)" how may I disable this commands on the login panel?
-
Yes, he is retired for ever, he won't be back, he had really bad experience at old GTi. It's not to be soothsayer, but It's practically impossible getting united GTi players again, we had really hard and deep problems with each other cause we had really different opinions about how game should be; Drug System (yes/no), Super Sprint (yes/no), Through wall shooting (yes/no) etc... Basically the half of the server (very pro players imo, exploiters for others) was always raged with the other half (the "non exploiters") in every stupid sh!t, even with FPS limiter :fp:
-
no, Felipe it shows when I stop aiming it, thanks alot is working perfectly
-
Tried this and nothing. function targetingActivated ( target, prevTarget ) if ( target ) then if getElementType(target) == "player" then outputChatBox(getElementType(target),255,255,255) setPlayerNametagShowing ( target, false ) target = prevTarget end elseif not (target) then outputChatBox("Heil Hitler!",0,255,0) setPlayerNametagShowing ( prevTarget, true ) end end addEventHandler ( "onClientPlayerTarget", getRootElement(), targetingActivated )
-
Well I want to hide the name of a player when localPlayer is aiming it, then restore it when it stops aiming it. function targetingActivated ( target ) if ( target ) then if getElementType(target) == "player" then outputChatBox(getElementType(target),255,255,255) setPlayerNametagShowing ( target, false ) end elseif not (target) then outputChatBox("Heil Hitler!",0,255,0) setPlayerNametagShowing ( target, true ) end end addEventHandler ( "onClientPlayerTarget", getRootElement(), targetingActivated ) For obvious reasons when I stop aiming the enemy the "target" var becomes into false, so I can't hide a name of a undefinied player. My question is how may I save the previous target?
-
Seems that setting it as string fixed it, thanks alot <3
-
http://i.imgur.com/X59pOcm.jpg
-
An example right now would be: Kills = 232 Deaths = 395 result is: 0.587341 so rounded should be 0.59 but instead of it it puts 0.5899997
-
I'm rounding player's KDR function setkdr ( player ) local dea = getElementData(player,"Deaths") local kil = getElementData(player,"Kills") local kdr = kil/dea setElementData(player,"K/D Ratio", math.round(kdr, 2)) local acc = getPlayerAccount(player) if not isGuestAccount(acc) then setAccountData(acc,"K/D Ratio", math.round(kdr, 2)) end end
-
I use a function that should work rightly on rounding numbers, but for some reason it rounds the numbers wrongly, instead of putting 0.56 it puts 0.569999999999999999999999 or 0.56000000000000000000000000001 function math.round(number, decimals, method) decimals = decimals or 0 local factor = 10 ^ decimals if (method == "ceil" or method == "floor") then return math[method](number * factor) / factor else return tonumber(("%."..decimals.."f"):format(number)) end end The number is displayed in the scoreboard.
-
No way man, I want to let players having their aim sign.
-
Can't report bugs at mantis
ManeXi replied to ManeXi's topic in Site/Forum/Discord/Mantis/Wiki related
Worked, thanks. -
Fixed, thanks.
-
I made a panel which opens when you hit a marker, the problem I've got is that if anyone hits it opens to everyone on the server. function ammuEnter() guiSetVisible(ammu.window[1], true) showCursor(true, false) toggleAllControls(false, false, true) toggleControl("fire", false) toggleControl("aim_weapon", false) end addEventHandler("onClientMarkerHit", resourceRoot, ammuEnter)
-
Anyone knows if the client's aim sign is a "defined" element on MTA?
-
For some reason I can't report my own bugs, http://i.imgur.com/CYbURPj.jpg I reported a bug before: https://bugs.mtasa.com/view.php?id=9004 I don't know why I can't now.
-
How may I force a player displaying aim sign("siteM16.png") even if he is not aiming weapon?
-
Now it's working but I don't understand very well how the command "getdist" detects the next 2 players.
-
Instead of making a list of exceptions(Grenade, RPG...) I made a list of all the weapons I want to be their damage canceled, now is working, thanks alot, this can be set as solved.
-
This is the code now: function getPlayerFromPartialName(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end function distCmd( cmd, pla1x, pla1y, pla1z, pla2x, pla2y, pla2z) if cmd == "getdist" then player1 = tostring(getPlayerFromName("")) player2 = tostring(getPlayerFromName("")) pla3 = getPlayerFromPartialName(player1) pla4 = getPlayerFromPartialName(player2) pla1x, pla1y, pla1z = getElementPosition ( pla3 ) pla2x, pla2y, pla2z = getElementPosition ( pla4 ) if pla1x then outputChatBox ( "The distance between pla1 and pla2 is "..tostring(getDistanceBetweenPoints3D ( pla1x, pla1y, pla1z, pla2x, pla2y, pla2z )) ) else outputChatBox("Another Error", player) end else outputChatBox("Error", player) end end addCommandHandler("getdist", distCmd) Idk, if I did it rightly or not but the code is not working
-
I want to get distance between two players but the code I made it doesn't work very well... My objective is making a code where I write "/getdist (Player A name) (Player B name)" and getting distance between player A and B in the chatbox function distCmd( cmd, pla1x, pla1y, pla1z, pla2x, pla2y, pla2z) if cmd == "getdist" then player1 = tostring(getPlayerFromName("")) player2 = tostring(getPlayerFromName("")) pla3 = getPlayerFromName(player1) pla4 = getPlayerFromName(player2) pla1x, pla1y, pla1z = getElementPosition ( pla3 ) pla2x, pla2y, pla2z = getElementPosition ( pla4 ) if pla1x then outputChatBox ( "The distance between pla1 and pla2 is "..tostring(getDistanceBetweenPoints3D ( pla1x, pla1y, pla1z, pla2x, pla2y, pla2z )) ) else outputChatBox("Another Error", player) end else outputChatBox("Error", player) end end addCommandHandler("getdist", distCmd)
