Jump to content

gghvcffcv

Members
  • Posts

    139
  • Joined

  • Last visited

Everything posted by gghvcffcv

  1. gghvcffcv

    BUG

    local Marker = createMarker ( 2048.68848, 1474.93945, 9.67188, "cylinder", 10.0, 155, 0, 0, 150, getRootElement( ) ) function elLoco() setPlayerWantedLevel ( source, 3 ) end addEventHandler ("onMarkerHit", Marker, elLoco) what's wrong
  2. function inCar(source) if isPedInVehicle (source) then outputChatBox("Mesage!!!") end end addEventHandler("onVehicleEnter" , getRootElement() , inCar) Try this!
  3. if my answer didn't work try this. /debugscript 3
  4. --Rob by DuFraN function Iniciar_Script() Marker_Entrada_Robo_Hamburgueseria = createMarker (811.28,-1616.14,12.54,"cylinder",2,255,255,0,50) Marker_Salida_Robo_Hamburgueseria = createMarker (459.91,-88.6,998.5,"cylinder",2,255,255,0,50) Blip_Robo_Hamburgueseria = createBlipAttachedTo (Marker_Entrada_Robo_Hamburgueseria,32,2,255,0,0,0,0,200,root) Circulo_De_Escape = createColCircle (815,-1616.37,100) setElementInterior(Marker_Salida_Robo_Hamburgueseria,4) Robo_Hamburgueseria = createElement ("Robo_Hamburgueseria") setElementData(Robo_Hamburgueseria,"Robo_Hamburgueseria","Si") setElementData(Robo_Hamburgueseria,"Robo_Hamburgueseria_Criminales_Totales",0) addEventHandler("onMarkerHit",Marker_Entrada_Robo_Hamburgueseria, Iniciar_Script() addEventHandler("onMarkerHit",Marker_Salida_Robo_Hamburgueseria, Iniciar_Script() Marker_Iniciar_Robo = createMarker (448,-87,998,"cylinder",5,255,0,0,50) setElementInterior(Marker_Iniciar_Robo,4) end addEventHandler("onMarkerHit",getResourceRootElement(getThisResource()),Iniciar_Script) function Marker(Jugador) local Team = getPlayerTeam(Jugador) local Team_Nombre = getTeamName(Team) if getElementData(Robo_Hamburgueseria,"Robo_Hamburgueseria") == "Si" and (getElementData(Robo_Hamburgueseria,"Robo_Hamburgueseria_Criminales_Totales") <= 4) and Team_Nombre == "Criminales" then setElementData(Robo_Hamburgueseria,"Robo_Hamburgueseria_Criminales_Totales",getElementData(Robo_Hamburgueseria,"Robo_Hamburgueseria_Criminales_Totales")+1) setElementInterior(Jugador,4) setElementData(Jugador,"Robo_Hamburgueseria","Si") setElementPosition(Jugador,457.18,-88.40,999.5) outputChatBox("Has entrado al lugar del robo, para robar usa #FFFFFF/robarhamburgueseria",Jugador,200,0,0,true) end end function Marker_Salida(Jugador) setElementData(Jugador,"Robo_Hamburgueseria","No") setElementInterior(Jugador,0) setElementPosition(Jugador,814.7,-1616.7,13.6) setElementData(Robo_Hamburgueseria,"Robo_Hamburgueseria_Criminales_Totales",getElementData(Robo_Hamburgueseria,"Robo_Hamburgueseria_Criminales_Totales")-1) end function comprobar() local Criminales = getElementsByType ( "player" ) for theKey,thePlayer in ipairs(Criminales) do local Team = getPlayerTeam(thePlayer) local Team_Nombre = getTeamName(Team) if isElementWithinMarker (thePlayer,Marker_Iniciar_Robo) and getElementData(Robo_Hamburgueseria,"Robo_Hamburgueseria") == "Si" and (getElementData(Robo_Hamburgueseria,"Robo_Hamburgueseria_Criminales_Totales") >= 2) and Team_Nombre == "Criminales" then outputChatBox("Estas robando esta hamburgueseria, cuando robes sal corriendo lo mas rapido posible!",thePlayer,255,255,255,true) setElementData(Robo_Hamburgueseria,"Robo_Hamburgueseria","No") setElementInterior(Marker_Salida_Robo_Hamburgueseria,0) setTimer(setElementInterior,120000,1,Marker_Salida_Robo_Hamburgueseria,4) setTimer(setPlayerWantedLevel,120000,1,thePlayer,getPlayerWantedLevel(thePlayer)+3) setTimer(outputChatBox,120000,1,"Has robado el dinero al empleado, sal corriendo!",thePlayer,200,0,0,true) setTimer(setElementData,120000,1,thePlayer,"Robo_Hamburgueseria_Escape","Si") setTimer(setElementData,900000,1,Robo_Hamburgueseria,"Robo_Hamburgueseria","Si") setTimer(outputChatBox,900000,1,"Una hamburgueseria en santa maria beach se puede robar!",thePlayer,255,0,0,true) local Policias = getElementsByType ("player") for theKey,thePlayer in ipairs(Policias) do local Team_del_Policia = getPlayerTeam(thePlayer) local Nombre_Del_Team_Del_Policia = getTeamName (Team_del_Policia) if (Nombre_Del_Team_Del_Policia == "Policias") then outputChatBox("[Radio] #FFFFFFSe ha reportado un robo en una hamburgueseria cerca de Santa Maria Beach",thePlayer,0,99,255,true) end end else outputChatBox("No",thePlayer) end end end addCommandHandler("robarhamburgueseria",comprobar) function Robo_Escape(leaveElement) local Jugador_Escapado = getElementData(leaveElement,"Robo_Hamburgueseria_Escape") if source == Circulo_De_Escape then if Jugador_Escapado == "Si" then givePlayerMoney(leaveElement,10000) setElementData(leaveElement,"Robo_Hamburgueseria_Escape","No") outputChatBox("Has ganado #007000$10000 #ffffffpor el robo de la hamburgueseria.",leaveElement,255,255,255,true) end end end addEventHandler ("onColShapeLeave",root,Robo_Escape) function Cuando_Un_Ladron_Salga() if getElementData(source,"Robo_Hamburgueseria") == "Si" then setElementData(Robo_Hamburgueseria,"Robo_Hamburgueseria_Criminales_Totales",getElementData(Robo_Hamburgueseria,"Robo_Hamburgueseria_Criminales_Totales")-1) end end addEventHandler("onPlayerQuit",root,Cuando_Un_Ladron_Salga)
  5. Mate i don't understand you ! if you need Ids are these. 1212: Money (Wad of Cash) 1240: Health (heart) 1242: Armour 1239: Info icon 1272: House (blue) 1273: House (green) 1274: Money (dollar symbol) 1241: Adrenaline 1247: Bribe 1248: GTA III sign 1252: Bomb from GTA III 1253: Photo op 1254: Skull 1274: Money icon 1275: Blue t-shirt 1277: Save disk 1313: 2 Skulls 1276: Tiki statue 1310: Parachute (with leg straps) 1318: Down arrow 1279: Drug bundle
  6. https://wiki.multitheftauto.com/wiki/Cl ... #Gridlists There you can see how to create it, And about you english mine is shit too so no problem
  7. Mate what's _setPlayerTeam?... Where's the name of the function? where is the Eventhandler or CommandHabler? ofc it will not work due to these errors. Too You should create a team, because you are using team as variable and it's not you should use the team that you create as variable, good luck!
  8. triggerClientEvent("onClientCraft", root,tonumber(newirons))) why 3 ))), test putting Same name to the functions in the trigger addEventHandler("onClientCraft", getRootElement(),getirons)
  9. The problem is that i have some resources that work with it and these doesn't works.
  10. Someone help me with it?
  11. Why these Errors?: http://prntscr.com/38kckr
  12. i think MTA doesn't allows you to get Colt45 and Deagle at the Same time.
  13. it says Error: exports: call ro non-running server resource (acl) [string"?"] why this?
  14. it doesn't gives none error in console But neither gives money.
  15. How could i use element data
  16. Hey guys Could you help with this? How to do that when some cop hits a criminal with silenced arrest the criminal without go to the Colshape. kingCOP = createElement( "Pgroup", "cops" ) kingCIV = createElement( "Pgroup", "civs" ) kingNONE = createElement( "Pgroup", "none" ) function legalstartup(startedresource) if startedresource == getThisResource() then 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 == 23)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 = getPlayerWeapon ( 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 > 24 ) then freetheguy ( theprisoner ) --FREES PRISONER IF HE GETS FAR AWAY elseif ( dist > 24 ) 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 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 end if prisoners == 0 then setElementData ( thecop, "currentarrests", "none" ) triggerClientEvent( thecop,"clearcopdirections",thecop) elseif prisoners == 1 then setElementData ( thecop, "currentarrests", "single" ) elseif prisoners == 2 then setElementData ( thecop, "currentarrests", "double" ) end
  17. addCommandHandler ("startscript", Start) ---- Sorry i left A little space between "startscript " and Add to the function (player, commandName)
  18. gghvcffcv

    Playtime

    function loadPlayTime(account) local minutes = getAccountData(account, "playTime") if (tonumber(minutes)) then minutes = tonumber(minutes) local hours = math.floor(minutes / 60) if (hours > 0) then setElementData(source, "playTime", hours.." Hours") else setElementData(source, "playTime", minutes.." Minutes") end else setAccountData(account, "playTime", 0) setElementData(source, "playTime", "0 Minutes") end playTimeTimer[source] = setTimer(incrementPlayTime, 60000, 0, source) end addEventHandler("onPlayerLogin", root, loadPlayTime) Are you sure that are 3 end?
  19. Mate, Do you have a meta.xml? other thing you need script.lua and put them in the meta.xml other thing you can add a (addCommandHandler Like this [code=text] GUIEditor = { button = {}, window = {}, label = {}, combobox = {} } function Start() GUIEditor.window[1] = guiCreateWindow(437, 135, 173, 127, "You're Cars", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.label[1] = guiCreateLabel(8, 28, 109, 19, "Select You're Car", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[1], "clear-normal") GUIEditor.combobox[1] = guiCreateComboBox(9, 57, 154, 21, "", false, GUIEditor.window[1]) guiComboBoxAddItem(GUIEditor.combobox[1], "Balista Compact") guiComboBoxAddItem(GUIEditor.combobox[1], "Club") GUIEditor.button[1] = guiCreateButton(18, 88, 135, 26, "Let's Go", false, GUIEditor.window[1]) end addCommandHandler ("startscript ", Start) --- It means when you do in the server /startscript it starts. --- And for that use: warpPedIntoVehicle ( ped thePed, vehicle theVehicle, [ int seat=0 ] )
×
×
  • Create New...