-
Posts
1,449 -
Joined
-
Last visited
-
Days Won
32
Everything posted by DiSaMe
-
Obviously, you can only use the last markers because they're the ones the event handlers are attached to. They are the ones whose values are assigned to the variables last, therefore all previous values are overwritten. You could call 'addEventHandler' in the same loop they're created. Or you could create some abstract element with 'createElement', attach event handler to them and make this abstract element the parent of marker elements using 'setElementMarker'. Or you could create a set of markers (the table where markers are keys and boolean values 'true' are values), attach the event handler to root and check for presence of marker in the set from within the event handler. As you can see, there are many things you could do to achieve the result.
-
I might be wrong, but if I remember correctly, https://wiki.multitheftauto.com/wiki/OnClientCursorMove is triggered regardless of whether the cursor is visible or not.
-
So, detect when the player logs in using "onPlayerLogin", check the data and depending on what is set, either play the intro movie or don't. What's so hard to understand?
-
No, seriously, how are you playing the intro movie on login if client doesn't detect when the player logs in in the first place?
-
If such actions like intro movie on login are initiated from client side, I don't think that's a sign of good design. How are login operations processed in the first place? Of course they're processed in the server, aren't they? So that's where the data should be checked and intro movie initiated.
-
You mean allowing MTA servers to execute arbitrary C++ code on clients? Not a good idea.
-
Oops, didn't think about it
-
You're welcome
-
There's a function for that: removeAccount Also, as far as I know, MTA stores accounts into SQLite database or something like that, so you can probably remove them from file with some browser of such databases.
-
You're welcome
-
Novo, you did a little mistake here: math.sqrt((mx-x)^2 + (my-y)^2) <= radius^2 You're calculating the square root and comparing it to square of radius. Either square root shouldn't be calculated or radius itself (not the square) should be used.
-
Oh, well, I just tried it and it doesn't seem to work. Either I did something wrong or it just doesn't work for sniper rifle. The latter case is more likely, so maybe you should detect when the player switches to/from sniper rifle using "onClientPlayerWeaponSwitch" event and toggle the control from there.
-
function isZombieBehindPlayer(zombie, player) local px, py, pz = getElementPosition(player) local zx, zy, zz = getElementPosition(zombie) local zdx, zdy = zx-px, zy-py -- direction from player to zombie local _, _, pr = getElementRotation(player) pr = -math.rad(pr) local fdx, fdy = math.sin(pr), math.cos(pr) -- player's front direction return zdx*fdx+zdy*fdy < 0 -- dot product is less than 0 if vectors point to opposite directions end
-
No problem
-
'setWeaponProperty' sets properties of weapons, and the properties vary among different skills. For example, the weapons have better accuracy on higher skills. I'm not sure if the skill is relevant to weapons like sniper rifle, but if so, I'd just unset the crouching flags for all skills for sniper rifle.
-
Well, you could just add some data among account data that indicates whether the account has been logged into or not. When account is registered, it's set to "not played", and when the player logs in, it would check the data. If it's "played", the player just spawns, otherwise it shows the intro movie and sets the data to "played".
-
Your script only disables the control when the player is hit by sniper rifle. Instead, you could try disabling crouching ability for the weapon: setWeaponProperty If that doesn't work, then you should detect when the player switches the weapon and enable/disable control depending on which weapon the player switched to: https://wiki.multitheftauto.com/wiki/On ... aponSwitch
-
Edit: There have been some changes and I don't script for money now. I might start again, but I'm not planning to in the nearest future. This is something I lacked interest for in the past, but now I think it's the only way to get things moving. So I decided to become a paid scripter. Introduction I've been scripting on MTA SA since 2008, when I was 14 years old. While I never scripted for money, scripting was my hobby and I've done plenty of things during those years. The scripts I've made include bone attachments and NPC traffic. Portfolio To evaluate my skills, you can take a look at my works in these links: http://crystalmv.net84.net - website of my scripts which I've released to use for free My Youtube scripts video playlist - videos of various scripts which I've done in the past, some of which I don't even have anymore My server's topic. Although the server is far from finished, I have received some positive feedback from players So I think you can see what I'm made of Details on paid scripting Since this is my first time, I'm not ready for big projects. But I still could accept requests for smaller scripts that could easily interact with bigger projects. For example, I won't accept a request for one big roleplay gamemode, but I will probably accept individual requests for job scripts with scripting interface that allows them to run as a part of one big roleplay gamemode. Things which I may do: General Lua/MTA scripting, obviously Basic SQL scripting Stuff related to geometry, rotations, etc. Because this list is only meant to allow you to get a grasp of what I'm more likely to accept, it's not exhaustive, and decision will be made for each request individually. Script ownership By buying the scripts which I make under your request, you will become the sole owner. That is, you will gain the right to modify, copy, redistribute, sell and use them in whatever other way the owner may use them. Payments Price: depending on script, I think the prices would vary mostly from 5 to 30 Euro, but they're not limited to this range. The price will be decided for each scripting request individually. I accept payments via PayPal. Contact info E-mail: [email protected] Skype: crystalmv_
-
'addEventHandler' function doesn't send anything to anyone. "onPlayerJoin" event is triggered when a player joins, and it's only triggered for the player who joined - that is, that player is always the source of event.
-
Can you drive vehicles? How do you drive vehicles? By setting control states of actions related to driving (accelerate, turn left/right, etc). That's how you do it, isn't it? So the peds must do the same (using setPedControlState). Though as far as I know, they cannot enter/exit the vehicles the same way players do (unless the stuff with ped and door animations is remade in Lua), so you have to use warpPedIntoVehicle to put them into cars.
-
Will what work? When you think about it, you control your ped with control states, aiming and camera rotations, and you can make it do whatever you want, so that does work, doesn't it?
-
So if it gives an error, that probably means at least the function is executed.
-
MTA does not use AI system of GTA. AI has to be implemented in scripts. "onPlayerWasted" getPlayerWantedLevel setPlayerWantedLevel createPed setPedControlState setPedCameraRotation setPedAimTarget