Jump to content

Victor214

Members
  • Posts

    32
  • Joined

  • Last visited

Everything posted by Victor214

  1. I didn't use it cuz I don't know how to use tables at all, I searched for a tutorial yesterday, but I didn't find a good one, anyway, thank ya
  2. Are you sure it'll work? this function will set the ped's aim target to a fixed location, and I need a function to set his target in other moving peds (that I'll add later), not to a fixed location =X
  3. So, I'm working on army peds that will be able to aim and shoot (like an aimbot) on other moving peds (I'll create them later), I've already given them weapons, now my problem is to do the aimbot, I though about creating an weapon, attaching them to the ped, add the "holding weapon" animation, and then use setWeaponTarget, but it'd be too complicated and would probably fail, is there any other way to do it? Here you have the script: army1 = createPed (287, 1799.6999511719, -1721.8000488281, 25.799999237061, 207.99983215332) army2 = createPed (179, 1813.1999511719, -1721.6999511719, 17.89999961853, 158.24719238281) army3 = createPed (191, 1759.6999511719, -1683.9000244141, 21.200000762939, 126.00411987305) army4 = createPed (73, 1758.5, -1705.5999755859, 18.39999961853, 63.998596191406) army5 = createPed (312, 1764.0999755859, -1709.6999511719, 28.89999961853, 72) army6 = createPed (287, 1793.1999511719, -1705.1999511719, 13.5, 0.25) army7 = createPed (179, 2021.4000244141, -1409.1999511719, 23.10000038147, 128.00091552734) army8 = createPed (287, 2041.1999511719, -1414.5999755859, 17.10000038147, 102.00103759766) army9 = createPed (73, 1030.5, -970.70001220703, 47.5, 10.003204345703) army10 = createPed (312, 1013, -943.29998779297, 48.200000762939, 176.00512695313) army11 = createPed (191, 1051.9000244141, -939.20001220703, 50.400001525879, 206.00508117676) armypeds = {army1, army2, army3, army4, army5, army6, army7, army8, army9, army10, army11} function aped () for _, ped in ipairs ( armypeds ) do setElementFrozen ( ped, true ) setTimer (giveWeapon, 50, 1, ped, 31, 200, true) end end addEventHandler("onResourceStart", resourceRoot, aped) Ps: I had to use the timer because it wasn't working without it (For no reason I think).
  4. hey guys, I have a question. I'm supposed to do a script that every 24 hours (00:00) of real life it starts a function (and I've already made it). In the function that will be started, I need to get 2 random values, one from 0 to 23 and other from 1 to 5, I also did it (0 to 23 is the real time that a function will be started and 1 to 5 is which function will be started, there are 5 functions). So, after that, I needed to do almost 400 lines of "if ( hour == 0 and event == 101 ) then meteor end" to preview every possibilitie, so I'd like to ask you, is there any way to reduce this ammount of lines? It's really confused to explain and to read as well, so I'll put the script(download because it's 400 lines): http://www.sendspace.com/file/n51n4c
  5. Hello! I would like to know How i can use the function dxDrawText , with relative values. Can someone help me and give an Example? Thanks
  6. Thanks, but the same thing is happening =X edit: I've found the problem, I put absolute positions of the screen (Pixels) and not a Percentage of the screen (Basically, It was there, but outside of the screen limits)
  7. So, I've made a script, when I tested it on "Host Game" it was working fine, then I put it on my server, my brother joined it to help me testing. The script is basicaly a dx rectangle, some images, some dx texts and a showhud function. For me, the script was working fine, but for my brother the only thing working was the showhud function, can anyone help me to find the reason? addEventHandler("onClientResourceStart",resourceRoot, function() GUIEditor_Window = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(227,759,486,78,"",false) guiSetAlpha(GUIEditor_Window[1],0) GUIEditor_Image[1] = guiCreateStaticImage(776,670,334,172,"images/gui5.png",false) GUIEditor_Image[2] = guiCreateStaticImage(235,778,79,73,"images/gui1.png",false) GUIEditor_Image[3] = guiCreateStaticImage(353,770,211,90,"images/gui2.png",false) GUIEditor_Image[4] = guiCreateStaticImage(594,727,124,137,"images/gui3.png",false) end ) --------- health = getElementHealth( localPlayer ) armor = getPedArmor ( localPlayer ) -- Direct X Drawing addEventHandler("onClientRender",root, function() wid = getPedWeapon(localPlayer) dxDrawRectangle(1152.0,864.0,5.0,5.0,tocolor(255,255,255,255),false) dxDrawRectangle(0.0,821.0,1152.0,41.0,tocolor(0,0,0,170),false) dxDrawRectangle(1152.0,863.0,5.0,5.0,tocolor(255,255,255,255),false) dxDrawText(""..getPedArmor(localPlayer).."",673.0,835.0,742.0,861.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) dxDrawText(""..getPedTotalAmmo(localPlayer).."",480.0,835.0,549.0,861.0,tocolor(255,255,0,255),1.0,"default","left","top",false,false,false) dxDrawText(""..getElementHealth(localPlayer).."",287.0,835.0,356.0,861.0,tocolor(255,0,0,255),1.0,"default","left","top",false,false,false) dxDrawText(""..getWeaponNameFromID(wid).."",480.0,845.0,356.0,861.0,tocolor(255,255,0,255),1.0,"default","left","top",false,false,false) showPlayerHudComponent ("ammo", false) showPlayerHudComponent ("armour", false) showPlayerHudComponent ("breath", false) showPlayerHudComponent ("clock", false) showPlayerHudComponent ("health", false) showPlayerHudComponent ("money", false) showPlayerHudComponent ("weapon", false) end )
  8. Hmm, I'm trying to use the function GuiGridListGetSelectedItem, but i couldn't understand how exactly it works Can someone give me a simple example on how to use it? Thanks!
  9. guys, I really need help with peds and timers, i want to know what function should I use to make a ped follow someone and hit this person, I also want to know how to do a text that goes down like a timer (starts in 2:00 and goes down to 1:59, 1:58... but the player needs to see this text going down in his screen), there is one more thing, I would like to know what's the function that allows me to put short movies in the game (like most of the servers do when you create your account, with airplanes landing,etc) Thanks and sorry to disturb
  10. I used And i even posted a SS
  11. it worked! Thank you a lot! ;D
  12. i tried this It didn't work, But thank you for the help
  13. Well, I'm trying to make a Ped Panel, to practice my Scripting Skills, But i got a problem here. Can someone help me? When i press the button Create Ped on the GUI, Nothing happens, here is the error message : Server-Side function spawnPed (source) local x,y,z = getElementPosition (source) pedio = createPed (0, x-2, y+2, z) end addEvent("spawnPed", true) addEventHandler("spawnPed", getRootElement(),spawnPed) Client-Side PedWdw = guiCreateWindow(255,130,582,361,"Ped Panel v1.0",false) CrePed = guiCreateButton(21,36,148,57,"Create Ped",false,PedWdw) DesPed = guiCreateButton(394,36,148,57,"Destoy Ped",false,PedWdw) SkinPed = guiCreateButton(208,36,148,57,"Edit Skin",false,PedWdw) Teleport = guiCreateButton(20,140,148,57,"Teleport to you",false,PedWdw) EditWpn = guiCreateButton(209,140,148,57,"Edit Weapon",false,PedWdw) Target = guiCreateButton(395,140,148,57,"Set Target",false,PedWdw) guiSetFont(Credit,"sa-gothic") guiSetVisible (PedWdw, false) function Scripting () triggerServerEvent("spawnPed", getLocalPlayer()) end addEventHandler("onClientGUIClick", CrePed, Scripting) bindKey("F2","down", function () guiSetVisible(PedWdw, not guiGetVisible(PedWdw)) showCursor(guiGetVisible(PedWdw)) end)
  14. How do i make a GUI that, When i press F1, It opens and when i press F1 Again it closes?(Sorry for my ignorance ) Thanks for the help!
  15. i'm doing an elevator script, I'm at the easyer part, but it isn't working =X what should happen: when the player goes on the marker, the gui should appear what is the problem: it isn't appearing when the player goes on the marker =X function nome() Maingui = guiCreateWindow(390,70,232,350,"Select Floor",false) abutton = guiCreateButton(56,247,135,45,"1",false,Maingui) bbutton = guiCreateButton(55,156,135,45,"2",false,Maingui) cbutton = guiCreateButton(52,70,135,45,"3",false,Maingui) guiSetVisible(Maingui, false) end addEventHandler("onClientResourceStart",resourceRoot, nome) mymarker = createMarker(591, -3417, 61.5, "cylinder", 1, 255, 255, 255, 140) function Visible(thePlayer) guiSetVisible(Maingui, true) end addEventHandler("onMarkerHit", mymarker, Visible)
  16. Thank you, and thanks the other who tryed to help me too ;D
  17. I was doing a map and i used a51_outbldgs object (a group of militar "houses"), i set doubleside true, when i was testing the map, i was able to walk thru the the object, this never happened with me, can anyone help me?
  18. This isn't a hard script for you, this is just a VERY basic script for you, but anyway, you are THE BEST SCRIPT ever, thx castillo =D I changed everything that was "theMarker" and "source" for "thePlayer", it wasn't working with "theMarker" and "source", realy thanks castilo!
  19. Hey, I'm doing a script that is suposed to warp the player to the place I chosed, in the script I made the marker and where the player will be warped, when he get in the marker, there will be a fade out of 2 secs, a message will appear and the screen will be black for 7 seconds, then, and the message will be deleted and there will be a fade in of 2 sec, but 1 - I set the marker to be an arrow, not a cilinder. 2 - the fade in isn't working and I don't know if the marker disapeared (the goal is that it stay there forever). local markert = createMarker(1960, -1583, 14,arrow , 1, 0, 255, 0, 200) function Teleport(thePlayer) local x = 3597 local y = -2611 local z = 1093 setElementPosition(thePlayer, x, y, z, true) fadeCamera(thePlayer, false, 2) local Display = textCreateDisplay() textDisplayAddObserver (Display, thePlayer) local Text = textCreateTextItem ( "GSC's Base", 0.5, 0.5, 1, 0, 255, 0, 255, 6.0 ) setTimer(textDisplayAddText, 2000, 1, Display, Text ) setTimer(fadeCamera, 7000, 1, true, 2) setTimer(textDestroyDisplay, 7000, 1, Display) end addEventHandler("onMarkerHit", markert, Teleport)
  20. I'm searching for some maps and I realy want to train with them in map editor, but i'm not finding them for download, can you help me?? Xman - New Generations Rafinha V9/V10/V11 Vortex V9/V11 Make me blowjob Super mario portal Infernus wave tracks Hypnoze Kompot Z-Dupy 1
  21. I know that i should put it at the end, put at the end i've already put addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource(), function GUI1() createLoginWindow() outputChatBox("Bem vindo/a ao TBG - RealPlay!") if (wdwLogin ~= nil) then guiSetVisible(wdwLogin, true) else outputChatBox("Ocorreu um inesperado erro no carregamento no painel de Login, tente reconectar!") end showCursor(true) guiSetInputEnabled(true) end ) I understood this other type to use addEventHandler, but the problem is how to put this code /\ and this "addEventHandler("onClientGUIClick", btnLogin, clientSubmitLogin, false)" at the same time =P
  22. Your not ignorant at all, your just asking a question but what Im glad to see is that your actually trying to learn LUA. In the future when you get an error, login as admin in your server and type /debugscript 3 that will display a GUI that shows the errors on the script, post the errors here and then we can narrow down whats wrong. Okay, i'll do that I dont know if you know, but i'm StormFox, from the SAUR server And Thanks for all your help, i really appreciate it
×
×
  • Create New...