-
Posts
6,062 -
Joined
-
Last visited
-
Days Won
208
Everything posted by IIYAMA
-
iprint(getAllPlayerInDimension (0)) First debug. After executing the function, it returns a table which contains all players from that dimension. Just run the code and check your debug-console.
-
Well you might be able to make it with: "onVehicleEnter" -- > save ------------------- "onPlayerDamage" -- maybe a delay? (not sure) isPedInVehicle -- > no vehicle? -- > fall off
-
No.no.no getRootElement is a function. root is a predefined variable that contains the root element. When you execute getRootElement it will return the value: root element: getRootElement == root -- false -- call the getRootElement function getRootElement() == root -- true So yes, in the end it doesn't matter which one you use. Except that with getRootElement you have to make one function call more before you have access to the value.(performance)
-
See my post, I did edit it afterwards.
-
function render () local timeNow = getTickCount() local alpha = (timeNow % 510) if alpha > 255 then alpha = 255 - (alpha - 255) end local color = tocolor(255,255,255, alpha) end Each 1 alpha unit of 255 = 1 millisecond. Very easy example. Which counts from: 0 > 255 > 0 > 255 > 0 etc. If you want some custom timing: (2s = full animation ON/OFF) local duration = 2000 local alpha = (timeNow % duration / duration) * 510
-
99% of people who request this do not learn anything about it, since the do not know lua. They do not even realize that learning it that way doesn't work at all. The only thing they do learn about it, is that it is really easy to let other people doing their work for free. So, what makes you that 1%? That precious 1%, which I think they deserve that kind of attention. The situation: To receive finished code without knowing lua.
-
Yes you need to add it again. Better to clear the innerHTML in text-chat instead.
-
use JS executeBrowserJavascript ( webBrowser, 'document.getElementById("element-id").innerHTML = ""') https://wiki.multitheftauto.com/wiki/ExecuteBrowserJavascript
-
setBrowserRenderingPaused = probably stopping the browser with making cycles. Probably stop doing this: You will need to use guiSetVisible to hide the gui: https://wiki.multitheftauto.com/wiki/GuiSetVisible Yet I recommend you to doing both, because afaik the browser doesn't stops rendering when you hide the gui. (will save you some performance)
-
[QUESTION] setElementRotation and getCameraMatrix.
IIYAMA replied to Exilepilot's topic in Scripting
Denny199 his reply is very useful. This will give you everything you need. -
[QUESTION] setElementRotation and getCameraMatrix.
IIYAMA replied to Exilepilot's topic in Scripting
I doing stuff like that with: local camera = getCamera() local matrix = getElementMatrix(camera) local rotX, rotY, rotZ = getElementRotation(camera) -
This doesn't work like that: getTeamName(getPlayerTeam(p))~= ("Criminals" or "Terrorists") This is how lua reads it: 1. 2. 3. So how to solve this?
-
marker = createMarker(v[1], v[2], v[3], 2,"corona",2,150,255,150,150) /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ In your code: coord == v[1] And v[2], v[3] are left out. Which gives you this result: marker = createMarker(v[1], 2,"corona",2,150,255,150,150) And that isn't what you want.
-
animationCommand(client) animationCommand2(client) function animationCommand ( player ) setPedAnimation ( player, "ped", "SEAT_idle", -1, true, false, false ) end function animationCommand2 ( player ) setPedAnimation ( player ) end Do not abuse the source variable.
-
It seems hiding content really helps to give clear information. Thank you very much too!
-
"user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ("Admin") ) Indeed. What was source again in this event? Can you get the account from a ... ? Answer: What happens when you do that? Can you get the accountname of the value false? So:
-
it means that the variable which should contain the player isn't containing it. If you use the event onVehicleStartEnter, use the first parameter for the player. https://wiki.multitheftauto.com/wiki/OnVehicleStartEnter Parameters: player enteringPlayer, int seat, player jacked, int door Source: The source is in this event the vehicle. Example: function enterVehicle ( player, seat, jacked ) if vehicleEnterExceptions[player] or (staffcar[getElementModel(player)] and not isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(player)), aclGetGroup ("Admin") )) then
-
By making exceptions local vehicleEnterExceptions = {} -- function if vehicleEnterExceptions[player] or (staffcar[getElementModel(source)] and not isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ("Admin") )) then -- end function addPlayerToException (player) vehicleEnterExceptions[player] = true return true end function removePlayerFromException (player) vehicleEnterExceptions[player] = nil return true end addEventHandler("onPlayerQuit", root, function () removePlayerFromException (source) end) addPlayerToException (player) -- DO > https://wiki.multitheftauto.com/wiki/WarpPedIntoVehicle setTimer(removePlayerFromException, 50, 1, player) -- Events are afaik async, so must this function call. You could try something like this. (untested)
-
Maybe you could ask it to somebody who already has done it, or the one who created the wiki topic. I am very sure those guys are out there.
-
To be able to do that, you have to learn how to communicate between client(player his pc) and the server(can also be the player his pc or another computer). GUI = clientside. Giving weapons, take money away(synced) = serverside You need to be able to understand this, even if you run your server on your own machine: The fibreculture journal. (z.d.). Architecting Cheating in MMORPGs [Foto]. Geraadpleegd van http://sixteen.fibreculturejournal.org/files/2010/07/Figure_3.jpg This tutorial might be handy.
-
hmm, well to figure out the problem, should start with try the same thing on another (2) server(s). Just to be sure that it isn't the server.
-
I think you should do some more digging in the server. Because it is almost as if the Firewall is blocking it. Also check the mta config file at that server, on this: <!-- This parameter specifies the TCP port on which the server will be accepting incoming http connections. It can be set to the same value as <serverport>. It is a required parameter if <httpserver> is set to 1. --> <httpport>22005</httpport>
-
Did you make sure you added this to the meta.xml? (on the resource where this function is located) <export function="outputChatBoxRemote" http="true" />
-
I am not sure if you can call remote to yourself. But the error 404 means not found. So try to ping to the ip, just to check if it available. Also the port is important, just to figure out which port you should use: function playerChat ( message, type ) for port=22000, 22030 do callRemote ( "87.229.77.40:" .. port, getResourceName(getThisResource()), "outputChatBoxRemote", finishedCallback, getPlayerName(source), message, type, getServerPort() ) end end