-
Posts
524 -
Joined
-
Last visited
-
Days Won
2
Everything posted by botder
-
Since about 12th October 2013. Just look up the history on meta.xml on wiki.
-
They are probably using musicmp3 as music provider. You can see failed attempts to play some music in the console, which shows the URL to musicmp3. And it's not a big deal to grab the album cover from the page. (I already made some kind of an API for that page)
-
Or simply create a custom weapon.
-
function isFloat(num) return ((num * 10^5) % 100000) ~= 0 end Should work.
-
https://forum.multitheftauto.com/viewtopic.php?p=708414 Use MTA:Eir or wait for the MTA Devs to implement that streaming.
-
https://wiki.multitheftauto.com/wiki/Resource:Race The race resource has a nice event for that purpose: onPlayerPickUpRacePickup You have to use the parameter vehicleModel to check if the new vehicle will be a hunter (== 425).
-
You are calling saveAccount always with an account element, but you should have passed the player element. That's why the "nil" values are being saved and also loaded, when the player logs in. for i,v in ipairs(getElementsByType("player")) do saveAccount(getPlayerAccount (v)) end addEventHandler("onPlayerQuit", cRoot, function() saveAccount(getPlayerAccount ( source )) end ) function saveAccount(player) local account = getPlayerAccount(player)
-
Except when he is using a module, which provides that function, he already mentioned above you.
-
Tested & works. local ignorelist = {} addCommandHandler("ignore", function (player, cmd, ignored) if (not ignored) then -- Usage: /ignore outputChatBox("Usage: /ignore ", player, 200, 200, 200) return end local ignored = getPlayerFromName(ignored) if (not ignored) then -- Player doesn't exist outputChatBox("Ignore: Player doesn't exist", player, 200, 200, 200) return end if (ignored == player) then -- You can't ignore yourself outputChatBox("Ignore: You can't ignore yourself", player, 200, 200, 200) return end if (not ignorelist[ignored]) then ignorelist[ignored] = {} end if (not ignorelist[ignored][player]) then ignorelist[ignored][player] = true outputChatBox("* You ignore now ".. getPlayerName(ignored), player, 0, 255, 0, true) else ignorelist[ignored][player] = false outputChatBox("* You do not ignore ".. getPlayerName(ignored) .." #00FF00anymore", player, 0, 255, 0, true) end end ) addEventHandler("onPlayerChat", root, function (message, messageType) -- Cancel event to prevent doubles cancelEvent() -- Get the name from the writer local name = getPlayerName(source) -- Write to log (cancelEvent prevents logging) outputServerLog("CHAT ".. name ..": ".. message) -- Send the message if (messageType == 0) then local players = getElementsByType("player") for _, player in ipairs(players) do if (not (ignorelist[source] and ignorelist[source][player])) then outputChatBox(name ..": ".. message, player, 255, 255, 255, true) end end elseif (messageType == 1) then local players = getElementsByType("player") for _, player in ipairs(players) do if (not (ignorelist[source] and ignorelist[source][player])) then outputChatBox("* ".. name .." ".. message, player, 255, 130, 130, true) end end elseif (messageType == 2) then local team = getPlayerTeam(source) if (team) then local players = getPlayersInTeam(team) for _, player in ipairs(players) do if (not (ignorelist[source] and ignorelist[source][player])) then outputChatBox("(Team) ".. name ..": ".. message, player, 255, 255, 255, true) end end end end end )
-
Try some experiments with setCameraMatrix.
-
mysql_query(mysqlHandler,"INSERT INTO housingdata(`name`, `address`, `type`, `interior`, `intlock`, `owner`, `price`, `value`, `income`, `status`, `x`, `y`, `z`, `csX`, `csY`, `csZ`, `csrX`, `csrY`, `csrZ`) .... ) I suspect that one of your column names is a MySQL keyword and makes the query fail. Try that.
-
Where does mysql_query come from? Why are you not using dbConnect and dbQuery?
-
getRootElement() Predefined variable: root getLocalPlayer() Predefined variable: localPlayer Source: https://forum.multitheftauto.com/viewtopic.php?f=91&t=39678
-
Again the wrong variable: outputChatBox("You gave #00FF00$"..tostring(amount).."#0096FF to #FFFFFF"..getPlayerName(targetplayer))
-
Why not make use of processLineOfSight and simply make no switching between targets?
-
The original MySQL syntax doesn't accept those "?" placeholders. The error tells you that there is no valid insert-values in that query.
-
Not tested. -- Removed: Working version below
-
getPlayerFromID(...) Is not a MTA function. if tonumber(id) then target = getPlayerFromID(tonumber(p2)) else target = getPlayerFromName(p2) end Sense?
-
getElementType(theAttacker) == "projectile"
-
The callback function from fetchRemote can't pass any "return" value to your getEmailGravatar this way. The function fetchRemote loads the data from gravatar.com probably asynchronous. That means you can't "wait" for the response from the page inside your function.
-
setElementData(player, "Occupation") You are missing the value parameter: occupation Replace with: setElementData(player, "Occupation", occupation)
-
outputChatBox("You gave #00FF00$"..amount.."#0096FF to #FFFFFF"..getPlayerName(target) getPlayerName(target) Use targetplayer instead of target, because you pass the command parameter name to the function: Example usage: /givemoney Franklin234 500 That line produces the following code: outputChatBox("You gave #00FF00$".."500".."#0096FF to #FFFFFF"..getPlayerName("Franklin234")