Jump to content

Best-Killer

Members
  • Posts

    494
  • Joined

  • Last visited

Everything posted by Best-Killer

  1. function depoistMoney() local text = tonumber (guiGetText(GUIEditor.edit[2])) local text2 = tonumber(guiGetText(GUIEditor.edit[1])) if (guiRadioButtonGetSelected(GUIEditor.radiobutton[1])) then if tonumber(text) and getPlayerMoney() >= tonumber(text) and tonumber(text) >= 0 then guiSetText(GUIEditor.edit[1],"Transferring...") setTimer(guiSetText,2000,1,GUIEditor.edit[1],tonumber(text + text2)) setTimer(takePlayerMoney,2000,1,tonumber(text)) exports['SAEGMessages']:sendClientMessage ( "You've withdrawn "..tonumber(text + text2)" from your bank account", source, 200, 200, 200 ) setElementData(localPlayer,"bankmoney",tonumber(text + text2)) elseif getPlayerMoney() == 0 then -- exports['SAEGMessages']:sendClientMessage ( "You don't have that ammount money in your bank", 255, 0, 0 ) elseif getPlayerMoney() < 0 then outputChatBox("You can't deposit negative numbers.") end end end function withdrawMoney() local text = guiGetText(GUIEditor.edit[2]) local text2 = guiGetText(GUIEditor.edit[1]) if (guiRadioButtonGetSelected(GUIEditor.radiobutton[2])) then if tonumber(text2) >= tonumber(text) and tonumber(text) > 0 then guiSetText(GUIEditor.edit[1],"Transferring...") setTimer(guiSetText,2000,1,GUIEditor.edit[1],tostring(text2 - text)) setTimer(givePlayerMoney,2000,1,tonumber(text)) setElementData(localPlayer,"bankmoney",tonumber(text2 - text)) elseif tonumber(text2) < tonumber(text) then exports['SAEGMessages']:sendClientMessage ( "You don't have that ammount money in your bank", 255, 0, 0 ) elseif tonumber(text) < 0 then outputChatBox("You can't withdraw negative numbers.") end end end
  2. Try this. addEventHandler("onPlayerLogin", getRootElement(), function () local account = getPlayerAccount(source) local balance = (getAccountData(account, "bankmoney") or 0) if balance then setAccountData(account, "bankmoney", balance) else setAccountData(account, "bankmoney", 0) end end ) addEventHandler("onPlayerLogout", getRootElement(), function () local account = getPlayerAccount(source) local balance = (getAccountData(account, "bankmoney") or 0) setAccountData(account, "bankmoney", balance) end ) addEventHandler("onPlayerQuit", getRootElement(), function () local account = getPlayerAccount(source) local balance = (getAccountData(account, "bankmoney") setAccountData(account, "bankmoney", balance) end ); Your code doesn't make any sense, you are basically obtaining the bank, then setting it back? how does that make sense? @Best-Killer: Are you trying to save the money players have? Yes Castillo
  3. Not work 0 errors
  4. Best-Killer

    Job

    elseif ( name == 'Police' ) then create3DText ( 'Police', { x, y, z }, { 0, 100, 255 }, { nil, true } ) local p = createElement ( "GodmodePed" ) setElementData ( p, "Model", 286 ) setElementData ( p, "Position", { x, y, z, rz } ) createBlip ( x, y, z, 61, 2, 255, 255, 255, 255, 0, 450 ) addEventHandler ( 'onMarkerHit', createMarker ( x, y, z - 1, 'cylinder', 2, 0, 0, 0, 0 ), function ( p ) if ( getElementType ( p ) == 'player' and not isPedInVehicle ( p ) and not isPedDead ( p ) ) then if ( getPlayerWantedLevel ( p ) > max_wanted.law ) then return exports['SAEGMessages']:sendClientMessage ( "The max wanted level for this job is "..tostring ( max_wanted.law )..".", p, 255, 0, 0 ) end if ( getElementData(p, "type") ~= "Gang" ) then return exports.SAEGMessages:sendClientMessage ("You Can't take this job while you are in the Gang.",p, 255, 7, 7 ) end triggerClientEvent ( p, 'SAEGJobs:OpenJobMenu', p, 'police' ) end end ) no one can get the job i want if play in gang can not take job 000 errors
  5. new code addEventHandler ( 'onPlayerLogin', root, function ( _,account ) local accountName = getAccountName ( account ); local balance = getAccountData ( account, 'bankmoney' ); setElementData ( source, 'AccountName', accountName ); if balance then setElementData ( source, 'bankmoney', tonumber( balance ) ); else setElementData ( source, 'bankmoney', '0' ); end end ); addEventHandler ( 'onPlayerLogout', root, function ( account ) local balance = getElementData ( source, 'bankmoney' ); setAccountData ( account, 'bankmoney', balance ); end ); addEventHandler ( 'onPlayerQuit', root, function ( ) local account = getPlayerAccount ( source ); if isGuestAccount ( account ) then return end local balance = getElementData ( source, 'bankmoney' ); setAccountData ( account, 'bankmoney', balance ); end ); but still not saved
  6. Nobody here will not write the whole code, or any example. And for you is the example = code. man i said i won't code -.- i want just example
  7. for player group work fine -.- i want just make gates opened for staff 0 errors and gate not opened for staffs
  8. any example or help guys ?
  9. --- GATE SYSTEM BY Fiocing Aka:Cherry --- miniDistance = 3 --RESOURCE SETTINGS --HERE CHANGE THE RESOURCE NAME TO THE GROUPS SYSTEM THAT YOU USE local GROUPS_RESOURCE_NAME = "SAEGGroups" -- CHANGE THAT LINE TO YOUR GROUP SYSTEM NAME function GPG(plr) if plr and getACC(plr) then return exports.SAEGGroups:getPlayerGroup ( plr) end end -- GATE MANAGERS LIST (ACCOUNT NAME) managers = { "oussama", } -- ALLOWED OBJECTS THAT MANAGERS CAN USE TO PLACE GATE allowedModels = { 980 , 967 , 16773 , 10829 , 10832, 2990 , 2933 , 971 , 9042 , 8957, 3089, 2955 , 2947 , 2924 , 2911 , 1491 , 1504 , 1505 , 1507 , 1523 , 1557 , } ----Gate System By Omar(aka.Darhal)---- ---- All Right Reserved --- --RESOURCE VARRIABLES local gates = {} local lastGatePos = {} -----SQL FUNCTIONS----- local DB_LOCATION = ":/gates.db" -- The location where the database file is stored default is ":/gates.db" (/server/mods/deathmatch/databases/global) Just copy gates.db to there and it will work fine dbc = dbConnect("sqlite", DB_LOCATION) -- To use MySQL you'll only need to change just this line. dbExec(dbc, "CREATE TABLE IF NOT EXISTS gates (pos TEXT, rot TEXT, model INT, groups TEXT, mvt TEXT)") function onStop() dbExec(dbc, "DELETE FROM gates") for i, v in pairs(gates) do local x, y, z = v.pos[1], v.pos[2],v.pos[3] local rx, ry, rz = v.rot[1], v.rot[2],v.rot[3] local pos = x..", "..y..", "..z local rot = rx..", "..ry..", "..rz local groupsJSON = toJSON (v.groups) dbExec ( dbc, "INSERT INTO gates (pos, rot, model, groups, mvt) VALUES ( ?, ?, ?, ?, ?)", pos, rot, getElementModel(v.gate), groupsJSON, v.mvt) end end addEventHandler("onResourceStop", resourceRoot, onStop) function onStart() local mnew = dbQuery ( dbc, "SELECT * FROM gates") local mresult = dbPoll ( mnew, - 1 ) for i, v in pairs(mresult) do local x, y, z = unpack(split(v.pos, ",")) local rx, ry, rz = unpack(split(v.rot, ",")) local groups = fromJSON(v.groups) local cordTbl = {x, y, z} local rotTbl = {rx, ry, rz} createGate(cordTbl, rotTbl, groups, v.mvt, v.model) end end addEventHandler("onResourceStart", resourceRoot, onStart) --------CORE----------- ----------------------- -- MAIN SCRIPT -- function getACC(plr) if plr and isElement(plr) then return getAccountName(getPlayerAccount(plr)) or nil end end function reciveDataAndCreateGtae(groups, mvtType, pos, rot, model) createGate(pos, rot, groups,mvtType,model) end addEvent("CUPgates.sendGateData", true) addEventHandler("CUPgates.sendGateData", root, reciveDataAndCreateGtae) function createGate(cordTbl, rotTbl, groups, mvt, model) local gate = createObject(model, cordTbl[1], cordTbl[2], cordTbl[3], rotTbl[1], rotTbl[2], rotTbl[3]) local marker = createMarker (cordTbl[1], cordTbl[2], cordTbl[3] , "cylinder", 4.0, 0, 0, 0, 0) setElementData(gate, "gateIsMoving", false) table.insert(gates, {gate=gate, marker=marker, pos=cordTbl, rot=rotTbl, groups=groups, mvt=mvt}) addEventHandler("onMarkerHit", marker, openGate) addEventHandler("onMarkerLeave", marker, closeGate) end function closeGate(plr, sdim) if plr and getElementType(plr) == "player" and sdim then for i=1, #gates do if gates[i].marker == source and getElementData(gates[i].gate, "gateIsMoving") then triggerClientEvent("CUPgates.moveGateBack", plr, lastGatePos[gates[i].gate], i, gates[i].gate) break end end end end function openGate(plr, sdim) if plr and getElementType(plr) == "player" and sdim then for i=1, #gates do if gates[i].marker == source and not getElementData(gates[i].gate, "gateIsMoving") then for k, group in pairs( gates[i].groups) do if group.accGrp == GPG(plr) then setElementData(gates[i].gate, "gateIsMoving", true) local x, y, z = getElementPosition(gates[i].gate) lastGatePos[gates[i].gate] = {x, y, z} triggerClientEvent("CUPgates.moveGate", plr, gates[i].mvt, i, gates[i].gate) break end end break end end end end function toggleGateDelete(plr, cmd) if plr then local access = false for i=1, #managers do if managers[i] == getACC(plr) then access = true --triggerClientEvent(plr, "CUPgates.placeGate", plr) end end if access then for i, v in pairs(gates) do local gx, gy, gz = getElementPosition(v.gate) local x, y, z = getElementPosition(plr) if getDistanceBetweenPoints3D ( gx, gy, gz, x, y, z ) < miniDistance then destroyElement(v.gate) destroyElement(v.marker) table.remove(gates, i) break end end end end end addCommandHandler("delgate", toggleGateDelete) function toggleGateCreation(plr, cmd, model) if plr then local access = false for i=1, #managers do if managers[i] == getACC(plr) then access = true --triggerClientEvent(plr, "CUPgates.placeGate", plr) end end if access then bool = false for i=1, #allowedModels do if allowedModels[i] == tonumber(model) then bool = true end end if bool then triggerClientEvent(plr, "CUPgates.placeGate", plr, tonumber(model)) else outputChatBox("Invalid Gate ID ! ", plr, 255, 0, 0) end end end end addCommandHandler("addgate", toggleGateCreation) ----Gate System By Omar(aka.Darhal)---- ---- All Right Reserved --- local currentEditingGate local controling local label = {} local movingDoor = {} local movingDoorAccess = {} local accGrpColumn function centerWindow (center_window) local screenW, screenH = guiGetScreenSize() local windowW, windowH = guiGetSize(center_window, false) local x, y = (screenW - windowW) /2,(screenH - windowH) /2 guiSetPosition(center_window, x, y, false) end function placeGate(model) local x, y, z = getElementPosition(localPlayer) local rx, ry, rz = getElementRotation(localPlayer) currentEditingGate = createObject(model, x+1, y+1, z, rx, ry, rz) addEventHandler("onClientKey", root, onClientKey) addEventHandler("onClientRender", root, controlGate) guiSetVisible(gateWindow, true) guiGridListClear(accessToOpenGrid) showCursor(true) end addEvent("CUPgates.placeGate", true) addEventHandler("CUPgates.placeGate", root, placeGate) function saveGateData() if currentEditingGate then local groups = movingDoorAccess[currentEditingGate] local mvtType = movingDoor[currentEditingGate] local x, y, z = getElementPosition(currentEditingGate) local rx, ry, rz = getElementRotation(currentEditingGate) triggerServerEvent("CUPgates.sendGateData", localPlayer, groups, mvtType, {x, y, z}, {rx, ry, rz}, getElementModel(currentEditingGate)) movingDoorAccess[currentEditingGate] = nil movingDoor[currentEditingGate] = nil destroyElement(currentEditingGate) currentEditingGate = nil end end addCommandHandler("gsave", saveGateData) function getPositionFromElementOffset(element,offX,offY,offZ) local m = getElementMatrix ( element ) -- Get the matrix local x = offX * m[1][1] + offY * m[2][1] + offZ * m[3][1] + m[4][1] -- Apply transform local y = offX * m[1][2] + offY * m[2][2] + offZ * m[3][2] + m[4][2] local z = offX * m[1][3] + offY * m[2][3] + offZ * m[3][3] + m[4][3] return x, y, z -- Return the transformed point end function onClientKey(button, press) if press then pressedButton = button else pressedButton = nil end end addEventHandler("onClientResourceStart", resourceRoot, function() gateWindow = guiCreateWindow(288, 53, 260, 464, "CUP - Doors/Gates Management", false) centerWindow (gateWindow) guiWindowSetSizable(gateWindow, false) hideGUI(gateWindow) saveGateData = guiCreateButton(149, 428, 100, 26, "Save/Close", false, gateWindow) mvtLeft = guiCreateRadioButton(10, 47, 251, 18, "Move to left", false, gateWindow) mvtRight = guiCreateRadioButton(10, 71, 250, 18, "Move to right", false, gateWindow) mvtUp = guiCreateRadioButton(9, 95, 251, 18, "Move upside", false, gateWindow) mvtDown = guiCreateRadioButton(9, 123, 251, 18, "Move down", false, gateWindow) label[1] = guiCreateLabel(10, 26, 268, 15, "Possible gate/door moves :", false, gateWindow) label[2] = guiCreateLabel(15, 145, 263, 18, "Door/Gate access management :", false, gateWindow) accessToOpenGrid = guiCreateGridList(10, 180, 238, 189, false, gateWindow) accGrpColumn = guiGridListAddColumn(accessToOpenGrid, "Group", 0.9) accGrpEdit = guiCreateEdit(10, 393, 135, 26, "", false, gateWindow) addToAccessListBtn = guiCreateButton(149, 392, 94, 26, "Add", false, gateWindow) removeFromAccessListBtn = guiCreateButton(10, 428, 129, 26, "Remove", false, gateWindow) label[3] = guiCreateLabel(10, 374, 233, 18, "GROUP NAME:", false, gateWindow) addEventHandler("onClientGUIClick", saveGateData, closeDoorGUI, false) addEventHandler("onClientGUIClick", addToAccessListBtn, addToAccessList, false) addEventHandler("onClientGUIClick", removeFromAccessListBtn, removeFromAccessList, false) end ) function addToAccessList() local accountOrGroup = guiGetText(accGrpEdit) local givenAccessType = "Group" if accGrpEdit and accGrpEdit ~= "" then if not movingDoorAccess[currentEditingGate] then movingDoorAccess[currentEditingGate] = {} end for i, v in pairs(movingDoorAccess[currentEditingGate]) do if v.accGrp == accountOrGroup then exports.CUPtexts:output("This "..givenAccessType.." name ("..accountOrGroup..") already exsit in the list !", 255, 0, 0) return end end table.insert(movingDoorAccess[currentEditingGate], {accGrp=accountOrGroup}) updateDoorAccessGrid() end end function hideGUI(wnd) guiSetVisible(wnd, false) end function closeDoorGUI() local mvtType if guiRadioButtonGetSelected(mvtLeft) then mvtType = "mvtLeft" elseif guiRadioButtonGetSelected(mvtRight) then mvtType = "mvtRight" elseif guiRadioButtonGetSelected(mvtUp) then mvtType = "mvtUp" elseif guiRadioButtonGetSelected(mvtDown) then mvtType = "mvtDown" end local x, y, z = getElementPosition(currentEditingGate) local radius mvtValue = 7 movingDoor[currentEditingGate] = mvtType hideGUI(gateWindow) showCursor(false) end function updateDoorAccessGrid() if movingDoorAccess[currentEditingGate] then guiGridListClear(accessToOpenGrid) for i, v in pairs(movingDoorAccess[currentEditingGate]) do local row = guiGridListAddRow ( accessToOpenGrid ) guiGridListSetItemText ( accessToOpenGrid, row, accGrpColumn, v.accGrp, false, false) end end end function removeFromAccessList(button) if button ~= "left" then return end local row = guiGridListGetSelectedItem(accessToOpenGrid) if (not row or row == -1) then return end local accGrp = guiGridListGetItemText(accessToOpenGrid, row, accGrpColumn) for i, v in pairs(movingDoorAccess[currentEditingGate]) do if v.accGrp == accGrp then table.remove(movingDoorAccess[currentEditingGate], i) updateDoorAccessGrid() return end end end function getGateCorrectMVT(mvtType, id, door) local nx, ny, nz if mvtType == "mvtRight" then nx, ny, nz = getPositionFromElementOffset(door,0-mvtValue,0,0) elseif mvtType == "mvtLeft" then nx, ny, nz = getPositionFromElementOffset(door,mvtValue,0,0) elseif mvtType == "mvtUp" then nx, ny, nz = getPositionFromElementOffset(door,0, 0, 0-mvtValue) elseif mvtType == "mvtDown" then nx, ny, nz = getPositionFromElementOffset(door,0,0,mvtValue) end moveObject(door, 1000, nx, ny, nz) end addEvent("CUPgates.moveGate", true) addEventHandler("CUPgates.moveGate", root, getGateCorrectMVT) function getGateCorrectMVT(pos, id, door) local nx, ny, nz = pos[1], pos[2], pos[3] moveObject(door, 1000, nx, ny, nz) setTimer(setElementData, 1000, 1, door, "gateIsMoving", false) end addEvent("CUPgates.moveGateBack", true) addEventHandler("CUPgates.moveGateBack", root, getGateCorrectMVT) function controlGate() for k, v in ipairs(getElementsByType("gui-window", resourceRoot)) do if (guiGetVisible(v)) then return end end if isChatBoxInputActive () or not isElement(currentEditingGate) then return end local camera = getCamera () if not currentEditingGate or not (camera) then return end local cameraX,cameraY,cameraZ = getElementPosition(camera) local objectX,objectY,objectZ = getElementPosition(currentEditingGate) local x,y,z if pressedButton == "num_8" then x,y,z = getPositionFromElementOffset(camera,0,moveSpeed,0) controling = true cameraZ = z elseif pressedButton == "num_2" then x,y,z = getPositionFromElementOffset(camera,0,0-moveSpeed,0) controling = true cameraZ = z elseif pressedButton == "num_6" then x,y,z = getPositionFromElementOffset(camera,moveSpeed,0,0) controling = true cameraZ = z elseif pressedButton == "num_4" then x,y,z = getPositionFromElementOffset(camera,0-moveSpeed,0,0) controling = true cameraZ = z elseif pressedButton == "pgup" then x,y,z = getPositionFromElementOffset(camera,0,0, moveSpeed) controling = true elseif pressedButton == "pgdn" then x,y,z = getPositionFromElementOffset(camera,0,0, 0-moveSpeed) controling = true elseif pressedButton == "num_add" then rx, ry, rz = getElementRotation(currentEditingGate) setElementRotation(currentEditingGate, rx, ry, rz+angleSpeed) controling = true elseif pressedButton == "num_sub" then rx, ry, rz = getElementRotation(currentEditingGate) setElementRotation(currentEditingGate, rx, ry, rz-angleSpeed) controling = true elseif pressedButton == "num_7" then rx, ry, rz = getElementRotation(currentEditingGate) setElementRotation(currentEditingGate, rx+angleSpeed, ry, rz) controling = true elseif pressedButton == "num_9" then rx, ry, rz = getElementRotation(currentEditingGate) setElementRotation(currentEditingGate, rx-angleSpeed, ry, rz) controling = true elseif pressedButton == "num_1" then rx, ry, rz = getElementRotation(currentEditingGate) setElementRotation(currentEditingGate, rx, ry+angleSpeed, rz) controling = true elseif pressedButton == "num_3" then rx, ry, rz = getElementRotation(currentEditingGate) setElementRotation(currentEditingGate, rx, ry-angleSpeed, rz) controling = true else controling = false end if x then setElementPosition(currentEditingGate, objectX+(x-cameraX),objectY+(y-cameraY),objectZ+(z-cameraZ)) end end --- GATE SYSTEM BY DARHAL --- moveSpeed = 0.1 -- HOW MUCH GATE SHOULD MOVE WHEN CONTROLING IT angleSpeed = 1 -- THE ROTATION SPEED WHEN ROTATING THE GATE mvtValue = 7 -- THE DISTANCE THAT THE GATE MOVE WHEN SOMEONE IS NEARBY IT about learning i learned much i swear kariim and all thanks to u cuz u made me try to learn again thanks you so much
  10. --- GATE SYSTEM BY Fiocing Aka:Cherry --- miniDistance = 3 --RESOURCE SETTINGS --HERE CHANGE THE RESOURCE NAME TO THE GROUPS SYSTEM THAT YOU USE local GROUPS_RESOURCE_NAME = "SAEGGroups" -- CHANGE THAT LINE TO YOUR GROUP SYSTEM NAME function GPG(plr) if plr and getACC(plr) then return exports.SAEGGroups:getPlayerGroup ( plr) or (getTeamName(getPlayerTeam(plr)) == "Staff") end end 0 errors any help pls !
  11. i want example i won't u make the code for me -.- also i'm asking "anyway" i'm not saying make code for me
  12. Any Help Guys pls
  13. Best-Killer

    help

    why only who in car can see nyan !! -- Save the points linePointX = {} linePointY = {} linePointZ = {} addCommandHandler ( "nyan", function (source) playSound("http://3a.media.v4.skyrock.net/music/3af/0b2/3af0b22c9b39c5a660fca11e00908225.mp3", false) setTimer( function() if isPedInVehicle(getLocalPlayer()) then local vehicle = getPedOccupiedVehicle(getLocalPlayer()) local velX, velY, velZ = getElementVelocity(vehicle) local theSpeed = (velX^2 + velY^2 + velZ^2)^(0.5) * 180 if not (theSpeed == 0)then if vehicle then local lX, lY, lZ = getElementPosition(vehicle) if lX and lY and lZ then table.insert(linePointX, lX) table.insert(linePointY, lY) table.insert(linePointZ, lZ-0.5) if(#linePointX > 20)then table.remove(linePointX, 1) table.remove(linePointY, 1) table.remove(linePointZ, 1) end end end end end end, 80, 0) end ) -- Draw addEventHandler("onClientRender", getRootElement(), function () for i,d in ipairs(linePointX)do if i then if linePointX[i] and linePointX[i-1] and linePointX[i-2] and linePointX[i-3] and linePointX[i-4] then dxDrawLine3D(linePointX[i], linePointY[i], linePointZ[i], linePointX[i-1], linePointY[i-1], linePointZ[i-1], tocolor(255, 0,0, 255), 9) dxDrawLine3D(linePointX[i-1], linePointY[i-1], linePointZ[i-1], linePointX[i-2], linePointY[i-2], linePointZ[i-2], tocolor(255, 0,0, 255), 9) dxDrawLine3D(linePointX[i-3], linePointY[i-3], linePointZ[i-3], linePointX[i-4], linePointY[i-4], linePointZ[i-4], tocolor(255, 0,0, 255), 9) dxDrawLine3D(linePointX[i], linePointY[i], linePointZ[i]+0.2, linePointX[i-1], linePointY[i-1], linePointZ[i-1]+0.2, tocolor(255, 174,0, 255), 9) dxDrawLine3D(linePointX[i-1], linePointY[i-1], linePointZ[i-1]+0.2, linePointX[i-2], linePointY[i-2], linePointZ[i-2]+0.2, tocolor(255, 174,0, 255), 9) dxDrawLine3D(linePointX[i-3], linePointY[i-3], linePointZ[i-3]+0.2, linePointX[i-4], linePointY[i-4], linePointZ[i-4]+0.2, tocolor(255, 174,0, 255), 9) dxDrawLine3D(linePointX[i], linePointY[i], linePointZ[i]+0.4, linePointX[i-1], linePointY[i-1], linePointZ[i-1]+0.4, tocolor(255, 246,0, 255), 9) dxDrawLine3D(linePointX[i-1], linePointY[i-1], linePointZ[i-1]+0.4, linePointX[i-2], linePointY[i-2], linePointZ[i-2]+0.4, tocolor(255, 246,0, 255), 9) dxDrawLine3D(linePointX[i-3], linePointY[i-3], linePointZ[i-3]+0.4, linePointX[i-4], linePointY[i-4], linePointZ[i-4]+0.4, tocolor(255, 246,0, 255), 9) dxDrawLine3D(linePointX[i], linePointY[i], linePointZ[i]+0.6, linePointX[i-1], linePointY[i-1], linePointZ[i-1]+0.6, tocolor(138, 255,0, 255), 9) dxDrawLine3D(linePointX[i-1], linePointY[i-1], linePointZ[i-1]+0.6, linePointX[i-2], linePointY[i-2], linePointZ[i-2]+0.6, tocolor(138, 255,0, 255), 9) dxDrawLine3D(linePointX[i-3], linePointY[i-3], linePointZ[i-3]+0.6, linePointX[i-4], linePointY[i-4], linePointZ[i-4]+0.6, tocolor(138, 255,0, 255), 9) dxDrawLine3D(linePointX[i], linePointY[i], linePointZ[i]+0.8, linePointX[i-1], linePointY[i-1], linePointZ[i-1]+0.8, tocolor(0, 144,255, 255), 9) dxDrawLine3D(linePointX[i-1], linePointY[i-1], linePointZ[i-1]+0.8, linePointX[i-2], linePointY[i-2], linePointZ[i-2]+0.8, tocolor(0, 144,255, 255), 9) dxDrawLine3D(linePointX[i-3], linePointY[i-3], linePointZ[i-3]+0.8, linePointX[i-4], linePointY[i-4], linePointZ[i-4]+0.8, tocolor(0, 144,255, 255), 9) dxDrawLine3D(linePointX[i], linePointY[i], linePointZ[i]+1, linePointX[i-1], linePointY[i-1], linePointZ[i-1]+1, tocolor(180, 0,255, 255), 9) dxDrawLine3D(linePointX[i-1], linePointY[i-1], linePointZ[i-1]+1, linePointX[i-2], linePointY[i-2], linePointZ[i-2]+1, tocolor(180, 0,255, 255), 9) dxDrawLine3D(linePointX[i-3], linePointY[i-3], linePointZ[i-3]+1, linePointX[i-4], linePointY[i-4], linePointZ[i-4]+1, tocolor(180, 0,255, 255), 9) end end end end) i want other players can see it too pls help
  14. Best-Killer

    anyway ?

    anyway to add last number won + last money won !! script function winLottery ( ) local winAccount = nil local winner = nil local num = getLotteryWinningNumber ( ) for i, v in pairs ( lottery ) do if ( v == num ) then winAccount = i end end if ( winAccount ) then for i, v in pairs ( getElementsByType ( "player" ) ) do local a = getPlayerAccount ( v ) if ( not isGuestAccount ( a ) and getAccountName ( a ) == winAccount ) then winner = v end end end if ( winAccount and not winner ) then winner = winaccount.." #ff0000(offline)" elseif ( not winAccount ) then winner = nil end exports.SAEGMessages:sendClientMessage("Lottery Winner is :"..tostring(winner or "Nobody")" Prize :"..tostring(prize), root, 0, 255, 0) if ( winner ~= nil and getElementType ( winner ) == "player" ) then exports.SAEGMessages:sendClientMessage("You won $"..tostring(prize).." from the lottery!", winner, 0, 255, 0) givePlayerMoney ( winner, prize ) end generateNextLottery ( ) end function generateNextLottery ( ) lottery = { } winningNum = math.random ( 1, 30 ) prize = math.random ( 1, 2000000 ) if ( isTimer ( lotTImer ) ) then killTimer ( lotTImer ) lotTImer = nil end lotTImer = setTimer ( winLottery, 1800000, 1) end function getLotteryWinningNumber ( ) return winningNum end function getLotteryTimer ( ) return lotTImer end generateNextLottery ( ) addEvent ( "SAEGLotter->onClientRequestTimerDetails", true ) addEventHandler ( "SAEGLotter->onClientRequestTimerDetails", root, function ( ) triggerClientEvent ( source, "SAEGLottery->onServerSendClientTimerDetails", source, convertMilSecsToTimer ( getTimerDetails ( getLotteryTimer ( ) ) )) end ) function convertMilSecsToTimer ( mil ) local h = 0 local m = 0 local s = 0 while ( mil > 1000 ) do s = s + 1 mil = mil - 1000 end while ( s > 60 ) do s = s - 60 m = m + 1 end while ( m > 60 ) do m = m - 60 h = h + 1 end return tostring ( h ).."h "..tostring(m).."m "..tostring (s).."s" end
  15. type="map" version="1.0.0"> "airport_map.map" dimension="0"/>
  16. lol it's Nerd Gaming script it's saved bro Note: Don't Forget to start NGantirestart script
  17. example from me : setWeaponProperty("silenced", "pro", "weapon_range", 45.0) setWeaponProperty("silenced", "pro", "maximum_clip_ammo", 1) setWeaponProperty("silenced", "pro", "damage", 100) that wiki SetWeaponProperty
  18. Best-Killer

    Nill

    if VIP == "None" then guiGridListRemoveRow ( tGrid, row4 ) guiGridListRemoveRow ( tGrid, row5 ) guiGridListRemoveRow ( tGrid, row6 ) guiGridListRemoveRow ( tGrid, row7 ) end row4 = guiGridListAddRow(tGrid) row5 = guiGridListAddRow(tGrid) row6 = guiGridListAddRow(tGrid) row7 = guiGridListAddRow(tGrid) row 4 , 5 not removed but 6 7 yes why ?
  19. Best-Killer

    Nill

    Work <3 Thanks u
  20. Not Work
  21. Best-Killer

    Nill

    Player rank is: silver then i changed to Gold Vip then it's showed Player rank is: Gold
  22. local peds = { } for i, v in ipairs ( locs ) do local x, y, z, rot = unpack ( v ) peds[i] = createPed ( 57, x, y, z, rot ) exports.SAEGJobs:create3DText ( "Lottery", { x, y, z }, { 255, 255, 0 }, nil, { } ) setElementFrozen ( peds[i], true ) addEventHandler ( "onClientPedDamage", peds[i], cancelEvent ) end function onPedClick(button, state, absX, absY, wx, wy, wz, element) if (element and getElementType(element) == "peds" and state=="down") then local x, y, z = getElementPosition(localPlayer) if (element == peds[i]) then if getDistanceBetweenPoints3D(x, y, z, wx, wy, wz)<=3 then guiSetVisible(GUIEditor.window[1], true) showCursor (true) end end end end addEventHandler("onClientClick", root, onPedClick) 0 Errors but when i click on ped the gui not showing
  23. No it's my own
  24. function onPlayerLogin() account = getPlayerAccount(source) money = getAccountData(account,"bankmoney") setElementData(source,"bankmoney",money) setElementData(source,"account",account) end addEventHandler("onPlayerLogin",root,onPlayerLogin) function onPlayerLogout() account = getPlayerAccount(source) money = getElementData(source,"bankmoney") setAccountData(account,"bankmoney",money) end addEventHandler("onPlayerQuit",root,onPlayerLogout) 0 errors when i deposit money in bank and i recconect the money in bank back to 0 any solution ?
  25. Best-Killer

    Nill

    the vip names Silver/Gold/Bronze/Premuim i won't the cars for all vip players example : Bronze : NRG-500 Silver : NRG-500 + Sultan understand ?
×
×
  • Create New...