Jump to content

SpecT

Members
  • Posts

    656
  • Joined

  • Days Won

    9

Everything posted by SpecT

  1. Yes. Here is an example resource: https://community.multitheftauto.com/in ... ls&id=7766 Good luck!
  2. Because it doesn't work like that? You can't cross-return data. You have to trigger another event to return any data. Oh yeah ... I'm sorry, my bad
  3. Lol why don't you use "return" instead of callback function ? I know that there is already solution but this is an easier and less code version. CLIENT: function createGuiStuff() -- gui grid list blablabla GUIEditor.label[1] = guiCreateLabel(13, 2, 521, 15, serverName, false, GUIEditor.gridlist[1]) -- Empty for now, it will be updated by our triggerXEvents -- rest of the gui blablabla -- and do this at the end: local serverName = triggerServerEvent("getServerInfo", localPlayer) -- Ask the server to send data(s) about the server to us end addEventHandler("onClientResourceStart", resourceRoot, createGuiStuff) SERVER: function getServerInfo() local playerAsking = source local serverName = getServerName() return serverName end addEvent("getServerInfo", true) addEventHandler("getServerInfo", root, getServerInfo)
  4. SpecT

    Question

    As I can see your "can u explain" means "can you make it for me". The forum is just for questions related to scripting and scripts you made and there is problem with them so we can help you fix them. Start making it yourself and when you need help you will get helped by the people here.
  5. SpecT

    2 questions

    No, that's impossible.
  6. SpecT

    dx functions

    You better post your code and the guys here could fix it for you.
  7. SpecT

    Saving Team

    You are welcome!
  8. SpecT

    Saving Team

    Oh ... wait you can't save the team in your account data. It has to be a string... function saveTeam () local account = getPlayerAccount (source) if not account or isGuestAccount(account) then return end local team = getTeamName(getPlayerTeam(source)) setAccountData (account, "savingTeam", team) end addEventHandler ("onPlayerQuit", root, saveTeam) function getTeam (_,acc) local team = getTeamFromName(getAccountData(acc, "savingTeam")) if team then setPlayerTeam (source, team) end end addEventHandler ("onPlayerLogin", root, getTeam) Now it should work!
  9. SpecT

    Saving Team

    Ha .. you said no error, huh ? What about the useless end in the first function? Try this: function saveTeam () local account = getPlayerAccount (source) if not account or isGuestAccount(account) then return end local team = getPlayerTeam (source) setAccountData (account, "savingTeam", team) end addEventHandler ("onPlayerQuit", root, saveTeam) function getTeam (_,acc) local team = getAccountData (acc, "savingTeam") if team then setPlayerTeam (source, team) end end addEventHandler ("onPlayerLogin", root, getTeam)
  10. SpecT

    Saving Team

    Are you sure you are in a team before you quit the server ?
  11. There is no problem with the script but he wants "custom" gui a.k.a. DX. To the author of this topic : https://wiki.multitheftauto.com/wiki/Tu ... _DX_Window You can find there all the dx drawing functions that you could use to remake your gui.
  12. SpecT

    Saving Team

    Any error in debugscript 3 ?
  13. Any error when you start it as client-side ?
  14. Don't spam lel ... Post the server-side of the userpanel. BTW thanks GTX for editing the code I wrote (made it for 1-2 minutes cuz I had no time) and forgot to get the data and then remove the value ...
  15. addEvent("nitroPickup", true) addEventHandler("nitroPickup", getRootElement(), function(player) if isPedInVehicle(source) then local account = getPlayerAccount(player) if account then if getAccountData(account,"cash") >= 1000 then --- change the string "cash" to what the money data is saved (cash,money) addVehicleUpgrade(getPedOccupiedVehicle(source),1010) setAccountData(account,"cash",-1000) --- change the string "cash" to what the money data is saved (cash,money) outputChatBox ( "You Bought a Nitro", player, 0, 0, 0, true ) else outputChatBox ( "You need 1000 to buy nitro", getRootElement(), 0, 0, 0, true ) end end end end )
  16. Lel why do you put so much adfly links .. jeez I hate when I see that. You just made a simple browser wich loads youtube and you want money for that ?? *facepalm* Also you uploaded a script that calls another resource called "webui" which isn't uploaded as I can see.
  17. Your code isn't wrong just the group - it is "Admin" not "admin".
  18. Of course it won't close ... Use removeEventHandler for the function "draw" and dont use these variables!
  19. To set the fps forever you have to follow John Smith's instructions: In your server folder find a file called "mtaserver.conf". Open it with a text editor and scroll down till you find "36" When you find it you have to replace the number 36 with whatever fps you want (36-100). You must do this while the server is not started and don't forget to SAVE the file!
  20. SpecT

    downloadFile

    downloadFile("Skins/dead.col") Should work.
  21. Try this. But there shouldn't be a problem hm ... GUIEditor = { button = {} } function GUI() GUIEditor.button[1] = guiCreateButton(231, 240, 143, 65, "onsound", false) GUIEditor.button[2] = guiCreateButton(390, 241, 143, 65, "offsound", false) end local sx,sy = guiGetScreenSize() function Dx() dxDrawRectangle(sx*0.3413,sy*0.3550,sx*0.3137,sy*0.2667) dxDrawLine(222 - 1, 164 - 1, 222 - 1, 376, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(545, 164 - 1, 222 - 1, 164 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(222 - 1, 376, 545, 376, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(545, 376, 545, 164 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawRectangle(222, 164, 323, 212, tocolor(10, 244, 231, 171), false) dxDrawLine(232 - 1, 240 - 1, 232 - 1, 306, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(373, 240 - 1, 232 - 1, 240 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(232 - 1, 306, 373, 306, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(373, 306, 373, 240 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawRectangle(232, 240, 141, 66, tocolor(10, 244, 231, 171), false) dxDrawLine(391 - 1, 240 - 1, 391 - 1, 306, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(532, 240 - 1, 391 - 1, 240 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(391 - 1, 306, 532, 306, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(532, 306, 532, 240 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawRectangle(391, 240, 141, 66, tocolor(10, 244, 231, 171), false) dxDrawText("αυ∂ισ ρℓαувα¢к", 230, 239, 373, 305, tocolor(120, 11, 242, 171), 1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("Extinguish sound", 390, 239, 531, 307, tocolor(247, 39, 5, 171), 1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawLine(220, 207, 543, 208, tocolor(255, 255, 255, 255), 1, false) dxDrawText("To play the sound Put option on αυ∂ισ ρℓαувα¢к", 222, 164, 546, 185, tocolor(144, 233, 18, 171), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("To reduce the sound Put Option Extinguish sound", 223, 185, 547, 206, tocolor(247, 39, 5, 171), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawLine(223 - 1, 339 - 1, 223 - 1, 375, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(545, 339 - 1, 223 - 1, 339 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(223 - 1, 375, 545, 375, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(545, 375, 545, 339 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawRectangle(223, 339, 322, 36, tocolor(144, 233, 18, 171), false) dxDrawText("Mod Sound By ~ Mr.Hassan", 222, 337, 544, 375, tocolor(19, 14, 236, 171), 1.00, "pricedown", "left", "top", false, false, false, false, false) end ------------------------------------- addEventHandler ( "onClientGUIClick", root, function ( ) if source == GUIEditor.button[1] then setSoundPaused(theSound, true) elseif source == GUIEditor.button[2] then setSoundPaused(theSound, false) end end ) ------------------------------ local opened = false function toggleWindow() if opened == false then opened = true addEventHandler("onClientRender",root,Dx) showCursor(true) guiSetAlpha(GUIEditor.button[1], 1) guiSetAlpha(GUIEditor.button[2], 1) else opened = false removeEventHandler("onClientRender",root,Dx) showCursor(false) guiSetAlpha(GUIEditor.button[1], 0) guiSetAlpha(GUIEditor.button[2], 0) end end bindKey ("F4","down",toggleWindow)
  22. Dude ... as I said check for errors from the debug script. To toggle it do the next: 1. Open console (F8) and type "debugscript 3" 2. Then restart the resource and write here the red text from there
  23. Type /debugscript 3 and write the error/s here.
  24. Dude ... you have so much posts and you don't even know how to form your code. I fixed the mess you did - random placed ends, also you must not use onClientRender for GUI! Use onClientRender ONLY for DX stuff! It should work now if not write here the errors you get from debugscript GUIEditor = { button = {} } function GUI() GUIEditor.button[1] = guiCreateButton(231, 240, 143, 65, "onsound", false) GUIEditor.button[2] = guiCreateButton(390, 241, 143, 65, "offsound", false) end local sx,sy = guiGetScreenSize() function Dx() dxDrawRectangle(sx*0.3413,sy*0.3550,sx*0.3137,sy*0.2667) dxDrawLine(222 - 1, 164 - 1, 222 - 1, 376, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(545, 164 - 1, 222 - 1, 164 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(222 - 1, 376, 545, 376, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(545, 376, 545, 164 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawRectangle(222, 164, 323, 212, tocolor(10, 244, 231, 171), false) dxDrawLine(232 - 1, 240 - 1, 232 - 1, 306, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(373, 240 - 1, 232 - 1, 240 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(232 - 1, 306, 373, 306, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(373, 306, 373, 240 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawRectangle(232, 240, 141, 66, tocolor(10, 244, 231, 171), false) dxDrawLine(391 - 1, 240 - 1, 391 - 1, 306, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(532, 240 - 1, 391 - 1, 240 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(391 - 1, 306, 532, 306, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(532, 306, 532, 240 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawRectangle(391, 240, 141, 66, tocolor(10, 244, 231, 171), false) dxDrawText("αυ∂ισ ρℓαувα¢к", 230, 239, 373, 305, tocolor(120, 11, 242, 171), 1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("Extinguish sound", 390, 239, 531, 307, tocolor(247, 39, 5, 171), 1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawLine(220, 207, 543, 208, tocolor(255, 255, 255, 255), 1, false) dxDrawText("To play the sound Put option on αυ∂ισ ρℓαувα¢к", 222, 164, 546, 185, tocolor(144, 233, 18, 171), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("To reduce the sound Put Option Extinguish sound", 223, 185, 547, 206, tocolor(247, 39, 5, 171), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawLine(223 - 1, 339 - 1, 223 - 1, 375, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(545, 339 - 1, 223 - 1, 339 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(223 - 1, 375, 545, 375, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(545, 375, 545, 339 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawRectangle(223, 339, 322, 36, tocolor(144, 233, 18, 171), false) dxDrawText("Mod Sound By ~ Mr.Hassan", 222, 337, 544, 375, tocolor(19, 14, 236, 171), 1.00, "pricedown", "left", "top", false, false, false, false, false) end ------------------------------------- addEventHandler ( "onClientGUIClick", root, function ( ) if source == GUIEditor.button[1] then setSoundPaused(theSound, true) elseif source == GUIEditor.button[2] then setSoundPaused(theSound, false) end end ) ------------------------------ local opened = false bindKey ( "F4", "down", function () if opened == false then opened = true addEventHandler("onClientRender",root,Dx) showCursor(true) guiSetAlpha(GUIEditor.button[1], 1) guiSetAlpha(GUIEditor.button[2], 1) else opened = false removeEventHandler("onClientRender",root,Dx) showCursor(false) guiSetAlpha(GUIEditor.button[1], 0) guiSetAlpha(GUIEditor.button[2], 0) end end)
×
×
  • Create New...