Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/04/18 in all areas

  1. Like explained in that other topic by Solidsnake14, you can use it to read and write data to sqlite databases, like registry.db and internal.db, which are explained in the Database article I linked in my previous reply. GitHub repository: https://github.com/sqlitebrowser/sqlitebrowser Downloads: https://github.com/sqlitebrowser/sqlitebrowser/releases
    1 point
  2. Pesquise mais na Wiki antes de perguntar. Está tudo em onPlayerWasted. addEventHandler ("onPlayerWasted", getRootElement(), function (ammo, attacker, weapon, bodypart) if (attacker) and getElementType (attacker) == "player" then local wanted = getPlayerWantedLevel (attacker) if wanted < 6 then setPlayerWantedLevel (attacker, wanted + 1) end elseif (attacker) and getElementType (attacker) == "vehicle" then local driver = getVehicleController (attacker) if driver and getElementType (driver) == "player" then local wanted = getPlayerWantedLevel (driver) if wanted < 6 then setPlayerWantedLevel (driver, wanted + 1) end end end end) De nada.
    1 point
  3. Yes, I tested and it worked! Thank you guy!
    1 point
  4. Thank u so much! I will test my script with your help at midnight. Thank u so much! ?
    1 point
  5. local serials = {} addEventHandler("onPlayerJoin", root, function() local serial = getPlayerSerial(source) if serials[serial] then serials[serial] = serials[serial] + 1 else serials[serial] = 1 end outputChatBox("Welcome, this is the "..(serials[serial]).." for you here", source, 255, 0, 0, true) end ) لصاحب الموضوع مو فاضي صراحه اسوي لك حفظ لهيك سويه بنفسك عن طريق : fileCreate loop fileWrite fileClose loop table.insert
    1 point
  6. toggler = { } dtype = { } syncTimer = { } currHeadLightColor = {{ }} function isVehicleBlinking( vehicle) if currHeadLightColor[vehicle] then return true else return false end end function toggleLights( veh ) if isElement( veh ) then setVehicleOverrideLights( veh, 2 ) if toggler[veh] == 1 then setVehicleLightState( veh, 0, 1 ) setVehicleLightState( veh, 1, 1 ) setVehicleLightState( veh, 2, 1 ) setVehicleLightState( veh, 3, 1 ) if veh and isElement(veh) and (getElementType(veh) == "vehicle") and getVehicleTowedByVehicle( veh ) then local veh2 = getVehicleTowedByVehicle( veh ) setVehicleLightState( veh2, 0, 1 ) setVehicleLightState( veh2, 1, 1 ) setVehicleLightState( veh2, 2, 1 ) setVehicleLightState( veh2, 3, 1 ) end toggler[veh] = 0 else if dtype[veh] == "left" then setVehicleLightState( veh, 0, 0 ) setVehicleLightState( veh, 1, 1 ) setVehicleLightState( veh, 2, 1 ) setVehicleLightState( veh, 3, 0 ) if veh and isElement(veh) and (getElementType(veh) == "vehicle") and getVehicleTowedByVehicle( veh ) then local veh2 = getVehicleTowedByVehicle( veh ) setVehicleLightState( veh2, 0, 0 ) setVehicleLightState( veh2, 1, 1 ) setVehicleLightState( veh2, 2, 1 ) setVehicleLightState( veh2, 3, 0 ) end elseif dtype[veh] == "right" then setVehicleLightState( veh, 0, 1 ) setVehicleLightState( veh, 1, 0 ) setVehicleLightState( veh, 2, 0 ) setVehicleLightState( veh, 3, 1 ) if (getElementType(veh) == "vehicle") and getVehicleTowedByVehicle( veh ) then local veh2 = getVehicleTowedByVehicle( veh ) setVehicleLightState( veh2, 0, 1 ) setVehicleLightState( veh2, 1, 0 ) setVehicleLightState( veh2, 2, 0 ) setVehicleLightState( veh2, 3, 1 ) end elseif (getElementType(veh) == "vehicle") and dtype[veh] == "all" then setVehicleLightState( veh, 0, 0 ) setVehicleLightState( veh, 1, 0 ) setVehicleLightState( veh, 2, 0 ) setVehicleLightState( veh, 3, 0 ) if veh and isElement(veh) and (getElementType(veh) == "vehicle") and getVehicleTowedByVehicle( veh ) then local veh2 = getVehicleTowedByVehicle( veh ) setVehicleLightState( veh2, 0, 0 ) setVehicleLightState( veh2, 1, 0 ) setVehicleLightState( veh2, 2, 0 ) setVehicleLightState( veh2, 3, 0 ) end end toggler[veh] = 1 end end end function lightHandler( player, cmd ) if player and isElement( player ) and getPedOccupiedVehicle( player ) then local veh = getPedOccupiedVehicle( player ) if ( not isTimer( syncTimer[veh] ) or cmd ~= dtype[veh] ) and getVehicleOccupants(veh)[0] == player then setVehicleLightState( veh, 0, 1 ) setVehicleLightState( veh, 1, 1 ) setVehicleLightState( veh, 2, 1 ) setVehicleLightState( veh, 3, 1 ) if veh and isElement(veh) and (getElementType(veh) == "vehicle") and getVehicleTowedByVehicle( veh ) then local veh2 = getVehicleTowedByVehicle( veh ) setVehicleLightState( veh2, 0, 1 ) setVehicleLightState( veh2, 1, 1 ) setVehicleLightState( veh2, 2, 1 ) setVehicleLightState( veh2, 3, 1 ) end if not currHeadLightColor[veh] then currHeadLightColor[veh] = { } currHeadLightColor[veh][1],currHeadLightColor[veh][2],currHeadLightColor[veh][3] = getVehicleHeadLightColor( veh ) end setVehicleHeadLightColor( veh, 255, 200, 0 ) if isTimer( syncTimer[veh] ) then killTimer( syncTimer[veh] ) setVehicleHeadLightColor(veh, currHeadLightColor[veh][1],currHeadLightColor[veh][2],currHeadLightColor[veh][3]) end syncTimer[veh] = setTimer( toggleLights, 380, 0, veh ) toggler[veh] = 1 dtype[veh] = cmd toggleLights( veh ) else if isTimer( syncTimer[veh] ) then killTimer( syncTimer[veh] ) local vehID = getElementData( veh, "vehicleID") if vehID then local vehID = tonumber( vehID) local colorTable = exports.GTIvehicles:getVehicleData( vehID, "light_color") or "255,255,255" local cData = split( colorTable, ",") setVehicleHeadLightColor( veh, cData[1], cData[2], cData[3]) currHeadLightColor[veh] = nil else setVehicleHeadLightColor( veh, 255, 255, 255) end end setVehicleLightState( veh, 0, 0 ) setVehicleLightState( veh, 1, 0 ) setVehicleLightState( veh, 2, 0 ) setVehicleLightState( veh, 3, 0 ) setVehicleOverrideLights( veh, 2 ) if veh and isElement(veh) and (getElementType(veh) == "vehicle") and getVehicleTowedByVehicle( veh ) then local veh2 = getVehicleTowedByVehicle( veh ) setVehicleLightState( veh2, 0, 0 ) setVehicleLightState( veh2, 1, 0 ) setVehicleLightState( veh2, 2, 0 ) setVehicleLightState( veh2, 3, 0 ) setVehicleOverrideLights( veh2, 2 ) end end end end addCommandHandler( "left", lightHandler ) addCommandHandler( "right", lightHandler ) addCommandHandler( "all", lightHandler ) addEvent("command:execute",true) addEventHandler("command:execute",resourceRoot, function(position) lightHandler(client,position) end) --//Client addEventHandler("onClientKey",getRootElement(), function(button,press) if press then if (button == "lshift" and getKeyState("a")) or (button == "a" and getKeyState("lshift")) then triggerServerEvent("command:execute",resourceRoot,"left") elseif (button == "lshift" and getKeyState("d")) or (button == "d" and getKeyState("lshift")) then triggerServerEvent("command:execute",resourceRoot,"right") elseif (button == "lshift" and getKeyState("s")) or (button == "s" and getKeyState("lshift")) then triggerServerEvent("command:execute",resourceRoot,"all") end end end)
    1 point
  7. FadeCamera: local camPositions = { {-2816.0283203125, 2125.6923828125, 156.8657989502, -2720.1396484375, 1835.1181640625, 133.21673583984}, {-1145.0048828125, 879.6533203125, 9.1189212799072, -1357.7978515625, 719.6279296875, 14.321132659912}, {1135.3759765625, -1977.408203125, 78.517211914063, 1413.7529296875, -1617.5576171875, 63.588264465332}, {2160.0869140625, -102.408203125, 5.6070313453674, 1894.4580078125, -146.1396484375, 21.12876701355} } addEventHandler("onPlayerJoin",getRootElement(), function() fadeCamera(source,true,5) setCameraMatrix(source,unpack(camPositions[math.random(#camPositions)])) end) Spawn: local randomSpawnTable = { { 270.92654418945, -1986.3665771484, 797.52966308594 }, { 270.92654418945, -1986.3665771484, 797.52966308594 }, { 270.92654418945, -1986.3665771484, 797.52966308594 } } addEventHandler("onPlayerLogin",getRootElement(), function() spawnPlayer(source,unpack(randomSpawnTable[math.random(#randomSpawnTable)])) setCameraTarget(source,source) setElementModel(source, 312) giveWeapon(source,46) giveWeapon(source,9) giveWeapon(source,25,5000,true) giveWeapon(source,28,5000,true) giveWeapon(source,31,5000,true) giveWeapon(source,22,5000,true) end)
    1 point
  8. local time = 4000 -- time for the gate open and close local gate = createObject(0, 0, 0, 0, 0, 0, 0) --(object id, x, y, z, rx, ry, rz) local marker = createMarker(0, 0, 0, "cylinder", 13, 255, 0, 0, 0) --(x, y, z, function moveGate(hitPlayer, matchingDimension) moveObject(gate, time, 0, 0, 0, 0, 0, 0) --(position when the gate is open (gate, time, x, y, z, rx, ry, rz) end addEventHandler("onMarkerHit", marker, moveGate) function moveBack() moveObject(gate, time, 0, 0, 0, 0, 0, 0) --(position when the gate is close same of "local gate = createObject..." but just(x, y, z, rx, ry, rz) not put id end addEventHandler("onMarkerLeave", marker, moveBack) -- for work with commands put addCommandHandler("open", moveGate) and addCommandHandler("close", moveBack) You need create a files with meta.xml and gate.lua, and put in meta.xml <script src="gates.lua" type="server"></script>
    1 point
  9. 1 point
  10. يمكن في كوليمن للأكاونت بس مخربط بين السريال و الأكاونت , ( v.serial ) الخطأ واضح , هو حاط
    1 point
  11. @Debo15 نفترض ان الاعب اول مره يدخل بالسيرفر false راح يرجع count وتقدر تختصر الكود في سطرين
    1 point
  12. settings = { objectID = GATEOBJECTID, -- fill up data closedPos = {x,z,y, rx,rz,ry}, -- fill up datas openedPos = {x,z,y, rx,rz,ry}, -- fill up datas duration = 2000, -- 2 sec (moving 2 sec) openedDuration = 5000, -- 5 sec (close after 5 sec) openRadius = 5, openInfo = "gate opened", closeInfo = "gate closed", opened = false, -- dont edit this } settings.gateObject = createObject(settings.objectID, settings.closedPos[1],settings.closedPos[2],settings.closedPos[3],settings.closedPos[4],settings.closedPos[5],settings.closedPos[6]) settings.openCol = createColSphere(settings.closedPos[1],settings.closedPos[2],settings.closedPos[3],settings.openRadius) function gate() if not settings.opened then moveObject(settings.gateObject, settings.duration, settings.openedPos[1],settings.openedPos[2],settings.openedPos[3],settings.openedPos[4],settings.openedPos[5],settings.openedPos[6]) outputChatBox(settings.openInfo, getRootElement()) else moveObject(settings.gateObject, settings.duration, settings.closedPos[1],settings.closedPos[2],settings.closedPos[3],settings.closedPos[4],settings.closedPos[5],settings.closedPos[6]) outputChatBox(settings.closeInfo, getRootElement()) end settings.opened = not settings.opened end addEventHandler("onColShapeHit", settings.openCol, function() if not settings.opened then gate() setTimer(gate, settings.openedDuration, 1) end end)
    1 point
  13. شباب ارجو مساعدة من اين ابدا في البرمجة وهل اكتب الاكواد في سيرفر وكلينت في نفس الوقت
    1 point
  14. Yeah caps, bah anyway before you post your question/problem please do the following 1. Check the Readme, its in the Console, and I beleave on the site too. 2. Read the forums to see if there are simmelar problems. Once you have done that and stil have no found a solution to your problem, wheny uo post remember the following 1. We do not read minds, please tell us your problem in detail, just saying "IT DONT WORK!!!!11" dosn't help us or yourselves at all. 2. Make a reasonable topic, not just "HELP!!1" Im not to sure about everyone, but that is kinda annoying. 3. Don't be stupid, things like "This stupid peace of crap wont work!" is not a good thing to say if your looking for help. That is all. Thank you P.S. If mods have ssomething to had, just unlock, and lock this thread back.
    1 point
×
×
  • Create New...