Jump to content

SpecT

Members
  • Posts

    656
  • Joined

  • Days Won

    9

Everything posted by SpecT

  1. Hey, How do players login in the server? Login panel or with command? If it's with login panel you can call the function after the player logs in. You should make it like a cycle: log in, spawn, give weapons. Otherwise you will have problems as sometimes the players will either first login or will first spawn and stuff might get messy.
  2. SpecT

    Race Maps Pack

    Hey, There are a lot of maps on the community site you can find. Just type in the name textbox "race" and select the type to "map" and it will show you all of them.
  3. SpecT

    Timer C-side

    Yes, you can change it to root. It won't trigger for everyone as long as you specify to which players to be triggered.
  4. SpecT

    Timer C-side

    Oh sorry I got it wrong the idea you have. The "if killer == localPlayer then" will be enough to limit it so your timer won't be killed when somebody else kills the ped. function drawxp(xpfromserver) xptogive = xpfromserver removetimer = setTimer(function() xptogive = false end, 3*1000, 1) end addEvent("drawxp", true) addEventHandler("drawxp", localPlayer, drawxp) function onWasted(killer, weapon, bodypart) if ( killer and getElementType(killer) == "player" and getElementType(source) == "ped" ) then if killer == localPlayer and getElementData(source, "zombie") == true then if isTimer(removetimer) then killTimer(removetimer) outputChatBox("killed timer") end end end end addEventHandler("onClientPedWasted", root, onWasted)
  5. SpecT

    Timer C-side

    Hello, All you need to do is to replace the getRootElement() in the addEventHandler with localPlayer . Also instead of getLocalPlayer() use the predefined variable localPlayer . Uhh I just noticed it is used when a zombie is being killed. Isn't this better to be in the server side ?
  6. Hey, I think that this is what you are looking for: local spamTimer function something() if isTimer(spamTimer) then return outputChatBox("Please don't spam") end sound = playSound("sounds/"..tostring(number)..".mp3") spamTimer = setTimer(resetTimer, 1000, 1) end function resetTimer() if isTimer(spamTimer) then killTimer(spamTimer) end end
  7. SpecT

    MTA uncommon Crash

    Hello, This obviously seems to be a problem with the display driver of Nvidia. Download the latest drivers from their site for your GPU and make sure to check the "perform a clean install" tickbox. Restart PC and then try again. If this doesn't help please paste the URL coppied from the MTADiag tool.
  8. function showgui() guiSetVisible(wear, true) guiSetVisible(cancel, true) guiSetAlpha(wear, 0) guiSetAlpha(cancel, 0) showCursor(true) addEventHandler("onClientPreRender", root, drawpurifier) end addEvent("showgui", true) addEventHandler("showgui", root, showgui) addEventHandler("onMarkerHit", resourceRoot, function(hitElement) if source == rmarker3 then if getElementType( hitElement ) == "player" then if getElementData(hitElement, "purifier") == "true" then outputChatBox("You are already a purifier", hitElement, 255, 0, 0) return end triggerClientEvent(hitElement, "showgui", hitElement) end end end) Use the predefined variables instead function calls to get them. Like this it should work fine as you are triggering the client event only for the specific "hitElement" player.
  9. Yes, and also replace the "getRootElement()" with "root" as it's faster.
  10. I don't think it should be possible or at least I don't see anything wrong in the code. You can put some debug outputChatBox messages in the client side function and stay away from the boss while someone else fights with it and see if it detects you to damage the boss somehow. It's not cool if the guy you test it with is joking. ? Ask him for a screenshot of the reward message. BTW some optimization you can do: in the server side you have 2 triggerClientEvent calls. You can easily merge them to a one. For example "onBossEventEnd" whidh will include all the stuff from the 2 functions "removehp" and "stopmusic" into 1 function.
  11. Hey, I played a little bit with the world sounds and found some stuff. Here is what I found: IDs 55 and 51 of the group 5 (weapons) are the reloading sounds for the pistols. But its different for the other types of weapons. For example the AK47 reload sound ID is 31. It will take some time to find them all tho since there is no (or at least I didn't find one) list of the sound IDs from each group. local allowedSoundIDs = { -- all the punching IDs are here, just find the reload sounds of all weapons and add them 9, 28, 31,32,34,35, 45,46,47,48, 50,51,54,55,56,57,58, 64,67, 75, 86,87,88 } setWorldSoundEnabled ( 5, false ) for i, sound in pairs(allowedSoundIDs) do setWorldSoundEnabled(5, sound, true) end
  12. Hello, As long as it is not higher than 60 FPS it should be pretty much fine. You can see what's the recommended FPS limit and the possible issues if the FPS is too high at this link.
  13. Hello and welcome to the forums! Could you run MTADiag and paste the coppied URL here.
  14. Welcome to the forums! The function to restart resources is restartResource. You need to pass it a resource element so you could use getResourceFromName. Example: restartResource(getResourceFromName("testResource")) Note: Don't forget that restartResource requires admin rights!
  15. Hello, I don't know if you know about this feature but you can create a shortcut on your desktop with the server IP and port and when you run it you will get connected to the server right after the game loaded. Shortcut path: mtasa://serverIP:serverPort Example: mtasa://12.34.56.78:22003 I think this might be useful to you as you mentioned you only play on one server and it's fastest way to get into a server (skipping all the menu browsing part).
  16. SpecT

    CD16

    And did you try what I suggested ?
  17. SpecT

    CD16

    Welcome to the forums! This is the right section to post a topic about such problems but it would be nice if you write in English. If you have a problem with that you can post in the Turkish section where people knowing your language could help. Now on topic: do you get this error on every server or on specific ones ? You can start by downloading THIS executable file and run it as Administrator. Then restart your PC and try again to connect to a server.
  18. SpecT

    ERROR CL33

    Hello, First thing you can do is to download and run MTADiag. Then post the coppied URL here.
  19. Hello and welcome to the forums! You can use MTA's anti-cheat to prevent such things. This guide might be useful to you: link
  20. SpecT

    no Plural-Forms given

    Welcome to the forums! This seems to be caused by the AR localization (language). Something is messed up in the code. Try with reinstalling MTA or just switch to English language.
  21. SpecT

    Verdana.tff

    Could you run again the MTADiag to see if it still can't read it.
  22. SpecT

    Verdana.tff

    You need to replace "userprofile" with the name of your Windows profile. There is an easier way: Locate to C:\Windows\Fonts and then drag the verdana.tff (the downloaded one) file into this folder. It will install it if it's missing.
  23. SpecT

    CD16 Error

    Well okay but it has no sense to be a problem from MTA if it happens only when you try to join their server.. Have you tried to use a VPN ? There are free ones with which you could test.
  24. Oh, my bad... getTeamName gets the name of a team element not player's team name. ? function stage100() setTimer(stage110, 10000, 1) for i, c in ipairs(alliedteams) do for k, v in ipairs(getPlayersInTeam(getTeamFromName((c)[1]))) do if isElementWithinColShape(v, rc) then local theVehicle = getPedOccupiedVehicle ( v ) if theVehicle then outputChatBox("#54F764[Rescue-Mission]: #FF0000Warning! You are in a vehicle, get off your vehicle to earn progress!", v, 255, 0, 0, true) else triggerClientEvent("draw100", v) end end end end local playersInCol = getElementsWithinColShape(rc, "player") if #playersInCol > 0 then for i, player in ipairs(playersInCol) do local playerTeam = getPlayerTeam(player) if playerTeam and getTeamName (playerTeam) == "Blue Team" then outputChatBox("Can't trigger event, blue team is in colshape", root) return end end triggerClientEvent("showheli", root, hiddenmarker) helicopter = true; end end
  25. Okay, so I think the second one is better BUT you forgot that getElementsWithinColShape returns a table. So you can't just use getTeamName by passing it the whole table ? It should be something like this: function stage100() setTimer(stage110, 10000, 1) for i, c in ipairs(alliedteams) do for k, v in ipairs(getPlayersInTeam(getTeamFromName((c)[1]))) do if isElementWithinColShape(v, rc) then local theVehicle = getPedOccupiedVehicle ( v ) if theVehicle then outputChatBox("#54F764[Rescue-Mission]: #FF0000Warning! You are in a vehicle, get off your vehicle to earn progress!", v, 255, 0, 0, true) else triggerClientEvent("draw100", v) end end end end local playersInCol = getElementsWithinColShape(rc, "player") if #playersInCol > 0 then for i, player in ipairs(playersInCol) do if getTeamName ( player ) == "Blue Team" then outputChatBox("Can't trigger event, blue team is in colshape", root) return end end triggerClientEvent("showheli", root, hiddenmarker) helicopter = true; end end OFF-TOPIC: It's a good practice to format your code in a way that is easy to read and track if there are any obvous mistakes. Especially if you are going to keep growing into the coding sphere. ?
×
×
  • Create New...