Jump to content

MaddDogg

Members
  • Posts

    189
  • Joined

  • Last visited

Everything posted by MaddDogg

  1. Your exlusive clientside concept won't work I quoting from here: You have to work serverside on this. You can optionally hide the vehicle from other players.
  2. A player is a subtype of a ped, so most of the functions also work on players. So, if you want to put a player into a vehicle, just use this: https://wiki.multitheftauto.com/wiki/WarpPedIntoVehicle But notice that it is clientside, so you will need an event, which gets triggered.
  3. MaddDogg

    carcols.dat

    The highest possible value is 255. And from 127-255 there are some cool colors, but most of the numbers just result in a black color. The others are tones of purple or dark green and no orange. So I still think that this would be a great feature, because it would give you the freedom to use your own colors. It would suffice, if you would be able to change the color of an existing color id by using RGB.
  4. MaddDogg

    carcols.dat

    It would be indeed a really great addition to MTA, if you would be able to choose custom colors. There are also colors missing like orange, so it would be just very helpful. Maybe someone should make a feature request about it, if it wasn't already done. I would just very much like to see it.
  5. I think you should learn a bit more about Lua syntax and event handlers.. 1. You attached the event to the resource root element, which makes no sense, because the source is the player, who died. https://wiki.multitheftauto.com/wiki/OnC ... ayerWasted 2. The thing with variable "ab" is unnecessary, math.random already returns a number, so a conversion from a number to number is pointless. 3. You're missing the "then" after your elseif conditions. 4. You set the sound volume from a sound element "snd" to something, although in the next line you play a sound and save it in the variable "sound". So the lines should be swapped and setSoundVolume should rather use an actual sound element.
  6. Okay, but I don't see, where you declare the 'client' variable. You don't pass on an argument called 'client' and there seems to be no global 'client' variable in existence. Do you actually mean 'source', which would be the cause of the event triggering, hence the player, who needs to be spawned? You could do it like this: locations = { {spawnX = 1000.0, spawnY = 500.0, spawnZ = 10.0, spawnRot = 90.0}, -- location 1 {spawnX = 2000.0, spawnY = -100.0, spawnZ = 18.0, spawnRot = 270.0}, -- location 2 {spawnX = -600.0, spawnY = -450.0, spawnZ = 53.0, spawnRot = 0.0}, -- location 3 -- and so on... } function spawnClick (button) -- some code... local row, col = guiGridListGetSelectedItem ( spawnList ) if row ~= -1 then -- if player selected an item triggerServerEvent ( "spawnWindow_SpawnPlayer", getLocalPlayer(), locations[row].spawnX, locations[row].spawnY, locations[row].spawnZ, locations[row].spawnRot, skin, interior, dimension, team ) end end That's just a simplified code and example, but you should get the idea.
  7. Sorry, if I missed something, but who is "client" in your serverside script? Is that supposed to be "source"? "client" is never given to the function, so I would wonder, why it would even spawn you once. But apart from that I would advise you to use tables. That would make the repeated elseif's unnecessary, since the script would get the respective data from a table using the row as index. That would definitely shorten your script to at least the half and would make it more readable and dynamic. But that's optional and just a tip
  8. Yes, XFire publicizes the server you're playing on by default. I had a similar problem with our TeamSpeak voiceserver. Some day someone joined our server, although the port was never publicly shown. We changed the port, but this guy joined some days later again. Btw, he tried to flood our server with bots. Finally I realized that XFire was the cause by publishing the server data. But I was able to turn that off in the options under privacy. There you also find the option to turn off the posting of game server data to other people on XFire.
  9. I've got the same problem. It seems that they've got a little problem with their MySQL database, since it refuses the connection. Just wait a bit and it might work again. Alternatively send them an email about this, but I'm sure that they're aware of the problem.
  10. By default, there are no blips displayed on the radar. Hence, if you have player blips on your server, they must be coming from a resource such as freeroam. To hide those, you have to edit the resource script. A hide command would then just delete your blip, a show command (or hide-stop) would create one again. I just had a quick look into the freeroam resource and there the blips are created like this: g_PlayerData[player].blip = createBlipAttachedTo(player, 0, 2, r, g, b) There you see, where the blip elements are stored in. Just write a command, which destroys the respective blip and a command, which would just hold the line above. But again, this is for the freeroam resource. So it depends on what you're playing with.
  11. MaddDogg

    carcols.dat

    If you want to change the colors of a car, which it can have upon spawn, you could make use of the vehiclecolors.conf, I guess. I actually never worked with the file before, but AFAIK it has the same purpose as the carcols.dat file. It can be found within the deathmatch mod folder of the server files.
  12. Didn't notice that it was serverside, but does it have to be? You could just create a ped for every player. But I actually don't know, what you're planning to do with the ped, so...
  13. Just make use of a canceling of OnClientPedDamage. That would make someone invincible, if that's what you want.. Also, this: setTimer (healing,1,0) wouldn't work, because the minimal value for the time if 50ms, as stated here.
  14. Are you serious? Not even bothered to search once? https://forum.multitheftauto.com/viewtop ... fbb5854f45
  15. MaddDogg

    Problem...

    Here you go: The first thing to notice that is the getLocalPlayer(). This returns the player element of the machine, who is also running this script. And since there is no player on the serverside, it's a clear indication for a clientside script, where this function is very often used. You can also notice that outputChatBox has no player parameter, which also leads to this conclusion. If you look at the serverside version of this function, you could also there leave out the player element, but that would result in every player seeing the message. Hope, you're satisfied. @Bumbi: You press F8 and then login using "login ". If you did not already create an administrator account, have a look at this: https://wiki.multitheftauto.com/wiki/Ser ... nistrators
  16. WTF? That's a total mess. First of all you can't name a function as an already existing MTA function. Second, you're second function is nested within the first one. I actually don't know, if that's allowed, but it's definitely not, what you want. You should really learn the basics of scripting, especially this section: https://wiki.multitheftauto.com/wiki/Scr ... le_command
  17. MaddDogg

    Problem...

    Commands can also be in non-gamemode resources, and a resource is not on a same level as a gamemode, so you can't say "resource or gamemode", because a resource can hold a gamemode. The command, you provided, is for a clientside script, so yes, you have to put it into a clientside script file such as fr_client.lua . In the wiki, it always says, whether examples are server- or clientside, if the page itself isn't already limited to server- or clientside scripting.
  18. Yes, although you should practise proper indentation, like this it is way harder to see those mistakes. Also, the second argument passed on by onColShapeHit is not a player element, but a boolean saying, whether the dimension between the col shape and the hitting element matched. https://wiki.multitheftauto.com/wiki/OnColShapeHit Another thing: You don't check, if the element hitting the col shape is a player. Although this will probably not cause problems with this code, since getElementModel will also work on vehicles, this might be dangerous, when you use ped or player functions on the element, which could also be a hitting vehicle. So better would be a.. if getElementType(hitElement) == "player" then ..inside your opena51gates function.
  19. It's because of some unneeded "end". Have a look in line 7 in your code snippet. There is an else, but where is the if?
  20. If it meets your needs and if you have a total even area, it will definitely suffice. But with a cuboid you also have the 3rd dimension up and down, which you may need in some cases.
  21. You have to do this first: sourceTable[source] = {} With this you create a new sub-table at index location [source].
  22. That was just an example of how you could get to your values easily. Just look at the thing I drew. You have to get the positions for the two blue points. How you get them does not matter.
  23. Nobody seems to be reading this https://forum.multitheftauto.com/viewtop ... 91&t=26541 Although it would really help...
  24. colshape createColCuboid ( float fX, float fY, float fZ, float fWidth, float fDepth, float fHeight ) The first point, determined by fX, fY and fZ, is located at the bottom left corner of the cuboid on the ground. The width, depth and height then determine, how far to the right, forward and up the cuboid should go. So, an easy way to create a cuboid is to first go to the bottom left corner of your area. Then save your position and go to the top right corner. Again a save. Now you use the first x,y,z as fX, fY and fZ. Then you calculate the difference between the second x,y and the first x,y and then that's your fWidth and fDepth. Now you just have to set your height (fHeight) of your cuboid. For that you could also save a position one more time, while you're up in the air. EDIT: Just drew something for you. [attachment=0]cuboid.jpg[/attachment]
  25. Correct, but that really seems to be a popular mistake. The source, which you provide, is never an argument, although it is in some way a "hidden" argument, if you will. But as R3mp said, you should directly call the function rather than using triggerEvent. Regarding your second problem, I don't really get, what you're trying to do. But anyway, you're using string.sub incorrectly. The second argument is not a word index, but rather a character index from where to start. If arg would be "blah", your string.sub would return "lah". http://www.lua.org/manual/5.1/manual.ht ... string.sub
×
×
  • Create New...