Jump to content

thegost

Members
  • Posts

    43
  • Joined

  • Last visited

Everything posted by thegost

  1. Link the imagem the erro: https://uploaddeimagens.com.br/imagens/ ... -46-58-png
  2. but ONLY show THAT Line you can fxe the line?
  3. I have in server: See all script: Client: local localPlayer = getLocalPlayer() local resX, resY = guiGetScreenSize() local startX = resX * (2 / 3) local startY = 0 local windowX = resX * (1 / 5) local windowY = resY local xml = xmlLoadFile("spawns.xml") -- open the XML file local cityNodes = xmlNodeGetChildren(xml) -- get all child nodes of the root node () local cities = {} -- create a new global variable to store the welcome messages local GUIEditor_Window = {} local GUIEditor_Button = {} local GUIEditor_Memo = {} local GUIEditor_Label = {} for i,node in ipairs(cityNodes) do cityname = xmlNodeGetAttribute(node, "name") local classnodes = xmlNodeGetChildren(node) cities[cityname] = {} for i2,node2 in ipairs(classnodes) do classname = xmlNodeGetAttribute(node2, "name") local spawnnodes = xmlNodeGetChildren(node2) cities[cityname][classname] = {} for i3, node3 in ipairs(spawnnodes) do skinName = xmlNodeGetAttribute(node3, "name") cities[cityname][classname][skinName] = {} cities[cityname][classname][skinName]["spawnX"] = xmlNodeGetAttribute(node3, "spawnX") cities[cityname][classname][skinName]["spawnY"] = xmlNodeGetAttribute(node3, "spawnY") cities[cityname][classname][skinName]["spawnZ"] = xmlNodeGetAttribute(node3, "spawnZ") cities[cityname][classname][skinName]["r"] = xmlNodeGetAttribute(node3, "r") cities[cityname][classname][skinName]["g"] = xmlNodeGetAttribute(node3, "g") cities[cityname][classname][skinName]["b"] = xmlNodeGetAttribute(node3, "b") local skinNodes = xmlNodeGetChildren(node3) cities[cityname][classname][skinName]["skins"] = {} for i4, node4 in ipairs(skinNodes) do local skinID = xmlNodeGetValue(node4) table.insert(cities[cityname][classname][skinName]["skins"], skinID) end cities[cityname][classname][skinName]["permission"] = xmlNodeGetAttribute(node3, "lock") cities[cityname][classname][skinName]["information"] = xmlNodeGetAttribute(node3, "information") cities[cityname][classname][skinName]["weapons"] = xmlNodeGetAttribute(node3, "weapons") end end end xmlUnloadFile(xml) function setCamera() setCameraMatrix(1192.3686523438, -2036.3634033203, 69.235496520996, 1191.3736572266, -2036.330078125, 69.141883850098, 0, 70) end function wastedScreenFix() guiSetVisible(GUIEditor_Window[1], true) end ---------------------------------------------- wasted selection GUI function drawWastedSelection() --Make vars cost = math.random(50,5000) --Make GUI GUIEditor_Window[1] = guiCreateWindow(0.25,0.8,0.5,0.3,"RG:RPG - Spawn",true) guiWindowSetMovable(GUIEditor_Window[1], false) guiWindowSetSizable(GUIEditor_Window[1], false) GUIEditor_Button[2] = guiCreateButton(0.2,0.3,0.6,0.2,"Return to the spawn menu",true,GUIEditor_Window[1]) --GUIEditor_Label[4] = guiCreateLabel(0.2,0.2,0.6,0.2,"(c)RG:RPG",true,GUIEditor_Window[1]) showCursor(true) --Button Handlers addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], onHospitalbuttonclick ) addEventHandler ( "onClientGUIClick", GUIEditor_Button[2], drawSpawnScreen ) addEventHandler ( "onClientGUIClick", GUIEditor_Button[2], hidewastedscreen ) --Make GUI Visable guiSetVisible(GUIEditor_Window[1], false) --Wasted Screen Camera --local ,yD,zD = getElementPosition( source ) --setCameraMatrix(,yD,zD-1,,yD,zD+1,90,110) -- attach camera to players face --fadeCamera( false, 5, 119,0,0 ) --Wasted Screen Sound local sound = playSound("client/wasted.mp3",false) setSoundVolume(sound, 0.75) --Draw GUI setTimer(wastedScreenFix,500,1) end function onHospitalbuttonclick() if source == GUIEditor_Button[1] then if getPlayerMoney(getLocalPlayer()) >= cost then guiSetVisible(GUIEditor_Window[1], false) showCursor(false) triggerServerEvent("SPAWNATHOSIPTAL", getLocalPlayer() ) takePlayerMoney ( cost ) elseif getPlayerMoney(getLocalPlayer()) < cost then has = getPlayerMoney(getLocalPlayer()) take = has - cost --outputChatBox("You respawned at hospital") triggerEvent("SAVE:RPG:addMessage", localPlayer, "You have respawned at the hospital", 255, 0, 0) guiSetVisible(GUIEditor_Window[1], false) showCursor(false) triggerServerEvent("SPAWNATHOSIPTAL", getLocalPlayer() ) takePlayerMoney ( cost ) else outputChatBox("An error occured.", 255, 0, 0) end end end function hidewastedscreen(button) if button == "left" then guiSetVisible(GUIEditor_Window[1], false) guiSetVisible(spawnWindow, true) end end -------------------------------------------- end wasted selection GUI function drawSpawnScreen() if ( spawnWindow or infoWindow ) then guiSetVisible(spawnWindow, false) guiSetVisible(infoWindow, false) end labels = {} spawnWindow = guiCreateWindow(0.005,0.395,0.5,0.6,"RG:RPG Spawn Menu",true) guiWindowSetMovable(spawnWindow, false) guiWindowSetSizable(spawnWindow, false) infoWindow = guiCreateWindow(0.005,0.265,0.5,0.125,"RG:RPG Class Information",true) guiWindowSetMovable(infoWindow,false) guiWindowSetSizable(spawnWindow,false) infoMemo = guiCreateMemo(0.0243,0.1712,0.9533,0.7534,"This server is ran by the Empire",true,infoWindow) guiMemoSetReadOnly(infoMemo, true) image = guiCreateStaticImage(0.0167,0.0387,0.975,0.225,"logo.png",true,spawnWindow) cityGridList = guiCreateGridList(0.025,0.27,0.455,0.5,true,spawnWindow) guiGridListSetSelectionMode(cityGridList,2) guiGridListAddColumn(cityGridList, "City", 0.82) classGridList = guiCreateGridList(0.52,0.27,0.455,0.3,true,spawnWindow) guiGridListSetSelectionMode(classGridList,2) guiGridListAddColumn(classGridList, "Team", 0.82) spawnGridList = guiCreateGridList(0.52,0.585,0.455,0.2995,true,spawnWindow) guiGridListSetSelectionMode(spawnGridList,2) guiGridListAddColumn(spawnGridList, "Class", 0.82) -- (LEFT RIGHT, UP DOWN, WIDTH,HEIGHT) skinPrevButton = guiCreateButton(0.55,0.9,0.125,0.25,"<-",true,spawnWindow) skinNextButton = guiCreateButton(0.82,0.9,0.125,0.25,"->",true,spawnWindow) guiSetProperty(skinPrevButton, "Disabled", "True") guiSetProperty(skinNextButton, "Disabled", "True") skinNumberLabel = guiCreateLabel(0.599,0.925,0.3058,0.0326,"1",true,spawnWindow) guiLabelSetVerticalAlign(skinNumberLabel,"center") guiLabelSetHorizontalAlign(skinNumberLabel,"center",false) spawnScreenOKButton = guiCreateButton(0.025,0.8,0.455,0.6,"Spawn",true,spawnWindow) guiSetProperty(spawnScreenOKButton, "Disabled", "True") for n, v in pairs(cities) do local row = guiGridListAddRow(cityGridList) guiGridListSetItemText(cityGridList, row, 1, n, false, false) end addEventHandler("onClientGUIClick", cityGridList, onCityClick) addEventHandler("onClientGUIClick", classGridList, onClassClick) addEventHandler("onClientGUIClick", spawnGridList, onSkinClick) addEventHandler("onClientGUIClick", spawnScreenOKButton, onSpawnButtonClick) addEventHandler("onClientGUIClick", skinPrevButton, onPrevSkin) addEventHandler("onClientGUIClick", skinNextButton, onNextSkin) fadeCamera(true) setCamera() guiSetVisible(spawnWindow, true) --guiGridListSetSelectedItem(spawnGridList, -1, 0) showCursor(true) end 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") guiSetProperty(skinPrevButton, "Disabled", "True") guiSetProperty(skinNextButton, "Disabled", "True") guiSetText(skinNumberLabel, 1) unRenderSkin() end end end function onClassClick(button) if source == classGridList and button == "left" then if guiGridListGetSelectedCount(cityGridList) > 0 and guiGridListGetSelectedCount(classGridList) > 0 then guiGridListClear(spawnGridList) 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(spawnGridList) guiGridListSetItemText(spawnGridList, row, 1, x, false, false) end guiSetProperty(spawnScreenOKButton, "Disabled", "True") guiSetProperty(skinPrevButton, "Disabled", "True") guiSetProperty(skinNextButton, "Disabled", "True") guiSetText(skinNumberLabel, 1) unRenderSkin() end end end function onSkinClick(button) if source == spawnGridList and button == "left" then if guiGridListGetSelectedCount(cityGridList) > 0 and guiGridListGetSelectedCount(classGridList) > 0 and guiGridListGetSelectedCount( spawnGridList ) > 0 then local selectedRow, selectedCol = guiGridListGetSelectedItem( cityGridList ); -- get double clicked item in the gridlist local cityName = guiGridListGetItemText( cityGridList, selectedRow, selectedCol ) -- get its text
  4. in / debugscript 3 not pops up the line the erro
  5. Hey All , I have one spawn panel good , but he bugged people not see the spawn .... people dead and spawn not see, he start and not have erros in /debugscript 3 help please local localPlayer = getLocalPlayer() local resX, resY = guiGetScreenSize() local startX = resX * (2 / 3) local startY = 0 local windowX = resX * (1 / 5) local windowY = resY local xml = xmlLoadFile("spawns.xml") -- open the XML file local cityNodes = xmlNodeGetChildren(xml) -- get all child nodes of the root node () local cities = {} -- create a new global variable to store the welcome messages local GUIEditor_Window = {} local GUIEditor_Button = {} local GUIEditor_Memo = {} local GUIEditor_Label = {} for i,node in ipairs(cityNodes) do cityname = xmlNodeGetAttribute(node, "name") local classnodes = xmlNodeGetChildren(node) cities[cityname] = {} for i2,node2 in ipairs(classnodes) do classname = xmlNodeGetAttribute(node2, "name") local spawnnodes = xmlNodeGetChildren(node2) cities[cityname][classname] = {} for i3, node3 in ipairs(spawnnodes) do skinName = xmlNodeGetAttribute(node3, "name") cities[cityname][classname][skinName] = {} cities[cityname][classname][skinName]["spawnX"] = xmlNodeGetAttribute(node3, "spawnX") cities[cityname][classname][skinName]["spawnY"] = xmlNodeGetAttribute(node3, "spawnY") cities[cityname][classname][skinName]["spawnZ"] = xmlNodeGetAttribute(node3, "spawnZ") cities[cityname][classname][skinName]["r"] = xmlNodeGetAttribute(node3, "r") cities[cityname][classname][skinName]["g"] = xmlNodeGetAttribute(node3, "g") cities[cityname][classname][skinName]["b"] = xmlNodeGetAttribute(node3, "b") local skinNodes = xmlNodeGetChildren(node3) cities[cityname][classname][skinName]["skins"] = {} for i4, node4 in ipairs(skinNodes) do local skinID = xmlNodeGetValue(node4) table.insert(cities[cityname][classname][skinName]["skins"], skinID) end cities[cityname][classname][skinName]["permission"] = xmlNodeGetAttribute(node3, "lock") cities[cityname][classname][skinName]["information"] = xmlNodeGetAttribute(node3, "information") cities[cityname][classname][skinName]["weapons"] = xmlNodeGetAttribute(node3, "weapons") end end end xmlUnloadFile(xml) function setCamera() setCameraMatrix(1192.3686523438, -2036.3634033203, 69.235496520996, 1191.3736572266, -2036.330078125, 69.141883850098, 0, 70) end function wastedScreenFix() guiSetVisible(GUIEditor_Window[1], true) end ---------------------------------------------- wasted selection GUI function drawWastedSelection() --Make vars cost = math.random(50,5000) --Make GUI GUIEditor_Window[1] = guiCreateWindow(0.25,0.8,0.5,0.3,"RG:RPG - Spawn",true) guiWindowSetMovable(GUIEditor_Window[1], false) guiWindowSetSizable(GUIEditor_Window[1], false) GUIEditor_Button[2] = guiCreateButton(0.2,0.3,0.6,0.2,"Return to the spawn menu",true,GUIEditor_Window[1]) --GUIEditor_Label[4] = guiCreateLabel(0.2,0.2,0.6,0.2,"(c)RG:RPG",true,GUIEditor_Window[1]) showCursor(true) --Button Handlers addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], onHospitalbuttonclick ) addEventHandler ( "onClientGUIClick", GUIEditor_Button[2], drawSpawnScreen ) addEventHandler ( "onClientGUIClick", GUIEditor_Button[2], hidewastedscreen ) --Make GUI Visable guiSetVisible(GUIEditor_Window[1], false) --Wasted Screen Camera --local ,yD,zD = getElementPosition( source ) --setCameraMatrix(,yD,zD-1,,yD,zD+1,90,110) -- attach camera to players face --fadeCamera( false, 5, 119,0,0 ) --Wasted Screen Sound local sound = playSound("client/wasted.mp3",false) setSoundVolume(sound, 0.75) --Draw GUI setTimer(wastedScreenFix,500,1) end function onHospitalbuttonclick() if source == GUIEditor_Button[1] then if getPlayerMoney(getLocalPlayer()) >= cost then guiSetVisible(GUIEditor_Window[1], false) showCursor(false) triggerServerEvent("SPAWNATHOSIPTAL", getLocalPlayer() ) takePlayerMoney ( cost ) elseif getPlayerMoney(getLocalPlayer()) < cost then has = getPlayerMoney(getLocalPlayer()) take = has - cost --outputChatBox("You respawned at hospital") triggerEvent("SAVE:RPG:addMessage", localPlayer, "You have respawned at the hospital", 255, 0, 0) guiSetVisible(GUIEditor_Window[1], false) showCursor(false) triggerServerEvent("SPAWNATHOSIPTAL", getLocalPlayer() ) takePlayerMoney ( cost ) else outputChatBox("An error occured.", 255, 0, 0) end end end function hidewastedscreen(button) if button == "left" then guiSetVisible(GUIEditor_Window[1], false) guiSetVisible(spawnWindow, true) end end -------------------------------------------- end wasted selection GUI function drawSpawnScreen() if ( spawnWindow or infoWindow ) then guiSetVisible(spawnWindow, false) guiSetVisible(infoWindow, false) end labels = {} spawnWindow = guiCreateWindow(0.005,0.395,0.5,0.6,"RG:RPG Spawn Menu",true) guiWindowSetMovable(spawnWindow, false) guiWindowSetSizable(spawnWindow, false) infoWindow = guiCreateWindow(0.005,0.265,0.5,0.125,"RG:RPG Class Information",true) guiWindowSetMovable(infoWindow,false) guiWindowSetSizable(spawnWindow,false) infoMemo = guiCreateMemo(0.0243,0.1712,0.9533,0.7534,"This server is ran by the Empire",true,infoWindow) guiMemoSetReadOnly(infoMemo, true) image = guiCreateStaticImage(0.0167,0.0387,0.975,0.225,"logo.png",true,spawnWindow) cityGridList = guiCreateGridList(0.025,0.27,0.455,0.5,true,spawnWindow) guiGridListSetSelectionMode(cityGridList,2) guiGridListAddColumn(cityGridList, "City", 0.82) classGridList = guiCreateGridList(0.52,0.27,0.455,0.3,true,spawnWindow) guiGridListSetSelectionMode(classGridList,2) guiGridListAddColumn(classGridList, "Team", 0.82) spawnGridList = guiCreateGridList(0.52,0.585,0.455,0.2995,true,spawnWindow) guiGridListSetSelectionMode(spawnGridList,2) guiGridListAddColumn(spawnGridList, "Class", 0.82) -- (LEFT RIGHT, UP DOWN, WIDTH,HEIGHT) skinPrevButton = guiCreateButton(0.55,0.9,0.125,0.25,"<-",true,spawnWindow) skinNextButton = guiCreateButton(0.82,0.9,0.125,0.25,"->",true,spawnWindow) guiSetProperty(skinPrevButton, "Disabled", "True") guiSetProperty(skinNextButton, "Disabled", "True") skinNumberLabel = guiCreateLabel(0.599,0.925,0.3058,0.0326,"1",true,spawnWindow) guiLabelSetVerticalAlign(skinNumberLabel,"center") guiLabelSetHorizontalAlign(skinNumberLabel,"center",false) spawnScreenOKButton = guiCreateButton(0.025,0.8,0.455,0.6,"Spawn",true,spawnWindow) guiSetProperty(spawnScreenOKButton, "Disabled", "True") for n, v in pairs(cities) do local row = guiGridListAddRow(cityGridList) guiGridListSetItemText(cityGridList, row, 1, n, false, false) end addEventHandler("onClientGUIClick", cityGridList, onCityClick) addEventHandler("onClientGUIClick", classGridList, onClassClick) addEventHandler("onClientGUIClick", spawnGridList, onSkinClick) addEventHandler("onClientGUIClick", spawnScreenOKButton, onSpawnButtonClick) addEventHandler("onClientGUIClick", skinPrevButton, onPrevSkin) addEventHandler("onClientGUIClick", skinNextButton, onNextSkin) fadeCamera(true) setCamera() guiSetVisible(spawnWindow, true) --guiGridListSetSelectedItem(spawnGridList, -1, 0) showCursor(true) end 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") guiSetProperty(skinPrevButton, "Disabled", "True") guiSetProperty(skinNextButton, "Disabled", "True") guiSetText(skinNumberLabel, 1) unRenderSkin() end end end function onClassClick(button) if source == classGridList and button == "left" then if guiGridListGetSelectedCount(cityGridList) > 0 and guiGridListGetSelectedCount(classGridList) > 0 then guiGridListClear(spawnGridList) 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(spawnGridList) guiGridListSetItemText(spawnGridList, row, 1, x, false, false) end guiSetProperty(spawnScreenOKButton, "Disabled", "True") guiSetProperty(skinPrevButton, "Disabled", "True") guiSetProperty(skinNextButton, "Disabled", "True") guiSetText(skinNumberLabel, 1) unRenderSkin() end end end function onSkinClick(button) if source == spawnGridList and button == "left" then if guiGridListGetSelectedCount(cityGridList) > 0 and guiGridListGetSelectedCount(classGridList) > 0 and guiGridListGetSelectedCount( spawnGridList ) > 0 then local selectedRow, selectedCol = guiGridListGetSelectedItem( cityGridList ); -- get double clicked item in the gridlist local cityName = guiGridListGetItemText( cityGridList, selectedRow, selectedCol ) -- get its text
  6. Not work erro: server.lua:89:attempt to perform arithmedic on a boolean valeu
  7. THis Fix But now have erro in Count: in : function checkHouseForPercentage() checkTimer = nil outputChatBox("1") if houserobBlip then outputChatBox("2") for i, robber in ipairs (getElementsWithinColShape(houserobCircle, "player")) do if not isPedDead(robber) and robberTeams[getTeamName(getPlayerTeam(robber))] then count = count +1 wl = getElementData(robber, "wanted") +1 if wl > 36 then wl = 36 exports.RPGPolice:setWantedLevel(robber, wl) end end end if not firstTime then outputChatBox("3") firstTime = 0 for i, robber in pairs (getElementsWithinColShape(houserobCircle, "player")) do if not isPedDead(robber) and robberTeams[getTeamName(getPlayerTeam(robber))] then showProcess(robber) end end end outputChatBox("4") if count > 0 then outputChatBox("5") local percent = getElementData(houserobMarker, "percent") local percent = percent + (count*ppP) if percent > 0 then triggerClientEvent("showHouserobBlip", getRootElement(), 2, houserob[houserobNumber][1],houserob[houserobNumber][2],houserob[houserobNumber][3]) outputChatBox("7") else if percent > 100 then setElementData(houserobMarker, "percent", 100) nextStep() else setElementData(houserobMarker, "percent", percent) outputChatBox("8") end end end outputChatBox("Last") checkTimer = setTimer(checkHouseForPercentage, 5000, 1) end end ERRO:attempt to perform arithmetic on global "count" (a nil value)
  8. Not work the erro in : for i, robber in ipairs (getElementsWithinColShape(houserobCircle, "player")) do if not isPedDead(robber) and robberTeams[getTeamName(getPlayerTeam(robber))] then count = count +1 wl = getElementData(robber, "wanted") +1 if wl > 36 then wl = 36 exports.RPGPolice:setWantedLevel(robber, wl) end end ERRO: "end" expected (to close "for" at line 85) near ""
  9. I See tomorow because now i go sleep but thanks
  10. The erro in function checkHouseForPercentage() checkTimer = nil if houserobBlip then for i, robber in ipairs (getElementsWithinColShape(houserobCircle, "player")) do if not isPedDead(robber) and robberTeams[getTeamName(getPlayerTeam(robber))] then count = count +1 wl = getElementData(robber, "wanted") +1 if wl > 36 then wl = 36 exports.RPGPolice:setWantedLevel(robber, wl) end end if not firstTime then firstTime = 0 for i, robber in pairs (getElementsWithinColShape(houserobCircle, "player")) do if not isPedDead(robber) and robberTeams[getTeamName(getPlayerTeam(robber))] then showProcess(robber) end end if count > 0 then local percent = getElementData(houserobMarker, "percent") local percent = percent + (count*ppP) if percent > 0 then triggerClientEvent("showHouserobBlip", getRootElement(), 2, houserob[houserobNumber][1],houserob[houserobNumber][2],houserob[houserobNumber][3]) else if percent > 100 then setElementData(houserobMarker, "percent", 100) nextStep() else setElementData(houserobMarker, "percent", percent) end end checkTimer = setTimer(checkHouseForPercentage, 5000, 1) end end help?
  11. I use /debugscript 3 and not see nothing
  12. I use this in consele ( /debugscript robbery ) and not see any
  13. Yes I have , I and My friend NoBiTa create this script but we see outher scrits the robbers.... and we add scripts part and create this , but not work good can help me please ?
  14. Hey ALL I have one script good House Robbery But He have problem and how WHEN PEOPLE(Criminals) GO FOR hr ( houserobbery ) A share of stay in 0 % (The percent not increases and hr not finich) layover and not increase the Faster Help In this script possible : server: houserobTime = (1000*60)*15 -- 1 min. until houserob cancels newHouserobTime = (1000*60)*5 -- 1 min. until houserob cancels ppP = 0.5 -- 1 % per Player in the circle every 5 sec robberTeams = { ["Criminal"] = true,["Sons Of Anarchy"] = true,["CLO"] = true, ["Official Gangs"] = true} houserob = {} houserob[1] = {2398.1826171875,-1893.1015625,13.3828125} houserob[2] = {2101.4228515625,-1806.6171875,13.5546875} houserob[3] = {427.2880859375,-1759.33203125,8.1472320556641} houserob[4] = {479.3154296875,-1534.490234375,19.641231536865} houserob[5] = {997.5947265625,-916.9677734375,42.1796875} houserob[6] = {2421.115234375,-1225.072265625,25.148614883423} houserob[7] = {1941.6552734375,-2116.6669921875,13.6953125} houserob[8] = {1834.2509765625,-1682.2880859375,13.439321517944} houserob[9] = {1929.76171875,-1775.720703125,13.546875} houserob[10] = {980.1845703125,-676.259765625,121.97625732422} houserob[11] = {-2321.94140625,-156.609375,35.5546875} houserob[12] = {-2494.0869140625,-27.7158203125,25.765625} houserob[13] = {-2673.0634765625,262.4248046875,4.6328125} houserob[14] = {-2766.0546875,787.8828125,52.78125} houserob[15] = {-2442.828125,753.923828125,35.171875} houserob[16] = {-2626.1259765625,1410.14453125,7.09375} houserob[17] = {-2522.6962890625,1216.8056640625,37.428329467773} houserob[18] = {-1724.7724609375,1360.3515625,7.1875} houserob[19] = {-1911.1806640625,830.68359375,35.171875} houserob[20] = {-1722.484375,-117.34375,3.5489187240601} houserob[21] = {1383, 1023.6, 10.8} houserob[22] = {1694.1, 2198.3, 10.8} houserob[23] = {2442.5009765625,2059.21484375,10.8203125} houserob[24] = {2628.7392578125,1844.1953125,10.8203125} houserob[25] = {2506.900390625,1247.271484375,10.8203125} houserob[26] = {2543.064453125,1018.7802734375,10.812517166138} houserob[27] = {2392.185546875,696.220703125,11.39614200592} houserob[28] = {1608.7568359375,712.177734375,10.8203125} houserob[29] = {946.73046875,1732.1171875,8.8515625} houserob[30] = {1461.6484375,2775.41796875,10.8203125} local informTeams = {["Police"]=true,["Desert Eagles"]=true,["Official Squads"]=true} function addHouserob() firstTime = nil triggerClientEvent("showHouserobBlip", getRootElement(), 0) if houserobMarker then destroyElement(houserobMarker) houserobMarker = nil end if houserobBlip then destroyElement(houserobBlip) houserobBlip = nil end if houserobPickup then destroyElement(houserobPickup) houserobPickup = nil end if houserobTimer then killTimer(houserobTimer) houserobTimer = nil end if checkTimer then killTimer(checkTimer) checkTimer = nil end if houserobCircle then destroyElement(houserobCircle) houserobCircle = nil end houserobNumber = math.random(#houserob) if houserobNumber then houserobPickup = createPickup(houserob[houserobNumber][1],houserob[houserobNumber][2],houserob[houserobNumber][3],3,1274, 0, 0 ) houserobMarker = createMarker(houserob[houserobNumber][1],houserob[houserobNumber][2],houserob[houserobNumber][3]-3,"cylinder", 20, 255, 100, 100, 20) setElementData(houserobMarker, "percent", 0) triggerClientEvent("showHouserobBlip", getRootElement(), 1, houserob[houserobNumber][1],houserob[houserobNumber][2],houserob[houserobNumber][3]) houserobBlip = createBlip(houserob[houserobNumber][1],houserob[houserobNumber][2],houserob[houserobNumber][3],43, 2, 255, 255, 255, 255, 0, 9999, getRootElement()) setElementVisibleTo (houserobBlip, getRootElement ( ), false ) houserobCircle = createColCircle(houserob[houserobNumber][1],houserob[houserobNumber][2], 10) addEventHandler("onPickupHit", houserobPickup, startHouserob) addEventHandler("onColShapeHit", houserobCircle, showProcess) addEventHandler("onColShapeLeave", houserobCircle, hideProcess) local x,y,z = getElementPosition(houserobCircle) for k, v in ipairs(getElementsByType("player")) do if getPlayerTeam(v) and informTeams[getTeamName(getPlayerTeam(v))] then exports.RPGcommands:sendMessage("*HOUSEROB* There is a house robbery taking place at "..getZoneName(x,y,z)..", "..getZoneName(x,y,z,true)..".",255,0,0,v) end end end end function startHouserob(player) if robberTeams[getTeamName(getPlayerTeam(player))] then exports.RPGcommands:sendMessage("Call more players to do a faster houserob!", 255, 100, 0, player) if houserobPickup then destroyElement(houserobPickup) houserobPickup = nil end houserobTimer = setTimer(stopHouserobUnfinished, houserobTime, 1) local x, y, z = getElementPosition(houserobMarker) local zone = getZoneName(x,y,z,false) local zone1 = getZoneName(x,y,z,true) checkHouseForPercentage() end end function checkHouseForPercentage() checkTimer = nil if houserobBlip then count = 0 for i, robber in ipairs (getElementsWithinColShape(houserobCircle, "player")) do if not isPedDead(robber) and robberTeams[getTeamName(getPlayerTeam(robber))] then count = count +1 wl = getElementData(robber, "wanted") +1 if wl > 36 then wl = 36 end exports.RPGPolice:setWantedLevel(robber, wl) end end if not firstTime then firstTime = 0 for i, robber in pairs (getElementsWithinColShape(houserobCircle, "player")) do if not isPedDead(robber) and robberTeams[getTeamName(getPlayerTeam(robber))] then showProcess(robber) end end end if count > 0 then local percent = getElementData(houserobMarker, "percent") local percent = percent + (count*ppP) if percent > 0 then triggerClientEvent("showHouserobBlip", getRootElement(), 2, houserob[houserobNumber][1],houserob[houserobNumber][2],houserob[houserobNumber][3]) end if percent > 100 then setElementData(houserobMarker, "percent", 100) nextStep() else setElementData(houserobMarker, "percent", percent) end end checkTimer = setTimer(checkHouseForPercentage, 5000, 1) end end function showProcess(robber) if getElementType(robber) == "player" and robberTeams[getTeamName(getPlayerTeam(robber))] then triggerClientEvent("showProcess", getRootElement(), robber, houserobMarker) end end function hideProcess(robber) if getElementType(robber) == "player" and robberTeams[getTeamName(getPlayerTeam(robber))] then triggerClientEvent("hideProcess", getRootElement(), robber) end end function nextStep() for i, robber in pairs (getElementsWithinColShape(houserobCircle, "player")) do if not isPedDead(robber) and isPedOnGround(robber) and robberTeams[getTeamName(getPlayerTeam(robber))] then exports.RPGcommands:giveMoney(robber, 10000) exports.RPGcommands:sendMessage("You got $10000 from the rob, go to the a warehouse in the city to get more money!", 0, 255, 0, robber) triggerClientEvent("showWarehouses", robber) end end firstTime = nil triggerClientEvent("showHouserobBlip", getRootElement(), 0) if houserobMarker then destroyElement(houserobMarker) houserobMarker = nil end if houserobBlip then destroyElement(houserobBlip) houserobBlip = nil end if houserobPickup then destroyElement(houserobPickup) houserobPickup = nil end if houserobTimer then killTimer(houserobTimer) houserobTimer = nil end if checkTimer then killTimer(checkTimer) checkTimer = nil end if houserobCircle then destroyElement(houserobCircle) houserobCircle = nil end setTimer(addHouserob, newHouserobTime, 1) end function stopHouserobUnfinished () firstTime = nil triggerClientEvent("showHouserobBlip", getRootElement(), 0) if houserobMarker then destroyElement(houserobMarker) houserobMarker = nil end if houserobBlip then destroyElement(houserobBlip) houserobBlip = nil end if houserobPickup then destroyElement(houserobPickup) houserobPickup = nil end if houserobTimer then killTimer(houserobTimer) houserobTimer = nil end if checkTimer then killTimer(checkTimer) checkTimer = nil end if houserobCircle then destroyElement(houserobCircle) houserobCircle = nil end setTimer(addHouserob, newHouserobTime, 1) end function waitTime() setTimer(addHouserob, 5000, 1) end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), waitTime) HELP ME PLEASE!!
×
×
  • Create New...