Jump to content

Tox

Members
  • Posts

    77
  • Joined

  • Last visited

Everything posted by Tox

  1. just bought MTA package and it's rockin'. they helped me a lot, i was having hard times to configure my own server. up time is a real problem nowadays but these guys are serious about that. it's not like some other cheeky vps provider who sells you :~ covered with gold. about the performance, i can't really say anything about that since there are no players on my server currently but i think the server will overcome that too. 10/10 would recommend
  2. you'll use; bindKey https://wiki.multitheftauto.com/wiki/SetPedWeaponSlot
  3. Tox

    SOLVED

    your code won't work
  4. Tox

    Give skin

    --Set Skin local inValidSkins = {[94] = true} -- replace teamName with the team you want addEvent("AdminPanel.setSkin", true) function setSkin(plr, getText) if plr and isElement(plr) then if getText then local skin = getElementModel(getText) if not skin then skin = getText end if inValidSkins[skin] then -- you can use getElementModel or simply replace it with getText outputChatBox("#00FF00Este team es solo para #FF0000[ADM]#00FF00 o#FF0000 [LIDER]", client, r, g, b, true) return end setElementModel(plr, skin) outputChatBox("#FF0000" ..getPlayerName(client).."#00FF00 Ha combiar su skin a #0B00FF("..skin..") ", plr, 0, 255, 0, true) outputChatBox("#00FF00Combiar #FF0000"..getPlayerName(plr).."#00FF00 skin a #0B00FF("..skin..") ", client, 0, 255, 0, true) end end end addEventHandler("AdminPanel.setSkin", root, setSkin)
  5. Tox

    SOLVED

    function onLogin (_, playeraccount) if ( playeraccount ) then local Timer = getAccountData ( playeraccount, "timercd" ) if ( Timer ) then timer[source] = setTimer(function() timer[source] = nil outputChatBox("You can now use the advert again", source) end, Timer, 1) end end end addEventHandler ( "onPlayerLogin", getRootElement ( ), onLogin)
  6. Tox

    SOLVED

    may i see the chunk?
  7. Tox

    SOLVED

    do you trigger set timer with "onPlayerLogin"?
  8. Tox

    SOLVED

    'source' is a userdata which is unique for every each element. so every time a player quits/joins they'll have a different userdata. you can save the timer's details with getTimerDetails function on player's account data when they quit and then work it after they join
  9. check out the https://wiki.multitheftauto.com/wiki/TriggerServerEvent function again and fully understand how it works.
  10. Tox

    metatables

    well yeah, of course i checked it out. i kind of understand what metatables do but the thing i am having a trouble with is what is metatables' advantage. i mean, can i still do the same things as metatables do without having to use metatables?
  11. Tox

    metatables

    what is the advantage of metatables? i've been coding for 8 months now, i've seen several examples of setmetatable here and there, still couldn't figure out what it does/how does it work. any comment is appreciated
  12. Tox

    dxCreateScreenSource

    i think i won't do it because of the performance issues, thank you for help
  13. Tox

    dxCreateScreenSource

    it looks cheesy when i try something like that, thank you for the suggestion though
  14. hello, i am trying to do something like camera on a certain point of player's screen, at first i thought dxCreateScreenSource was the right function but here's the thing: i am trying to get the screen of another player. not the source player so, i need to use getElementPosition somehow but the function only captures the local player's screen. oh and i need it like a camera which means it will update when it is active. not just like a screenshot from another player's screen, i would be grateful if you can help me here's a video, that explains more:
  15. http://www.w3schools.com/sql/default.asp ^ easier to find things
  16. remove "thePlayer" argument and replace it with client function loginPlayer(username, password) local account = getAccount(username, password) if (account ~= false) then logIn(client, account, password) else outputChatBox("Invalid username & password!", client, 255, 0, 0) end end addEvent("loginPlayer", true) addEventHandler("loginPlayer", getRootElement(), loginPlayer)
  17. getAttachedElements getElementType isElement destroyElement for key, value in ipairs (table) do --code end you'll use these functions
  18. Tox

    Player movements

    if you mean animations, i believe if you install customized .ifp files you can achieve the same thing. i'm not really sure, you gotta try it.
  19. element data and table are the same things, however element data is synced on both client and server. if you want to store movements you'll want to store them in a table instead, and no i don't think it'd lag much if you set a limit for rewind time according to movements for example if it shows only 30 seconds back, it wouldn't lag much i guess, never tried something like that before though
  20. i don't really know about that, i would dxDraw though
  21. local images ={ "Main/files/images/menu_bg1.jpg", "Main/files/images/menu_bg2.jpg", "Main/files/images/menu_bg3.jpg", "Main/files/images/menu_bg4.jpg", "Main/files/images/menu_bg5.jpg", "Main/files/images/menu_bg6.jpg" } local ap = 0 local id = 1 local tick = getTickCount() local function setId() id = id + 1 if id >= #images then id = 1 end tick = getTickCount () + 3000 end setTimer (setId, 5000, 1) function fade () if ap >= 255 then if getTickCount () >= tick then ap = ap - 5 end else ap = ap + 5 end end function testBackground() fade() dxDrawImage(s[1]*0/1440,s[2]*0/900, s[1]*1440/1440,s[2]*900/900, images[id], 0, 0, 0, tocolor(255, 255, 255, ap),false) end addEventHandler ("onClientRender", root, testBackground)
  22. you need to use https://wiki.multitheftauto.com/wiki/On ... ayerTarget OR you can add a getPedTarget check into render chunk and if it doesn't return nil, change the colour/texture or whatever
  23. you can either loop; for key, value in ipairs (result) do outputChatBox(value.Cocodrilo.. " is into db") end or use the column name as lua index; outputChatBox (result[1].Cocodrilo.. "is into db")
  24. i have done something similar but i don't suggest it because you have to giveWeapon every time player changes slot, also it's not very reliable. it causes lag and if the server is lagging player will get the weapon in delay so yeah this could cause some problem. nevertheless, if you still want to do it you'll use these; [url=https://wiki.multitheftauto.com/wiki/OnPlayerWeaponSwitch]https://wiki.multitheftauto.com/wiki/On ... aponSwitch[/url], [url=https://wiki.multitheftauto.com/wiki/GiveWeapon]https://wiki.multitheftauto.com/wiki/GiveWeapon[/url] and of course you must be familiar with lua tables to make it work correctly, good luck
  25. Tox

    onClientClick

    clickedWorld: This represents any physical entity elements that were clicked. If the player clicked on no MTA element, it's set to false. you can use onClientGUIClick instead
×
×
  • Create New...