Jump to content

Victor214

Members
  • Posts

    32
  • Joined

  • Last visited

Details

  • Gang
    IDK

Victor214's Achievements

Rat

Rat (9/54)

0

Reputation

  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)
×
×
  • Create New...