-
Posts
6,097 -
Joined
-
Last visited
-
Days Won
218
Everything posted by IIYAMA
-
I have no idea why the getPedOccupiedVehicle or isPedInVehicle function failed, very strange. I hardly use the isPedInVehicle function, because I always need to know the vehicle element userdata. But this is how I would write it. function speed () local vehicle = getPedOccupiedVehicle (localPlayer) if vehicle then local speedX, speedY, speedZ = getElementVelocity (vehicle) local speed = math.ceil (((speedX^2 + speedY^2 + speedZ^2)^(0.5))*180) dxDrawText (speed.." km/h", x/1.20, y/2.8, x, y, tocolor (255, 255, 255)) end end addEventHandler ("onClientRender", root, speed)
-
I recommend this: for i = 1, 24 do guiGridListAddRow(GUIEditor.gridlist[2]) end -- rest of the code.....
-
Requires an integer. setPedWalkingStyle ( localPlayer, tonumber(id) or 0 ) @Chris!i! What is that loop all about? Doesn't make sense.
-
removeElementData(element,"faction") setElementData(element,"faction",false) I recommend you (if you use that event) to remove the elementdata only when you stop your resource. Also when you start your resource, for every player the elementdata of the key "faction" to false. Because this event does also not triggers if you add elementdata, only when it changes from something to something else.
-
yea, a few smart calculations. About synchronization problems. One of the players will be the syncer, this player will be the one who is going to download and upload with no delay, so it has a little impact at his own network traffic.(and if he lose connection, you can abort the projectile or synced it by somebody else) But for the other players in the server, the projectile is just an effect. Which means if the network can't handle the traffic, you have the choice: send the packet or don't send the packet. Synchronization problems are manage able, if you know how and what functions you have to use. an interval of 300 ms is suit able for the syncer and an interval for other players can be handled with 600 ms. and the reason why I said this all is because circa 7 months ago I started building it, but I never finished it because I started with another resource and I was to lazy to develop it further.
-
Well that depends, everything can be done with lua. You can do the coll checks after the rocket path has been created and during the flying. So yes it is not impossible and high ping maybe annoying. But that is just what it is.
-
The server can synchronize it(serverside >client), except the rocket will never hit anything. The only information the server got, is the streamed element information. So it got disabled most of the time.
-
I had a cheater in my 1.3 server. https://www.dropbox.com/s/r1xi9wjqqvlr0 ... 0.avi?dl=0 He is able to edited his velocity/airbrake. (watch till the end) Cheaters do not get privacy. [2014-09-08 17:53:57] CONNECT: ConTesT[T1] connected (IP: 88.250.163.184 Serial: B6F349555DF1733E1052581A98C20FA1 Version: 1.3.5-9.06531.0) any forum accounts related to this ip? my config: <!-- Comma separated list of disabled anti-cheats. For details see [url=https://wiki.multitheftauto.com/wiki/Anti-cheat_guide]https://wiki.multitheftauto.com/wiki/Anti-cheat_guide[/url] e.g. To disable anti-cheat #2 and #3, use: 2,3 --> <disableac></disableac> <!-- Comma separated list of enabled special detections. A special detection is a type of anti-cheat for (usually) harmless game modifications. Competitive servers may wish to enable special detections, but most servers should leave this setting blank. For details see [url=https://wiki.multitheftauto.com/wiki/Anti-cheat_guide]https://wiki.multitheftauto.com/wiki/Anti-cheat_guide[/url] e.g. To enable special detection #12 use: 12 --> <enablesd></enablesd> <!-- This parameter specifies if/when the <minclientversion> setting is automatically updated. Keeping <minclientversion> updated can help reduce cheating. Note: The instant setting (2) is only recommened for competitive servers. Values: 0 - disabled, 1 - enabled (delayed by a few days), 2 - enabled (instant) ; default value: 1. --> <minclientversion_auto_update>1</minclientversion_auto_update>
-
Well you could check them manualy and if they are you can add in the meta.xml(per resource) a new setting, so you can skip them.
-
if you want to use "table" which contains all table functions, you need to loop with pairs instead of ipairs. (table doesn't have a array) for index,data in pairs(table) do outputChatBox(index .. " " .. tostring(data)) end remove function: 0x421580 maxn function: 0x4219a0 insert function: 0x421800 concat function: 0x421ac0 pack function: 0x421900 unpack function: 0x4216b0 sort function: 0x4214f0 Will return all table functions + index. So now you know where the "unpack" function comes from. value1,value2,value3 = table.unpack(myTable) value1,value2,value3 = table["unpack"](myTable)
-
local theSupermarket = { "oranges", -- index 1 "apples", -- index 2 "cheese", -- index 3 "pizza", -- index 4 } for index,content in ipairs(theSupermarket) do outputChatBox("The index is: " .. index .. ", the content is: " .. content .. ", bon appetit!") end
-
Maybe you should first correct your question before you go, , because it doesn't make sense.
-
You need to send the spawned car(element) back to clientside(after you spawn a vehicle), so you can define the spawnCar variable. and setElementVisibleTo is a server side function. https://wiki.multitheftauto.com/wiki/Se ... tVisibleTo orange = server red = client blue = shared
-
debug your code if it doesn't work -_-" outputDebugString(tostring(button) .. " " .. tostring(spawnCar)) anyway where is spawnCar defined?
-
https://wiki.multitheftauto.com/wiki/On ... layerSpawn
-
local markerTableData = destinationCoords[math.random ( #destinationCoords )] local x = markerTableData[1] local y = markerTableData[2] local z = markerTableData[3] startMarker = createMarker ( [strike]destinationCoords,[/strike] x, y, z, "cylinder", 3, 255, 255, 51 )
-
you can cry and learn nothing or you can debugging. https://wiki.multitheftauto.com/wiki/Debugging
-
addCommandHandler("createInvisibleBlip", function(player) local blip = createBlipAttachedTo(player, 0, 3, 200, 200, 200) outputChatBox("hide blip ".. tostring(setElementVisibleTo(blip,player,false)),player) end) Returns true, but result is incorrect. If I can't set the visibility, it should return false instead of true.
-
Difine the variable as local, before creating the function. Local's will be active after they have been set. local initComponents addEventHandler("onResourceStart", resourceRoot, function () --[[Code... ... ...]] initComponents() end) function initComponents() -- Code... end
-
function myFunction () end -- global access local myFunction = myFunction -- local access Well, you always can make more blocks with the same variable, can`t you? Global access for other files and a both the function. Local access for everything under the function.
-
anyway, why are you use this variable for defining the ped that must be teleported in? Because now ped/peds will be shared with other taxi drives. and why don't you check if client1 is an element? Always keep an eye on the unpredictable. You should save everything with elementdata, tables or a database per player. Like you did on line 8. and you should debug your code before you ask again why it doesn't work. outputDebugString("It doesn't get triggered!!!! Please try again!") /debugscript 3 Here a nice example: https://wiki.multitheftauto.com/wiki/Debugging
-
Try something like this: local markerLS = createMarker (1784.78, -1702.06, 12.50, "cylinder", 2, 255, 0, 0, 255) local blipLS = createBlipAttachedTo (markerLS, 40) local markerLV = createMarker (1074.43, 1292.71, 9.82, "cylinder", 2, 255, 0, 0, 255) local blipLV = createBlipAttachedTo (markerLV, 40) local markerSF = createMarker (-2052.80, 144.87, 27.83, "cylinder", 2, 255, 0, 0, 255) local blipSF = createBlipAttachedTo (markerSF, 40) local visibilityTable = { ["LS"]={markerLS,blipLS}, ["LV"]={markerLV,blipLV}, ["SF"]={markerSF,blipSF} } local vehicleJobSave = {} local changeVisibleJobElements = function (player,job,status) local jobTable = visibilityTable[job] if jobTable and type(status)== "boolean" then for j=1,#jobTable do local element = jobTable[j] if isElement(element) then setElementVisibleTo(element,player,status) end end end end local lsjobser = function () local carLS = createVehicle (440, 2460.52, -2004.38, 13.54) warpPedIntoVehicle(source, carLS) local lastCar = vehicleJobSave[source] if lastCar and isElement(lastCar) then destroyElement(lastCar) end vehicleJobSave[source] = carLS changeVisibleJobElements(source,"LS",true) end addEvent ("givePlayerJobLS", true) addEventHandler ("givePlayerJobLS", root, lsjobser) local moneyLS = function (attackerLS) if (attackerLS) and (attackerLS ~= source) then givePlayerMoney(attackerLS, 3000) setPlayerWantedLevel(attackerLS, getPlayerWantedLevel(attackerLS)+2) local lastCar = vehicleJobSave[attackerLS] if lastCar and isElement(lastCar) then destroyElement(lastCar) end vehicleJobSave[attackerLS] = nil changeVisibleJobElements(attackerLS,"LS",false) end end addEventHandler( "onMarkerHit", markerLS, moneyLS ) local lvjobser = function () local carlv = createVehicle (440, 2460.52, -2004.38, 13.54) warpPedIntoVehicle(source, carlv) local lastCar = vehicleJobSave[source] if lastCar and isElement(lastCar) then destroyElement(lastCar) end vehicleJobSave[source] = carlv changeVisibleJobElements(source,"LV",true) end addEvent ("givePlayerJobLV", true) addEventHandler ("givePlayerJobLV", root, lvjobser) local moneyLV = function (attackerLV) if attackerLV and attackerLV ~= source then givePlayerMoney(attackerLV, 6000) setPlayerWantedLevel(attackerLV, getPlayerWantedLevel(attackerLV)+4) local lastCar = vehicleJobSave[attackerLV] if lastCar and isElement(lastCar) then destroyElement(lastCar) end vehicleJobSave[attackerLV] = nil changeVisibleJobElements(attackerLV,"LV",false) end end addEventHandler( "onMarkerHit", root, moneyLV ) local sfjobser = function () local carSF = createVehicle (440, 2460.52, -2004.38, 13.54) warpPedIntoVehicle(source, carSF) local lastCar = vehicleJobSave[source] if lastCar and isElement(lastCar) then destroyElement(lastCar) end vehicleJobSave[source] = carSF changeVisibleJobElements(source,"SF",true) end addEvent ("givePlayerJobSF", true) addEventHandler ("givePlayerJobSF", root, sfjobser) local moneySF = function (attackerSF) if attackerSF and attackerSF ~= source then givePlayerMoney(attackerSF, 10000) setPlayerWantedLevel(attackerSF, getPlayerWantedLevel(attackerSF)+6) local lastCar = vehicleJobSave[attackerSF] if lastCar and isElement(lastCar) then destroyElement(lastCar) end vehicleJobSave[attackerSF]= nil changeVisibleJobElements(attackerSF,"SF",false) end end addEventHandler( "onMarkerHit", root, moneySF ) ------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------- addEventHandler("onResourceStart",resourceRoot, function() local players = getElementsByType("player") for i=1,#players do local player = players[i] for kind,jobTable in pairs(visibilityTable) do for j=1,#jobTable do local element = jobTable[j] if isElement(element) then setElementVisibleTo(element,player,false) end end end end end) addEventHandler("onPlayerJoin",root, function () local player = source for kind,jobTable in pairs(visibilityTable) do for j=1,#jobTable do local element = jobTable[j] if isElement(element) then setElementVisibleTo(element,player,false) end end end end) addEventHandler("onPlayerQuit",root, function () local lastCar = vehicleJobSave[source] if lastCar and isElement(lastCar) then destroyElement(lastCar) end vehicleJobSave[source] = nil end)
-
Perhaps you should try to add "not", because you are doing the opposite of what you are saying. Never use source as parameter or you will not be able to access the source element any more.(in this case the marker itself) and not isPedInVehicle(source) then You never wondering why something isn't working, don't you?
-
They should give more priority to: onPlayerWeaponFire, since those bullets are already can be synced.
-
hmmm, yes. Why is there a onWeaponFire event when people can't create custom weapons serverside. @-stolka- By using a timer, checking the ammo, setting the ammo.
