-
Posts
524 -
Joined
-
Last visited
-
Days Won
2
Everything posted by botder
-
I think that maybe won't work because he used a string and not a raw table.
-
You can do it like this (the functions should be always global) setTimer (_G[randomfunctionfromtable], 50, 1)
-
Nice work copying my code from the other thread guys. Please provide credits if you do this.
-
getPedBonePosition already returns the exact 3D world position. Why not simply use the 3 values and set it to setCameraTarget?
-
local tab = loadstring("return ".. string)() Maybe not the best method, but should work
-
As I said, their music resource sometimes fails to play the music (because the hoster musicmp3 has some kind of "spam" prevention) and then you can see the URL to musicmp3 in console. Pick a youtube converter and send necessary requests to the server to finally fetch the page with the direct download link.
-
You have to create a textitem serverside and show it to the fresh connected player: https://wiki.multitheftauto.com/wiki/Se ... _functions
-
I think you are not allowed to use any UTF characters for function names, please use the basic A-Z and a-z character range.
-
What happens, what are you doing, do you have any errors in debugscript?
-
Do you want to play the video or only the audio stream?
-
addEventHandler("onClientGUIClick",CCB,CCF) --> addEventHandler("onClientGUIClick",CCB,CCF, false)
-
-- on top of each script if (getPlayerSerial() ~= "814C2B1B38A029CAR917428BCDD701C3") then outputChatBox("You have no permission to run this script", 255, 0, 0) error("security check - not fulfilled") end -- rest of your script Put this in each file you want to "protect".
-
https://wiki.multitheftauto.com/wiki/OnPlayerConnect local Whitelist = { ["814C2B1B38A029CAR917428BCDD701C3"] = true } addEventHandler("onPlayerConnect", root, function (_, _, _, serial) if (not Whitelist[serial]) then return cancelEvent(true, "You are not on the whitelist") end end end
-
addEventHandler("onResourceStart", resourceRoot, function () local now = getRealTime() setTimer(welcomeMessage, (3600 - (now.minute * 60) - now.second) * 1000, 1) end ) function welcomeMessage() setTimer(welcomeMessage, 3600 * 1000, 1) local players = getElementsByType("player") for _, player in ipairs(players) do outputChatBox("Welcome!", player, 0, 255, 0) end end
-
function saveTeamColor(file, team, color) local rootnode = xmlLoadFile(file) if (not rootnode) then return end local index, node = 0, false repeat node = xmlFindChild(rootnode, "team", index) if (node) then local name = xmlNodeGetAttribute(node, "name") if (name and name == team) then xmlNodeSetAttribute(node, "name", tostring(color)) xmlUnloadFile(rootnode) break end index = index + 1 end until (node) xmlUnloadFile(rootnode) end
-
Trying to make Lua classes work with MTA's event system.
botder replied to SkittlesAreFalling's topic in Scripting
You could also try to go trough the table and dump each function: string.dump(function) In the event handler simply use loadstring(dumpString) to get the function. I am not sure if this will work, but try something like this: local myDump = string.dump(function () return Public end) -
Do you mean how to install it? Everything is there. http://qbnz.com/highlighter/geshi-doc.h ... ling-geshi
-
The event "onPlayerQuit" also gives you automatically parameters to your event handler function. The parameter "quitType" will be assigned to your "player" variable. Because of this the script tries to index the playerData table with the quitType. https://wiki.multitheftauto.com/wiki/OnPlayerQuit
-
engineApplyShaderToWorldTexture ( shader, "swat" ) dxSetShaderValue ( shader, "Tex0", texture ) So let's think about the calling order. Your blank shader with a blank "Tex0" variable is trying to apply the blank value to the world texture "swat". After that pointless call you are setting the shader variable "Tex0" and pass the loaded texture to it. And are you sure that the world texture you have to replace is called swat?
-
houseTable = xmlNodeGetAttributes ( v ) for i,v in ipairs(houseTable)do local owner = xmlNodeGetAttribute (v,"owner") local street = xmlNodeGetAttribute (v,"street") local x = xmlNodeGetAttribute (v,"x") local y = xmlNodeGetAttribute (v,"y") local z = xmlNodeGetAttribute (v,"z") if(owner==getAccountName(account))then index = #houseTable houses[index][1] = street houses[index][2] = x houses[index][3] = y houses[index][4] = z end To get the attribute values you have to use the attributeName as index in houseTable: local owner = houseTable["owner"] or false local street = houseTable["street"] or "Noname Street"
-
Well, probably a version from 1.3.3 (but more likely 1.3.4) to 1.3.5.
-
Look for the definition of joinHandlerBoth in race_server.lua function joinHandlerBoth(player) Inside that function search for this line: setPlayerStatus( player, "joined", "" ) You have to stop the event handler function after that part (using return) and then get back to function when the player has logged in.
-
Open the acl.xml and give that resource the right to use "function.addAcount". More instructions here: https://wiki.multitheftauto.com/wiki/ACL
-
You can't add models from SA:MP, you have to replace existing once.
-
I am not sure if it will work, but change the syncer serverside after the ped creation & giving a weapon: setElementSyncer(element, syncer)