Jump to content

TAPL

Retired Staff
  • Posts

    7,337
  • Joined

  • Days Won

    11

Everything posted by TAPL

  1. This impossible! The source of event onElementDataChange cannot be nil. If there no source (nil) then there will be no element Data changed and that mean the event onElementDataChange will not triggered.
  2. Try. function onOccupationChange(dataName) if getElementType(source) == "player" and dataName == "Occupation" then if getElementData(source, dataName) == "Mailman" then local x, y, z = getNewMailLocation(source, 1) setElementData(source,"mailData",1) end end end addEventHandler("onElementDataChange", root, onOccupationChange)
  3. You want get the flags image from admin panel? if so local imgPath = ":admin/client/images/flags/"..getElementData(source,"Country")..".png"
  4. Script 1: setElementCollidableWith is Client-only function and it Require element, not a table. Script 2: function onOccupationChange() if getElementData(source, "Occupation") == "Mailman" then local x, y, z = getNewMailLocation(source, 1) setElementData(source,"mailData",1) end end addEventHandler("onElementDataChange", root, onOccupationChange)
  5. Try. -- Server Side -- function showHome() local Home = exports.admin:getPlayerCountry(source) or "N/A" setElementData(source,"Country",Home) end addEventHandler("onPlayerJoin", root, showHome) -- Client Side -- font = dxCreateFont("font.ttf", 18) function dxDrawColorText(str, ax, ay, bx, by, color, scale, font, left, top, clip, wordbreak, postGUI) local pat = "(.-)#(%x%x%x%x%x%x)" local s, e, cap, col = str:find(pat, 1) local last = 1 while s do if cap == "" and col then color = tocolor( tonumber( "0x"..col:sub( 1, 2 ) ), tonumber( "0x"..col:sub( 3, 4 ) ), tonumber( "0x"..col:sub( 5, 6 ) ), 255 ) end if s ~= 1 or cap ~= "" then local w = dxGetTextWidth(cap, scale, font) dxDrawText( cap, ax, ay, ax + w, by, color, scale, font ) ax = ax + w color = tocolor( tonumber( "0x"..col:sub( 1, 2 ) ), tonumber( "0x"..col:sub( 3, 4 ) ), tonumber( "0x"..col:sub( 5, 6 ) ), 255 ) end last = e + 1 s, e, cap, col = str:find( pat, last ) end if last <= #str then cap = str:sub( last ) local w = dxGetTextWidth( cap, scale, font ) dxDrawText( cap, ax, ay, ax + w, by, color, scale, font, left, top, clip, wordbreak, postGUI ) end end local messageJoin = "" local messageQuit = "" function renderPlayerJoined() dxDrawColorText("► ".. messageJoin,400,750.0,574.0,20.0,tocolor(255,255,255,255),0.45,font,"left","top",false,false,false) end function renderPlayerLeft() dxDrawColorText("◄ ".. messageQuit,400,740.0,574.0,32.0,tocolor(255,255,255,255),0.45,font,"left","top",false,false,false) end addEventHandler('onClientPlayerJoin', root, function() setTimer(function(source) local country = getElementData(source,"Country") messageJoin = getPlayerName(source).." #00A6FFhas #FFFFFFJoin #00A6FFThe server "..country.."." addEventHandler("onClientRender", root, renderPlayerJoined) setTimer(function() removeEventHandler("onClientRender", root, renderPlayerJoined) end,7000,1) end,250,1,source) end) addEventHandler('onClientPlayerQuit', root, function(reason) messageQuit = getPlayerName(source) .. " #00A6FFhas #FFFFFFLeft #00A6FFThe server.#FFFFFF [" .. reason .. "]" addEventHandler("onClientRender", root, renderPlayerLeft) setTimer(function() removeEventHandler("onClientRender", root, renderPlayerLeft) end,7000,1) end) fileDelete("joinquit.lua")
  6. Where is line 39? and please post the last full code you have while doesn't work.
  7. TAPL

    trigger

    What is this then?
  8. TAPL

    trigger

    Do you need it to be in function? Try without function. label = guiCreateLabel ( 0.5, 0.5, 0.2, 0.5, "ALIVE: ".. #getAlivePlayers ( ), true ) guiSetFont ( label, "sa-header" ) guiLabelSetColor ( label, 255, 175, 0 )
  9. omg this so hard <~ if getTeamName(getPlayerTeam(psource)) == "test" then and you forgot one 'end in function moveGate.
  10. Valhalla?
  11. The rows in the table has only 3 values, that means dest[4] and v[4] is nil. line 39, make no sense, it will overwrite. and there are others errors.
  12. TAPL

    error please help

    Try get last resources http://mtasa-resources.googlecode.com/files/mtasa-resources-r882.zip
  13. I can't see where is id define. Since it client-side, Mostly you should use localPlayer Instead of source. Otherwise, post full code, includes the event you're using and the Table (markers).
  14. and please next time use lua button not Code. EDIT: is your code client-side or server-side? if it client side outputChatBox in client-side does not need player argument. btw: player argument here does not look defined. outputChatBox("Załadowałeś trociny!", player) if it server-side outputChatBox in server-side need player argument. outputChatBox("Id: " .. id .. "Id 2: " .. id2, 0, 255, 0)
  15. Report community center resources here!: https://forum.multitheftauto.com/viewtopic.php?f=108&t=45807
  16. This depends on the car spawner, it will be a marker? You can easily make the marker visible only to medics, but again it depends on how you will get these medics, is they are team? gang? ACL group? You can use setElementVisibleTo or you can use IF statement to make the marker show the gui only for medics, whatever they were a team or gang or ACL group.
  17. local marker = createMarker(1552.33, -1605.37, 12.5, "Cylinder",2,6,183,248,153) GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Label = {} local x,y = guiGetScreenSize() windowjob = guiCreateWindow(x/2-150,y/2-199,301,397,"Military job",false) guiSetVisible(windowjob, false) GUIEditor_Button[1] = guiCreateButton(22,352,108,35,"Take job",false,windowjob) GUIEditor_Label[1] = guiCreateLabel(193,-103,5,5,"",false,windowjob) GUIEditor_Button[2] = guiCreateButton(179,352,110,36,"Cancel",false,windowjob) GUIEditor_Memo[1] = guiCreateMemo(19,33,273,215,"To take Military job, press Take job.\n\nIf you don't want to, press Cancel.",false,windowjob) function Medicjob(hitElement) if getElementType(hitElement) == "player" and hitElement == localPlayer then if (getElementData(hitElement, "gang") == "Military") then if not guiGetVisible(windowjob) then guiSetVisible(windowjob, true) showCursor(true) end end end end addEventHandler("onClientMarkerHit", marker, Medicjob) function Medicjobleave(leaveElement) if getElementType(leaveElement) == "player" and leaveElement == localPlayer then if (getElementData(hitElement, "gang") == "Military") then if guiGetVisible(windowjob) then guiSetVisible(windowjob, false) showCursor(false) end end end end addEventHandler("onClientMarkerLeave", marker, Medicjobleave) function joinTeam() triggerServerEvent("setMili",localPlayer) guiSetVisible(windowjob, false) showCursor(false) end addEventHandler("onClientGUIClick", GUIEditor_Button[1] , joinTeam, false) function removeMedicWindow() guiSetVisible(windowjob, false) showCursor(false) end addEventHandler("onClientGUIClick", GUIEditor_Button[2] , removeMedicWindow, false) Here you don't need true, it's already true by default. setElementData(source, "Occupation", "Military", true)
  18. if ( msg == "طلال" or "مستر طلال" ) then إلى if ( msg == "طلال" or msg == "مستر طلال" ) then
  19. TAPL

    Login Panel

    triggerServerEvent("onRequestLogin",getLocalPlayer(),username,password,enableKickPlayer,attemptedLogins,maxLoginAttempts) enableKickPlayer and attemptedLogins and maxLoginAttempts is not defined anywhere in the code. Also the function onClickLogin should be above, not below the Event. addEventHandler("onClientGUIClick",loginButton,onClickLogin) Also there no such function with this name xmlFileHandler() + You didn't post the server-side (you have?) and please next time use lua button not Code.
  20. TAPL

    Need help

    You're welcome.
  21. TAPL

    Need help

    This: local playermoney = getElementData ( source, Occupation ) should be local playermoney = getElementData ( source, "Occupation" ) And this: setElementData ( source, playermoney, "Occupation" ) should be: setElementData ( source, "Occupation", playermoney )
  22. قصدك أنك تستخدم كودي المسروق من قبل سعد و ماتدري وين الكود بأي ملف؟ هههههه يغلق
  23. TAPL

    Need help

    You have forgot the key of the element data. key: The name of the element data entry you want to retrieve. (Maximum 31 characters.) key: The key you wish to store the data under. (Maximum 31 characters.) Here: local playermoney = getElementData ( source ) And here: setElementData ( source, playermoney )
  24. TAPL

    Need help

    setAccountData ?
  25. ؟؟؟؟؟؟؟ تستهبل؟ ايش دخل أم الفري روم SpawnMe يا حبيبي كود الكلينت الي تسوي منه ترقير للأفنت spawn1 spawn2 spawn3 الي فيه الأزرار
×
×
  • Create New...