Jump to content

Pedro Silveira

Members
  • Posts

    15
  • Joined

  • Last visited

Recent Profile Visitors

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

Pedro Silveira's Achievements

Square

Square (6/54)

0

Reputation

  1. Hello, im trying to make this: function verificar12 ( l_5_0 ) anim1, anim2 = getPedAnimation( l_5_0 ) if ( getElementInterior( l_5_0 ) == 1 ) then if ( anim1 == "shop" and anim2 == "shp_serve_loop" ) then givePlayerMoney ( l_5_0, 10000 ) else outputChatBox("Você parou de roubar o caixa e não pegou nenhum dinheiro!", l_5_0, 255, 0, 0) end else outputChatBox("Você saiu da loja e o dinheiro foi devolvido!", l_5_0, 255, 0, 0) end end I call the function in this part: setTimer(verificar12, 90000, 1, l_5_0) But is returning this message: "ERROR: [SCRIPT]RoubarLojas\server.lua:27: attempt to call global 'getPedAnimation' <a nil value>" WHY?
  2. 1) It was for him to show the output message only if the player was on top of the marker. But when entering the dimension of the script it shows the message as if the player was in the marker. I have another function equal to this in the script and it does not give this problem. It is written in the same way only as changing the function name obviously. 2) Another question I have is how to set the player drunk. Do you know how to do this? Thanks.
  3. Hello, i made this code: local marker2 = createMarker(1215.326953125, 6.1982421875, 999.921875, "cylinder", 1.2, 255, 10, 10, 0) setElementInterior(marker2, 2) setElementDimension(marker2, 10) mensagem2 = function(thePlayer) if isElementWithinMarker(thePlayer, marker2) then outputChatBox("#C71585Você deseja um boquete por #FF69B4R$ 100,00#C71585, meu bem? Digite #FF69B4/boquete!", l_5_0, 255, 255, 255, true) end end addEventHandler("onMarkerHit", getRootElement(), mensagem2) But always i restart the script and they show the message if i inside the interior 2 and dimension 10. NOTE: I have another function like this and she don't show the message. Anyone can help me? Thanks!
  4. Hello, i set a animation for a ped but i need this ped stopped during the animation! How i can do it? Here the code: setPedAnimation(ped2, "shop", "SHP_Rob_Givecash") giveWeapon(l_5_0, 22) setPedRotation(l_5_0, 90) setPedWeaponSlot(l_5_0, 2) setPedAnimation(l_5_0, "shop", "rob_loop") setTimer(setPedAnimation, 4000, 1, l_5_0, false) setTimer(setPedAnimation, 90000, 1, ped2, "shop", "SHP_Rob_Handsup") setTimer(setPedAnimation, 300000, 1, ped2, false) setElementPosition(robmarker2, 3099.97, -3281.69, -0.5) Thanks everybody!
  5. Im trying to compare a element position with this code: function verificar2 () x, y, z = getElementPosition( robmarker1 ) if x == 3099.97 and y == -3281.69 and z == -0.5 then outputChatBox("Esta loja ainda está recuperando-se de um assalto!", l_5_0, 0, 255, 0) else outputChatBox("Digite /roubar para furtar a loja!", l_5_0, 0, 255, 255) end end But she only do the else. The marker is in the correct position and the script do the else. Why?
  6. Sorry but i don't understand what you said Bonus. As i said before, i new in mta scripts. That script i catched from the internet. But is a bad script and i trying to upgrade her, so i don't care for the variables. I really don't know how to do this. You can make for me please? That script is made for players can robb the shops i selected in the map, so the position can be checked this way because i testing the position of a marker and don't a position of a player, and this marker only stay in two positions: 1 - On the position for player can robb the shop. 2 - A position when the player robbed the shop. So i guess its not necessary use the getDistanceBetweenPoints3D. Thank you.
  7. Hello, i'm new in MTA Scripts and i trying to make something like this: function verificar2 () if ( getElementPosition( robmarker1 ) == 3099.97, -3281.69, -0.5 ) then outputChatBox("Esta loja ainda está recuperando-se de um assalto!", l_5_0, 0, 255, 0) else outputChatBox("Digite /roubar para furtar a loja!", l_5_0, 0, 255, 255) end end But this don't work. I use the "verificar2" in this part of code: setTimer(verificar2, 2000, 1, l_7_0) And here the full code for more informations: -------------------- Loja AmmuNation de São Paulo -------------------- local Exitdoorrob1 = createMarker(285.84375, -86.7724609375, 1002.2, "arrow", 1.5, 255, 255, 0, 255) setElementInterior(Exitdoorrob1, 4) setElementDimension(Exitdoorrob1, 1) local Doorentryrob1 = createMarker(1368.890625, -1279.787109375, 14.546875, "arrow", 1.5, 255, 255, 0, 255) createBlipAttachedTo(Doorentryrob1, 17, 2, 0, 255, 0, 0, 0, 7000) local robmarker1 = createMarker(295.5595703125, -80.40859375, 1000.515625, "cylinder", 1.2, 255, 10, 10, 255) setElementInterior(robmarker1, 4) setElementDimension(robmarker1, 1) function verificar ( thePlayer ) if ( getElementInterior( thePlayer ) == 4 ) then givePlayerMoney( thePlayer, 10000 ) else outputChatBox("Você saiu da loja e o dinheiro foi devolvido!", l_5_0, 255, 0, 0) end end function verificar2 () if ( getElementPosition( robmarker1 ) == 3099.97, -3281.69, -0.5 ) then outputChatBox("Esta loja ainda está recuperando-se de um assalto!", l_5_0, 0, 255, 0) else outputChatBox("Digite /roubar para furtar a loja!", l_5_0, 0, 255, 255) end end duty1 = function(l_5_0, l_5_1) if isElementWithinMarker(l_5_0, robmarker1) then setPlayerWantedLevel(l_5_0, 6) triggerClientEvent(root, "playTheSound1", root, l_5_0) outputChatBox("O caixa está colocando o dinheiro na sacola! Aguarde até ele terminar!", l_5_0, 0, 255, 0) outputChatBox("#DF0101[Alarme]: #FF8C00O Meliante " .. getPlayerName(l_5_0) .. " #FF8C00está assaltando a #DF0101Ammu Nation!", root, 255, 255, 255, true) setElementPosition(robmarker1, 3099.97, -3281.69, -0.5) setMarkerSize(Exitdoorrob1, 0) local blip2 = createBlipAttachedTo(Doorentryrob1, 20, 2, 0, 255, 0, 0, 0, 7000) setTimer(triggerClientEvent, 21000, 1, root, "playTheSound1", root, l_5_0) setTimer(triggerClientEvent, 42000, 1, root, "playTheSound1", root, l_5_0) setTimer(triggerClientEvent, 63000, 1, root, "playTheSound1", root, l_5_0) setTimer(setElementPosition, 300000, 1, robmarker1, 295.5595703125, -80.40859375, 1000.515625) setTimer(setMarkerSize, 90000, 1, Exitdoorrob1, 1.5) setTimer(verificar, 90000, 1, l_5_0) setTimer(destroyElement, 300000, 1, blip2) else outputChatBox("", source, 255, 0, 0) end end addCommandHandler("roubar", duty1) Exitdrob1 = function(l_6_0) if source == Exitdoorrob1 and getElementType(l_6_0) == "player" then fadeCamera(l_6_0, false, 1, 0, 0, 0) setTimer(fadeCamera, 1000, 1, l_6_0, true, 1) setTimer(setElementRotation, 1000, 1, l_6_0, 0, 0, 90) setTimer(setElementInterior, 1000, 1, l_6_0, 0, 1366.744140625, -1279.75, 13.546875) setTimer(setElementDimension, 1000, 1, l_6_0, 0) end end addEventHandler("onMarkerHit", getRootElement(), Exitdrob1) Doorerob1 = function(l_7_0) if source == Doorentryrob1 and getElementType(l_7_0) == "player" then fadeCamera(l_7_0, false, 1, 0, 0, 0) setTimer(setElementRotation, 1000, 1, l_7_0, 0, 0, 90) setTimer(fadeCamera, 1000, 1, l_7_0, true, 1) setTimer(setElementInterior, 1000, 1, l_7_0, 4, 285.689453125, -84.826171875, 1001.515625) setTimer(setElementDimension, 1000, 1, l_7_0, 1) setTimer(verificar2, 2000, 1, l_7_0) end end addEventHandler("onMarkerHit", getRootElement(), Doorerob1) Please help me! Thanks for everybody!
  8. Hello, i'm new in MTA Scripts and i trying to make something like this: function verificar2 () if ( getElementPosition( robmarker1 ) == 3099.97, -3281.69, -0.5 ) then outputChatBox("Esta loja ainda está recuperando-se de um assalto!", l_5_0, 0, 255, 0) else outputChatBox("Digite /roubar para furtar a loja!", l_5_0, 0, 255, 255) end end But this don't work. I use the "verificar2" in this part of code: setTimer(verificar2, 2000, 1, l_7_0) And here the full code for more informations: -------------------- Loja AmmuNation de São Paulo -------------------- local Exitdoorrob1 = createMarker(285.84375, -86.7724609375, 1002.2, "arrow", 1.5, 255, 255, 0, 255) setElementInterior(Exitdoorrob1, 4) setElementDimension(Exitdoorrob1, 1) local Doorentryrob1 = createMarker(1368.890625, -1279.787109375, 14.546875, "arrow", 1.5, 255, 255, 0, 255) createBlipAttachedTo(Doorentryrob1, 17, 2, 0, 255, 0, 0, 0, 7000) local robmarker1 = createMarker(295.5595703125, -80.40859375, 1000.515625, "cylinder", 1.2, 255, 10, 10, 255) setElementInterior(robmarker1, 4) setElementDimension(robmarker1, 1) function verificar ( thePlayer ) if ( getElementInterior( thePlayer ) == 4 ) then givePlayerMoney( thePlayer, 10000 ) else outputChatBox("Você saiu da loja e o dinheiro foi devolvido!", l_5_0, 255, 0, 0) end end function verificar2 () if ( getElementPosition( robmarker1 ) == 3099.97, -3281.69, -0.5 ) then outputChatBox("Esta loja ainda está recuperando-se de um assalto!", l_5_0, 0, 255, 0) else outputChatBox("Digite /roubar para furtar a loja!", l_5_0, 0, 255, 255) end end duty1 = function(l_5_0, l_5_1) if isElementWithinMarker(l_5_0, robmarker1) then setPlayerWantedLevel(l_5_0, 6) triggerClientEvent(root, "playTheSound1", root, l_5_0) outputChatBox("O caixa está colocando o dinheiro na sacola! Aguarde até ele terminar!", l_5_0, 0, 255, 0) outputChatBox("#DF0101[Alarme]: #FF8C00O Meliante " .. getPlayerName(l_5_0) .. " #FF8C00está assaltando a #DF0101Ammu Nation!", root, 255, 255, 255, true) setElementPosition(robmarker1, 3099.97, -3281.69, -0.5) setMarkerSize(Exitdoorrob1, 0) local blip2 = createBlipAttachedTo(Doorentryrob1, 20, 2, 0, 255, 0, 0, 0, 7000) setTimer(triggerClientEvent, 21000, 1, root, "playTheSound1", root, l_5_0) setTimer(triggerClientEvent, 42000, 1, root, "playTheSound1", root, l_5_0) setTimer(triggerClientEvent, 63000, 1, root, "playTheSound1", root, l_5_0) setTimer(setElementPosition, 300000, 1, robmarker1, 295.5595703125, -80.40859375, 1000.515625) setTimer(setMarkerSize, 90000, 1, Exitdoorrob1, 1.5) setTimer(verificar, 90000, 1, l_5_0) setTimer(destroyElement, 300000, 1, blip2) else outputChatBox("", source, 255, 0, 0) end end addCommandHandler("roubar", duty1) Exitdrob1 = function(l_6_0) if source == Exitdoorrob1 and getElementType(l_6_0) == "player" then fadeCamera(l_6_0, false, 1, 0, 0, 0) setTimer(fadeCamera, 1000, 1, l_6_0, true, 1) setTimer(setElementRotation, 1000, 1, l_6_0, 0, 0, 90) setTimer(setElementInterior, 1000, 1, l_6_0, 0, 1366.744140625, -1279.75, 13.546875) setTimer(setElementDimension, 1000, 1, l_6_0, 0) end end addEventHandler("onMarkerHit", getRootElement(), Exitdrob1) Doorerob1 = function(l_7_0) if source == Doorentryrob1 and getElementType(l_7_0) == "player" then fadeCamera(l_7_0, false, 1, 0, 0, 0) setTimer(setElementRotation, 1000, 1, l_7_0, 0, 0, 90) setTimer(fadeCamera, 1000, 1, l_7_0, true, 1) setTimer(setElementInterior, 1000, 1, l_7_0, 4, 285.689453125, -84.826171875, 1001.515625) setTimer(setElementDimension, 1000, 1, l_7_0, 1) setTimer(verificar2, 2000, 1, l_7_0) end end addEventHandler("onMarkerHit", getRootElement(), Doorerob1) Please help me! Thanks for everybody!
  9. Still don't working. Here the full code: -------------------- Loja AmmuNation de São Paulo -------------------- local Exitdoorrob1 = createMarker(285.84375, -86.7724609375, 1002.2, "arrow", 1.5, 255, 255, 0, 255) setElementInterior(Exitdoorrob1, 4) setElementDimension(Exitdoorrob1, 1) local Doorentryrob1 = createMarker(1368.890625, -1279.787109375, 14.546875, "arrow", 1.5, 255, 255, 0, 255) createBlipAttachedTo(Doorentryrob1, 17, 2, 0, 255, 0, 0, 0, 7000) local robmarker1 = createMarker(295.5595703125, -80.40859375, 1000.515625, "cylinder", 1.2, 255, 10, 10, 255) setElementInterior(robmarker1, 4) setElementDimension(robmarker1, 1) function verificar ( thePlayer ) if ( getElementInterior( thePlayer ) == 4 ) then givePlayerMoney( thePlayer, 10000 ) else outputChatBox("Você saiu da loja e o dinheiro foi devolvido!", l_5_0, 255, 0, 0) end end duty1 = function(l_5_0, l_5_1) if isElementWithinMarker(l_5_0, robmarker1) then setPlayerWantedLevel(l_5_0, 6) triggerClientEvent(root, "playTheSound1", root, l_5_0) outputChatBox("O caixa está colocando o dinheiro na sacola! Aguarde até ele terminar!", l_5_0, 0, 255, 0) outputChatBox("#DF0101[Alarme]: #FF8C00O Meliante " .. getPlayerName(l_5_0) .. " #FF8C00está assaltando a #DF0101Ammu Nation!", root, 255, 255, 255, true) setElementPosition(robmarker1, 3099.97, -3281.69, -0.5) setMarkerSize(Exitdoorrob1, 0) local blip2 = createBlipAttachedTo(Doorentryrob1, 20, 2, 0, 255, 0, 0, 0, 7000) setTimer(triggerClientEvent, 21000, 1, root, "playTheSound1", root, l_5_0) setTimer(triggerClientEvent, 42000, 1, root, "playTheSound1", root, l_5_0) setTimer(triggerClientEvent, 63000, 1, root, "playTheSound1", root, l_5_0) setTimer(setElementPosition, 300000, 1, robmarker1, 295.5595703125, -80.40859375, 1000.515625) setTimer(setMarkerSize, 90000, 1, Exitdoorrob1, 1.5) setTimer(verificar, 1000, 1, thePlayer) setTimer(destroyElement, 300000, 1, blip2) else outputChatBox("", source, 255, 0, 0) end end addCommandHandler("roubar", duty1) Exitdrob1 = function(l_6_0) if source == Exitdoorrob1 and getElementType(l_6_0) == "player" then fadeCamera(l_6_0, false, 1, 0, 0, 0) setTimer(fadeCamera, 1000, 1, l_6_0, true, 1) setTimer(setElementRotation, 1000, 1, l_6_0, 0, 0, 90) setTimer(setElementInterior, 1000, 1, l_6_0, 0, 1366.744140625, -1279.75, 13.546875) setTimer(setElementDimension, 1000, 1, l_6_0, 0) end end addEventHandler("onMarkerHit", getRootElement(), Exitdrob1) Doorerob1 = function(l_7_0) if source == Doorentryrob1 and getElementType(l_7_0) == "player" then fadeCamera(l_7_0, false, 1, 0, 0, 0) setTimer(setElementRotation, 1000, 1, l_7_0, 0, 0, 90) setTimer(fadeCamera, 1000, 1, l_7_0, true, 1) setTimer(setElementInterior, 1000, 1, l_7_0, 4, 285.689453125, -84.826171875, 1001.515625) setTimer(setElementDimension, 1000, 1, l_7_0, 1) setTimer(outputChatBox, 2000, 1, "Digite /roubar para furtar a loja.", l_7_0, 0, 255, 255) end end addEventHandler("onMarkerHit", getRootElement(), Doorerob1)
  10. I used in this part of my code: setTimer(verificar, 1000, 1)
  11. Hello, i'm brazilian. Because this my english isn't too good. I make this Script: function verificar ( thePlayer ) if ( getElementInterior( thePlayer ) == 4 ) then givePlayerMoney( thePlayer, 10000 ) else outputChatBox("Você saiu da loja e o dinheiro foi devolvido!", l_5_0, 255, 0, 0) end end But return the next message: Bad argument @ 'getElementInterior' [Expected element at argument 1, got nil] How i can fix this? Thanks for everybody!
×
×
  • Create New...