Jump to content

FreeGells

Members
  • Posts

    32
  • Joined

  • Last visited

Everything posted by FreeGells

  1. getElementPosition ( thePlayer ) ?
  2. And how i get the player position on server-side ? x_x
  3. ok, now leaving a little of topic subject, how can I create a command with params? ex: /gate obj pass
  4. How i create the gate ingame ?
  5. Hello friends! I wonder if any of you have any resource to create gates in-game with password, I am looking this for a long time, thanks!
  6. FreeGells

    Help

    hello, please help me with this script function glue() local player = getLocalPlayer() if not getPedOccupiedVehicle(player) then local vehicle = getPedContactElement(player) if getElementType(vehicle) == "vehicle" then local px, py, pz = getElementPosition(player) local vx, vy, vz = getElementPosition(vehicle) local sx = px - vx local sy = py - vy local sz = pz - vz local rotpX = 0 local rotpY = 0 local rotpZ = getPedRotation(player) local rotvX,rotvY,rotvZ = getElementRotation(vehicle) local t = math.rad(rotvX) local p = math.rad(rotvY) local f = math.rad(rotvZ) local ct = math.cos(t) local st = math.sin(t) local cp = math.cos(p) local sp = math.sin(p) local cf = math.cos(f) local sf = math.sin(f) local z = ct*cp*sz + (sf*st*cp + cf*sp)*sx + (-cf*st*cp + sf*sp)*sy local x = -ct*sp*sz + (-sf*st*sp + cf*cp)*sx + (cf*st*sp + sf*cp)*sy local y = st*sz - sf*ct*sx + cf*ct*sy local rotX = rotpX - rotvX local rotY = rotpY - rotvY local rotZ = rotpZ - rotvZ local slot = getPedWeaponSlot(player) triggerServerEvent("gluePlayer", player, slot, vehicle, x, y, z, rotX, rotY, rotZ) unbindKey("m","down",glue) bindKey("m","down",unglue) end end end addCommandHandler("glue",glue) function unglue () local player = getLocalPlayer() triggerServerEvent("ungluePlayer", player) unbindKey("jump","down",unglue) unbindKey("m","down",unglue) bindKey("m","down",glue) end addCommandHandler("unglue",unglue) bindKey("m", "down", glue) ERROR: Is on Server-Side Thanks!
  7. Hello! I need check if player is in a top of vehicle, how i check this ? thanks
  8. Hello friends, i need help to make random messages, but i dont have idea how i make this, please help, thanks.
  9. Hello! I need help to change weapons sound, why i don't have idea to how make this, thanks!
  10. sorry, forgot to remove that part.
  11. i try adapt this, but i dont got it function reload (thePlayer) reloadPedWeapon( thePlayer) addEventHandler('onResourceStart', resourceRoot, reload) end function replaceModel() txd = engineLoadTXD ( "skins/10.txd" ) engineImportTXD ( txd, 10 ) dff = engineLoadDFF ( "skins/10.dff", 10 ) engineReplaceModel ( dff, 10 ) txd = engineLoadTXD ( "weapons/m4.txd" ) engineImportTXD ( txd, 356 ) dff = engineLoadDFF ( "weapons/m4.dff", 356 ) engineReplaceModel ( dff, 356 ) txd = engineLoadTXD ( "weapons/sniper.txd" ) engineImportTXD ( txd, 358 ) dff = engineLoadDFF ( "weapons/sniper.dff", 358 ) engineReplaceModel ( dff, 358 ) end addEventHandler("onPlayerJoin", getRootElement(), function() bindKey(source, "r", "down", reloadGun) end) addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel, resourceRoot, reload) addEventHandler('onPlayerJoin', resourceRoot, function(thePlayer) bindKey(thePlayer, 'r', 'down', reload) end )
  12. Hello friends, i try create a bind to reload my weapon with R , but this dont working.. Code: function reloadGun(sourcePlayer, command) reloadPedWeapon(sourcePlayer) end addEventHandler("onPlayerJoin", getRootElement(), function() bindKey(source, "r", "down", reloadGun) end) Thanks!
  13. FreeGells

    GUI Help

    The error continue... @EDIT FIXED! Thanks for all.
  14. FreeGells

    GUI Help

    61: Bad argument @ 'bindKey'
  15. FreeGells

    GUI Help

    Oh, sorry.. function build_Dialog() local gui = {} gui._placeHolders = {} local screenWidth, screenHeight = guiGetScreenSize() local windowWidth, windowHeight = 633, 608 local left = screenWidth/2 - windowWidth/2 local top = screenHeight/2 - windowHeight/2 gui["_root"] = guiCreateWindow(left, top, windowWidth, windowHeight, "SEALS Clan [ADMIN PANEL]", false) guiWindowSetSizable(gui["_root"], false) gui["label"] = guiCreateLabel(10, 25, 201, 41, "Players Online:", false, gui["_root"]) guiLabelSetHorizontalAlign(gui["label"], "left", false) guiLabelSetVerticalAlign(gui["label"], "center") gui["label_2"] = guiCreateLabel(400, 25, 201, 41, "Variaveis:", false, gui["_root"]) guiLabelSetHorizontalAlign(gui["label_2"], "left", false) guiLabelSetVerticalAlign(gui["label_2"], "center") gui["setr"] = guiCreateEdit(250, 95, 121, 21, "", false, gui["_root"]) guiEditSetMaxLength(gui["setr"], 32767) gui["label_3"] = guiCreateLabel(250, 75, 71, 16, "Setar para:", false, gui["_root"]) guiLabelSetHorizontalAlign(gui["label_3"], "left", false) guiLabelSetVerticalAlign(gui["label_3"], "center") gui["srt_botao"] = guiCreateButton(270, 125, 75, 23, "Setar", false, gui["_root"]) if on_srt_botao_clicked then addEventHandler("onClientGUIClick", gui["srt_botao"], on_srt_botao_clicked, false) end gui["fecha_botao"] = guiCreateButton(270, 575, 75, 23, "Fechar", false, gui["_root"]) if on_fecha_botao_clicked then addEventHandler("onClientGUIClick", gui["fecha_botao"], on_fecha_botao_clicked, false) end gui["listWidget"] = guiCreateGridList(10, 65, 211, 531, false, gui["_root"]) guiGridListSetSortingEnabled(gui["listWidget"], false) gui["listWidget_col"] = guiGridListAddColumn(gui["listWidget"], "", 0.85) local listWidget_row = nil gui["listWidget_2"] = guiCreateGridList(400, 65, 221, 531, false, gui["_root"]) guiGridListSetSortingEnabled(gui["listWidget_2"], false) gui["listWidget_2_col"] = guiGridListAddColumn(gui["listWidget_2"], "", 0.85) local listWidget_2_row = nil return gui, windowWidth, windowHeight end function on_srt_botao_clicked(button, state, absoluteX, absoluteY) if (button ~= "left") or (state ~= "up") then return end end function on_fecha_botao_clicked(button, state, absoluteX, absoluteY) if (button ~= "left") or (state ~= "up") then guiSetVisible ( gui["_root"], false ) return end end function joinHandler() guiSetVisible ( gui["_root"], false ) end addEventHandler ( "onClientResourceStart", resourceRoot, build_Dialog ) addEventHandler("onPlayerJoin", getRootElement(), joinHandler) bindKey ( "F3", function ( ) guiSetVisible ( gui["_root"], not guiGetVisible ( gui["_root"] ) ) showCursor ( guiGetVisible ( gui["_root"] ) ) for id, playeritem in ipairs(getElementsByType("player")) do local row = guiGridListAddRow ( gui["listWidget"] ) guiGridListSetItemText ( gui["listWidget"], row, gui["listWidget_col"], getPlayerName ( playeritem ), false, false ) end end )
  16. FreeGells

    GUI Help

    Ok.. one more help, on i enter in the server, the GUI is visible, the F3 button don't work, and the online players don't appears in the grid... ): function joinHandler() guiSetVisible ( gui["_root"], false ) end addEventHandler ( "onClientResourceStart", resourceRoot, build_Dialog ) addEventHandler("onPlayerJoin", getRootElement(), joinHandler) bindKey ( "F3", function ( ) guiSetVisible ( gui["_root"], not guiGetVisible ( gui["_root"] ) ) showCursor ( guiGetVisible ( gui["_root"] ) ) local column = guiGridListAddColumn( gui["listWidget"], "Online:", 0.85 ) for id, playeritem in ipairs(getElementsByType("player")) do local row = guiGridListAddRow ( gui["listWidget"] ) guiGridListSetItemText ( gui["listWidget"], row, column, getPlayerName ( playeritem ), false, false ) end end )
  17. FreeGells

    GUI Help

    ok, thanks for the help castillo, you have skype?
  18. FreeGells

    GUI Help

    and i can't put the elements in the grid to edit them? ):
  19. FreeGells

    GUI Help

    Castillo, and to put the elements in the grind list ? in the end of script have outputChatBox, i need put this in a grid "listWidget_2"... Code updated: function build_Dialog() local gui = {} gui._placeHolders = {} local screenWidth, screenHeight = guiGetScreenSize() local windowWidth, windowHeight = 633, 608 local left = screenWidth/2 - windowWidth/2 local top = screenHeight/2 - windowHeight/2 gui["_root"] = guiCreateWindow(left, top, windowWidth, windowHeight, "SEALS Clan [ADMIN PANEL]", false) guiWindowSetSizable(gui["_root"], false) gui["label"] = guiCreateLabel(10, 25, 201, 41, "Players Online:", false, gui["_root"]) guiLabelSetHorizontalAlign(gui["label"], "left", false) guiLabelSetVerticalAlign(gui["label"], "center") gui["label_2"] = guiCreateLabel(400, 25, 201, 41, "Variaveis:", false, gui["_root"]) guiLabelSetHorizontalAlign(gui["label_2"], "left", false) guiLabelSetVerticalAlign(gui["label_2"], "center") gui["setr"] = guiCreateEdit(250, 95, 121, 21, "", false, gui["_root"]) guiEditSetMaxLength(gui["setr"], 32767) gui["label_3"] = guiCreateLabel(250, 75, 71, 16, "Setar para:", false, gui["_root"]) guiLabelSetHorizontalAlign(gui["label_3"], "left", false) guiLabelSetVerticalAlign(gui["label_3"], "center") gui["srt_botao"] = guiCreateButton(270, 125, 75, 23, "Setar", false, gui["_root"]) if on_srt_botao_clicked then addEventHandler("onClientGUIClick", gui["srt_botao"], on_srt_botao_clicked, false) end gui["fecha_botao"] = guiCreateButton(270, 575, 75, 23, "Fechar", false, gui["_root"]) if on_fecha_botao_clicked then addEventHandler("onClientGUIClick", gui["fecha_botao"], on_fecha_botao_clicked, false) end gui["listWidget"] = guiCreateGridList(10, 65, 211, 531, false, gui["_root"]) guiGridListSetSortingEnabled(gui["listWidget"], false) gui["listWidget_col"] = guiGridListAddColumn(gui["listWidget"], "", 0.85) local listWidget_row = nil gui["listWidget_2"] = guiCreateGridList(400, 65, 221, 531, false, gui["_root"]) guiGridListSetSortingEnabled(gui["listWidget_2"], false) gui["listWidget_2_col"] = guiGridListAddColumn(gui["listWidget_2"], "", 0.85) local listWidget_2_row = nil return gui, windowWidth, windowHeight end function on_srt_botao_clicked(button, state, absoluteX, absoluteY) if (button ~= "left") or (state ~= "up") then return end end function on_fecha_botao_clicked(button, state, absoluteX, absoluteY) if (button ~= "left") or (state ~= "up") then return end end addEventHandler ( "onClientResourceStart", resourceRoot, build_Dialog ) bindKey ( "F2", function ( ) guiSetVisible ( gui["_root"], not guiGetVisible ( gui["_root"] ) ) showCursor ( guiGetVisible ( gui["_root"] ) ) local data = getAllElementData(thePlayer) for k, v in pairs(data) do outputChatBox(tostring(k) .. ": " .. tostring(v), thePlayer) // here the function to add at the grid end end )
  20. FreeGells

    GUI Help

    Hello friends, i create this GUI with QTToLua , and i don't know how put this on game, how i open this GUI on press key F2 ? Please help! thank you GUI: function build_Dialog() local gui = {} gui._placeHolders = {} local screenWidth, screenHeight = guiGetScreenSize() local windowWidth, windowHeight = 633, 608 local left = screenWidth/2 - windowWidth/2 local top = screenHeight/2 - windowHeight/2 gui["_root"] = guiCreateWindow(left, top, windowWidth, windowHeight, "SEALS Clan [ADMIN PANEL]", false) guiWindowSetSizable(gui["_root"], false) gui._placeHolders["online"] = {left = 10, top = 65, width = 211, height = 531, parent = gui["_root"]} gui._placeHolders["variaveis"] = {left = 400, top = 65, width = 221, height = 531, parent = gui["_root"]} gui["label"] = guiCreateLabel(10, 25, 201, 41, "Players Online:", false, gui["_root"]) guiLabelSetHorizontalAlign(gui["label"], "left", false) guiLabelSetVerticalAlign(gui["label"], "center") gui["label_2"] = guiCreateLabel(400, 25, 201, 41, "Variaveis:", false, gui["_root"]) guiLabelSetHorizontalAlign(gui["label_2"], "left", false) guiLabelSetVerticalAlign(gui["label_2"], "center") gui["setr"] = guiCreateEdit(250, 95, 121, 21, "", false, gui["_root"]) guiEditSetMaxLength(gui["setr"], 32767) gui["label_3"] = guiCreateLabel(250, 75, 71, 16, "Setar para:", false, gui["_root"]) guiLabelSetHorizontalAlign(gui["label_3"], "left", false) guiLabelSetVerticalAlign(gui["label_3"], "center") gui["srt_botao"] = guiCreateButton(270, 125, 75, 23, "Setar", false, gui["_root"]) if on_srt_botao_clicked then addEventHandler("onClientGUIClick", gui["srt_botao"], on_srt_botao_clicked, false) end gui["fecha_botao"] = guiCreateButton(270, 575, 75, 23, "Fechar", false, gui["_root"]) if on_fecha_botao_clicked then addEventHandler("onClientGUIClick", gui["fecha_botao"], on_fecha_botao_clicked, false) end return gui, windowWidth, windowHeight end
  21. Hello! How create a GUI with a grindlist with online players ? i search for it a lot of time, thanks
  22. Don't! Appears only: "Water Bottle: 0" and "Wood: 0" when i execute the command.
  23. No, it give me 2 Sniper Rifles, if i use: setElementData(getPlayerFromName("FreeGells"),"Sniper Ammo", 10) I Get 10 Sniper Ammo. (This show in my inventory, if i use admin painel in "p" then dont put sniper/ammo in inventory). @EDIT I Think the value is a boolean, and is 'true' or 'false', not a integer value
×
×
  • Create New...