-
Posts
1,105 -
Joined
-
Last visited
Everything posted by Aibo
-
isGuestAccount и проверяет.
-
message is shown only to the player you push.
-
nope, because right now id's are values, not keys, like notAllowed[1] = 509. local notAllowed = { [509] = true, [481] = true } -- etc if notAllowed[getElementModel(hitElement)] then outputChatBox ( "That vehicle is not allowed!" ) end
-
tocolor() does not return hex color value as i recall. it's decimal with alpha.
-
eh function rgb2hex(r,g,b) return string.format("#%02X%02X%02X", r,g,b) end
-
function hex2rgb(hex) hex = hex:gsub("#","") return tonumber("0x"..hex:sub(1,2)), tonumber("0x"..hex:sub(3,4)), tonumber("0x"..hex:sub(5,6)) end EDIT: https://wiki.multitheftauto.com/wiki/GetColorFromString
-
приаттачить машину к трейлеру, а самому трейлеру setElementAlpha на 0 ой, «простыми тачками».
-
ну и откуда ты знаешь, что именно нужный блип в этой переменной? с 1 блипом это работает без глюков. больше 1-го — начинается путаница и bad argument. может я тупой, но мне не нравится эта система, когда функция вложена в другую функцию, зависит от ее переменных, а вызывается внешним эвентом. если вынести onStreamOut() отдельно, а блипы сохранять, допустим, в element data машины — все нормально удаляется и никаких ошибок.
-
remove this, Lua is dynamically typed: string message, int messageType P.S. your function will create these variables local to itself anyway.
-
у тебя blip — локальная переменная, и указатель на сам блип нигде не сохраняется после завершения работы функции. ну мне так каатса.
-
а я эльф 80-го уровня.
-
add this function findRotation(x1,y1,x2,y2) local t = -math.deg(math.atan2(x2-x1,y2-y1)) if t < 0 then t = t + 360 end return t end to your script
-
well findRotation is not a built-in MTA function, you need to add it to your script to use it.
-
well that part has nothing to do with peds() function. it cant be the full code, since peds() function is never called in this code, so you cant possibly have those errors shown.
-
you dont know what you're doing. you need to have quite good understanding of lua and programming in general to edit race resource. you can try replacing the function that is called with playSound and sound id argument with your file, but it will probably work only if playSoundFrontEnd is called clientside.
-
both your errors are caused by invalid source variable. (and why are you using source AND player variable?) where is the code that calls this function?
-
if you are so sure that it "should output something different", check the code where "curgang" element data is set.
-
race resource uses playSoundFrontEnd sounds 44 and 45 for countdown.
-
как все серьезно, мать моя.
-
offtopic deleted, please use appropriate language section for such conversations.
-
setElementRotation does not do any animation or anything. use moveObject with rotation parameters.
-
who said you can't? http://luabinaries.sourceforge.net/download.html — compiles just fine.
-
-- first you create a table to hold your bet info: bets = {} function onPlaceBet (playerSource, cmd, guy, amount) guy = getPlayerFromID(guy) amount = tonumber(amount) if (guy and amount) and amount > 0 then -- check so players wont bet negative amounts local points = tonumber(getElementData(playerSource, "Points")) if points < amount then outputChatBox("#00FF00<#9370DBServer#00FF00>#ff0000: #9ACD32Not enough Points!", playerSource, 255,255,255, true) else --ADD THE BET bets[playerSource] = {guy, amount} setElementData(playerSource, "Points", points - amount) -- accept the bet and take the points outputChatBox("#00FF00<#9370DBServer#00FF00>#ff0000: #9ACD32"..getPlayerName(playerSource).." #9ACD32Placed a bet on "..getPlayerName(guy).."#9ACD32!", getRootElement(), 255,255,255, true) end else outputChatBox("#00FF00<#9370DBServer#00FF00>#ff0000: #9ACD32Syntax: /bet [playerID] [betAmount]", playerSource, 255,255,255, true) end end addEvent("onRaceStateChanging") function removeCmd () outputChatBox("#00FF00<#9370DBServer#00FF00>#ff0000: #9ACD32Bets Closed!", getRootElement(), 255,255,255, true) removeCommandHandler("bet", onPlaceBet) end addEventHandler("onRaceStateChanging", getRootElement(), removeCmd) addEvent("onGamemodeMapStart") function addCmd () outputChatBox("#00FF00<#9370DBServer#00FF00>#ff0000: #9ACD32Place now your bets: /bet [thePlayer] [betAmount] ", getRootElement(), 255,255,255, true) addCommandHandler("bet", onPlaceBet) end addEventHandler("onGamemodeMapStart", getRootElement(), addCmd) function onPlayerEx (theWinner) --THAT FUNCTION IS CALLED BY WIN FUNC --GIVE POINTS TO THE BETTER for player, bet in pairs(bets) do if isElement(player) then -- check if a player still there local points = tonumber(getElementData(player, "Points")) if bet[1] == theWinner then -- check if player won the bet setElementData(player, "Points", points + bet[2]*2) -- give him 2x the points outputChatBox("#00FF00<#9370DBServer#00FF00>#ff0000: #9ACD32Your bet won: "..(bet[2]*2).." point(s) earned!", player, 255,255,255, true) end end end -- clear the bets list bets = {} end
-
а лучше бы использовал для центровки текста в зависимости от разрешения. :Р
