-
Posts
551 -
Joined
-
Last visited
Everything posted by AGENT_STEELMEAT
-
Well then what exactly are you trying to do? Also, a single if statement is not going to be noticeable.
-
Wrong functions - use the new dbConnnect, dbQuery, dbExec, dbPoll, and dbFree functions, not the old mysql module.
-
What code are you using to connect to the server?
-
Why don't you want to use an if statement, that makes no sense.
-
The clientscript is already there, the example is in two sections...
-
Depends on your script's efficiency and the latency between the mta server and the mysql server, among other things. For smaller server it may not be as fast, but for larger scale servers it almost a necessity.
-
Your going to cause an infinite loop with that. Not to mention your forgot a ')'. I am assuming you want to restart the scoreboard every time another resource is started. In that case: --This function is executed when a resource starts, it restarts the scoreboard (UNLESS it was the scoreboard that was reset). local function resourceStart(startedResource) local resourceName = getResourceName(startedResource) if resourceName ~= "scoreboard" then restartResource(getResourceFromName("scoreboard")) end end addEventHandler("onResourceStart", root, resourceStart)
-
There aren't any security issues, unless you cause them. MySQL is the only good solution.
-
Nobody ever pays me in kisses... *points head down and cries*
-
Because it would make sense just to make a small modification to the zombies resource, and take care of it all serverside (like the rest of the resource).
-
Why would the source be a player? lol. In this case, do this: addEvent( "onZombieSpawn", true ) --ADD THIS addEvent("onZombieCreate", true) function RanSpawn_Z ( gx, gy, gz, rot) local safezone = 0 local allradars = getElementsByType("radararea") for theKey,theradar in ipairs(allradars) do if getElementData(theradar, "zombieProof") == true then if isInsideRadarArea ( theradar, gx, gy ) then safezone = 1 end end end if safezone == 0 then if table.getn ( everyZombie ) < newZombieLimit then if not rot then rot = math.random (1,359) end randomZskin = math.random ( 1, table.getn ( ZombiePedSkins ) ) local zomb = createPed( tonumber( ZombiePedSkins[randomZskin] ), gx, gy, gz ) if zomb ~= false then setElementData ( zomb, "zombie", true ) table.insert( everyZombie, zomb ) setTimer ( function (zomb, rot) if ( isElement ( zomb ) ) then setPedRotation ( zomb, rot ) end end, 500, 1, zomb, rot ) setTimer ( function (zomb) if ( isElement ( zomb ) ) then setPedAnimation ( zomb, "ped", chaseanim, -1, true, true, true ) end end, 1000, 1, zomb ) setTimer ( function (zomb) if ( isElement ( zomb ) ) then setElementData ( zomb, "status", "idle" ) end end, 2000, 1, zomb ) triggerClientEvent ( "Zomb_STFU", getRootElement(), zomb ) --ADD THIS triggerEvent("onZombieCreate", zomb) end end end end addEventHandler( "onZombieSpawn", getRootElement(), RanSpawn_Z ) In zombie_server.lua in the zombies resource. Then, just use the onZombieCreate event.
-
addEvent("onZombieSpawn",true) addEventHandler("onZombieSpawn",root, function() giveWeapon ( source, 8, 1, true ) outputChatBox ( "zomb with weapon!" ) end) Try that.
-
No to all the above. Simply do this to replace a MTA function with one of your own: _getPlayerMoney = getPlayerMoney --store the old function function getPlayerMoney() --Your code here end setPlayerMoney clientside sets the local players money, but does not sync it with the server.
-
Try again, I fixed some things I missed in my ninja-posting.
-
Better than using server-side text functions (raping bandwidth and not that pretty), just use client-side dx drawing functions: --Serverside --This function freezes a player for the given amount of time in MILISECONDS. --If root is passed, all players will be frozen. function freezePlayer(player, freezeLength) triggerClientEvent(player, "onServerFreezePlayer", root, freezeLength) end --Clientside local freezeTicks --This funciton freezes the local player for the given length of time, or indefintley if freezeLength == 0 function freezeLocalPlayer(freezeLength) setElementFrozen(localPlayer, true) if freezeLength > 0 then freezeTicks = freezeLength else freezeTicks = false end addEventHandler("onClientRender", root, drawFreezeScreen) end addEvent("onServerFreezePlayer", true) addEventHandler("onServerFreezePlayer", root, freezeLocalPlayer) --This function draws the freeze screen local screenWidth, screenHeight = guiGetScreenSize() local textColor = tocolor(255, 0, 0) function drawFreezeScreen() if freezeTicks then if freezeTicks == 0 then setElementFrozen(localPlayer, false) freezeTicks = nil removeEventHandler("onClientRender", root, drawFreezeScreen) return end dxDrawText(0, 0, screenWidth, screenHeight, color, 1, "You have been frozen! Time remaining: "..tostring(math.ceil(freezeTicks / 100)), "center", "center") freezeTicks = freezeTicks - 1 else if isElementFrozen(localPlayer) then dxDrawText(0, 0, screenWidth, screenHeight, color, 1, "You have been frozen!", "center", "center") else freezeTicks = nil removeEventHandler("onClientRender", root, drawFreezeScreen) end end end NOTE: Untested, also I corrected myself like 3 times lul. 1 - The serverside function freezePlayer will freeze the given player for the given amount of time (in miliseconds). If the player is root, then all players will be frozen. If the time is 0, the player(s) will be frozen indefinitley. 2- Clientside, the function freezeLocalPlayer is called by the server (via the event onServerFreezePlayer), and it freezes the local player. If the freeze length is greater than 0, it will store the freeze length. 3- The function drawFreezeScreen will draw the message to the player, and also will determine when to unfreeze the player. So now, when a player buys a player freeze, just call freezePlayer. You can also use freezeLocalPlayer clientside to freeze the local player clientside.
-
Rather than a 'blacklist', just use a certification system that reserves a name / tag to one server. If any other servers try to post to the master server, block them. Also, the reports system would be just like the community resource report section - anyone can argue/appeal publicly, and people that abuse it will be blocked from it. This does not have to be so complex.
-
I'm not sure about linux.
-
I don't map, lol, I'm a scripter. For mastertop (or anything that just warps a player to a place), it's just a simple command: local function onMastertopCommand(player) --Determine the element to warp (either the player, or their vehicle). local vehicle = getPedOccupiedVehicle(player) if vehicle and getVehicleController(vehicle) == player then player = vehicle end --Warp em', adding 5 to the position, so the player does not get stuck in the road. --Also, reset their rotation on the X and Y axis. local _, _, rotZ = getElementRotation(vehicle) setElementPosition(player, posX, posY, posZ + 5) setElementRotation(player, 0, 0, rotZ) end addCommandHandler("mastertop", onMastertopCommand) I have a headache right now, so I can't guarantee that it will work. Anyway, glad you enjoy the resources .
-
People 'spamming' then system will be obvious - processing of reports will be done by hand, not automatically. If someone has no good argument on why the server should not be certified, they will be ignored.
-
While I'm flattered by this, I don't think that is the best idea. There is the matter of corruption and accusations when you have a team of people doing something like that. How about we just have a public application process? All server owners must publicly apply to have their server 'certified' - meaning their name (including clan tags) are reserved in the server browser. If there are no valid complaints, then grant the owner a 6 - 12 month certificate, which would expire and have to be renewed. Also have a reports system where users can report servers for improper conduct (both other servers trying to copy others, and maybe 'certified' servers doing bad things).
-
Nevermind. local function playGunfireSound(weaponID) local muzzleX, muzzleY, muzzleZ = getPedWeaponMuzzlePosition(source) if weaponID == 22 then --colt45 local sound = playSound3D("sounds/Colt45.mp3", muzzleX, muzzleY, muzzleZ, false) setSoundMaxDistance(sound, 30) end end addEventHandler("onClientPlayerWeaponFire", root, playGunfireSound) 1 - This function does not need to be global, so make it local. 2 - It is not a good practice to have function names the same as event names. 3 - You want to find the muzzle position of the source player (the player who shot the weapon), not the local player. If the local player does shoot, however, source will be the local player. So use source.
-
What exactly is wrong? Is the sound not playing at all, is it too loud, being heard from to great a distance? Be specific.
-
Ralph, do you mean mta resources for your server, or the CPU usage of your server? If its CPU usage your talking about, try changing your Energy Options in the windows control panel, to ensure that your CPU doesn't clock-down to save energy.
-
Hey all, I had these two small resources lying around, and figured I'd upload them for all to use. The first one is PlayerBlips2, a simple resource that implements player blips for each player. Every player will have a blip on the radar and map. The color of the blip will match their nametag color. This is similar to the freeroam blips system, but a very simple standalone system (less than 37 lines of code). I don't expect many people to need/want this, but I uploaded it anyway. The second one is VehicleBlips, another simple resource that implements vehicle blips for each vehicle. All streamed in vehicles will have a small gray blip on the radar and map, just like SA:MP. If you have any requests for additional features (i.e some exported functions) let me know - I will only consider implementing features that you all suggest.
-
REPORT COMMUNITY CENTER RESOURCES HERE
AGENT_STEELMEAT replied to SATAN's topic in General MTA discussion
oh my god https://community.multitheftauto.com/index.php?p= ... ls&id=3205 CLICK CLICK CLICK SPACES IN RESOURCE NAME TITTIES ASS WHOO HOO OH MY GOD SKEET SKEET SKEET Also, in addition to that, I'd like my safezones and superglue resources removed from the community as well.
