Jump to content

PLEP

Members
  • Posts

    19
  • Joined

  • Last visited

Everything posted by PLEP

  1. PLEP

    Text

    Oh crap.
  2. PLEP

    Text

    By some reason it doesn't work for me I see nothing while in the position 0, 0, 3 or around.
  3. Well, yeah. But I'm trying to find out how all this stuff works with files to get atleast some scripting experience. There are no examples about xml in wiki also. However, now I made another function that would read my file till the end of it and write in another position (Without overwriting the first one). But when I type /mypos in MTA, it causes some excessive error spam in the server window, then I get network troubles. Looks like something's wrong with fileIsEOF and fileRead. I tried everything that would come up in my head, but nothing worked. function consoleAddPos ( thePlayer, command ) local testFile = fileOpen("Positions.txt") if (testFile) then local buffer while not fileIsEOF(testFile) do buffer = fileRead(testFile, 60) local c = getPlayerFromName("PLEP") if c then local x, y, z = getElementPosition (c) if x and y and z then fileWrite(testFile, " ", tostring(x), " ", tostring(y), " ", tostring(z), " ") -- Those " " in the beginning and ending are supposed to be spacebars between positions. fileClose(testFile) end end end end end addCommandHandler ( "mypos", consoleAddPos )
  4. Why would it be better? I need just it to be saved in notepad so I can quickly copy/paste coordinates into script.
  5. Thanks! Works perfectly. Now just left to find out how to add more coordinates in the file instead of overwriting existed over again.
  6. Better get your own ideas and make something fun and intresting instead of copycat Valhalla's script. Eventhough if someone decides to do this for you. You'll just lose money for nothing, because noone will be playing on your server, since there's another just the same server. Plus Venturas is awful city for RP.
  7. Basicly, I'm trying to make a small script that would save my positions in a test.txt, but I can't get getElementPosition to print out as text in the file. Any ideas? function consoleCommandTest ( thePlayer, command ) local newFile = fileCreate("test.txt") if (newFile) then a = getPlayerFromName( "PLEP" ) if a then b = getElementPosition (a) if b then fileWrite(newFile, b) fileClose(newFile) end end end end addCommandHandler ( "mypos", consoleCommandTest )
  8. Thank you! Few pages that already loaded are working perfectly. But it takes hella lot of time to DL MTA wiki: Like 6 hours passed and only 66MiB downloaded
  9. I have very bad internet connection, so checking wiki while scripting is very troublesome. I thought if it's possible to download MTA wiki page fully so that I don't need internet at all to see some functions, ids, etc?
  10. I think 200 hp is the maximum in GTA SA.
  11. PLEP

    [HELP] RPG SERVER

    https://wiki.multitheftauto.com/index.ph ... ntPosition To find out my own coordinates in game I usually do run p = getPlayerFromNick("PLEP") run getElementPosition(p)
  12. PLEP

    Few questions.

    Got a problem here with camera... According to my idea, after player dies and 4 seconds delay passes he will respawn at the certain place (-1951.37, 148.78, 26.28) and facing west (, 90). It works, but camera wouldn't look at west as the ped does. I tried fix this with setCameraMatrix. It actualy looks where I need to, but then I couldn't get back to Ped camera. I tried few variations with setCameraTarget and tried to cancel setCameraMatrix after it's true. Either way, it won't work. Maybe I did something wrong, I dunno. function setCameraOnPlayerSpawn() setTimer( spawnPlayer, 4000, 1, source, -1951.37, 148.78, 26.28, 90 ) deathCam = setCameraMatrix(source, -1984, 210, 37.95, -2024.27, 148.62,28.835) if (deathCam == true) then cancelEvent() end end addEventHandler( "onPlayerWasted", getRootElement(),setCameraOnPlayerSpawn)
  13. PLEP

    Is there

    Anyway cops and robbers is boring like hell.
  14. PLEP

    Few questions.

    Well, yeah. I need the way to assign unique ID number to each player when he joins. That's going to be used mainly for personal messages, commands in run code during test and in game commands which starting with slash ( /giveweapon [iD/PlayerName] [Weapon ID] [Ammo] for example ). IDs should be different so there won't be any mix, when player disconnects his ID could be used by another player who joins the server. And IDs should be automaticaly sorted from first one to last in scoreboard. It's actualy the same thing like in SAMP, those are dynamic. Also I thought of static IDs. So every player gets his unique static ID number that attaches to his account forever. If player joins back on the server, then he will have the same ID like before disconnecting. 13. Hence I would need a system to save accounts data, which would save: static IDs, amount of money, cars and stuff player owns, weapons, houses, business, etcetera. Here's another question: 14. function [u]funcname[/u](args) -- Code end I could give any name I want to funcname or not? 15. How do I set up an arrow near some door and when I steo on it, and actualy press F, then I will get teleported to <interior id="96" name="OG Loc's House" posX="516.8890" posY="-18.4120" posZ="1001.5650" rot="0" world="3" /> and vice versa? If I make 2 or more arrows in different places with same interior id like above, then all players who enters it would teleport to same place? If so, How to avoid this?
  15. PLEP

    Few questions.

    I believe there was a function like setObjectStatic or something like that. Look for that in wiki It doesn't work. I also need to make wooden fences unbreakable. Well, you kind of need to make your own system for it, since there is no real pre-made one yet. Best way to use this is using setElementData and a table next to that. (table[iD]=player) Then you need to make commands use this method. Could you explain more in depth how to make it please? I need to gets IDs as fast as possible so it will be easier to use some commands during test.
  16. PLEP

    Few questions.

    Thank you for your answers. Here's some more questions... 9. How do I set ID for every player on player join? So then I could use commands on players using theirs ID instead of typing a full name. Either how to force script to recognize players by parts of theirs name. 10. I have added two commands to my gamemode, /w and /v. /w [Weapon ID] [Ammo] gives weapon to player who wrote the command. Same with /v, but it's for vehicles, /v [Vehicle ID] . At the moment they are recognizing only Weapons or Vehicles ID, but not names or part of name. How to make make them recognize names too? For example /w ak 100, /w min 500 or /v monster , /v greenwo . 11. When car damaged really bad first it starts smoking, then flaming, then finnaly blows up. When car begins flaming, how to force it NOT to blow? I just need a way to keep it flaming without blowing. 12. Anybody have an example of fuel system script? I need that cars could refill on certain petrol stations, for certain price and each vehicle has it's own fuel consumption speed. As I said, explanations in wiki are TOO complicated and I don't understand anything in it. Althought it's waaaay easier for me if someone explains it to me, like here. Yes, I will post more scripts to modify. If you don't want to modify them, don't do it. I won't bother you anymore. This way it's easier for me to see what was wrong. This is the way I am learning. In any way, Thank you for trying to help me.
  17. PLEP

    Few questions.

    Thanks. Doesn't work.
  18. PLEP

    Few questions.

    Hello, I'm Alexander_Rudin for those who knows me or saw in game earlier. I started to script recently and have in possession very little knowledge in this area. I read some tutorial in wiki (Introduction in Scripting) and decided not to go reading further, before I make sure how every simple function working. However it's all seems to be too complicated for me. Here is few questions... 1. I took simple script from the tutorial and tried to modify it a little. According to my idea, when player joins, he and the camera has to face west. But every server restart causes camera to change it's position. Although ped keeps facing west. Modify the script please, so I can see what was wrong. Don't attempt to explain in words - anyway won't work with me, lol. function joinHandler() local x = -1951.37 local y = 148.78 local z = 26.28 local r = 90 spawnPlayer(source, x, y, z, r) fadeCamera(source, true) setCameraTarget(source, rotation) outputChatBox("Test.", source) end addEventHandler("onPlayerJoin", getRootElement(), joinHandler) 2. What does "local" and in which cases should I use it? 3. Is there any objects/markers/pickups/vehicles limit? 4. How do I place static Brownstreak (Train engine) on the rails? Than when I restart server it's will be on certain place and noone could use it. 5. How to make gas station pumps "un-blow-able"? 6. Map Editor. How to delete objects ( Not these which I created )? I mean in cases when there is a skyscraper, but I want to delete it and place few other small buildings on this place. 7. How to toggle lights on/off, add new lights on vehicles and change color of each light? 8. How could I lower top speed of all/some vehicles in game? So that when I start gamemode everyone has same handling. That's all for now. Would add some more later. Please, don't tell me to google or use wiki. All this :~ is too complicated for me. I want to hear simple and clear explanation.
×
×
  • Create New...