Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Castillo

    need help

    I don't know, but I know that is not my script. Do you have anything else in that resource?
  2. Castillo

    need help

    I don't know what are you talking about, the script works perfectly, want proof? Here: http://imageshack.us/photo/my-images/9/ ... 01228.png/
  3. Castillo

    need help

    I would set element data to the player when login, and remove it when logout. -- server side: addEventHandler("onPlayerLogin",root, function () local account = getPlayerAccount(source) if account and not isGuestAccount(account) then local accountName = getAccountName(account) if isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Admin" ) ) then setElementData(source,"isAdmin",true) end end end) addEventHandler("onPlayerLogout",root, function () setElementData(source,"isAdmin",false) end) -- client side: addEventHandler("onClientRender",getRootElement(), function () for i,v in ipairs(getElementsByType("player")) do if getElementData(v,"isAdmin") then local x,y,z = getElementPosition(v) local cx,cy,cz = getCameraMatrix() if getDistanceBetweenPoints3D(cx,cy,cz,x,y,z) <= 15 then local px,py = getScreenFromWorldPosition(x,y,z+1.3,0.06) if px then local text = "Admin ".. tostring(getPlayerName(v)) local width = dxGetTextWidth(text,1,"sans") dxDrawText(text, px, py, px, py, tocolor(0, 255, 0, 255), 2, "sans", "center", "center", false, false) end end end end end)
  4. I would say setCameraMatrix, maybe onClientPreRender slowly change the position.
  5. function setTeam() local account = getPlayerAccount(source) local theTeam = getAccountData (account, "Staff") if theTeam and getTeamFromName(theTeam) then setPlayerTeam(source, getTeamFromName(theTeam)) end end addEventHandler("onPlayerLogin",getRootElement(),setTeam) function saveTeam() local theTeam = getPlayerTeam(source) local account = getPlayerAccount(source) if (theTeam) and not isGuestAccount(account) then setAccountData(account, "Staff", getTeamName(theTeam)) end end addEventHandler("onPlayerQuit",getRootElement(),saveTeam)
  6. Castillo

    help me

    Dude, I gave you the script and the meta.xml... just create a new folder called "weapons" in resources folder at your server, then create two files: script.lua and meta.xml.
  7. Castillo

    help me

    -- script.lua: local weapons = {{fileName="M4", model=356}} function load() for index, weapon in pairs(weapons) do txd = engineLoadTXD ( weapon.fileName.. ".txd" ) engineImportTXD ( txd, weapon.model ) dff = engineLoadDFF ( weapon.fileName.. ".dff", 0 ) engineReplaceModel ( dff, weapon.model ) end end addEventHandler("onClientResourceStart",resourceRoot, function () local version = getVersion() if version.mta == "1.1.1" then setTimer ( load, 1000, 1) end end) -- meta.xml: NOTICE: To replace a weapon, you must use the WEAPON OBJECT MODEL not the WEAPON MODEL (Ex M4 = 31), but the M4 object model is 356 which is the one you must replace. You can get the weapon OBJECT MODEL'S from here: https://wiki.multitheftauto.com/wiki/Weapons
  8. Do you have any other script that could cause this?
  9. We are here to HELP not to script things for you because you're either lazy or busy.
  10. If you don't post the script, we cannot help you...
  11. local screenWidth, screenHeight = guiGetScreenSize() function M ( ) local money = getPlayerMoney(localPlayer) local ping = getPlayerPing(localPlayer) dxDrawText( "Your Money: "..tostring(money), 44, screenHeight-43, screenWidth, screenHeight, tocolor ( 0, 255, 0, 255 ), 1, "default-bold" ) dxDrawText( "Your Ping: "..tostring(ping), 44, screenHeight-43, screenWidth, screenHeight, tocolor ( 255, 255, 0, 255 ), 1, "default-bold" ) end addEventHandler("onClientRender",root, M)
  12. Could you explain us what are you trying to do? because that's a mess of client side functions and server side events. P.S: Is getPlayerMoney not getPlayerMony.
  13. Castillo

    Problem

    Try this: function cp () local skinList = guiCreateGridList ( 0.80, 0.10, 0.15, 0.30, true ) local column = guiGridListAddColumn( skinList, "Skins", 0.85 ) if ( column ) then local xml = getResourceConfig("skins.xml") for id, skin in ipairs(xmlNodeGetChildren(xml)) do local row = guiGridListAddRow ( skinList ) guiGridListSetItemText ( skinList, row, column, xmlNodeGetAttribute(skin, "name"), false, false ) end end end
  14. What are you talking about? the other topic is some posts below this one.
  15. True, my mistake, corrected.
  16. Castillo

    need help

    DX drawing doesn't return anything, is not a element as it's drawn every frame, it doesn't work that way.
  17. Castillo

    help me

    myonlake, you're outdated, weapon model replacement is already possible.
  18. Dude, you don't have to create a new topic because none want's to join you.
  19. Jaysd, that would require a team called "Admins", what if he doesn't want it to work that way? function join ( ) local serial = getPlayerSerial(source) local hour, mins = getTime() local name = getPlayerName(source) local version = getPlayerVersion(source) local ip = getPlayerIP(source) for index, player in pairs(getElementsByType("player")) do local account = getPlayerAccount(player) if not account or isGuestAccount(account) then return end if isObjectInACLGroup("user."..getAccountName(account),aclGetGroup("Admin")) then outputChatBox(tostring(name).."'s serial: ".. tostring(serial),player) outputChatBox(tostring(name).."'s IP: ".. tostring(ip),player) outputChatBox(tostring(name).."'s version: ".. tostring(version),player) outputChatBox(tostring(hours)..":".. tostring(mins),player) end end end addEventHandler("onPlayerJoin",root,join)
  20. function join ( ) local serial = getPlayerSerial() local hour, mins = getTime() local name = getPlayerName(source) local version = getPlayerVersion(source) local ip = getPlayerIP(source) outputChatBox(tostring(name).."'s serial: ".. tostring(serial),getRootElement()) outputChatBox(tostring(name).."'s IP: ".. tostring(ip),getRootElement()) outputChatBox(tostring(name).."'s version: ".. tostring(version),getRootElement()) outputChatBox(tostring(hours)..":".. tostring(mins),getRootElement()) end addEventHandler("onPlayerJoin",root,join)
  21. -- client side: function Example() triggerServerEvent("returnData",localPlayer,"Hey Brown Cow!") end addEvent("TheExample", true) addEventHandler("TheExample", getRootElement(), Example) -- server side: triggerClientEvent("TheExample", getRootElement()) addEvent("returnData",true) addEventHandler("returnData",root, function (msg) outputChatBox(tostring(msg)) end)
×
×
  • Create New...