Jump to content

WorthlessCynomys

Members
  • Posts

    369
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by WorthlessCynomys

  1. I have no idea about the gun transparency. If it is possible, then with a little search on WIKI, you'll find a function that can do it.
  2. You have to store the images in a table and make a pointer that indicates which image is shown at the moment. On the click of the button, you change that pointer's value in the right direction, then redraw the image.
  3. Users are stored in ACL with the prefix user. and their usernames with what they registered and logged in on the server. So like a player registers on the server with username Doe, he will be stored in the ACL like user.Doe . You have to use this format in the isObjectInACLGroup to check it properly.
  4. onClientRender is an event, you have to handle with addEventHandler. addEventHandler("onClientRender", root, functionToCall); In the function it will call: function fadingImages() dxDrawImage(500, 500, 250, 250, "image1.png", 0, 0, 0, tocolor(255, 255, 255, 255), false); -- This line will draw the image (image1.png) on your monitor. It's left top corner will be at (500;500) pixel position and it will spread to the right 250 pixels and down 250 pixels. So it's right bottom corner will be at (750;750) pixel position on your screen. To make it transparent, you have to change the 4th, Alpha value in the tocolor function ( R(ed)G(reen)B(lue)A(lpha) ). end onClientRender gets called every time your PC refreshes/renders the game. If you play at 60 FPS(Frames per second), it means it gets called 60 times per second. Now using this knowledge you can make what I recommended: This code is NOT tested! Images = { {"image1.png", 255}, {"image2.png", 0}, }; function fadeImages() -- || This part will do the transparency changes || -- if (Images[1][2] > 0) then -- If the transparency of the first image is greater than none, we subtract 1 from it's value, making it more transparent. Images[1][2] = Images[1][2]-1; end if (Images[2][2] < 255) then -- If the transparency of the second image is less then full, we add 1 to it's value, making it less transparent. Images[2][2] = Images[2][2]+1; end -- Doing the part above, will result in the two images changing each other with a fade effect. -- || This part will draw the 2 images on top of each other || -- dxDrawImage(500, 500, 250, 250, Images[1][1], 0, 0, 0, tocolor(255, 255, 255, Images[1][2]), false); dxDrawImage(500, 500, 250, 250, Images[2][1], 0, 0, 0, tocolor(255, 255, 255, Images[2][2]), false); end addEventHandler("onClientRender", root, fadeImages);
  5. I'm from phone, so I didn't read the code! I would put the images and their alpha values in a table, like: Images = { {"image1", 255}, {"image2", 0}, } And I would use 2 dxDrawImages using the alpha values attached to the images and I would change the image to be displayed while changing the numbers representing the alpha values. Hope that you understand what I try to say.
  6. You can try the getCursorPosition() if that does not work (I have no idea whether it does) then you can use the onClientCursorMove event which returns it's position upon moving it. Note that while non-visible, the cursor's position is always (0.5;0.5). When it moves, the onClientCursorMove returns the curremt position of it (which is jumping between the value and the 0.5;0.5 positions, since the cursor tries to be always in the middle).
  7. Well... You should start off by creating the meta.xml file (you can find it's documentation on wiki) and the script files in a resource (basically a folder in the resources folder of your server). After that, start a function, like: function functionName () end and then use the already provided functions for this matter getPlayerSerial() getElementPosition() createVehicle() You can use if statements to compare and decide: if (condition) then -- Spawn the vehicle end
  8. How do you want to specify the player who can get it and drive it? Do you want to do it by name, serial code or do you want it like players in a certain group are allowed to do that? You can check if the player is the one you want by serial code. I assume that if you want to restrict the use of this function for a specific player, you can get the serial code belonging to it's PC. You can do it based on player name, but since other players can change their names any time, it wouldn't really be restricted to a player, but to a name instead. You can do it based on ACL groups, adding only the specified player to that group, but admins can add objects to ACL groups so that wouldn't be so restricted neither. You can also do it based on teams, but there's the same problem as with ACL groups. The best option (if you want it to be useable by only one specific player) is the serial based. On the call of this command you comapre the serial of the sourcePlayer with the serial of the player who can spawn the car. If it's a match, spawn the car. If it isn't output a message or do something. Maybe do nothing.
  9. Just feel free to ask me or anyone on at this place about nearly everything. I can't promise I'll give the best answers, but I'll definitely try ?
  10. Well... Don't use tooooo much of them. It's memory, obviously. They have an event on both server and client side, which can be use easily with addEventHandler on their side. After that it's soooo easy to use them, sometimes it is hilarious. You just have to find the proper functions to do what you want. AND THE ACTUAL TIP Turn on development mode (setDevelopmentMode(true)) and use the showcol command. It will magically make them visible
  11. Well... Those are big plans, I hope you will achieve it You don't have to start resources. I would use collision shapes to detect if a player walks close enough and make a script that changes the necessary things.
  12. V is the object element, not the model id. getElementModel(v) will get you what you want
  13. I'll get back to you in about an hour.
  14. You should put the checking in a timer that executes every second. setTimer() getElementHealth() setElementHealth()
  15. Rendben. Akkor amint tudok felmegyek. Az IPt szerintem ne írd ki publikusan. Az lenne a legpraktikusabb, ha privát üzenetben el tudnád küldeni porttal együtt. Köszi!
  16. Fél óra múlva fel tudok ugrani TSre ha az jó.
  17. Hello! Meg tudnád fogalmazi a kérdést röviden? Elvesztettem a fonalat a hosszú szövegben, hogy mi a probléma. Talán tudok segíteni.
  18. Hey! Serious problems won't occur. FPS limit is for syncing problems. A player who has 100 fps can sync differently than a player with 24. This could cause desync problems. High FPS won't really cause any problems. However I don't think MTA will ever have more than 60 or so
  19. Use onVehicleExit and check vehicle model ID
  20. You have to make a function that has the command in it, then make a bind that calls that function. Should work.
  21. Well... Me too okay so xampp local mysql db doesn't need a password. Just leave the password part like ""
  22. No. Next time use the <> sign.
×
×
  • Create New...