Jump to content

Ace_Gambit

Members
  • Posts

    569
  • Joined

  • Last visited

Everything posted by Ace_Gambit

  1. He probably used absolute instead of relative image coordinates.
  2. Ace_Gambit

    gostown server????

    Of course it would. Except that the race track itself is not synchronized. To other players it seems like you are racing in mid air because they can't see the race track. Besides, using your own mods in MTA is discouraged as it is classified as cheating.
  3. By user base I mean the amount of active players. And making the limit go up doesn't make more people join the game. It's not like there are queues of people waiting to join. Servers are not getting filled up as it is right now. What makes you think they will when the amount of slots goes up by that excessive amount. It's not just a matter of expanding. It just doesn't work like that. Then you should watch game-monitor more often. Maybe. But that still doesn't make for a good reason to make the limit go up to 1000 slots. That's ridiculous. I highly doubt the current synchronization can cope with such an high density of players in a server.
  4. I personally think it's a terrible idea. Apart from the fact that I truly start to hate RPG due to the overkill of role crap modes, the current user base isn't even near big enough to make fully use of such an huge amount of slots. It would be a waste of effort since the most players I've seen in a server so far was like 28.
  5. Except that there is no way you can calculate a hardware hash since MTA does not provide low level functionality on the client side and MAC addresses are easy to change as do IP's.
  6. That's one way of doing it. It is however advised to use map files for things like vehicles.
  7. In the next release you will be able to set animations.
  8. Registering is the best way to discourage cheaters imo. It's obviously easy to switch IP address. However even to persistent cheaters getting a new account every time is demoralizing. But I am not a big fan of water proof security "systems" to be honest. It's too easy to cheat in GTA based multiplayer mods and all those security measurements can seriously scare even honest players off.
  9. Alpha is triggered on all models with the same id. It doesn't matter if you pass a source argument. Setting CJs' alpha to 0 for example, makes all players with the same skin id invisible as well. Same goes for vehicles.
  10. People (including me) are still playing GTA3 so I don't get your point. Just because you bought a new game doesn't mean you can't play the old one. Besides, my computer specs wouldn't allow me to play IV anyway lol.
  11. These are the functions you are probably interested in the most. http://development.mtasa.com/index.php? ... _functions
  12. You get more success by just asking how to do it yourself. You said it yourself. It's going to take at least a month. Let's say it does take a month to complete. Who would be crazy enough to work for only $50 a month? Realistic would be more like $50 a day.
  13. well i have the camera like GTA 2 and when i try to make the object at the bottom of the screen it cant go there Obviously because the code above takes the screen depth into account. The closer you get to the bottom of the screen the closer the object moves towards you. That's what it is supposed to do. It's not working for "bird view".
  14. I've simplified things a bit by taking the part that should interest you the most. It's easier to read now . local selectedElement = false local screenX, screenY = guiGetScreenSize() function onClientCursorMove(cursorX, cursorY) local worldX, worldY, worldZ = 0, 0, 0 local rotX, rotY, rotZ = 0, 0, 0 local depth = 0 local distance = 0 cursorX = screenX * (cursorX / 1) cursorY = screenY * (cursorY / 1) depth = (math.abs(cursorY - screenY) / screenY) * 100 depth = 50.0 * ((depth / 100) * (depth / 100)) worldX, worldY, worldZ = getWorldFromScreenPosition(cursorX, cursorY, depth) collision, pX, pY, pZ, element = processLineOfSight(worldX, worldY, worldZ + 5.0, worldX, worldY, -100, true, true, true, true, false, true, true, true, nil) if (selectedElement) then distance = getElementDistanceFromCentreOfMassToBaseOfModel(selectedElement) if (collision and getKeyState("lshift")) then worldZ = pZ + distance end if (getElementType(selectedElement) == "vehicle") then setVehicleFrozen(selectedElement, true) end setElementPosition(selectedElement, worldX, worldY, worldZ) end end addEventHandler("onClientCursorMove", getRootElement(), onClientCursorMove, true)
  15. I did something with object dragging in one of my earlier resources. https://community.multitheftauto.com/index.php?p= ... ils&id=137
  16. The % mathematical operator calculates the modulo.
  17. Very funny. Now go ask for help on *****sux.net. I am sure they are willing to help you there.
  18. LOL, what the **** is that at the bottom of the screen? It looks like s0b.
  19. You should test for server lag on an empty server. That is with a basic spawn script. It may just as well be a poorly scripted game mode that caused the lag. I am not familiar with the whole synchronization process. But if the server is lagging and it forces to lower the fps on all clients to distribute a "fair share" it could explain a lot.
  20. What exactly does that chat resource do if I may ask? Is it "attached" to the onPlayerChat event?
  21. That was just a basic example. You should indeed use inline code for MTA functions. I was just trying to show how you could call functions when the website is not located in the resource root. In the end that is exactly what the PHP SDK is doing. Using HTTP requests to call functions.
  22. I'll put my thinking hat on and let you know . EDIT Ok, this is what I came up with. It may not be the best solution but it gets the job done. What I basically did is delegate the explosion event to the server script. The full modified code is listed below. You'll notice I didn't make any significant changes, just moved the code to the body of the server script. Server EFFECTIVE_RANGE = 10 EXPLOSION_DAMAGE = 5 function onClientExplosion(x, y, z) local tX, tY, tZ = 0, 0, 0 local distance3D = 0 local health = 0 local damage = 0 for _, vehicle in ipairs((getElementsByType("vehicle", getRootElement()) or {})) do if (getVehicleID(vehicle) == 432) then tX, tY, tZ = getElementPosition(vehicle) health = getElementHealth(vehicle) or 0 distance3D = getDistanceBetweenPoints3D(x, y, z, tX, tY, tZ) or 0 if (distance3D < EFFECTIVE_RANGE) then damage = EXPLOSION_DAMAGE * (EFFECTIVE_RANGE - distance3D) if (health - damage > 0) then setElementHealth(vehicle, health - damage) end end end end end addEvent("onClientExplosion", true) addEventHandler("onClientExplosion", getRootElement(), onClientExplosion) Client BULLET_DAMAGE = 10 function onClientExplosion(x, y, z, type) local vehicle = false if (getElementType(source) == "player") then vehicle = getPlayerOccupiedVehicle(source) if (vehicle) then if (getVehicleID(vehicle) == 432 and getVehicleController(vehicle) == getLocalPlayer()) then triggerServerEvent("onClientExplosion", getRootElement(), x, y, z) end end end end function onClientPlayerWeaponFire(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement) local health = 0 if (isElement(hitElement)) then if (getElementType(hitElement) == "vehicle") then if (getVehicleID(hitElement) == 432) then health = getElementHealth(hitElement) or 0 if (health - BULLET_DAMAGE > 0) then setElementHealth(hitElement, health - BULLET_DAMAGE) end end end end end addEventHandler("onClientExplosion", getRootElement(), onClientExplosion, true) addEventHandler("onClientPlayerWeaponFire", getLocalPlayer(), onClientPlayerWeaponFire, false)
  23. Yeah, I feel your pain. I think I know what the problem is. It seems like (but I am not 100% sure) onClientExplosion is only triggered if you are the creator of the explosion (which in a way does make sense). I never thought about it.
×
×
  • Create New...