Jump to content

mjr

Members
  • Content Count

    39
  • Joined

  • Last visited

Community Reputation

0 Neutral

About mjr

  • Rank
    Rat

Details

  • Location
    Ukraine, Ternopil / Kirovohrad
  1. just of interest i want to watch it
  2. Понял о чем ты говоришь) Ну, короче, пусть ТС уже сам додумает скрипт
  3. аа, я думал там в процентах что-ли) ну тогда setElementHealth (v,2000) и getElementHealth (source) < 260
  4. kay, i got it. there is no possibility to do that) stuff with images is too mess and uneffective
  5. mjr

    Help

    yes, to save "licenceGot" state till the end of game session. On game guit it should be written in database. The algorithm is: 1) You press key to buy licence 2) If your cash is > cost of licence 3) Cash -= cost of licence 4) Write in playerData string 5) On quit checks the string in playerData, if true, write value in database
  6. Is there a way to put it in the game? [i know, MTA GUI is more comfortable, i'm just interested ]
  7. function carHealth() setTimer(function() for i, v in ipairs (getElementsByType("vehicle")) do setElementHealth (v,200) end, 1500,1) -- если ресурс основной, таблица с машинами некоторое время подгружается end addEventHandler ("onResourceStart",getResourceRootElement(getThisResource()),carHealth) function carSaver(source) if isPedInVehicle (getLocalPlayer()) then if getElementHealth (source) < 26 then setVehicleEngineState (source,false) setVehicleDamageProof (source,true) setVehicl
  8. Никогда таким не занимался, но можно предположить, что стрельба и прицеливание должны быть в цикле
  9. thx, Dwane. if tonumber(recipient) == getElementData (v,"id") works! final form: function privateMessage(source,commandName,recipient,...) local origin = { ... } local message = table.concat(origin, "") if tonumber(recipient) then for i, v in ipairs (getElementsByType("player")) do if tonumber(recipient) == getElementData(v,"id") then target = v break end end else target = (getPlayerByName (recipient)) end [...immaterial code...] target = nil end thanks to everybody for help!
  10. haha, same code, same result
  11. if tonumber(recipient) then for i, v in ipairs (getElementsByType("player")) do if recipient == getElementData(v,"id") then target = v break end end else target = (getPlayerByName (recipient)) end don't work too /pm 1 msg --player not found getElementData(source,"id") --1
  12. getPlayerByName - my function that is similar to standart getPlayerFromName, but in addition it converts any coloured name to normal form okay, my mistake, but it isn't what try to solve. variable "recipient" always is a "string" type. Even if i type number instead on nichname. type(recipient) == "string" triggers all the time. Statement don't want to progress.
  13. yeh yeh sorry :) i type very fast how it's possible to press "H" button when buttons with letters "W" and "A" are not even close to it? ps. "whant" was hilarious
  14. working on PM function now. problem is that 6th string of code isn't working. even when i write /pm 1 msg, "if" statement anyway goes to type(recipient) == "string" case. what's the problem? function privateMessage(source,commandName,recipient,...) local origin = { ... } local message = table.concat(origin, "") if type(recipient) == "string" then target = (getPlayerByName (recipient)) elseif type(recipient) == "number" then for i, v in ipairs (getElementsByType("players")) do if recipient == getElementData(v,"id") then t
×
×
  • Create New...