Jump to content

bandi94

Members
  • Posts

    1,037
  • Joined

  • Last visited

Everything posted by bandi94

  1. bandi94

    how ?

    function markerattach ( player ) local vehicle = getPedOccupiedVehicle(player) local Marker = createMarker ( 0, 0, 0, "arrow", 1, 255, 0, 0, 170 ) attachElements ( Marker, vehicle, 0, 0, 2 ) end addCommandHandler ( "attach", markerattach )
  2. bandi94

    Gui.lua

    i think ist not the script fix (problem ) its a Qt to LUA scripting bug ( when you transformet Qt to LUA the positions of text was scripted wrong)
  3. bandi94

    Gui.lua

    i don't know i only added the missing ")" and added a name to function (it need) and added an event handler on resource start for that function i don't modified positions ...
  4. bandi94

    Gui.lua

    try this -- Code generated by DKR QT to Lua 0.1.7 -- -- Source: gui2.ui -- -- Date: 31/07/2011 - 07:51:20 -- ------------------------------------- addEventHandler("onClientResourceStart",resourceRoot, function() local gui = {} gui._placeHolders = {} local screenWidth, screenHeight = guiGetScreenSize() local windowWidth, windowHeight = 800, 615 local left = screenWidth/2 - windowWidth/2 local top = screenHeight/2 - windowHeight/2 gui["_root"] = guiCreateWindow(left, top, windowWidth, windowHeight, "TabWidget", false) guiWindowSetSizable(gui["_root"], false) return gui, windowWidth, windowHeight end) addEventHandler("onClientResourceStart",resourceRoot, function (parent) local gui = {} gui._placeHolders = {} gui["label"] = guiCreateLabel(372, 50, 61, 41, "Rules", false, parent) guiSetFont(gui["label"], "default-bold-small") guiLabelSetHorizontalAlign(gui["label"], "left", false) guiLabelSetVerticalAlign(gui["label"], "center") gui._placeHolders["textBrowser"] = {left = 12, top = 110, width = 781, height = 411, parent = parent} gui["pushButton"] = guiCreateButton(262, 550, 91, 41, "Accept", false, parent) if on_pushButton_clicked then addEventHandler("onClientGUIClick", gui["pushButton"], on_pushButton_clicked, false) end gui["pushButton_2"] = guiCreateButton(422, 550, 91, 41, "Decline", false, parent) if on_pushButton_2_clicked then addEventHandler("onClientGUIClick", gui["pushButton_2"], on_pushButton_2_clicked, false) end gui["checkBox"] = guiCreateCheckBox(12, 530, 361, 21, "I accept the Rules and Conditions and i will be play fair !", false, false, parent) guiSetFont(gui["checkBox"], "default-bold-small") gui["label_2"] = guiCreateLabel(22, 190, 101, 31, "*DONT HACK!", false, parent) guiSetFont(gui["label_2"], "default-bold-small") guiLabelSetHorizontalAlign(gui["label_2"], "left", false) guiLabelSetVerticalAlign(gui["label_2"], "center") gui["label_3"] = guiCreateLabel(22, 220, 101, 31, "*DONT ABUSE!", false, parent) guiSetFont(gui["label_3"], "default-bold-small") guiLabelSetHorizontalAlign(gui["label_3"], "left", false) guiLabelSetVerticalAlign(gui["label_3"], "center") gui["label_4"] = guiCreateLabel(22, 250, 161, 31, "*DONT FLOOD THE CHAT!", false, parent) guiSetFont(gui["label_4"], "default-bold-small") guiLabelSetHorizontalAlign(gui["label_4"], "left", false) guiLabelSetVerticalAlign(gui["label_4"], "center") gui["label_5"] = guiCreateLabel(22, 280, 101, 31, "*DONT BOTHER!", false, parent) guiSetFont(gui["label_5"], "default-bold-small") guiLabelSetHorizontalAlign(gui["label_5"], "left", false) guiLabelSetVerticalAlign(gui["label_5"], "center") gui["label_6"] = guiCreateLabel(22, 310, 211, 31, "*DONT USE MODIFIED HANDLING!", false, parent) guiSetFont(gui["label_6"], "default-bold-small") guiLabelSetHorizontalAlign(gui["label_6"], "left", false) guiLabelSetVerticalAlign(gui["label_6"], "center") gui["label_7"] = guiCreateLabel(22, 350, 171, 21, "*DONT USE VISUAL MODS!", false, parent) guiSetFont(gui["label_7"], "default-bold-small") guiLabelSetHorizontalAlign(gui["label_7"], "left", false) guiLabelSetVerticalAlign(gui["label_7"], "center") gui._placeHolders["line"] = {left = 12, top = 359, width = 781, height = 91, parent = parent} gui["label_8"] = guiCreateLabel(32, 420, 101, 31, "Have Fun !", false, parent) guiSetFont(gui["label_8"], "default-bold-small") guiLabelSetHorizontalAlign(gui["label_8"], "left", false) guiLabelSetVerticalAlign(gui["label_8"], "center") gui["label_9"] = guiCreateLabel(282, 480, 751, 61, "Every rule break will result ban or permaban .", false, parent) guiSetFont(gui["label_9"], "default-small") guiLabelSetHorizontalAlign(gui["label_9"], "left", false) guiLabelSetVerticalAlign(gui["label_9"], "center") return gui end) function on_pushButton_clicked(button, state, absoluteX, absoluteY) if (button ~= "left") or (state ~= "up") then return end --TODO: Implement your button click handler here end function on_pushButton_2_clicked(button, state, absoluteX, absoluteY) if (button ~= "left") or (state ~= "up") then return end --TODO: Implement your button click handler here end
  5. nice jobb are some bugs ( missing ")" and don't add function name where it need )
  6. bandi94

    Gui.lua

    try this its missing a ")" and " function (parent)" need a name i add "function gui (parent)" i don't know if it will work or not -- Code generated by DKR QT to Lua 0.1.7 -- -- Source: gui2.ui -- -- Date: 31/07/2011 - 07:51:20 -- ------------------------------------- addEventHandler("onClientResourceStart",resourceRoot, function() local gui = {} gui._placeHolders = {} local screenWidth, screenHeight = guiGetScreenSize() local windowWidth, windowHeight = 800, 615 local left = screenWidth/2 - windowWidth/2 local top = screenHeight/2 - windowHeight/2 gui["_root"] = guiCreateWindow(left, top, windowWidth, windowHeight, "TabWidget", false) guiWindowSetSizable(gui["_root"], false) return gui, windowWidth, windowHeight end) function gui (parent) local gui = {} gui._placeHolders = {} gui["label"] = guiCreateLabel(372, 50, 61, 41, "Rules", false, parent) guiSetFont(gui["label"], "default-bold-small") guiLabelSetHorizontalAlign(gui["label"], "left", false) guiLabelSetVerticalAlign(gui["label"], "center") gui._placeHolders["textBrowser"] = {left = 12, top = 110, width = 781, height = 411, parent = parent} gui["pushButton"] = guiCreateButton(262, 550, 91, 41, "Accept", false, parent) if on_pushButton_clicked then addEventHandler("onClientGUIClick", gui["pushButton"], on_pushButton_clicked, false) end gui["pushButton_2"] = guiCreateButton(422, 550, 91, 41, "Decline", false, parent) if on_pushButton_2_clicked then addEventHandler("onClientGUIClick", gui["pushButton_2"], on_pushButton_2_clicked, false) end gui["checkBox"] = guiCreateCheckBox(12, 530, 361, 21, "I accept the Rules and Conditions and i will be play fair !", false, false, parent) guiSetFont(gui["checkBox"], "default-bold-small") gui["label_2"] = guiCreateLabel(22, 190, 101, 31, "*DONT HACK!", false, parent) guiSetFont(gui["label_2"], "default-bold-small") guiLabelSetHorizontalAlign(gui["label_2"], "left", false) guiLabelSetVerticalAlign(gui["label_2"], "center") gui["label_3"] = guiCreateLabel(22, 220, 101, 31, "*DONT ABUSE!", false, parent) guiSetFont(gui["label_3"], "default-bold-small") guiLabelSetHorizontalAlign(gui["label_3"], "left", false) guiLabelSetVerticalAlign(gui["label_3"], "center") gui["label_4"] = guiCreateLabel(22, 250, 161, 31, "*DONT FLOOD THE CHAT!", false, parent) guiSetFont(gui["label_4"], "default-bold-small") guiLabelSetHorizontalAlign(gui["label_4"], "left", false) guiLabelSetVerticalAlign(gui["label_4"], "center") gui["label_5"] = guiCreateLabel(22, 280, 101, 31, "*DONT BOTHER!", false, parent) guiSetFont(gui["label_5"], "default-bold-small") guiLabelSetHorizontalAlign(gui["label_5"], "left", false) guiLabelSetVerticalAlign(gui["label_5"], "center") gui["label_6"] = guiCreateLabel(22, 310, 211, 31, "*DONT USE MODIFIED HANDLING!", false, parent) guiSetFont(gui["label_6"], "default-bold-small") guiLabelSetHorizontalAlign(gui["label_6"], "left", false) guiLabelSetVerticalAlign(gui["label_6"], "center") gui["label_7"] = guiCreateLabel(22, 350, 171, 21, "*DONT USE VISUAL MODS!", false, parent) guiSetFont(gui["label_7"], "default-bold-small") guiLabelSetHorizontalAlign(gui["label_7"], "left", false) guiLabelSetVerticalAlign(gui["label_7"], "center") gui._placeHolders["line"] = {left = 12, top = 359, width = 781, height = 91, parent = parent} gui["label_8"] = guiCreateLabel(32, 420, 101, 31, "Have Fun !", false, parent) guiSetFont(gui["label_8"], "default-bold-small") guiLabelSetHorizontalAlign(gui["label_8"], "left", false) guiLabelSetVerticalAlign(gui["label_8"], "center") gui["label_9"] = guiCreateLabel(282, 480, 751, 61, "Every rule break will result ban or permaban .", false, parent) guiSetFont(gui["label_9"], "default-small") guiLabelSetHorizontalAlign(gui["label_9"], "left", false) guiLabelSetVerticalAlign(gui["label_9"], "center") return gui end function on_pushButton_clicked(button, state, absoluteX, absoluteY) if (button ~= "left") or (state ~= "up") then return end --TODO: Implement your button click handler here end function on_pushButton_2_clicked(button, state, absoluteX, absoluteY) if (button ~= "left") or (state ~= "up") then return end --TODO: Implement your button click handler here end
  7. i don't know why its not working if you wanna i can make it whit a marker when you go in front of the gate its open when you left the gate its close ... or see if somebody can fix it
  8. try this --Client side: Only you can see it opening --Server side: Everybody can see it opening -- Create the marker at the middle of GTA gate = createObject(980, 1119.2196044922, -1161.8154296875, 25.339630126953, 0, 0, 0) -- create the gate when the resource starts function moveGate() -- create the moving gate function moveObject(gate, 3000, 1119.2196044922, -1161.8154296875, 23.339630126953) -- move it 5 units higher in 1 second (1000ms) setTimer(moveObject, 6000, 1, gate,3000, 1119.2196044922, -1161.8154296875, 25.339630126953) -- move it back after 3 seconds end addCommandHandler("meep", moveGate)
  9. you added "1" at moveObject affter 1000 and also i modified 1000 to 3000 and 5000 to 6000 for smother move --Client side: Only you can see it opening --Server side: Everybody can see it opening -- Create the marker at the middle of GTA gate = createObject(980, 1119.2196044922, -1161.8154296875, 25.339630126953, 0, 0, 0) -- create the gate when the resource starts function moveGate() -- create the moving gate function moveObject(gate, 3000, 1119.2196044922, -1161.8154296875, 23.339630126953, 0, 0, 0) -- move it 5 units higher in 1 second (1000ms) setTimer(moveObject, 6000, 1, gate, 1119.2196044922, -1161.8154296875, 25.339630126953, 0, 0, 0) -- move it back after 3 seconds end addCommandHandler("meep", moveGate)
  10. bandi94

    Gui.lua

    missing ")" at line 42 i put the ) for you test it now ------------------------------------- -- Code generated by DKR QT to Lua 0.1.7 -- -- Source: GUI.ui -- -- Date: 31/07/2011 - 01:29:51 -- ------------------------------------- addEventHandler("onClientResourceStart",resourceRoot, function() local gui = {} gui._placeHolders = {} local screenWidth, screenHeight = guiGetScreenSize() local windowWidth, windowHeight = 800, 600 local left = screenWidth/2 - windowWidth/2 local top = screenHeight/2 - windowHeight/2 gui["_root"] = guiCreateWindow(left, top, windowWidth, windowHeight, "Dialog", false) guiWindowSetSizable(gui["_root"], false) gui[""] = guiCreateButton(125, 268, 75, 24, "Accept", false, gui["_root"]) if on__clicked then addEventHandler("onClientGUIClick", gui[""], on__clicked, false) end gui[""] = guiCreateButton(206, 268, 75, 24, "Decline", false, gui["_root"]) if on__clicked then addEventHandler("onClientGUIClick", gui[""], on__clicked, false) end gui["checkBox"] = guiCreateCheckBox(10, 225, 341, 41, "I accept the rules and i will be play fair, will not bother others!", false, false, gui["_root"]) gui["tabWidget"] = guiCreateTabPanel(20, 45, 361, 181, false, gui["_root"]) gui["tab"] = guiCreateTab("Rules", gui["tabWidget"]) gui._placeHolders["textEdit"] = {left = 0, top = 0, width = 361, height = 161, parent = gui["tab"]} gui["tab_2"] = guiCreateTab("Staff", gui["tabWidget"]) gui["scrollArea"] = guiCreateScrollPane(339, 0, 121, 171, false, gui["tab_2"]) return gui, windowWidth, windowHeight end) function on__clicked(button, state, absoluteX, absoluteY) if (button ~= "left") or (state ~= "up") then return end --TODO: Implement your button click handler here end function on__clicked(button, state, absoluteX, absoluteY) if (button ~= "left") or (state ~= "up") then return end --TODO: Implement your button click handler here end
  11. gate = createObject(980, x, y, z, rx, ry, rz) -- 980 it id of object(gate) x,y,z is cordinates of gate ,rx,ry,rz is rotation of gate function moveGate() -- create the moving gate function moveObject(gate, 1000, x, y, z) -- 1 second (1000ms) x,y,z is the cordinates when gate is opened setTimer(moveObject, 5000, 1, gate, x, y, z) -- move it back after 5=(5000ms) seconds, x,y,z is cordinates when the gate is closed end addCommandHandler("meep", moveGate)-- to open the gate you need to write in chat /meep you need to ad this in a .lua file in meta you put server side start script start play mode go to gate and write in chat /meep and the gate open and after 5s after opened it close (its btert to usemarker bk if you stay in gate and the 5 sec passed then the gate will close and you get stuck) in map editor put your gate when you whant and se ethe cordinates when the gate is in colsed posotion and again when is opened position
  12. bk you need to put your cordinates tell me you wanna the gate to open whit code ( exp you need to type in chat /meep or check the player name ) and i make it for you and i show you where you need to put your cordinates and ..
  13. @ Jesseunit why you create a marker if you use comand (/meep) ? @ NameThatGuy you wanna the gate to open whit code ( exp you need to type in chat /meep or check the player name )
  14. createMarker -- create a marker "onMarkerHit"--when player hit the marker getPlayerName -- to check player name moveObject --to open the gate "onMarkerLeave"-- when the player left the marker moveObject --to close the gate
  15. function setThePlayerTeam(player) if player then local r, g, b = getTeamColor(getPlayerTeam(player)) createBlipAttachedTo(player,2,1,r,g,b) end end
  16. bandi94

    Stats system

    yes if the player is loged in
  17. yes bk playSound3D is clients side = only that client (player) hear it
  18. bandi94

    GTA Stats

    local account local skill local time = 0 function getdata (player) account=getPlayerAccount(player) if not account or isGuestAccount(account) then return end skill = getAccountData(account,"skill") if not skill then setAccountData(account,"skill",0) end end addEventHandler("onPlayerLogin",root,getdata) ----- this function give 1 exp when player drived a car for 1 hour------ function addskill() if isPedInVehicle(getLocalPlayer()) then time = time+1 end if time == 3600 then setAccountData(account,"skill",tonumber(accountData)+1) time =0 end end setTimer(addskill,1000,0)
  19. bandi94

    idle cars?

    then put your spawn x,y,z
  20. bandi94

    idle cars?

    you write x,y,z where you wana to put the car if is idle or use random to don't put 2 cars on same place ex. setElementPosition(vehicle,1600,-2000,5)
  21. bandi94

    GTA Stats

    yes you can do that but you need something when to add the skill like if you drive 1h you get skill or ...
  22. bandi94

    idle cars?

    if isPedInVehicle(player) then ---- check if player is in vehicle or not ...
  23. bandi94

    idle cars?

    addEventHandler("onResourceStart",getRootElement(), function() local vehicles = getElementsByType ( "vehicle" ) -- Return all the vehicles in a table for k, vehicle in ipairs ( vehicles ) do -- For every vehicle do the following... resetVehicleIdleTime ( vehicle ) -- Reset the vehicle's idle time setTimer(function() setElementPosition(vehicle,x,y,z) end,30000,0) end end)
×
×
  • Create New...