Jump to content

Stanley Sathler

MTA Contributors
  • Posts

    563
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Stanley Sathler

  1. Hi guys, I'm trying create a little script in Lua. It will create a hot dog tent on All Saint Hospital (Los Santos) after 18:00hrs (6:00pm). The script will create the tent, two chairs, a ped (vendor) and a mark. When the player enter on mark, I wanna call the function PlayerWannaFood(). Look: -- Variables definitions OpenHour = { ["HotDogSaintHospital"] = 18 } SHOP_Objects = {} SHOP_Tents = {} SHOP_Markers = {} SHOP_Peds = {} ObjectWasCreated = false function PlayerWannaFood(source) setElementFrozen(source, true) setPedAnimation(source, "FOOD", "EAT_Burguer", 2000, false, false, false) setElementHealth(source, getElementHealth(source) + 20) setElementFrozen(source, false) end function OpenFoodTents() GameTimeHour, GameTimeMinute = getTime() -- Get the current game time if( GameTimeHour >= OpenHour["HotDogSaintHospital"] ) then -- If the current game time is more that the open hour, so open the tent if(ObjectWasCreated == false) then SHOP_Objects[1] = createObject(643, 1281.20, -1383.30, 12.80, 0, 0, 52) -- Chairs #01 SHOP_Objects[2] = createObject(643, 1282.60, -1379.80, 12.80, 0, 0, 326) -- Chairs #02 SHOP_Tents[1] = createObject(1340, 1285.19, -1382.40, 13.69, 0, 0, 180) -- HotDog Tent SHOP_Markers[1] = createMarker(1284, -1382.4, 12.5, "cylinder", 1, 255, 0, 0, 255) addEventHandler("onMarkerHit", SHOP_Markers[1], PlayerWannaFood) SHOP_Peds[1] = createPed(168, 1286, -1382.4, 14, 90.0) ObjectWasCreated = true end else if(ObjectWasCreated == true) then destroyElement(SHOP_Objects[1]) destroyElement(SHOP_Objects[2]) destroyElement(SHOP_Tents[1]) destroyElement(SHOP_Markers[1]) destroyElement(SHOP_Peds[1]) ObjectWasCreated = false end end end addEventHandler("onResourceStart", root, function () setTimer(OpenFoodTents, 60000, 0) end) * I'm not good in Lua, so if there's a idiot error, I'm sorry. My problem: When the player enter on mark, the function is not called. Why? One love, Stanley Sathler.
  2. Jaysds1, I made it on description field. Thanks for the advice, hehe. One love bro.
  3. Oh yes, so I'll use MySQL. Thanks to everybody who posted here.
  4. Hoho, it's my modified script. I hope you like it. (: -- EDIT I'm sorry for the mistake on script description. It was fixed. Jeremaniak, thanks for the help (:
  5. Ficamos felizes que tenha sanado sua dúvida. E não precisa agradecer, afinal, só usamos alguns minutos de nosso tempo para lhe ajudar. Principalmente o Jayz, que ainda se deu o trabalho de copiar o XML e postar aqui.
  6. Jesus, I loved the answers! If I choose MySQL, I just must install the MySQL in my Host (like I install to use in a web page, for example) or I must use a special configuration to use with MTA?
  7. Oh John, I liked your details. I will not use on others services, but I'm trying choose by the more secure and faster. Peace, Stanley Sathler.
  8. I didn't understood... commands for jail someone? For open cells? ... Anyway, normally you must create your scripts and use addCommandHandler() for set a command to execute a function.
  9. I've never seen anything like this. Isn't possible, I think.
  10. Hi guys, In the last weeks I have been thinking about make a RPG mode. In gamemodes of this type, the server must save many informations, like current money, weapons, cars, current skin, current position on map (when the player leave the server) and much more. I would like to know: the functions setAccountData() and getAccountData() are recommended to do it? Or I must use MySQL (example) for save these informations? I would like to know the more details possible. Thx for the patience, Stanley Sathler.
  11. Go to meta.xml and insert the line: <info author="Your Name" type="gamemode" name="Your gamemode name" description="Description goes here" /> Insert on "name" the text you want.
  12. Se seu .XML não funciona e você não posta o código, é praticamente impossível lhe ajudar. Como o Jayz disse, você provavelmente danificou o arquivo.
  13. SkinToBeModified = 235 --ID Skin TxdFilePath = "cop_female.txd" DffFilePath = "cop_female.dff" SkinTXD = engineLoadTXD(TxdFilePath) engineImportTXD(SkinTXD, SkinToBeModified) SkinDFF = engineLoadDFF(DffFilepath, SkinToBeModified) engineReplaceModel(SkinDFF, SkinToBeModified) And don't forget: you must set the skin files in Meta.xml using: <file src="cop_female.txd" /> <file src="cop_female.dff" /> Enjoy yourself. And remember: learn the functions. Nobody will create a script for you like I did.
  14. Honda_aa, poste seu XML modificado para que possamos analisar o erro. Em geral, basta adicionar: <group name="Nome_do_Grupo"> <vehicle id="411" name="Infernus" /> <!-- <vehicle id="x" name="Nome_Veiculo" /> - Onde "X" é o ID do veiculo e "name" é o nome que irá aparecer na lista --> </group>
  15. I ain't good in Lua, but try it: -- Show message only to the player who called g_Root = getRootElement() addEventHandler('onPlayerJoin', g_Root, function() outputChatBox("* #FF4000'" .. getPlayerName(source) .. "'#00FF00 has joined the game", source, 0, 255, 0, true) end ) Or try it: -- Show message to all the players online g_Root = getRootElement() addEventHandler('onPlayerJoin', g_Root, function() outputChatBox("* #FF4000'" .. getPlayerName(source) .. "'#00FF00 has joined the game", root, 0, 255, 0, true) end )
  16. Sendo direto: vai precisar modificar o código responsável pelo gamemode "play". Se não sabe LUA, não conseguirá, visto que é pouco provável que alguém faça este favor por você.
  17. What do you want? Set a bindKey for call the GUI when pressed? If yes, read: https://wiki.multitheftauto.com/wiki/BindKey
  18. Para tal, creio eu que seja necessário a modificação do script responsável pelo gamemode (no caso, o gamemode "play").
  19. Ok, você quer adicionar um grupo de carros em seu servidor. Até aí tudo bem. No entanto, pretende fazer o quê com esses carros? Criá-los aleatoriamente no mapa? Utilizá-los para criar uma lista de carros para compra? Peço que seja um pouco mais explicativo para que possamos lhe ajudar mais facilmente. - A propósito... aqui não é Yahoo!, meu caro, hehe. Não convém oferecer "10 pontos" para uma resposta bem dada.
  20. Create: • A GUI (containing a GridList) with a button (for spawn vehicle) • A list of vehicles (available for spawn) • A function to show the GUI when the event onClientMarkerHit is called. We will not create a free code to you, understand. If you wanna a free code, search on Community Page (community.multitheftauto.com) or learn LUA Scripting. Or if you made a simple code, show it here using the tags.
  21. We need your script for help, bro.
  22. Seems amazing! I still not tested, but I'll do it later. Reading your code I saw the variable "distancia"... Where you from? Brazil, Portugal?
×
×
  • Create New...