Jump to content

SpecT

Members
  • Posts

    656
  • Joined

  • Days Won

    9

Everything posted by SpecT

  1. SpecT

    Shader bug.

    Hey and welcome to the Forums! The most frequent error seems to be "CIncludeManager: Illegal path". Also about this: MTA path: C:\..GTA_SA GTA path: C:\..GTA_SA\Grand Theft Auto San Andreas Have you tried to install GTA SA and/or MTA SA in different locations ? Maybe on another local disk ? One or more of the folders from the full path of MTA migth have illegal chars set as name thus causing it to not find the required files for some resources. I can't see the full path so I'm only guessing. I don't know how exactly you have installed the game and the mod but from the paths I have seen it seems kinda messy (imo). Here is what you can try to do: 1) Uninstall both GTA SA and MTA SA. 2) Make a folder for example Games. 3) Install GTA SA in Games/GTA San Andreas. 4) Install MTA SA in Games/MTA San Andreas. If this doesn't help - repeat but install them on a different local disk. It would be nice if someone who knows the real reason behind this "CIncludeManager: Illegal path" error tells how to deal with it.
  2. SpecT

    find

    Hey, Well if you are using getPlayerFromPartialName then just remove the :lower() from the lines 2 and 5.
  3. How can I convert water into wine ? This is how your question looks like to me... ? (no offense) Now on topic: Unfortunately, there is no simple way to do it. You will need 3D modelling (to re-create the objects from Assetto Corsa as GTA:SA objects) and mapping skills (to arrange them) to do that. You can look in the Community site for similar resources (race tracks ?) or on the internet for custom race tracks which you can insert in MTA (with script).
  4. Your MySQL server might be only listening to local connections. I'm not 100% sure if this would help but why don't you try using localhost (or 127.0.0.1) instead as a host address ?
  5. SpecT

    utf8.match

    Hey, Well you can use string.match and check whether there are any uppercase letters. If it returns nill then all the letters are lowercase and everything is good. if string.match(text, '%u') == nil then -- all chars are lowercase else -- an uppercase letter is found end I hope I understood correct what you want to do.
  6. Welcome to the Forums! Where are you trying to connect to the MySQL server from - from your PC or an MTA server hosted on the same VPS ? Also could you show the code with the dbConnect part (don't forget to remove the sensitive information!).
  7. For those who still wonder ? The idea of drawing on top of it with dx functions was actually good and it works! Here is the result from what I tried: This was done by drawing a rectangle with the size of the screen and some text over it and as you can see you can barely see the ***NETWORK TROUBLE*** text. function onGotProblem(status) if status == 0 then -- we got a problem addEventHandler("onClientRender", root, networkWarning) else -- all good removeEventHandler("onClientRender", root, networkWarning) end end addEventHandler("onClientPlayerNetworkStatus", root, onGotProblem) function networkWarning() -- Draw your stuff here dxDrawRectangle(...) dxDrawText(...) end
  8. SpecT

    button

    You can call the function which handles the onClientGUIClick event.
  9. Well you will have to search through all the client-sided scripts and find the onDownloadFinish event.
  10. SpecT

    Sd 11 Ejfa

    Yeah the virus might have blocked the windows update service thus this patch can't be installed. Then try with other antivirus product. Thats why I told you to upload the injector.exe file to virustotal website to see which antivirus programs can detect it and use one of them to fight it. If it spred widely on your PC and you can't deal with it you should either reinstall Windows or as I said above send the computer to a PC service.
  11. SpecT

    Sd 11 Ejfa

    Well I guess you are missing an update for Windows 7 which might be needed for Malwarebytes. From Malwarebytes' forum they say you will need the KB4474419 update in order to keep using their programs. I'm not 100% sure if this is gonna work tho but give it a try. Here is a link for the patch: https://www.catalog.update.microsoft.com/Search.aspx?q=kb4474419 windows 7 Download the last one as it is for 64-bit Win OS. Then try to install again Malwarebytes. BTW Windows 7 has many holes in the security and if you don't install the updates things might get worse after time (more viruses, etc..). Also this is a forum for support regarding MTA:SA not a computer support one and for such problems please search in other forums about viruses and/or PC problems and try to get them sorted out yourself or just send the computer to a PC repair service.
  12. SpecT

    Sd 11 Ejfa

    Well it looks you are definitely infected. You can upload the injector.exe to https://www.virustotal.com/ to see which antivirus programs can detect it. I think that Malwarebytes could help you in this situation. Here is a link to download: https://www.malwarebytes.com/mwb-download/thankyou/ Do a full scan and remove the suspicious files it finds. It would be good if you send a log or a screenshot of the files it found.
  13. You don't need the onMarkerHit event. Use isElementWithinMarker to check in the freezeObject function if the player is inside the marker. Like this: function freezeObject(thePlayer) if isElementWithinMarker(thePlayer, playerMarker) then local currentFreezeStatus = isElementFrozen ( testdoor ) if currentFreezeStatus then setElementFrozen ( testdoor, not currentFreezeStatus ) outputChatBox("You have opened the door!",255,255,255) else setElementFrozen ( testdoor, not currentFreezeStatus ) outputChatBox("You have closed the door!",255,255,255) end end end BTW when you paste code here please use the Code button (next to Quote) in the text editor to be easier to read it here.
  14. Well I can but you won't learn anything expecting someone else to do it for you. You will need getElementPosition to get the x, y and z coordinates for the player and the object and then compare them with the getDistanceBetweenPoints3D as I have shown you in the post above. At least give it a try and show us what you tried and we will correct it if it's needed.
  15. You can use the function getDistanceBetweenPoints3D to get the distance between the player and the object. For example: if getDistanceBetweenPoints3D(pX, pY, pZ, oX, oY, oZ) <= 50 then -- first 3 args are player's position, the other 3 args are object's position -- do your stuff end
  16. SpecT

    Sd 11 Ejfa

    Hello, Please read the information written by @Dutchman101 in this topic about this error. If you have the injector.exe file running then your PC might be infected with a virus so it would be best to get a good antivirus software and do a full scan! Also it would be good to post the logs from MTADiag.
  17. Hey, Editing the admin panel to store the teams in an SQL database might be difficult for you as it is not like flipping a switch (changing a setting). There are many resources already made for this in the community site. Check here: https://community.multitheftauto.com/index.php?p=resources&s=list&name=teams&descr=&category= Some of them are reading a teams.xml file which contains all the teams and their details like name, tags, colors (you will have to manually add them in this file). And there are ones that get the current created teams (i.e. by Admin panel) and once the resource gets stopped (or server shuts down) it saves them in a file and once the resource is started it creates them back. Just try them and use what fits your needs. But if you want to create your own resource (and have scripting knowledge) we can help you if you are having hard time making it.
  18. Hey, To update your server go to https://nightly.multitheftauto.com/ and download latest version of the server you are using ( windows or linux [32 or 64bit] ). For Linux: Then replace the server files you have with the newer ones. For Windows: Place the .exe file you downloaded in the server folder and then use it to start the server. You won't need the old MTA Server exe file. ! PS: Moved the topic to the server support category as it is not related to scripting!
  19. Hey, The problem is that the events onVehicleStartExit and onPlayerQuit have different parameters and your function is made to handle the arguments only from onVehicleStartExit. You can check out the documentations (the links above) of the two events and see what parameters they have. Simple example: when a player leaves (onPlayerQuit) the first argument is quitType and in your function it's thePlayer. This is why you get "Quit" as player and it can't get the occupied vehicle of "Quit" as it's expecting a ped not string. This should do the trick: function ExitCar (playerORquitType, seat) local thePlayer = playerORquitType local seat = seat if(type(thePlayer) ~= "player") then -- if the function is triggered by onPlayerQuit thePlayer = source -- in onPlayerQuit the player who left is "source" end if(type(seat) ~= "number") then -- if the function is triggered by onPlayerQuit; there is no argument for seat seat = getPedOccupiedVehicleSeat(thePlayer) -- so we get the seat of the player end local theVehicle = getPedOccupiedVehicle (thePlayer) local vehid = getElementID (theVehicle) if vehid == "1" or vehid == "2" or vehid == "3" or vehid == "4" or vehid == "5" or vehid == "6" then local onMark = getElementData(thePlayer, "onMark") or false -- we put this in a variable so we don't make unnecessary calls if onMark then if seat and seat == 0 then destroyElement(onMark) end end end end addEventHandler("onVehicleStartExit", getRootElement(), ExitCar) addEventHandler("onPlayerQuit", getRootElement(), ExitCar) *PS: Please, don't just copy and paste it but try to understand how it works. It might help you in future similar situations.
  20. function setToner(veh, t1, t2, t3, p1, p2, p3) -- p1, p2 and p3 are missing from the call ... end addEvent("setToner", true) addEventHandler("setToner", getRootElement(), setToner) It throws you errors cuz the part where you call the "setToner" function misses the last 3 arguments. Find where you trigger the "setToner" event and add the missing p1, p2 and p3 arguments.
  21. Hello, What exactly doesn't work ? You didn't tell us if there are any errors (/debugscript 3) and gave no information about what the problem with this script is. Also if this script is not written by you then it would be best to ask its creator for assistance! We are here to help you with a script you wrote and we expect you to have at least some kind of an idea what might be wrong. Simply dropping the full script with 300+ lines here and asking someone to get it fixed for you isn't the best idea. ?
  22. I just tested it and it works fine. Player gets respawned after 10 seconds at the place of death. If it keeps spawning ONLY at the LS hospital then you probably have a script running which does that.
  23. Hey, Sorry about the incorrect info about the broph.lua file. I had an older version of the play resource. This should be the code of broph.lua : local vehiclesToSpawn = { } local spawnpoints = { {-11.054133415222,2329.2023925781,24.303375244141,90}, {-18.531280517578,2323.3835449219,24.303373336792,270}, {-27.869777679443,2321.8896484375,24.303373336792,0}, {-10.329539299011,2336.9331054688,24.303375244141,128}, } local vehicleDestroyTimers = {} local validSkins = {60} local playerVehicles = {} local function spawn(player) if player and isElement(player) then local x,y,z,r = unpack(spawnpoints[math.random(1,#spawnpoints)]) spawnPlayer(player,x+math.random(-3,3),y+math.random(-3,3),z,r,validSkins[math.random(1,#validSkins)],0,0) fadeCamera(player, true) setCameraTarget(player, player) end end local function onJoin() spawn(source) end local function onWasted() local t = tonumber(get("playerRespawnTime")) or 5000 setTimer(spawn,(t > 50 and t or 50),1,source) end local function destroyPlayerVehicles() local vehicles = playerVehicles[source] for _,vehicle in ipairs(vehicles) do if isElement(vehicle) then destroyElement(vehicle) end end playerVehicles[source] = nil end local function onEnter(player) local t = tonumber(get("vehicleRespawnTime")) or 60000 source.damageProof = false source.frozen = false local vehicledata = vehiclesToSpawn[source] setTimer(createNewVehicle,(t > 50 and t or 50),1,vehicledata) vehiclesToSpawn[source] = nil if not playerVehicles[player] then playerVehicles[player] = {} addEventHandler("onPlayerQuit",player,destroyPlayerVehicles) end table.insert(playerVehicles[player],source) removeEventHandler("onVehicleEnter",source,onEnter) end local function destroyVehicle(vehicle) if vehicle and isElement(vehicle) and getElementType(vehicle) == "vehicle" then destroyElement(vehicle) end end local function destroyTimer() if vehicleDestroyTimers[source] and isTimer(vehicleDestroyTimers[source]) then killTimer(vehicleDestroyTimers[source]) end removeEventHandler("onVehicleEnter",source,destroyTimer) end local function onExit() local t = tonumber(get("vehicleExpireTime")) or 600000 vehicleDestroyTimers[source] = setTimer(destroyVehicle,(t > 50 and t or 50),1,source) addEventHandler("onVehicleEnter",source,destroyTimer) end function createNewVehicle(vehicledata) local m,x,y,z,r = unpack(vehicledata) local vehicle = Vehicle(m,x,y,z,0,0,r) vehicle.damageProof = true vehicle.frozen = true vehiclesToSpawn[vehicle] = vehicledata addEventHandler("onVehicleEnter",vehicle,onEnter) addEventHandler("onVehicleExit",vehicle,onExit) end local function initScript() resetMapInfo() local players = getElementsByType("player") for _,player in ipairs(players) do spawn(player) end for _,vehicledata in ipairs(vehiclesToSpawn) do createNewVehicle(vehicledata) end addEventHandler("onPlayerJoin",root,onJoin) -- addEventHandler("onPlayerWasted",root,onWasted) -- commenting this will stop respawning the player end addEventHandler("onResourceStart",resourceRoot,initScript) It should work just fine now.
  24. Hey, Yeah, it's possible. Unfortunately, not with one line of code. ? A client-sided way to do it is to save the serials of the players you don't want messages from in a table and then save them in an xml file (you will need load and save operations of course - XML functions). And when the event onClientChatMessage is triggered check whether the source's serial is one of the ones in the xml file/table. If it is => cancelEvent() *Note that you will have the get player's serial from server! The server-sided way is to put the serials in a table and then convert it toJSON and save it as account data (setAccountData). To load them you will need to get them (getAccountData) and convert to a table (fromJSON). The thing is that you will need to cancel the onChatMessage event and re-write the operations of sending the messages to all the players (with a for loop). And then to do the filtering who should and who shouldn't receive the message by checking the serials in the table. In my opinion the client-sided one is better and easier. ? Especially if you are new to scripting. I hope I gave you enough information on how it can be done.
  25. Hello and welcome to the Forums! To disable the respawn function in "play" gamemode ( resources/[gamemodes]/play ) you will have to edit the broph.lua file. You can simply comment/remove the 5 lines where the even handler is added. addEventHandler("onPlayerWasted", root, function() --setTimer(spawn, 1800, 1, source) -- you can comment it like this to prevent it from running end ) Also in your function respawnPlayerAfterDied the arguments in the spawnPlayer function are wrong. Please check the wiki documentation. It should be something like this: function respawnPlayerAfterDied(p) local x,y,z = getElementPosition(p) -- changed from "thePlayer" to "p" spawnPlayer(p, x, y, z) -- corrected the arguments fadeCamera(p, true, 5) outputChatBox("Tedavi oldun, hadi yine iyisin.",p,255,0,0) end
×
×
  • Create New...