Jump to content

ReZurrecti0n

Members
  • Posts

    123
  • Joined

  • Last visited

  • Days Won

    4

ReZurrecti0n last won the day on June 30 2023

ReZurrecti0n had the most liked content!

About ReZurrecti0n

  • Birthday 12/12/1979

Details

  • Location
    Florida, US
  • Occupation
    Game Designer
  • Interests
    Role Play Games

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

ReZurrecti0n's Achievements

Sucka

Sucka (13/54)

20

Reputation

  1. Using root will make things work, but very hard on the CPU. You will want to switch from root to getResourceRoot() instead for most cases, directed at those Event Handlers though. Also if it continues to execute for every player, add a check with onClientMarkerHit (outFourDragons) for the local player: if(hitPlayer == localPlayer)then -- Whatever Code end
  2. What about detecting when the fire key(s) are being pressed and released? Display the text when the fire key is down and then stop displaying when the fire key has been released? However, this may get complex because of the amount of ways to attack and may just need to check a whole mess of conditions...
  3. Why not just place the function under onClientResourceStart?
  4. English seems great to me, haven't even noticed it wasn't your native language... But as for how to figure out what parameters a event has: Let's say we want to know what parameters come with the OnPlayerWasted Event We first look up the event on the wiki: https://wiki.multitheftauto.com/wiki/OnPlayerWasted Look for where it says: Parameters You may rename these parameters to anything you want, but will always be the same So on this example: onPlayerWasted(totalAmmo,killer,killerWeapon,bodypart,stealth) Let's change the parameter names to be like: onPlayerWasted(candy,bird,sun,rock,tools) candy will still be the total ammo, bird will be the killer element if any, sun would still be the weapon used for the kill, so on and so forth... You're going to have to look into this wiki, search these forums and google search Lua to figure everything out. This is how I learned, but every now and then I won't be able to find anywhere on how to do this or that and so I finally make a thread for it
  5. infourdragons = createMarker (2019.76953125, 1007.0116577148, 9.7203125, "cylinder", 1, 255, 0, 0, 153) function saythis (player) -- Should consider adding the 2nd parameter for future use and renaming the player parameter to something more related such as element if (player == infourdragons) then -- The player is not infourdragons and never will be, you must be confusing this as checking the player touching infourdragons or something. Instead check if player is an actual player element AND if source (The Marker) is infourdragons outputChatBox ("What are you doing?", player, true) -- This would work currently, but what if player is a vehicle instead of a player? Should rename the player parameter for that reason end end addEventHandler("onHitMarker", player, "saythis") -- onHitMarker is wrong, you meant onMarkerHit. getRootElement() should be used instead of the player parameter, but unsure if player could or even should be used. Never tried, always gone with getRootElement() on all my Handlers
  6. Because you are using player, but player is not defined in this function anywhere. However, with onMarkerHit(hitElement, matchingDimension), the first parameter is the element that hit the marker which in this case is likely the player: infourdragons = createMarker (2019.76953125, 1007.0116577148, 9.7203125, "cylinder", 1, 255, 0, 0, 153) -- Coords for a spot next to the doors of the casino, on the outside. function enteredDragons(hitElement, matchingDimension) -- When anything hits the marker (players, objects, vehicles, etc.) it becomes "hitElement" if (source == infourdragons and getElementType (hitElement) == "player") then -- Making sure the element is a player setElementInterior (hitElement, 0) setElementPosition (hitElement, 2018.9376220703, 1017.0843505859, 996.875 ) -- Coords for a spot next to the doors of the casino, on the inside. setElementRotation (hitElement, 0, 0, 90) outputChatbox ("Entraste al Casino 'Four Dragons'", hitElement, true) end end addEventHandler ("onMarkerHit", root, enteredDragons) There are other options you may take, one is simply just changing that first parameter to player (But this may confuse you down the road because more than just a player can trigger the event) Another option is using onPlayerMarkerHit(markerHit, matchingDimension), source would then be the player that hit the marker
  7. Maybe the client file wasn't downloaded and run yet when the server attempted the triggerClientEvent. But after it finishes downloading and running the client file, it all works... A solution to this is starting your server from the onClientResourceStart event on your client side file. Once that event triggers, then you could just use triggerServerEvent to spawn in your player in etc. Oh, but you may want to make sure it only triggers once, so just do a quick resource check, I'll give a full example of what I mean: function ClientResourceStart(resource) if(getResourceName(resource)=="EXAMPLE")then triggerServerEvent("SomeFunction",localPlayer) end addEventHandler("onClientResourceStart",getRootElement(),ClientResourceStart) Where as "SomeFunction" would be a custom function created server side with all your starting player code and whatnot
  8. Strange, it does reach the event, thus you get the "test2" outputchatbox for it... It is saying expected Element at Argument 2, but getting a Function Well, maybe if you fix the showCursor(false) and showCursor(true)
  9. Ah yes, majqq is right, thank you So try changing the command from "test" to "showexample" or anything more unique that wouldn't mix with already existing hard coded commands
  10. 0 Interior is outside, but your z position is probably too high (1025.732323227) You would end up teleporting somewhere in the sky and then just falling back down to the ground... I don't recall what the Z limit for Interior 0 (Outside) is, but if you were to change below that limit, it would likely teleport you then. Change the Z to 500.0, it will likely work, but you'll also likely fall to your death as well
  11. Well, you just remove ALL those resource lines and then only add in the resource(s) you created To make a resource, you just need a script file and the meta file for it inside a folder or zip file (But keep in mind, your server will have nothing except what you created basically...)
  12. Thank you, you're right, thank you for pointing that out
  13. There are no messages or not even the timer itself either, you will need to work with the base script and then throw in the changes so that you have the entire working script. You won't learn much if you just copy and paste, it's better you construct your own. But here would be the final result anyway: local messages = { "Visit our website at www.google.com!", "Did you know? These messages are automated!", "Add another message here!" } local prefix = "[INFO] #FFFFFF" -- message prefix local interval = 5 -- time between messages (minutes) number = 0 -- Declare the variable outside the function function outputRandomMessage() number = number + 1 -- Add +1 so it changes each time the function is called local msg = messages[number] -- Display the Message outputChatBox(prefix .. msg, root, 3, 169, 244, true) -- Actual Message being sent out to everyone! if number = 3 then -- If it just Displayed the last Message... number = 0 -- Reset it to start all over again end end -- Forgotten End :( setTimer(outputRandomMessage, interval * 60 * 1000, 0) -- Message Timer
  14. addCommandHandler ("test", someFunction) -- Does not match up to the function, case sensitive, it should be: SomeFunction Anyway, my SomeFunction was just an example. If you copy and paste it only, then nothing will ever trigger SomeFunction(), therefore nothing would happen... It was meant for you to look at the example and then use it in your own code at the point you need it. But, just for understanding purposes, if you fix the command handler, then the command will trigger it and will then give you a better idea of how to implent/mod/use it into your own code Look over the Wiki Page for setCameraTarget and you may notice there are 2 ways of using this function IF used clientside: https://wiki.multitheftauto.com/wiki/SetCameraTarget
  15. Hmm, that could be... I'm afraid I'm not familiar with the default resources as I myself cut them ALL out and only use what I create myself... Make some form of backup Then plug and play with it and see what happens, try removing any resource you don't think you use and keep only the ones you actually do use etc.
×
×
  • Create New...