Jump to content

Aibo

Retired Staff
  • Posts

    1,105
  • Joined

  • Last visited

Everything posted by Aibo

  1. Aibo

    Help ?!

    nice way to "fix" the undefined function problem — remove it lol
  2. Aibo

    help me!

    i dont think you don't need a separate functions/handlers for every class. just place ped class in its elementData (on spawn or something, never got a good look on zombie resource tho), and control them accordingly.
  3. Aibo

    Help ?!

    "markerHit" function is not created when you attach event handler to your marker, causing this error. and that is because you've placed "markerHit" function inside "warp" function (see your "end"s) function startclient () setSkyGradient( 50 , 255 , 255 , 65 , 100 , 25 ) Marker1 = createMarker ( 4183.0122070313, -2877.7978515625, 1067.9123535156, "arrow", 5, 0, 2, 255, 255) addEventHandler( "onClientMarkerHit", Marker1, markerHit) end function warp (player) if source == Marker1 then if isPedInVehicle(player) then local vehicle=getPedOccupiedVehicle(player) setElementPosition (vehicle , 4154.0571289063, -2392.6955566406, 1610.1810302734 ) setTimer( setVehicleFrozen, 1000, 1, vehicle, false ) end end end function markerHit(thePlayer,dimension) if (dimension and thePlayer==getLocalPlayer()) then local sound = playSound("files/warp.mp3") end end addEventHandler("onClientResourceStart", resourceRoot, startclient) addEventHandler("onClientMarkerHit", getRootElement(), warp)
  4. Aibo

    sqlite problem

    there could be only 1 condition string in executeSQLDelete, and you have to use "AND" in it, if you need multiple conditions to be met: executeSQLDelete("PlayersEmail2","mail = '".. address .."' AND subject = '".. selected .."'")
  5. Aibo

    GM qustion

    you need to load race definitions first. click on definitions, add "race", then use mouse wheel to scroll in lower left corner, to see race pickups/spawns/checkpoints
  6. Aibo

    GM qustion

    create a model in 3D software, texture it, export to DFF, textures to TXD, replace race pickups with new DFF/TXD.
  7. Aibo

    GM qustion

    they are no longer mine (after mta racemod death), i'm just doing scripts/design/support there.
  8. https://wiki.multitheftauto.com/wiki/AttachElements
  9. Aibo

    GM qustion

    gamemode is "race" (though edited a bit), "drunk" is set by me just for fun.
  10. Aibo

    Fade

    well, first thing is you have to put 0-1 range instead of 0-255 for alpha (btw. someone have to fix this wiki example ). second, changing alpha will not set GUI element visible if it's not, visibility and alpha are independent properties.
  11. Aibo

    Costom Func

    there's is a "player" here: function savePlayerData (player,datatype,newvalue) and "source" on the next line: local playerIP = getPlayerSerial(source) is source even passed to this function? otherwise i don't see what else is wrong.
  12. Aibo

    Fade

    https://wiki.multitheftauto.com/wiki/GuiSetAlpha Required Arguments * guiElement: the GUI element whose visibility is to be changed * alpha: The visibility/transparency of the GUI element. Ranges from 0 (fully transparent) to 1 (fully opaque).
  13. i bet GUIEditor_Window is not declared as a table, so it causes "attempt to index" error. GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_TabPanel = {} GUIEditor_Tab = {} GUIEditor_Memo = {} GUIEditor_Label = {} function createWelcomeWindow() GUIEditor_Window[1] = guiCreateWindow(208,127,669,520,".: ..:: ...::: Welcome to [FTS] Clan DD/DM Server :::... ::.. :.",false) GUIEditor_Button[2] = guiCreateButton(50,481,574,20,"I accept Rules and I want to continue!",false,GUIEditor_Window[1]) addEventHandler("onClientGUIClick", GUIEditor_Button[2], clientAccept, false) --here GUIEditor_TabPanel[1] = guiCreateTabPanel(70,115,531,323,false,GUIEditor_Window[1]) GUIEditor_Tab[1] = guiCreateTab("Rules",GUIEditor_TabPanel[1]) GUIEditor_Memo[1] = guiCreateMemo(20,21,212,258,"-Cheating\n\n-Swearing\n\n-Spamming\n\n-Faking nicks",false,GUIEditor_Tab[1]) guiMemoSetReadOnly(GUIEditor_Memo[1],true) GUIEditor_Memo[2] = guiCreateMemo(298,20,212,258,"-Having Fun\n\n-Reading Rules on welcome window\n\n-Using our Userpanel",false,GUIEditor_Tab[1]) guiMemoSetReadOnly(GUIEditor_Memo[2],true) GUIEditor_Label[1] = guiCreateLabel(25,5,202,19,"NOT TO DO",false,GUIEditor_Tab[1]) guiLabelSetColor(GUIEditor_Label[1],255,0,0) guiLabelSetVerticalAlign(GUIEditor_Label[1],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[1],"left",false) guiSetFont(GUIEditor_Label[1],"default-bold-small") GUIEditor_Label[2] = guiCreateLabel(302,4,172,20,"TO DO",false,GUIEditor_Tab[1]) guiLabelSetColor(GUIEditor_Label[2],0,255,0) guiLabelSetVerticalAlign(GUIEditor_Label[2],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[2],"left",false) guiSetFont(GUIEditor_Label[2],"default-bold-small") GUIEditor_Tab[2] = guiCreateTab("Progress of server",GUIEditor_TabPanel[1]) GUIEditor_Memo[3] = guiCreateMemo(24,24,484,253,"2010 November 9:\n-Added new Welcome Window\n-IP changed to 46.4.193.42:22003\n\n2010 November 8:\n-Bought VPS, started new project which implements CS 1.6 and MTA\n\n2010 October 8:\n-Bought Server, started to host 24/7\n\n",false,GUIEditor_Tab[2]) guiMemoSetReadOnly(GUIEditor_Memo[3],true) GUIEditor_Tab[3] = guiCreateTab("About Clan",GUIEditor_TabPanel[1]) GUIEditor_Memo[4] = guiCreateMemo(20,17,493,262,"Server owner:\n\nBleidex~[LTU]\n\n[FTS] Leader: [FTS] Co-Leader:\n\nReD_PiT AnoN\n\n LT-V14",false,GUIEditor_Tab[3]) guiMemoSetReadOnly(GUIEditor_Memo[4],true) GUIEditor_Tab[4] = guiCreateTab("About Script",GUIEditor_TabPanel[1]) GUIEditor_Memo[5] = guiCreateMemo(13,14,143,269,"Commands:\n\n/lol\n/omfg\n/afk\n/back\n/hi\n/bye\nand so on...",false,GUIEditor_Tab[4]) guiMemoSetReadOnly(GUIEditor_Memo[5],true) GUIEditor_Memo[6] = guiCreateMemo(200,14,138,268,"Gamble Commands:\n\n/roll\n/spin (number) (cash)",false,GUIEditor_Tab[4]) guiMemoSetReadOnly(GUIEditor_Memo[6],true) GUIEditor_Memo[7] = guiCreateMemo(379,14,138,270,"More to come....",false,GUIEditor_Tab[4]) guiMemoSetReadOnly(GUIEditor_Memo[7],true) GUIEditor_Label[3] = guiCreateLabel(70,445,530,30,"NOT READDING RULES DOES NOT HELP YOU",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[3],255,0,0) guiLabelSetVerticalAlign(GUIEditor_Label[3],"center") guiLabelSetHorizontalAlign(GUIEditor_Label[3],"center",false) guiSetFont(GUIEditor_Label[3],"default-bold-small") GUIEditor_Label[4] = guiCreateLabel(155,32,347,80,"www.fts.vhost.lt",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[4],0,0,200) guiLabelSetVerticalAlign(GUIEditor_Label[4],"center") guiLabelSetHorizontalAlign(GUIEditor_Label[4],"center",false) guiSetFont(GUIEditor_Label[4],"sa-gothic") GUIEditor_Label[5] = guiCreateLabel(492,499,170,14,"Created By Bleidex~[LTU]",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[5],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[5],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[5],"left",false) end function clientAccept(button,state) if button == "left" and state == "up" then guiSetInputEnabled(false) guiSetVisible(GUIEditor_Window[1], false) showCursor(false) end end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function () createWelcomeWindow() outputChatBox("Welcome to [FTS] Clan DD/DM Server!") if (GUIEditor_Window[1] ~= nil) then guiSetVisible(GUIEditor_Window[1], true) else outputChatBox("An unexpected error has occurred and the welcome GUI has not been created.") end showCursor(true) guiSetInputEnabled(false) end )
  14. --misleading info deleted EDIT2: now i really see i need to sleep more, ty varez
  15. onClientPlayerJoin is not triggered for local player (see wiki), so you better use onClientResourceStart. and you can't attach an event to an element which is not yet even created. so place you addEventHandler after you created the acceptButton element. function createWelcomeWindow() welcomeWindow = guiCreateWindow(174,173,713,431,"[FTS] Clan DM Server Welcome Window",false) rulesLabel = guiCreateLabel(46,78,301,252,"Rules:",false,welcomeWindow) guiLabelSetColor(rulesLabel,255,0,0) guiLabelSetVerticalAlign(rulesLabel,"top") guiLabelSetHorizontalAlign(rulesLabel,"left",true) guiSetFont(rulesLabel,"default-bold-small") noCheatingLabel = guiCreateLabel(-1,19,271,232,"-No cheating!",false,rulesLabel) guiLabelSetColor(noCheatingLabel,0,255,0) guiLabelSetVerticalAlign(noCheatingLabel,"top") guiLabelSetHorizontalAlign(noCheatingLabel,"left",false) noSwearingLabel = guiCreateLabel(0,18,233,213,"-No swearing",false,noCheatingLabel) guiLabelSetColor(noSwearingLabel,255,255,255) guiLabelSetVerticalAlign(noSwearingLabel,"top") guiLabelSetHorizontalAlign(noSwearingLabel,"left",false) beNiceLabel = guiCreateLabel(-1,21,186,190,"-Be nice to admins and others",false,noSwearingLabel) guiLabelSetColor(beNiceLabel,255,255,255) guiLabelSetVerticalAlign(beNiceLabel,"top") guiLabelSetHorizontalAlign(beNiceLabel,"left",false) websiteLabel = guiCreateLabel(137,24,429,54,"www.fts.vhost.lt",false,welcomeWindow) guiLabelSetColor(websiteLabel,225,215,0) guiLabelSetVerticalAlign(websiteLabel,"center") guiLabelSetHorizontalAlign(websiteLabel,"center",false) guiSetFont(websiteLabel,"sa-gothic") acceptButton = guiCreateButton(47,401,617,21,"Accept the rules and continue!",false,welcomeWindow) addEventHandler("onClientGUIClick", acceptButton, clientAccept, false) --here guiSetVisible(welcomeWindow,false) end function clientAccept(button,state) if button == "left" and state == "up" then guiSetInputEnabled(false) guiSetVisible(welcomeWindow, false) showCursor(false) end end addEventHandler("onClientResourceStart", getRootElement(), function () createWelcomeWindow() -- addEventHandler("onClientGUIClick", acceptButton, clientAccept, false) -- or here outputChatBox("Welcome to [FTS] Clan DD/DM Server!") if (welcomeWindow ~= nil) then guiSetVisible(welcomeWindow, true) else outputChatBox("An unexpected error has occurred and the welcome GUI has not been created.") end showCursor(true) guiSetInputEnabled(false) end )
  16. https://wiki.multitheftauto.com/wiki/TakePlayerMoney p.s.: pay attention that you're using it client-side
  17. well then obviously you're not trying it right, cause when i tried this: local defR = 255 local defG = 255 local defB = 255 function changeBackground(r,g,b) defR, defG, defB = r, g, b end addEventHandler("onClientPlayerDamage", getLocalPlayer(), function() changeBackground(255, 0, 0) setTimer(changeBackground, 1000, 1, 255, 255, 255) end) addEventHandler("onClientRender", getRootElement(), function() dxDrawImage(37, 450.5, 147.5, 130,"background.png",0.0,0.0,0.0,tocolor(defR, defG, defB),false) end) it worked.
  18. you have your code, you fix it. i can't, because i can't see it. i've already asked like 3? times to post it.
  19. whats your hesitation to post your code then? because i've just even tested the code above, and it works fine. so it's a fault on your end.
  20. again, post the code you use, check if the event is triggered at all. like: addEventHandler("onClientPlayerDamage", getLocalPlayer(), function() outputChatBox("onClientPlayerDamage triggered") changeBackground(255, 0, 0) setTimer(changeBackground, 1000, 1, 255, 255, 255) end)
  21. tocolor() recieves alpha as last argument and it's optional, so i guessed the value he returns with only 3 color arguments already contains default alpha (255). though need to check that of course
  22. you have it in place and added it to meta.xml, don't you?
  23. what exactly "not works"? my phone "not works", can you fix it? seriously, post the whole code that "not works". p.s. i doubt that is the problem, but what is that "nil" in dxDrawImage anyway?
  24. Aibo

    on car crate

    well i get what you mean (ehm i guess), and i've already posted a script which will show in chat who types /car command. right now you've said nothing new, posted nothing of your actual code and the only "basemode"s i could find in the community are either compiled or private.
  25. well, dxDrawImage needs to be called from "onClientRender" event: local defR = 255 local defG = 255 local defB = 255 function changeBackground(r,g,b) defR, defG, defB = r, g, b end addEventHandler("onClientPlayerDamage", getLocalPlayer(), function() changeBackground(255, 0, 0) setTimer(changeBackground, 1000, 1, 255, 255, 255) end) addEventHandler("onClientRender", getRootElement(), function() dxDrawImage(37, 450.5, 147.5, 130,"background.png",0.0,0.0,0.0,tocolor(defR, defG, defB),false,nil) end)
×
×
  • Create New...