-
Posts
1,105 -
Joined
-
Last visited
Everything posted by Aibo
-
if your event code is server-side (is it?), then why it has client-side functions like guiSetInputEnabled(false) and guiSetVisible(wdwLogin, false)?
-
because you've messed it up again. (what name? what guy?): https://wiki.multitheftauto.com/wiki/Resource:Race addEvent("onPlayerPickUpRacePickup", true) addEventHandler("onPlayerPickUpRacePickup", getRootElement(), function (pickupID, pickupType, vehicleID) -- and «source» is the player here if (vehicleID) and (vehicleID == 425) then -- since vehicleID is only passed with vehiclechange pickup type local acc = getPlayerAccount(source) local accountdata = tonumber(getAccountData(acc, "exp")) if not accountdata then accountdata = 0 -- set 0 exp if player has no exp in account data yet end accountdata = accountdata+10 -- increase exp, cause he picked up hunter setAccountData(acc, "exp", accountdata) setElementData(source, "exp", accountdata) outputChatBox("Exp earned: 10, total Exp: ".. accountdata, source, 0, 255, 0) end end) oops, too late
-
maybe change event arguments? like, you dont have «attacker» now
-
local gate1 = createObject(980,-1530.9265136719,482.71939086914,8.6744327545166,0,0,0) local marker1 = createMarker(-1530.5067138672,482.19729614258,6.4375,"cylinder",8,255,0,0,0) function openGate(player) if getElementType(player) == "player" then -- check if a player element hit the marker local team = getPlayerTeam" class="kw2">getPlayerTeam(player) -- geting player's team if team and getTeamName(team) == "Navy" then -- if player is in team and team name is "Navy" moveObject (gate1,1500,-1541.51,482.69,8.67) end end end addEventHandler("onClientMarkerHit",marker1,openGate) function closeGate(player) if getElementType(player) == "player" then local team = getPlayerTeam" class="kw2">getPlayerTeam(player) if team and getTeamName(team) == "Navy" then moveObject (gate1,1500,-1530.92,482.71,8.67) end end end addEventHandler("onClientMarkerLeave",marker1,closeGate) JasperRieken, use [lua] or tags please.[b]volk-rus[/b], please stop posting nonsense like «if getElementModel( theTeam ) == Navy then»
-
why you're not using something like onVehicleEnter event then?
-
Ни разу не знаю английский. / запуск сервака на фряхе
Aibo replied to Easterdie's topic in Помощь / Отчеты об ошибках
viewtopic.php?f=106&t=28964 в линукс-сервер разделе есть темы про х64, или совсем с английским никак? -
https://wiki.multitheftauto.com/wiki/OnPlayerWasted first parameter of this event is ammo, not the killer.
-
function restartthisscript() local res = getResourceFromName("randoms") if getResourceState(res) == "running" then restartResource(res) end end
-
function rgb2hex(r,g,b) return string.format("#%02X%02X%02X", r, g, b) end
-
are there any other resources running that can possibly set player money?
-
do you have any money? which gamemode are you using?
-
well elements will be created regardless whether you save a pointer to them in a variable or not.
-
thats the whole code? are you sure that script local «player» variable is not reassigned somewhere else? anyway its a bad decision to store local player in «player» variable, can be confusing.
-
well you haven't posted any code.
-
why are you putting them in the same variable?
-
you are already doing it with setPedHeadless (though the ped element is wrong) local myMarker = createMarker ( -720,965,11.78, "corona",3,255,0,0,255 ) function MarketHit ( hitElement, mathingDimension ) if getElementType (hitElement) == "player" then setPedHeadless(hitElement, true) outputChatBox ("You lost your head.", hitElement, 255, 140, 0) end end addEventHandler ("onMarkerHit", myMarker, MarkerHit) PS: corona should be quoted, cause it's a string argument. well unless corona is a variable.
-
have you added your sound to meta.xml?
-
function/variable name must not start with a number. PS: http://www.lua.org/pil/1.3.html
-
here: function renamePlayer() -- first we check if player name is "Player" or "pLayEr", by lowering the case -- using string.lower() and comparing the result with "player": if string.lower(getPlayerName(source)) == "player" then -- then we generate a string with new name like "Player_35" and put it in local variable: local name = "Player_" .. math.random(1, 99) -- this will generate a new name if a player with previously generated name already exists: while getPlayerFromName(name) do name = "Player_" .. math.random(1, 99) end -- setting a new player name from local name variable: setPlayerName(source, name) end end addEventHandler ( "onPlayerJoin", getRootElement(), renamePlayer)
-
yuo should've made str local, and there's no point in splitting the message of you're using string.find, imo. and "hacker" will already be found by "hack". WorksToCensor = { "hack", "cheat" } function checkorcensure(message,messageType) for k, word in ipairs(WorksToCensor) do if string.find(message:lower(), word, 1, true) then outputChatBox("Use /report!", source) cancelEvent() return end end end addEventHandler("onPlayerChat", getRootElement(), checkorcensure)
-
tonumber() returns either number or nil, so i dont think type(amount) == "number" is necessary. unless i'm wrong ofc :3
-
is it really necessary trigger an event for EVERY map? why dont just send a table with all the maps?
-
you cant do that in map editor, you need to script that.
-
on resource start you're getting a vehicle (which player is in) pointer to a variable (theVehicle). later player vehicle can change, but theVehicle variable will point to the old vehicle. also the gravity of the new vehicle will be standard again. so either get player vehicle and set graivty with marker/colshape events (but dont place vehicle change pickups if you dont want the gravity to be reset) or use some vehicle event like onClientVehicleEnter.
-
but vehicle can change, and you're not updating theVehicle variable.
