Jump to content

sthprk

Members
  • Posts

    11
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

sthprk's Achievements

Square

Square (6/54)

0

Reputation

  1. estoy siguiendo unos tutoriales en videos de python y no me va tan bien no me salen la mayoria de los ejercicios soy un asco xd , me entero en teoria nadamas , por eso lo de 'no me va tan bien' ,aparte que me aburro , despues por otro lado edito algunos script Lua del mta , o puedo hacer uno pequeño como , crear un marker, al entrar al marker hace un sonido, abre una ventana, y hace una animacion , crea un objeto en la mano, al salir del marker tal cosa y asi... no se si gano mas viendo los tutoriales o creando editando scripts ? porque tambien me lleva tiempo ponerme a hacer scripts xd
  2. no me funciono, me daba error en el argumento player , le cambie por thePlayer y despues no me aparecian los objetos en la mano a menos que pusiera la linea esta : if getElementData(player, "hojillas") and getElementData(player, "bolsitaweed") then de esta forma por ejemplo: if weed[thePlayer] == nil and not getElementData(thePlayer, "bolsitaweed") and not getElementData(thePlayer, "hojillas1") then osea si le saco el not a uno de esos ya no aparece ningun objeto .-.
  3. Exacto amigo eso mismo quiero por las dudas te digo que ya tengo una funcion para comprar las hojillas y luego llamar a la función de ponerle las hojillas en la mano y es esta: local animTimers = {} -- Tabla , almacena datos function buyHojillas () -- Pie para dar comienzo a la función. local money = getPlayerMoney( source ) -- Devuelve la cantidad de dinero que un jugador tiene actualmente. if money >= 45 then -- si el dinero es mayor o igual a $45 entonces... setPedAnimation( source,"DEALER", "shop_pay", -1, false, true, true, false) -- Hace una animacion. takePlayerMoney(source, 45) -- Y quita $45 del Player animTimers[source] = setTimer(starthojillas1,4500,1,source) -- llama a la función: starthojillas1 , luego de 4.5 segundos.
  4. nop, sigue sin andar ya intenté todo ,pegaria la biblia de comentadas de codigo que tengo pero :s , y el ejemplo de la wiki no hizo mas que confundirme lo cambié asi pero no anda tampoco xd function starthojillas1 ( thePlayer ) setElementData ( thePlayer, "hojillas1", getElementData ( thePlayer, "hojillas1" ) ) --if hojillas1[thePlayer] == nil and not getElementData ( thePlayer, "bolsitaweed" ) and not isTimer(cooldowns[thePlayer]) then -- Activar las funciones con una tecla usando bindkey --bindKey( thePlayer, "F","down", "fumarmariguanadmps" ) --bindKey( thePlayer, "num_sub","down", "stophojillas1" ) --cooldowns[thePlayer] = setTimer( function() end, 3000, 1 ) if (getElementData(thePlayer,"hojillas1") == true and getElementData(thePlayer,"bolsitaweed") then--------------------------------------------------------- getElementData(thePlayer, "bolsitaweed", true) bindKey (thePlayer, "F","down", "fumarmariguanadmps") print("con weed ") else if getElementData(thePlayer,"hojillas1") == true and not getElementData(thePlayer,"bolsitaweed") then----------------------------------------------------- getElementData(thePlayer, "bolsitaweed", false) unbindKey (thePlayer, "F","down", "fumarmariguanadmps") print("sin weed ") end end
  5. eso es el mismo codigo xd no le habia puesto el -- de comentar le puse el getElementData no se si tengan algo que ver los binds , porque activa el cigaro desde las hojillas desde los binds ... asi tengo en esta funcion: local bolsitaweed = { } -- tablas local cooldowns = { } local syncTimer = { } function startbolsitaweed ( thePlayer ) getElementData ( thePlayer, "bolsitaweed" ) -- setElementData borar if isPedInVehicle(thePlayer) then return end -- cancela la funcion si está en un vehiculo. if bolsitaweed[thePlayer] == nil and not getElementData(thePlayer, "bolsitaweed") and not isTimer(cooldowns[thePlayer]) then --bindKey( thePlayer, "F","down", "startbolsitaweed" ) bindKey( thePlayer, "H","down", "startbolsitaweed" ) -- Anim in --setPedAnimation( thePlayer, "GANGS", "drnkbr_prtl", 0, false, true, false, true ) --setTimer( function() -- setElementHealth ( thePlayer, getElementHealth(thePlayer) +4 )--- --end, 2000, 1) cooldowns[thePlayer] = setTimer( function() end, 3000, 1 ) Despues la otra de la hojillas: function starthojillas1 ( thePlayer ) if isPedInVehicle(thePlayer) then return end -- Bink keys to control bindKey( thePlayer, "F","down", "fumarmariguanadmps" ) cooldowns[thePlayer] = setTimer( function() end, 3000, 1 )
  6. Sip , tiene setelementdata solo no se como agregarle aca local bolsitaweed = { } local cooldowns = { } local syncTimer = { } function startbolsitaweed ( thePlayer ) if isPedInVehicle(thePlayer) then return end setElementData ( thePlayer, "bolsitaweed", not getElementData ( thePlayer, "bolsitaweed" ) ) -- setElementData data.s ( thePlayer, "bolsitaweed", not data.g ( thePlayer, "bolsitaweed" ) ) if bolsitaweed[thePlayer] == nil and not isTimer(cooldowns[thePlayer]) then --bindKey( thePlayer, "num_sub","down", "stopbolsitaweed" ) cooldowns[thePlayer] = setTimer( function() end, 3000, 1 ) -- Create weed local bolsetaweed = createObject(2663, 0,0,0) setObjectScale ( bolsetaweed, 0.2) bolsitaweed[thePlayer] = bolsetaweed --exports.bone_attach:attachElementToBone(bear,thePlayer,12, 0.26, 0.01, 0.16, 255, -9000, 90) exports.bone_attach:attachElementToBone(bolsetaweed,thePlayer,12, -0.04, 0.03, 0.1, 0, 180, 90) end end addCommandHandler("bolsitaweed", startbolsitaweed ) ----------------------------------fumar weed function smokeWeedDrag( thePlayer ) setElementData ( thePlayer, "bolsitaweed", not getElementData ( thePlayer, "bolsitaweed" ) ) getElementData( thePlayer, "bolsitaweed" ) data.spa( thePlayer, "GANGS", "smkcig_prtl", 0, false, true, false, true ) if getElementData(thePlayer, "bolsitaweed") then end addCommandHandler( "smokeweed_drag", smokeWeedDrag ) --------------------------------------------- function stophojillas1( thePlayer ) -- Unbind control keys unbindKey( thePlayer, "F","down", "fumarmariguanadmps" )-- if isElement(hojillas1[thePlayer]) then --setPedAnimation( thePlayer, "BASEBALL", "Bat_M", -1, false, true, true, false ) end setTimer( function() data.spa ( thePlayer ) if isElement(hojillas1[thePlayer]) then -- Free memory destroyElement (hojillas1[thePlayer]) hojillas1[thePlayer]=nil end end, 450, 1) end addCommandHandler( "stophojillas1", stophojillas1 )
  7. Buenas gente , tengo una función con bindkey de crear un objeto bolsita de weed , otra funcion de crear objeto hojillas , y otra funcion de crear objeto cigarro le puse un bindkey al objeto hojilla para llamar y crear el objeto cigarro , Asi que si tengo las hojillas puedo crear el cigarro , sin tener que necesitar el objeto weed pero quiero que tengas que tener la weed y las hojillas para que te deje crear el cigarro sinó ni gracia pero no me sale una ayudita? acá mi intento xdd local hojillas1 = { } local cooldowns = { } local syncTimer = { } function starthojillas1 ( thePlayer ) setElementData ( thePlayer, "hojillas1", not getElementData ( thePlayer, "hojillas1" ) ) if hojillas1[thePlayer] == nil and not isTimer(cooldowns[thePlayer]) then setElementData ( thePlayer, "bolsitaweed", not getElementData ( thePlayer, "bolsitaweed" ) ) if isElement( starthojillas1 ) and getElementType( startbolsitaweed ) == "player" then unbindKey( thePlayer, "F","down", "fumarmariguanadmps" ) end
  8. Buenas gente, el asunto es el siguiente Tengo unos objetos bindeados uno es el de una bolsita de mariguana , el otro es de hojillas y el otro es el porro prendido xd cuando compro las hojillas puse un bindkey en las hojillas que activa la funcion de fumar presionando F , pero puedo fumar sin haber comprado la bolsita, como hago para que necesite tener los dos objetos : la bolsita y las hojillas para activar el porro prendido?
  9. Son objetos con createObject y con bone attach comidas cigarros y eso ,que apretas una tecla y crea el objeto, por ejemplo una lata de sprunk, despues toma la sprunk con clic derecho... pero yo queria que pudiera tomar hasta cierto punto, por ejemplo tomar solo 3 veces y que la bebida se termine y dejar la lata en el piso o eliminarla... para los cigarros esta bien porque se van consumiendo pero no se como hacer con las latas comidas y eso..
  10. Buenas gente queria ponerle duración a los objetos por ejemplo a las comidas y eso, que se use hasta un punto y despues se elimine que funciones deberia usar ?
×
×
  • Create New...