-
Posts
1,105 -
Joined
-
Last visited
Everything posted by Aibo
-
maybe you have an error somewhere else.
-
Lua doesn't support ++/-- operators, as i recall. Ranking = Ranking-1 this shouldn't give any errors, unless Ranking variable is nil or not a number.
-
as i recall, dxscoreboard supports the same exported functions as original scoreboard resource: https://wiki.multitheftauto.com/wiki/Dxscoreboard
-
xmlSaveFile
-
executeCommandHandler
-
"thePlayer" is not a player element here, it's player's previous account. use "source" instead. and i bet you'll need to recount team members when you add a player to the team.
-
nop, you'll need to find some event (i suggest onVehicleDamage when vehicle health below 250, if i remember correctly when fire starts) and set it damageproof, as Doomed_Space_Marine suggested. and then when you put out the fire - set it back to normal. though i dont see a point to make vehicles burning this way, they'll be indestructible.
-
you cant post a single line that gives error and expect help. that way people only can help you with syntax errors. and if you have some function which has some "thePlayer" argument, it doesnt mean its not nil. where's this function called? what is passed to this function?
-
with the script above it works fine, i've tested, you can extinguish the fire and it stops > no explosion. that is of course if you'll make it in time. or you want the vehicle not exploding at all when burning? i dont think that can be done easily, cancelling the onVehicleExplode event doesnt help here.
-
i think it will be synced, as long as the vehicle element is synced. well that's my assumption anyway.
-
when you're adding a player to the team, check how many members it has already. if it has reached some limit - dont accept player to the team. https://wiki.multitheftauto.com/wiki/CountPlayersInTeam also see related Team functions.
-
doesnt work at all or doesnt work as intended? PS: i bet you have to also remove the default player damage by cancelling onClientPlayerDamage event. PS2: if then elseif then elseif then elseif then ... end but imo better make a damage table like damage[weaponid] = damageamount to avoid these elseif's.
-
why not leave it be? other people may have the same question.
-
sorry, now i dont get it again.
-
now i get it: fix vehicle with fire extinguisher. here (client-side): function vehicleFireFix(weapon, _, _, _, _, _, element) if weapon == 42 and element and getElementType(element) == "vehicle" then local health = getElementHealth(element) if health < 500 then -- dont want to "fix" healthy cars --fixVehicle(element) -- uncomment to fix the damage model also setElementHealth(element, health + 10) end end end addEventHandler("onClientPlayerWeaponFire", getLocalPlayer(), vehicleFireFix) EDIT: added a health check EDIT2: "gradual" healing, you can change "healing" speed by editing "health + 10"
-
onClientPlayerJoin is not triggered for the player who joined the server, only for other players. use onClientResourceStart.
-
explain exactly how you want to determine the winner.
-
if you dont know, who you post misleading replies like a link to GUI wiki? https://wiki.multitheftauto.com/wiki/Scoreboard if by «modify» you mean adding/removing columns, then use exported functions. PS: race car mod setting can be changed in resource options (well THAT's what in meta are for, and not for editing the meta every time).
-
but reference to a vehicle stored in global "vehicle" variable will be gone next time someone spawns another car. new car will be stored in this variable. element data does really nothing here. yes it says if certain player has a car spawned, but nothing more. to elaborate: player1 spawned a car: player1car1 == true, vehicle = player1's car player2 spawned a car: player2car1 == true, vehicle = player2's car player1 spawned another car. guess who's car will be deleted?
-
it still has only 1 vehicle variable. vehicles = {} function spawnAcar(carID, playerSource) for i,v in ipairs (disallowedVehicle) do if (v[1] == carID) then outputChatBox("This is disallowed vehicle!",source,255,0,0) return false end end local playerX,playerY,playerZ = getElementPosition(source) if vehicles[source] and isElement(vehicles[source]) then destroyElement(vehicles[source]) end vehicles[source] = createVehicle(carID, playerX, playerY, playerZ + 0.5) warpPedIntoVehicle(source, vehicles[source]) end
-
this way server will have only 1 car for all players.
-
function setblur () setTimer(blurroff, 2500, 1) end -- function must be created BEFORE you attach it as a handler, otherwise it'll trigger an error addEvent("onMapStarting") addEventHandler("onMapStarting", getRootElement(), setblur) function blurroff() for theKey,thePlayer in ipairs(getElementsByType("player")) do setPlayerBlurLevel ( thePlayer , 0 ) end -- you forgot this end
-
https://wiki.multitheftauto.com/wiki/GetPedBonePosition
-
local gate4 = createObject(971,1539.0588378906,-1451.3624267578,15.952730178833,0,0,0) local gate5 = createObject(971,1530.3012695313,-1451.3624267578,15.952730178833,0,0,180) local marker4 = createMarker(1534.7189941406,-1451.9150390625,12.6328125,"cylinder",10,255,0,0,0) function openGate(hitPlayer) if getPlayerName(hitPlayer) ~= "JasperRieken" then return end moveObject (gate4,1000,1545.0588378906,-1451.3624267578,15.952730178833) moveObject (gate5,1000,1523.3012695313,-1451.3624267578,15.952730178833) end addEventHandler("onClientMarkerHit",marker4,openGate) function closeGate(hitPlayer) if getPlayerName(hitPlayer) ~= "JasperRieken" then return end moveObject (gate4,1000,1539.0588378906,-1451.3624267578,15.952730178833) moveObject (gate5,1000,1530.3012695313,-1451.3624267578,15.952730178833) end addEventHandler("onClientMarkerLeave",marker4,closeGate) you can change the name. or change it to check ACL group, team, serial, some custom player property, whatever.
