Jump to content

Lucario

Members
  • Posts

    153
  • Joined

  • Last visited

Everything posted by Lucario

  1. Hi, im making a full car shop for the community and my server, but i have problems, when i start the resource, the 2 guis appears in 1 time, and have a little bugs with the buttons i think, anyone can help me plz, or fix the start resource bug, code: Server side carShopMarker = createMarker (2133.59,-1149.29, 23.3, "cylinder", 3, 255, 255, 0, 127) carShopMarker2 = createMarker (562, -1270, 16, "cylinder", 2, 255, 255, 0, 127) carShopMarker3 = createMarker (-1954,299,34,"cylinder",2,255,255,0,127) carShopMarker4 = createMarker (-1663,1208,6,"cylinder",2,255,255,0,127) carShopMarker5 = createMarker (1946,2068,10,"cylinder",2,255,255,0,127) createBlipAttachedTo(carShopMarker,55,2,0,255,0,0,0,200) createBlipAttachedTo(carShopMarker2,55,2,0,255,0,0,0,200) createBlipAttachedTo(carShopMarker3,55,2,0,255,0,0,0,200) createBlipAttachedTo(carShopMarker4,55,2,0,255,0,0,0,200) createBlipAttachedTo(carShopMarker5,55,2,0,255,0,0,0,200) addEvent ("watchGUI", true) function markerHit (hitPlayer, matchingDimension) if (source == carShopMarker) or (source == carShopMarker2) or (source == carShopMarker3) or (source == carShopMarker4) or (source == carShopMarker5) then triggerClientEvent ("watchGUI", hitPlayer) end end addEventHandler ("onMarkerHit", getRootElement(), markerHit) addEvent ("carShopBuy", true) addEventHandler ("carShopBuy", getRootElement(), function(id, cost, name) if (getPlayerMoney (source) >= tonumber(cost)) then outputChatBox ("Has comprado un " .. name, source, 0, 255, 0, false) outputChatBox ("Precio: " .. cost, source, 0, 255, 0, false) takePlayerMoney (source, tonumber (cost)) setAccountData (getPlayerAccount (source), "funmodev2-car", tonumber(id)) setAccountData (getPlayerAccount (source), "funmodev2-paintjob", 3) setAccountData (getPlayerAccount (source), "funmodev2-carupg", 0) else outputChatBox ("No tienes suficiente dinero para comprar un" .. name, source, 255, 0, 0, false) end end) addEvent ("carTeletransport", true) addEvent ("carSell", true) function carSpawn () if not (isGuestAccount (getPlayerAccount (source))) and not (isPedInVehicle(source)) then if (getElementData (source, "hisCar")) and (getElementData (source, "hisCar") ~= nil) and (getElementType(getElementData (source, "hisCar")) == "vehicle") then setElementVelocity (getElementData (source, "hisCar"), 0,0,0) setElementPosition (getElementData (source, "hisCar"), 1631.3790283203,-1094.9102783203,23.90625) outputChatBox ("El vehiculo ha sido teletransportado con exito.", source, 0, 255, 0) elseif not (getElementData (source, "hisCar")) then local accountData = getAccountData (getPlayerAccount (source), "funmodev2-car") if (accountData) then vehicleID = getAccountData (getPlayerAccount (source), "funmodev2-car") x,y,z = getElementPosition (source) vehicle = createVehicle (carID, x +2, y, z +1) setElementID (vehicle, getAccountName (getPlayerAccount(source))) setElementData (source, "hisCar", vehicle) outputChatBox ("El vehiculo ha sido teletransportado con exito.", source, 255, 0, 0) if (getAccountData (getPlayerAccount(source), "funmodev2-carupg")) then local upgrades = nil local upgrades = {} local upgrades = getAccountData (getPlayerAccount(source), "funmodev2-carupg") for i,v in ipairs (upgrades) do addVehicleUpgrade (vehicle, v) end end if (getAccountData (getPlayerAccount(source), "funmodev2-paintjob")) then local paintjob = getAccountData (getPlayerAccount(source), "funmodev2-paintjob") setVehiclePaintjob (vehicle, paintjob) end if (getAccountData (getPlayerAccount(source), "funmodev2-carcolor1")) and (getAccountData (getPlayerAccount(source), "funmodev2-carcolor2")) then local c1 = getAccountData (getPlayerAccount(source), "funmodev2-carcolor1") local c2 = getAccountData (getPlayerAccount(source), "funmodev2-carcolor2") setVehicleColor (vehicle, c1,c2,0,0) end else outputChatBox ("No tienes ningun vehiculo.", source, 255, 0, 0) end else outputChatBox ("Ya estas en un vehiculo!", source, 255, 0, 0) end end end addEventHandler ("carSpawn", getRootElement(), carSpawn) function carDestroy (cost) if not (isGuestAccount (getPlayerAccount (source))) then if (isPedInVehicle (source)) then if (getElementID(getPedOccupiedVehicle(source)) == getAccountName (getPlayerAccount(source))) then local sell = getPlayerAccount (source), "hisCar", tonumber(cost) givePlayerMoney (sell (source, "hisCar")) destroyElement (getPedOccupiedVehicle (source)) removeElementData (source, "hisCar") outputChatBox ("Vehiculo vendido, te han sido devueltos " ..cost, source, 0, 255, 0) else outputChatBox ("Este no es tu vehiculo!", source, 255, 0, 0) end elseif (not (isPedInVehicle (source))) and (getElementData (source, "hisCar")) and (getElementData (source, "hisCar") ~= nil) then car=getElementData(source, "hisCar") cancelEvent() outputchatbox ("Este carro es gratis y no se puede vender", source, 255, 0, 0) end end end addEventHandler ("carSell", getRootElement(), carDestroy) function lightsSwitch () if (isPedInVehicle (source)) then local veh = getPedOccupiedVehicle (source) if (getVehicleOverrideLights(veh) ~= 2) then setVehicleOverrideLights(veh, 2) outputChatBox ("Las luces del vehiculo han sido encendidas.", source, 0, 0, 255) elseif (getVehicleOverrideLights(veh) ~= 1) then setVehicleOverrideLights(veh, 1) outputChatBox ("Las luces del vehiculo han sido apagadas.", source, 0, 0, 255) end else outputChatBox ("No estas en un vehiculo!", source, 255, 0, 0) end end addEvent("lightsCar",true) addEventHandler("lightsCar",getRootElement(),lightsSwitch) function lockSwitch () if (isPedInVehicle (source)) then local veh = getPedOccupiedVehicle (source) if not (isVehicleLocked (veh)) then setVehicleLocked (veh, true) setVehicleDoorsUndamageable (veh, true) setVehicleDoorState (veh, 0, 0) setVehicleDoorState (veh, 1, 0) setVehicleDoorState (veh, 2, 0) setVehicleDoorState (veh, 3, 0) outputChatBox ("El vehiculo ha sido cerrado.", source, 255, 0, 0) elseif (isVehicleLocked (veh)) then setVehicleLocked (veh, false) setVehicleDoorsUndamageable (veh, false) outputChatBox ("El vehiculo ha sido abierto.", source, 0, 255, 0) end else outputChatBox ("No estas en un vehiculo!", source, 255, 0, 0) end end addEvent("lockCar",true) addEventHandler("lockCar",getRootElement(),lockSwitch ) addEventHandler ("onVehicleStartEnter", getRootElement(), function(player, seat, jacked, door) if (isVehicleLocked (source) == true) then local mannetjeNaam = getAccountName (getPlayerAccount (player)) local autoNaam = getElementID (source) if (mannetjeNaam == autoNaam) then setVehicleLocked (source, false) outputChatBox ("El vehiculo ha sido abierto!", player, 255, 0, 0, false) end end end) addEventHandler ("onVehicleExplode", getRootElement(), function() local theOwner = getAccountName (getPlayerAccount(getPlayerFromName (getElementID (source)))) if (theOwner) then removeElementData (theOwner, "hisCar") end end) addEventHandler ("onPlayerQuit", getRootElement(), function(quitType, reason, responsibleElement) if (getElementData (source, "hisCar")) then blowVehicle (getElementData (source, "hisCar")) removeElementData (source, "hisCar") end end) addEventHandler( "onResourceStop", getResourceRootElement( getThisResource() ), function () for i,v in ipairs (getElementsByType ("player")) do if (getElementData (v, "hisCar")) then setElementHealth (getElementData (v, "hisCar"), 0) removeElementData (v, "hisCar") end end end ) function destroyOnExplode () setTimer (destroyElement, 2500, 1, source) end addEventHandler ("onVehicleExplode", getRootElement(), destroyOnExplode) Client side: local lp = getLocalPlayer() GUIEditor = { label = {}, button = {}, window = {}, gridlist = {}, memo = {} } shopwindows = guiCreateWindow(352, 156, 510, 519, "Tienda de autos por MultiKiller", false) guiWindowSetMovable(shopwindows, false) guiWindowSetSizable(shopwindows, false) shopgrid = guiCreateGridList(9, 21, 288, 390, false, shopwindows) guiGridListAddColumn(shopgrid, "Autos", 0.4) guiGridListAddColumn(shopgrid, "Precios", 0.4) guiGridListSetItemText(shopgrid, 0, 1, "Virgo", false, false) guiGridListSetItemText(shopgrid, 0, 2, "20000$", false, false) guiGridListSetItemText(shopgrid, 1, 1, "Uranus", false, false) guiGridListSetItemText(shopgrid, 1, 2, "27000$", false, false) guiGridListSetItemText(shopgrid, 2, 1, "Turismo", false, false) guiGridListSetItemText(shopgrid, 2, 2, "25000$", false, false) guiGridListSetItemText(shopgrid, 3, 1, "Super GT", false, false) guiGridListSetItemText(shopgrid, 3, 2, "30000$", false, false) guiGridListSetItemText(shopgrid, 4, 1, "Sultan", false, false) guiGridListSetItemText(shopgrid, 4, 2, "40000$", false, false) guiGridListSetItemText(shopgrid, 5, 1, "Euros", false, false) guiGridListSetItemText(shopgrid, 5, 2, "30000$", false, false) guiGridListSetItemText(shopgrid, 6, 1, "Romero", false, false) guiGridListSetItemText(shopgrid, 6, 2, "30000$", false, false) guiGridListSetItemText(shopgrid, 7, 1, "Regina", false, false) guiGridListSetItemText(shopgrid, 7, 2, "28000$", false, false) guiGridListSetItemText(shopgrid, 8, 1, "Rancher", false, false) guiGridListSetItemText(shopgrid, 8, 2, "20000$", false, false) guiGridListSetItemText(shopgrid, 9, 1, "Primo", false, false) guiGridListSetItemText(shopgrid, 9, 2, "23500$", false, false) guiGridListSetItemText(shopgrid, 10, 1, "Mr.Whooper", false, false) guiGridListSetItemText(shopgrid, 10, 2, "25000$", false, false) guiGridListSetItemText(shopgrid, 11, 1, "Kart", false, false) guiGridListSetItemText(shopgrid, 11, 2, "18000$", false, false) guiGridListSetItemText(shopgrid, 12, 1, "Jester", false, false) guiGridListSetItemText(shopgrid, 12, 2, "24000$", false, false) guiGridListSetItemText(shopgrid, 13, 1, "Infernus", false, false) guiGridListSetItemText(shopgrid, 13, 2, "40000$", false, false) guiGridListSetItemText(shopgrid, 14, 1, "Hotdog", false, false) guiGridListSetItemText(shopgrid, 14, 2, "23000$", false, false) guiGridListSetItemText(shopgrid, 15, 1, "Harvester", false, false) guiGridListSetItemText(shopgrid, 15, 2, "29000$", false, false) guiGridListSetItemText(shopgrid, 16, 1, "Emperor", false, false) guiGridListSetItemText(shopgrid, 16, 2, "24000$", false, false) guiGridListSetItemText(shopgrid, 17, 1, "Elegy", false, false) guiGridListSetItemText(shopgrid, 17, 2, "25000$", false, false) guiGridListSetItemText(shopgrid, 18, 1, "Elegant", false, false) guiGridListSetItemText(shopgrid, 18, 2, "26000$", false, false) guiGridListSetItemText(shopgrid, 19, 1, "Comet", false, false) guiGridListSetItemText(shopgrid, 19, 2, "29000$", false, false) guiGridListSetItemText(shopgrid, 20, 1, "Cheetah", false, false) guiGridListSetItemText(shopgrid, 20, 2, "35000$", false, false) guiGridListSetItemText(shopgrid, 21, 1, "Caddy", false, false) guiGridListSetItemText(shopgrid, 21, 2, "19000$", false, false) guiGridListSetItemText(shopgrid, 22, 1, "Bullet", false, false) guiGridListSetItemText(shopgrid, 22, 2, "42000$", false, false) guiGridListSetItemText(shopgrid, 23, 1, "Buffalo", false, false) guiGridListSetItemText(shopgrid, 23, 2, "37000$", false, false) guiGridListSetItemText(shopgrid, 24, 1, "Bravura", false, false) guiGridListSetItemText(shopgrid, 24, 2, "27500$", false, false) guiGridListSetItemText(shopgrid, 25, 1, "Blade", false, false) guiGridListSetItemText(shopgrid, 25, 2, "28500$", false, false) guiGridListSetItemText(shopgrid, 26, 1, "Banshee", false, false) guiGridListSetItemText(shopgrid, 26, 2, "45000$", false, false) guiGridListSetItemText(shopgrid, 27, 1, "Bandito", false, false) guiGridListSetItemText(shopgrid, 27, 2, "30000$", false, false) guiGridListSetItemText(shopgrid, 28, 1, "Admiral", false, false) guiGridListSetItemText(shopgrid, 28, 2, "23000$", false, false) GUIEditor.memo[1] = guiCreateMemo(0, 390, 40, 47, "", false, shopgrid) GUIEditor.memo[2] = guiCreateMemo(10, 505, 20, 0, "", false, shopwindows) GUIEditor.memo[3] = guiCreateMemo(10, 417, 277, 88, "Sistema de tienda de autos profesional, \nelige el auto comprarlo y apreta F2\npuedes comprar mas de 2 autos\npuedes cerrarlo, teleportarlo al punto de reparo, etc", false, shopwindows) guiMemoSetReadOnly(GUIEditor.memo[3], true) buy = guiCreateButton(326, 28, 153, 90, "Comprar", false, shopwindows) guiSetFont(buy, "sa-header") GUIEditor.label[1] = guiCreateLabel(313, 444, 187, 51, "Por MultiKiller con Ayuda de \nTigreBlanco\nSaludos de Juramento Server", false, shopwindows) guiSetFont(GUIEditor.label[1], "clear-normal") guiLabelSetColor(GUIEditor.label[1], 17, 255, 0) addEvent ("watchGUI", true) function watchGUI () if (getLocalPlayer() == source) then guiSetVisible (shopgrid, true) showCursor (true) end end addEventHandler ("watchGUI", getRootElement(), watchGUI) function onClientClick (button, state, absoluteX, absoluteYe) if (source == buy) then guiSetVisible (shopwindows, false) showCursor (false) if (guiGridListGetSelectedItem (shopwindows)) then local vehicleName = guiGridListGetItemText (shopgrid, guiGridListGetSelectedItem (shopgrid), 1) local vehicleID = getVehicleModelFromName (vehicleName) local vehicleCost = guiGridListGetItemText (shopgrid, guiGridListGetSelectedItem (shopgrid), 2) triggerServerEvent ("carShopBuy", getLocalPlayer(), vehicleID, vehicleCost, vehicleName) end end end addEventHandler ("onClientGUIClick", getRootElement(), onClientClick) carwindows = guiCreateWindow(398, 193, 463, 396, "Panel de Carro Por MultiKiller", false) guiWindowSetSizable(carwindows, false) cargridlist = guiCreateGridList(10, 28, 139, 358, false, carwindows) carcolumn = guiGridListAddColumn(cargridlist, "Autos", 0.9) carrow = guiGridListAddRow(cargridlist) teletransport = guiCreateButton(166, 28, 130, 97, "Teletransportar", false, carwindows) guiSetFont(teletransport, "default-bold-small") guiSetProperty(teletransport, "NormalTextColour", "C8FFFFFF") sell = guiCreateButton(310, 28, 129, 97, "Vender", false, carwindows) guiSetFont(sell, "default-bold-small") guiSetProperty(sell, "NormalTextColour", "C8FFFFFF") lock = guiCreateButton(168, 265, 130, 110, "Cerrar", false, carwindows) guiSetFont(lock, "default-bold-small") guiSetProperty(lock, "NormalTextColour", "C8FFFFFF") lights = guiCreateButton(310, 265, 129, 110, "Luces ON/OFF", false, carwindows) guiSetFont(lights, "default-bold-small") guiSetProperty(lights, "NormalTextColour", "C8FFFFFF") watch = guiCreateButton(168, 140, 128, 105, "Observar", false, carwindows) guiSetFont(watch, "default-bold-small") guiSetProperty(watch, "NormalTextColour", "C8FFFFFF") mark = guiCreateButton(310, 139, 129, 106, "Marcar", false, carwindows) guiSetFont(watch, "default-bold-small") guiSetProperty(watch, "NormalTextColour", "C8FFFFFF") function resourceStart () bindKey ("F2", "down", carPanel) end addEventHandler ("onClientResourceStart", getResourceRootElement ( getThisResource () ), resourceStart) function carPanel () panel = guiGetVisible (carwindows) if (panel == true) then guiSetVisible (carwindows, false) showCursor (false) end if (panel == false) then guiSetVisible (carwindows, true) showCursor (true) end end addEvent ("carTeletransport", true) addEvent ("carSell", true) function guiClick (button, state, absoluteX, absoluteY) if (source == teletransport) then triggerServerEvent ("carTeletransport", lp) elseif (source == sell) then triggerServerEvent ("carSell", lp) elseif (source == watch) then triggerServerEvent ("lookCar", lp) elseif (source == lock) then triggerServerEvent ("lockCar", lp) elseif (source == lights) then triggerServerEvent ("lightsCar", lp) end end addEventHandler ("onClientGUIClick", getRootElement(), guiClick) addEventHandler( "onClientGUIClick", getRootElement(), function(vehiclename) if (source == mark) then local v = getElementModel (vehiclename) vehicleBlips[v] = createBlipAttachedTo( v, 27, 1 ) end end ) addEventHandler( "onClientGuiClick", getRootElement(), function(vehiclename) if (source == mark) then local vb = getElementModel (vehiclename) destroyElement( vb[source] ) vb[source] = nil end end ) function vehicleGridlist() if ( eventName == "onClientPlayerJoin" ) then guiGridListSetItemText ( cargridlist, guiGridListAddRow ( cargridlist ), carcolumn, getElementModel ( source ), false, false ) elseif ( eventName == "onClientPlayerQuit" ) then for carrow = 0, guiGridListGetRowCount ( cargridlist ) do if ( guiGridListGetItemText ( cargridlist, carrow, carcolumn ) == getElementModel ( source ) ) then guiGridListRemoveRow ( cargridlist, carrow ) end end elseif ( eventName == "onClientGuiClick" ) then triggerServerEvent ("carSell", source) for carrow = 0, guiGridListGetRowCount ( cargridlist ) do if ( guiGridListGetItemText ( cargridlist, carrow, carcolumn ) == getElementModel ( source ) ) then guiGridListRemoveRow ( cargridlist, carrow ) end end addEventHandler ( "onClientPlayerJoin", root, vehicleGridList ) addEventHandler ( "onClientPlayerQuit", root, vehicleGridList ) end end In the debugscript doesnt output messages Be feel to edit now, when i fix it will be compiled
  2. http://www.gtainside.com There are so much skins, try to search bro
  3. Hi, you are cheap, medium, or expensive scripter?
  4. I think you need more prosesor, grafic, and ram
  5. I thinked it is in the gta jaja, but it is in real life, are there any video?
  6. Nice simple script bro OFF: I like the KH and your photo if very nice
  7. LOL, im said this is not my resource! this is the legalsystem from community, but dont work, anyone can test and say the problem plz Read after write
  8. Sorry, the resource dont get errors, when anyone hit me with the nighstick and i have stars, nothing happen, the name is legalsystem, i have fixed the meta: "jail.map" /> The clientside and server side: kingCOP = createElement( "Pgroup", "cops" ) kingCIV = createElement( "Pgroup", "civs" ) kingNONE = createElement( "Pgroup", "none" ) function legalstartup(startedresource) if startedresource == getThisResource() then createTeam ( get( 'legalsystem.Copteam' ) ); WantedWatch = setTimer (wantedlevelmonitor, 1000, 0) local allplayers = getElementsByType ( "player" ) local detectmethod = get("legalsystem.Copmethod") for playerKey,thePlayer in ipairs(allplayers) do if detectmethod == "team" then local copteam = get("legalsystem.Copteam") local thisTeam = getPlayerTeam(thePlayer) if thisTeam ~= false then if thisTeam == getTeamFromName(copteam) then setElementParent ( thePlayer, kingCOP ) else setElementParent ( thePlayer, kingCIV ) end end elseif detectmethod == "skin" then local thisSkin = getPedSkin(thePlayer) setElementData(getRootElement(),"Copskins",get("legalsystem.Copskins")) local copskins = getElementData(getRootElement(),"Copskins") if type(copskins) == "table" and #copskins > 0 then for k,skinID in ipairs(copskins) do copskins[skinID] = true end end local isacop = 0 for ElementKey, ElementValue in ipairs ( copskins ) do if thisSkin == ElementValue then isacop = 1 end end if isacop == 1 then setElementParent ( thePlayer, kingCOP ) else setElementParent ( thePlayer, kingCIV ) end end end end end addEventHandler( "onResourceStart", getRootElement(), legalstartup) function copSpawnCheck() local detectmethod = get("legalsystem.Copmethod") if detectmethod == "team" then local copteam = get("legalsystem.Copteam") local thisTeam = getPlayerTeam(source) if thisTeam ~= false then if thisTeam == getTeamFromName(copteam) then setElementParent ( source, kingCOP ) else setElementParent ( source, kingCIV ) end end elseif detectmethod == "skin" then local thisSkin = getPedSkin(source) setElementData(getRootElement(),"Copskins",get("legalsystem.Copskins")) local copskins = getElementData(getRootElement(),"Copskins") if type(copskins) == "table" and #copskins > 0 then for k,skinID in ipairs(copskins) do copskins[skinID] = true end end local isacop = 0 for ElementKey, ElementValue in ipairs ( copskins ) do if thisSkin == ElementValue then isacop = 1 end end if isacop == 1 then setElementParent ( source, kingCOP ) else setElementParent ( source, kingCIV ) end end end addEventHandler ( "onPlayerSpawn", getRootElement(), copSpawnCheck ) --ARREST PLAYERS BY SMACKING WITH A NIGHTSTICK function rodneykingcheck ( attacker, weapon, bodypart, loss ) if (attacker) and (weapon == 3) then if getElementParent(attacker) == kingCOP then local thecop = attacker local theprisoner = source local wlevel = getPlayerWantedLevel( source ) if (getElementData ( theprisoner, "currentstatus" ) ~= "underarrest") and (wlevel > 0) then if (getElementData ( attacker, "currentarrests" ) ~= "single" ) and (getElementData ( attacker, "currentarrests" ) ~= "double" ) then setElementData ( thecop, "currentarrests", "single" ) triggerClientEvent(thecop,"copdirections",thecop) elseif (getElementData ( attacker, "currentarrests" ) == "single" ) then setElementData ( thecop, "currentarrests", "double" ) end setElementData ( theprisoner, "currentstatus", "underarrest" ) setElementData ( theprisoner, "captor", thecop ) showCursor ( source, true ) toggleAllControls ( source, false, true, false ) walktheprisoner ( thecop, theprisoner ) setElementData ( theprisoner, "arrestTimeout", setTimer ( freetheguy, 180000, 1, theprisoner )) end end end end addEventHandler ( "onPlayerDamage", getRootElement(), rodneykingcheck ) --ARREST PLAYERS BY HOLDING THEM AT GUNPOINT IF THEY HAVE LOW HP function sightscheck ( element ) if isElement(element) then if ( getElementType ( element ) == "player" ) then if ( getControlState ( source, "aim_weapon" ) ) then local currentgun = getPedWeapon ( source ) local wlevel = getPlayerWantedLevel( element ) if (currentgun > 19) and (currentgun < 39) and (wlevel > 0) then if getElementParent(source) == kingCOP then local thecop = source local theprisoner = element local cx, cy, cz = getElementPosition ( source ) local px, py, pz = getElementPosition ( element ) if ( getElementHealth ( element ) < 15 ) and ( getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz ) < 3 ) then if (getElementData ( theprisoner, "currentstatus" ) ~= "underarrest" ) then if (getElementData ( thecop, "currentarrests" ) ~= "single" ) and (getElementData ( thecop, "currentarrests" ) ~= "double" ) then triggerClientEvent(thecop,"copdirections",thecop) setElementData ( thecop, "currentarrests", "single" ) elseif (getElementData ( thecop, "currentarrests" ) == "single" ) then setElementData ( thecop, "currentarrests", "double" ) end setElementData ( theprisoner, "currentstatus", "underarrest" ) setElementData ( theprisoner, "captor", thecop ) showCursor ( theprisoner, true ) toggleAllControls ( theprisoner, false, true, false ) walktheprisoner ( thecop, theprisoner ) setElementData ( theprisoner, "arrestTimeout", setTimer ( freetheguy, 180000, 1, theprisoner )) -- local arresttoolong = setTimer ( freetheguy, 180000, 1, theprisoner ) end end end end end end end end addEventHandler ( "onPlayerTarget", getRootElement(), sightscheck ) --ARREST PLAYERS BY PULLING THEM OUT OF A VEHICLE function yankhimout(player, seat, jacker) if isElement(jacker) then if getElementParent(jacker) == kingCOP then local wlevel = getPlayerWantedLevel( player ) if wlevel > 0 then if (getElementData ( jacker, "currentarrests" ) ~= "single" ) and (getElementData ( jacker, "currentarrests" ) ~= "double" ) then local thecop = jacker local theprisoner = player setElementData ( theprisoner, "currentstatus", "underarrest" ) setElementData ( theprisoner, "captor", thecop ) setElementData ( thecop, "currentarrests", "single" ) triggerClientEvent(thecop,"copdirections",thecop) showCursor ( theprisoner, true ) toggleAllControls ( theprisoner, false, true, false ) walktheprisoner ( thecop, theprisoner ) setElementData ( theprisoner, "arrestTimeout", setTimer ( freetheguy, 180000, 1, theprisoner )) elseif (getElementData ( jacker, "currentarrests" ) == "single" ) then local thecop = jacker local theprisoner = player setElementData ( theprisoner, "currentstatus", "underarrest" ) setElementData ( theprisoner, "captor", thecop ) setElementData ( thecop, "currentarrests", "double" ) showCursor ( theprisoner, true ) toggleAllControls ( theprisoner, false, true, false ) walktheprisoner ( thecop, theprisoner ) setElementData ( theprisoner, "arrestTimeout", setTimer ( freetheguy, 180000, 1, theprisoner )) end end end end end addEventHandler ( "onVehicleExit", getRootElement(), yankhimout ) --FORCES A PRISONER TO FOLLOW THE COP function walktheprisoner(thecop, theprisoner) if (getElementData ( theprisoner, "currentstatus" ) == "underarrest") and (getPedOccupiedVehicle ( theprisoner ) == false ) then local copx, copy, copz = getElementPosition ( thecop ) local prisonerx, prisonery, prisonerz = getElementPosition ( theprisoner ) copangle = ( 360 - math.deg ( math.atan2 ( ( copx - prisonerx ), ( copy - prisonery ) ) ) ) % 360 setPedRotation ( theprisoner, copangle ) setCameraTarget ( theprisoner, theprisoner ) local dist = getDistanceBetweenPoints2D ( copx, copy, prisonerx, prisonery ) if ( dist > 40 ) then local element = "vehicle" local radius = 40 local warp_successful = "Nearest vehicles warped to you." local x, y, z = getElementPosition(player) local colshape = createColSphere(tonumber(x), tonumber(y), tonumber(z), tonumber(radius)) for index, value in ipairs(getElementsWithinColShape(colshape, element)) do setElementPosition(value, tonumber(x) - 2, tonumber(y), tonumber(z)) elseif ( dist > 40 ) then freetheguy ( theprisoner ) end elseif ( dist > 12 ) then setControlState ( theprisoner, "sprint", true ) setControlState ( theprisoner, "walk", false ) setControlState ( theprisoner, "forwards", true ) local zombify = setTimer ( walktheprisoner, 500, 1, thecop, theprisoner ) elseif ( dist > 6 ) then setControlState ( theprisoner, "sprint", false ) setControlState ( theprisoner, "walk", false ) setControlState ( theprisoner, "forwards", true ) local zombify = setTimer ( walktheprisoner, 500, 1, thecop, theprisoner ) elseif ( dist > 1.5 ) then setControlState ( theprisoner, "sprint", false ) setControlState ( theprisoner, "walk", true ) setControlState ( theprisoner, "forwards", true ) local zombify = setTimer ( walktheprisoner, 500, 1, thecop, theprisoner ) elseif ( dist < 1.5 ) then setControlState ( theprisoner, "sprint", false ) setControlState ( theprisoner, "walk", false ) setControlState ( theprisoner, "forwards", false ) local zombify = setTimer ( walktheprisoner, 500, 1, thecop, theprisoner ) end end --FREES A PLAYER (RESETS THEIR CONTROLS AND STATUS) function freetheguy (theprisoner) local thecaptor = (getElementData ( theprisoner, "captor" )) setElementData ( theprisoner, "currentstatus", "none" ) setElementData ( theprisoner, "captor", "none" ) showCursor ( theprisoner, false ) setControlState ( theprisoner, "sprint", false ) setControlState ( theprisoner, "walk", false ) setControlState ( theprisoner, "forwards", false ) toggleAllControls (theprisoner, true) local prisonercheck = setTimer ( checkforprisoners, 1500, 1, thecaptor ) TimoutTimer = (getElementData ( theprisoner, "arrestTimeout" )) if isTimer(TimoutTimer) then killTimer(TimoutTimer) setElementData ( theprisoner, "arrestTimeout", nil) TimeoutTimer = nil end end function checkforprisoners(thecop) if isElement(thecop) then local prisoners = 0 local players = getElementsByType ( "player" ) for theKey,thePlayer in ipairs(players) do if (getElementData ( thePlayer, "captor" ) == thecop ) then prisoners = prisoners+1 end
  9. Todavía no se sabe una lista entera de los juegos que saldrán para PS4. Pero si quieres compararlo con los que ya se anunciaron, el mejor será Watch Dogs. No es ese juego el cual anunciaron hace poco? el que ya se puede descargar para pc, algo creado por rockstar creo, este es: Admito que esta muy bueno
  10. El 'for-loop' se usa para ejecutar un código a todos los valores/elementos dentro de una tabla. En esta parte: local blip = getElementsByType("blip") local r,g,b,a = getBlipColor(blip) setBlipColor(blip,r,g,b,0) 'blip' es una tabla, pero getBlipColor y setBlipColor necesitan un elemento 'blip', no una tabla. Es lo mismo que puse jajaja, mira bn el code, la linea que pusistes sale la misma Editado: puede que haya entendido, hay que quitar la tabla de local, asi como lo edite?
  11. Parece que todavia no os habeis enterado de nada, puede que los personas de primaria seais vosotros, y no hay pastillas para curar eso, y si se escribir mas que vosotros, que seguramente estareis sentados en el ordenador con gafas de 3 metros y con 13 años de edad, si fuerais mayores, no estarias insultando como unos mal educados que sois, es = cualquier opinion negativa que se os de la vais y insultais, la verdad, si veis por la calle a un hombre que os dice hola, vosotros le deciis, che calla hijo de ****, lavaos la boca con jabon y aprended vocabulario si supuestamente sois mayores de edad, gente asi sobra en el mundo, es verdad que castillo tiene 18, y tiene educacion, no va insultando asi por la vida, como vosotros, destacando a brad vickers, que es el rey de las gilipolleses, ocultandose tras una pantalla y en realidad sera un mocoso (sin ofender) que se pasa la vida jodiendo, nose vosotros, pero castillo deberia cerrar el tema Respondiendo a Alexs_Steel: A ti no te importara pero a muchos si, si no te interesa el tema, no lo mires
  12. Creo que si no sabes de data base no podes arreglar un code de data base PD: El problema no es el code sino que nose como hacer para cargar 4 posiciones Code: function getClanSpawn( ClanName ) if ( not connection2 ) then return end local query = dbQuery( connection2, "SELECT * FROM Spawns WHERE ClanName=?", tostring ( ClanName ), tostring(spawnX), tostring(spawnY), tostring(spawnZ) ) -- esto nose si esta bien local result, numrows, errmsg = dbPoll ( query, -1 ) if ( type( result ) == "table" and #result == 0 or not result ) then return false else return true end end Ok intentare aprender cuando pueda el database, lo que quieres es tener 3 spawnx spawny y spawnz no?
  13. No necesito putas wn, para eso tengo novia no como tu parasito sin vida social
  14. +1 Otro +1 PD: En mi opinion el Gta 5 sera el mejor juego de ps4 en todo caso
  15. Lucario

    Un Regalo :D

    LOL y el bocadillo que pinta ai xdd, lo pondre de wallpaper jajaja
  16. Simple but nice, not tested for now
  17. Mensaje a Brad_Vickers el creador del semejante problema:
  18. function CreateCoche (hitElement) local skin = getPlayerSkin ( hitElement ) if skin == 100 then local x, y, z = getElementPosition ( hitElement ) Bici = createVehicle ( 510, x +2, y, z +2) setVehicleColor( Bici, 127, 0, 0 ) end end addCommandHandler ( "bici", CreateCoche )
  19. A eso aun no llegue yo , si posteas el codigo yo lo puedo arreglar
×
×
  • Create New...