Jump to content

johny46

Members
  • Posts

    81
  • Joined

  • Last visited

Everything posted by johny46

  1. What do you mean by that? What is "post"?
  2. Może opisz trochę bardziej ten ekwipunek, co chcesz tam przechowywać i w jaki sposób (baza MySQL, baza wbudowana w MTA, czy może jeszcze jakoś inaczej). Co do Twojego pytania o wzięcie kodu z innego zasobu, to myślę, że jak podpatrzysz mniej więcej co i jak działa to nie powinno być problemu, ale gdybyś chciał skopiować cudzy kod, to wtedy najlepiej spytać autora gamemodu o pozwolenie
  3. You forgot about this: setTimer(fadeCamera, 2000, 1, player, true)
  4. What about mine solution? Have you tried it?
  5. In order to calculate the width and height to use with createColRectangle, you need to subtract the x and y coordinates of your points from each other like this: width = math.abs(x1-x2) height = math.abs(y1-y2)
  6. To, że działa, nie znaczy jeszcze, że problem został rozwiązany, bo jest to trochę metoda "na około" Spróbuj zobaczyć, czy jakiś inny skrypt nie wymusza widoczności chmur przy starcie. Możliwe też, że może to zależeć od mapy, która ma ustawiona widoczność chmur.
  7. You change the players position in almost no time after starting to fade his screen out, which is set to take one second. So there's what happens: 1. The camera starts to fade (but at the time of execution, it is still visible) 2. The timer is created to fade the camera in 3. The position of player gets changed while the camera is still fading out 4. The camera ends fading out one second after the player's position has been changed 5. The camera fades in after two seconds due to the timer (At least that's how I think it should work, I haven't tested your code) To fix, replace setElementPosition(player,x,y,z) with setTimer(setElementPosition, 1000, 1, player, x, y, z) Again, I haven't tested the code because I don't have access to a computer with MA installed right now, but it should work.
  8. According to wiki, it is possible: bool dxDrawRectangle ( int startX, int startY, float width, float height [, int color = white, bool postGUI = false] ) For example, to make the rectangle half visible, you'd use this: bool dxDrawRectangle ( 100, 100, 50, 50, tocolor(255,255,255,128) ) In order to make the rectangle fade out, you'd have to calculate the new alpha value in some time interval or simply "onClientRender".
  9. Gdzie wrzuciłeś to: outputChatBox("test") W funkcji disableClouds(), czy bezpośrednio na początku pliku? Jeśli na początku pliku, to teraz spróbuj w funkcji i sprawdź czy działa. Możliwe też, że jakiś inny zasób ustawia widoczność chmur. Spróbuj zastąpić setCloudsEnabled(false) tym: setTimer(setCloudsEnabled, 1000, 10, false) Sprawi to, że skrypt przez około 10 sekund od rozpoczęcia będzie co sekundę wyłączał chmury. Jeśli zadziała, to już wiesz gdzie leży problem
  10. Try this: textToDraw = string.sub(string playerName, 1, int maxCharacters) Examples: string.sub("johny46", 1, 5) == "johny" string.sub("johny46", 1, 4) == "john" string.sub("johny46", 1, 10) == "johny46"
  11. The map looks really awesome but it is incredibly hard for me to beat and the lack of checkpoints makes it even harder. I tried it yesterday with my friends and no one actually managed to get past the first ramp.
  12. Yes. Copy the one which contents are what you want to keep, or copy both.
  13. johny46

    help

    Define a variable at the start of script like howManyProgressBarReached100 = 0 Then check it's value and if it's 1 then it means that the progressbar reached 100% one time. You have to increase that counter whenever your function ends working.
  14. It basically is meant to hide all player blips whenever they open their map and show them again when map is closed, so it has to be fast. I think i'll make a timer to call 'getKeyBoundToCommand' every second, because I don't think it's possible to save settings, press the OK button, then press Esc and then open the map in less than one second thanks.
  15. https://wiki.multitheftauto.com/wiki/Database
  16. Then how can i know when player changes his bindings? Afaik there's no event for that so i'd have to run 'getKeyBoundToCommand' onClientRender
  17. Then how can I execute some code whenever a player opens his map without having to check whether isPlayerMapVisible "onClientRender"?
  18. Hi. I want to execute some function whenever a player opens his map. According to the "MTA hard-coded commands" section of Control names i should be able to use "radar" as a command. Then why this code: addCommandHandler("radar", function() outputDebugString("Command handler executed!") end) does not work? No debug string is outputted no matter if I press the F11 key or actually type "radar" on the console, but the map is shown in both situations.
  19. Check whether 'playerblips' resource is running, and if so - stop it
  20. You could just use the example provided on the wiki and use admin panel to see player's health. Other than that, I don't see any other way of doing it, since setPlayerNametagShowing doesn't take any argument which would tell it who can see the nametag and who can not. One thing that comes to my mind is writing some kind of command, which would show nametags for players near the person executing, and second call to the command would hide them, but that is an really silly workaround.
  21. I guess you have to connect to your PHPBB MySQL database and create an forum account from it. You need to know the way PHPBB stores accounts and then try to create new following similar steps. Check out this: https://wiki.multitheftauto.com/wiki/Mysql
  22. Thanks for help. I appreciate your solutions, especially Schlammy's one, but it's too much overcomplicated for my simple needs. I followed the Solidsnake14's idea and I just do setElementData(player,"Health",getElementHealth(player)) every time I slap a player. Works without any problem as of now Again thanks for your replies
  23. Wouldn't it spam my server a lot? I guess onClientRender is triggered very often. Solidsnake, I didn't know that we are able to create our own events, thanks! I'll have to look further into it tomorrow. PS. Cześć
  24. Hi. I've made a resource, which adds a Health column to the scoreboard. It gets updated on onPlayerSpawn and onPlayerDamage events. It works quite well, but it doesn't react to slapping, simply Slap doesn't call the onPlayerDamage event. Is there any other way to check whether player's health has changed? Of course other than getting the player's health every second and comparing it for changes If not, maybe you could consider adding such event to MTA?
  25. I was looking for the most lightweight solution possible, I don't think shaders and stuff would be appropriate for my server, since the VPS is very weak. Thank you for kind reply though
×
×
  • Create New...