Jump to content

swedishboy

Members
  • Posts

    45
  • Joined

  • Last visited

Everything posted by swedishboy

  1. This will freeze the player in 3 seconds and then make him unfreeze again --sets the armor when someone attacked him function buyShield(thePlayer) local money = getPlayerMoney ( thePlayer ) if money >= 5000 then exports.texts:output("You have bought armor for $5000",thePlayer, 0, 255, 0) setPedArmor ( thePlayer, 100 ) takePlayerMoney ( thePlayer, 5000 ) setElementFrozen(thePlayer, true) setTimer ( function() setElementFrozen (thePlayer, false) end, 3000, 1 ) else exports.texts:output("You don't have enough money.",thePlayer, 255, 0, 0) end end addCommandHandler ( "buyarmor", buyShield )
  2. Try hijackSpawnLocations = { {407.2060546875, -1317.748046875, 14.8968334198}, {1987.4150390625, -1219.77734375, 20.0234375}, {706.1728515625, -1627.5732421875, 3.4375}, {1627.3935546875, -1516.0615234375, 13.604349136353}, {1254.90234375, -2026.1435546875, 59.565620422363}, {2469.4697265625, -2070.9326171875, 13.546875}, {402, 1359.490234375, -1663.4287109375, 8.609375} } hijackVehicleIDs = { {402}, {434}, {492}, {551}, {496}, {445} } deliveryLocations = { {1315.8544921875, -1379.6435546875, 12.742877960205}, {2772.787109375, -1606.0068359375, 9.921875}, {1716.384765625, -1921.58984375, 12.566222190857}, {370.3857421875, -2079.5712890625, 6.8359375}, {2156.2705078125, -1134.7431640625, 24.420726776123}, {2791.4453125, -2096.521484375, 10.388750076294} }
  3. Try this one addEvent "onPlayerHeadshot" addEventHandler("onPlayerDamage", getRootElement(), function (attacker, weapon, bodypart, loss) if getElementType ( attacker ) == "player" then if bodypart == 9 and weapon == 34 then local HSteam = getPlayerTeam(attacker) if HSteam and getTeamName(HSteam)=="YOUR GANG NAME HERE" then local result = triggerEvent("onPlayerHeadshot",source, attacker, weapon, loss) if result == true then killPed(source, attacker, weapon, bodypart) setPedHeadless( source, true ) addEventHandler("onPlayerSpawn", root, function () setPedHeadless( source, false) end ) end end end end end ) function BackUp( source ) if getElementType ( source ) == "player" then setPedHeadless ( source, false ) end end
  4. The script works fine for me, tested it.. So dont understand why it didnt work for you
  5. I guess you start the headshot script that already exist, rename is like this in your Meta "Headshot" type="script" version="1.0.0" /> with a big H and 2st o like this Headshoot
  6. Then it should work, check your Meta then?
  7. The problem is taht you added the script Client-side add it to Server-side
  8. swedishboy

    Objects.

    same shi't, both works
  9. swedishboy

    Objects.

    You can use attachElementToElement
  10. Yes ofc i added it on client-side.. and works perfect, also i did not add the addEventHandler or the function() because he only want the codes and i think he know how to do it by himself.. Also you forgot to add ''fgt'' at line 3 setTimer (setObjectBreakable, 1000, 1, fgt, false)
  11. try this, if i understood you right local fgt = createObject ( 1645,-810.13623046875, 2535.4724121094, 96.055953979492 ) if isObjectBreakable(fgt) then setObjectBreakable(fgt, false) end
  12. You can use attachElementToElement Or do you mean that you want to move the marker only without any object?
  13. swedishboy

    Help

    try this addEventHandler("onPlayerDamage", root, function(attacker, attackerweapon, bodypart) if bodypart == 9 then killPlayer ( source ) exports["topbarchat"]:sendClientMessage("[server Dragon] Head shot", attacker, 0, 255, 0) triggerClientEvent(attacker, "text", attacker) end end)
  14. If if fu*ck up at beginning then just try to lower your engineAcceleration You could also try to use this at handlingFlags 0x1400001
  15. try this function damageNo (player) setVehicleDamageProof(source, true) end addEventHandler("onVehicleEnter", getRootElement(), damageNo) function damageYes (player) setVehicleDamageProof(source, false) end addEventHandler("onVehicleExit", getRootElement(), damageYes)
  16. swedishboy

    Weapons

    A bit bored so i've made it for you Client side: GUIEditor = { button = {}, window = {} } function thewindow () GUIEditor.window[1] = guiCreateWindow(702, 455, 118, 115, "Weapon", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 1.00) showCursor (true) GUIEditor.button[1] = guiCreateButton(20, 79, 79, 26, "Close", false, GUIEditor.window[1]) GUIEditor.button[2] = guiCreateButton(9, 25, 99, 36, "M4", false, GUIEditor.window[1]) addEventHandler("onClientGUIClick", GUIEditor.button[1], closee, false ) addEventHandler("onClientGUIClick", GUIEditor.button[2], getm4, false ) end addCommandHandler("wep", thewindow) function closee () guiSetVisible ( GUIEditor.window[1], false ) showCursor(false) end function getm4 (weaponID, ammo) guiSetVisible(GUIEditor.window[1], true) showCursor(true) triggerServerEvent( "getm", getLocalPlayer(),weaponID, ammo) end Server side: function getWep ( weaponID, ammo ) giveWeapon(source, 31, 500) outputChatBox ( "#FF0000You got a M4 with #00FF00500 #FF0000Ammo", source, 255, 255, 255, true ) end addEvent("getm", true) addEventHandler("getm", getRootElement(), getWep) open the window with /wep
  17. Write /give function giveWeaponCommand(cmd, weapon, amount) weapon = tonumber(weapon) or getWeaponIDFromName(weapon) if not weapon then return end amount = amount and tonumber(amount) or 500 server.giveMeWeapon(math.floor(weapon), amount) end addCommandHandler('give', giveWeaponCommand) What you mean with ( lower name ) ?
  18. If i understand you right so try this.. Go in to [gameplay] > freeroam > and open fr_client.lua then you will see this line > {'txt', id='skinid', text='', width=50}, just change 50 to 0
  19. Wanted to see your Server-side too but try this.. function drawSpawnScreen() spawnWindow = guiCreateWindow(350,150,800,528, "Spawn Screen", false) ----- Old pos 239,198,376,478 ---- infoMemo = guiCreateMemo(198,357,355,160,"",false, spawnWindow) guiMemoSetReadOnly(infoMemo, true) cityGridList = guiCreateGridList(60,40,171,269, false, spawnWindow) guiGridListSetSelectionMode(cityGridList, 2) guiGridListAddColumn(cityGridList, "City", 0.82) classGridList = guiCreateGridList(250,40,171,269, false, spawnWindow) guiGridListSetSelectionMode(classGridList, 2) guiGridListAddColumn(classGridList, "Class", 0.82) skinGridList = guiCreateGridList(450,40,171,269, false, spawnWindow) guiGridListSetSelectionMode(skinGridList, 2) guiGridListAddColumn(skinGridList, "Skin", 0.82) guiWindowSetMovable(spawnWindow, true) guiWindowSetSizable(spawnWindow, false) spawnScreenOKButton = guiCreateButton(624,321,210,36, "Spawn", false, spawnWindow) Image = guiCreateStaticImage(60,390,128,63,"logo.png",false,spawnWindow) guiSetProperty(spawnScreenOKButton, "Disabled", "True") for n, v in pairs(cities) do local row = guiGridListAddRow(cityGridList) guiGridListSetItemText(cityGridList, row, 1, n, false, false) end setTimer (drawSpawnScreen, 2500) guiSetVisible(spawnWindow, false) addEventHandler("onClientGUIClick", cityGridList, onCityClick) addEventHandler("onClientGUIClick", classGridList, onClassClick) addEventHandler("onClientGUIClick", skinGridList, onSkinClick) addEventHandler("onClientGUIClick", spawnScreenOKButton, onSpawnButtonClick) fadeCamera(true) guiSetVisible(spawnWindow, true) guiGridListSetSelectedItem(skinGridList, -1, 0) showCursor(true) showPlayerHudComponent ("all",false) end addEventHandler("onClientResourceStart", getRootElement(), drawSpawnScreen) function onCityClick(button) if source == cityGridList and button == "left" then if guiGridListGetSelectedCount(cityGridList) > 0 then guiGridListClear(classGridList) local selectedRow, selectedCol = guiGridListGetSelectedItem( cityGridList ); -- get double clicked item in the gridlist local cityName = guiGridListGetItemText( cityGridList, selectedRow, selectedCol ) -- get its text local cityClasses = cities[cityName] for x, y in pairs(cityClasses) do local row = guiGridListAddRow(classGridList) guiGridListSetItemText(classGridList, row, 1, x, false, false) end guiSetProperty(spawnScreenOKButton, "Disabled", "True") end end end function onClassClick(button) if source == classGridList and button == "left" then if guiGridListGetSelectedCount(cityGridList) > 0 and guiGridListGetSelectedCount(classGridList) > 0 then guiGridListClear(skinGridList) local selectedRow, selectedCol = guiGridListGetSelectedItem( cityGridList ); -- get double clicked item in the gridlist local cityName = guiGridListGetItemText( cityGridList, selectedRow, selectedCol ) -- get its text local selectedRow, selectedCol = guiGridListGetSelectedItem( classGridList ); -- get double clicked item in the gridlist local className = guiGridListGetItemText( classGridList, selectedRow, selectedCol ) -- get its text local classSkins = cities[cityName][className] for x, y in pairs(classSkins) do local row = guiGridListAddRow(skinGridList) guiGridListSetItemText(skinGridList, row, 1, x, false, false) end guiSetProperty(spawnScreenOKButton, "Disabled", "True") end end end function onSkinClick(button) if source == skinGridList and button == "left" then if guiGridListGetSelectedCount(cityGridList) > 0 and guiGridListGetSelectedCount(classGridList) > 0 and guiGridListGetSelectedCount( skinGridList ) > 0 then local selectedRow, selectedCol = guiGridListGetSelectedItem( cityGridList ); -- get double clicked item in the gridlist local cityName = guiGridListGetItemText( cityGridList, selectedRow, selectedCol ) -- get its text local selectedRow, selectedCol = guiGridListGetSelectedItem( classGridList ); -- get double clicked item in the gridlist local className = guiGridListGetItemText( classGridList, selectedRow, selectedCol ) -- get its text local selectedRow, selectedCol = guiGridListGetSelectedItem( skinGridList ); -- get double clicked item in the gridlist local skinName = guiGridListGetItemText( skinGridList, selectedRow, selectedCol ) -- get its text guiSetProperty(spawnScreenOKButton, "Disabled", "False") guiSetText(infoMemo, cities[cityName][className][skinName]["information"]) end end end function onSpawnButtonClick(button) if source == spawnScreenOKButton and button == "left" then if guiGridListGetSelectedCount( cityGridList ) > 0 and guiGridListGetSelectedCount( classGridList ) > 0 and guiGridListGetSelectedCount( skinGridList ) > 0 then local selectedRow, selectedCol = guiGridListGetSelectedItem( cityGridList ); -- get double clicked item in the gridlist local cityName = guiGridListGetItemText( cityGridList, selectedRow, selectedCol ) -- get its text local selectedRow, selectedCol = guiGridListGetSelectedItem( classGridList ); -- get double clicked item in the gridlist local className = guiGridListGetItemText( classGridList, selectedRow, selectedCol ) -- get its text local selectedRow, selectedCol = guiGridListGetSelectedItem( skinGridList ); -- get double clicked item in the gridlist local skinName = guiGridListGetItemText( skinGridList, selectedRow, selectedCol ) -- get its text local spawninfo = cities[cityName][className][skinName] setElementData ( client, "Class", skinName ) triggerServerEvent("onPlayerSpawnButton", getLocalPlayer(), spawninfo["spawnX"] , spawninfo["spawnY"], spawninfo["spawnZ"], className, spawninfo['permission'], spawninfo['skin'],spawninfo['weapons'], getLocalPlayer(), skinName) else displayError("Please make a selection!") end end end function hideSpawnScreen() if spawnWindow then guiSetVisible(spawnWindow, false) showCursor(false) if errorWindow then guiSetVisible(errorWindow, false) end guiSetText(infoMemo, "") currentSpawn = false currentWeapons = false currentColors = {} currentLocation = {} end showPlayerHudComponent ("all",true) end addEvent("onSpawnSuccessful", true) addEventHandler("onSpawnSuccessful", getRootElement(), hideSpawnScreen()()) function createMessageBox() errorWindow = guiCreateWindow(resX / 2 - 150, resY / 2 - 100, 300, 200, "OPS ERROR!!", false) errorLabel = guiCreateMemo(5, 25, 295, 125, "", false, errorWindow) guiMemoSetReadOnly(errorLabel, true) errorWindowButton = guiCreateButton(110, 160, 80, 25, "OK", false, errorWindow) guiWindowSetMovable(errorWindow, false) guiWindowSetSizable(errorWindow, false) guiSetVisible(errorWindow, false) addEventHandler("onClientGUIClick", errorWindowButton, function() guiSetVisible(errorWindow, false) guiSetProperty(errorWindow, "AlwaysOnTop", "False") end, false) end function displayError(error) if not errorWindow then createMessageBox() end guiSetText(errorLabel, error) guiSetProperty(errorWindow, "AlwaysOnTop", "True") guiSetVisible(errorWindow, true) end addEvent("onSpawnError", true) addEventHandler("onSpawnError", getRootElement(), displayError) addCommandHandler( "spawnerror",displayError) function checkPlayerAlive() triggerServerEvent("wasPlayerAliveEvent", getLocalPlayer()) end addEvent("onPlayerLogin", true) addEventHandler("onPlayerLogin", getRootElement(), drawSpawnScreen) addEventHandler("onClientPlayerLogin", getLocalPlayer(), drawSpawnScreen) addEventHandler("onClientPlayerWasted", getLocalPlayer(), drawSpawnScreen) addEvent("onPlayerWasntAlive", true) addEventHandler("onPlayerWasntAlive", getRootElement(), drawSpawnScreen) function stopMinigunDamage ( attacker, weapon, bodypart ) if ( getTeamName(getPlayerTeam(source)) == "Admin" ) then if ( getTeamName(getPlayerTeam(attacker)) ~= "Admin" ) then cancelEvent() end end end addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopMinigunDamage )
×
×
  • Create New...