-
Posts
2,973 -
Joined
-
Last visited
-
Days Won
3
Everything posted by 50p
-
There is guiCreateWindow but no GuiCreateWindow which I can't see in your code. Lua is case-sensitive language and all MTA function names start with lower case letters.
-
May I ask you what do you need getAccount for? onPlayerLogin passes 3 arguments to handlers, 1st being player's previous account and 2nd the account player logged into, 3rd a boolean value indicating if player was auto logged in. So, what's the point of getAccount? Also, why do you pass account element to getAccount function if it expects username and/or password (strings) not account? You should read wiki more carefully. Just answer these questions. I'm honestly surprised that source is not the player who logged in. What is it then? Debug the function.
-
I guess you're not reading my posts. Why should I bother to help?
-
I suppose you want to press a button to teleport you there. You also need to know when to let player use the button? Don't expect us to make it for you because that's a request which we're not dealing with here.
-
You can make your own maps with a Map Editor. How to use it? Well, start MTA and click "Map editor" in main menu. You will start with a tutorial which will explain everything to you. If you'll still have problems, you can read more about it on wiki: https://wiki.multitheftauto.com/wiki/Resource:Editor
-
I'll give you advice for if statements. Use brackets ( "(" and ")" ) to separate checks because in Lua or and and have unexpected results. You may thing that it should work but it doesn't, after you add brackets it works. Well, at least that what I noticed one day. For instance look at this example and ask yourself what the result you'd expect: a = 2 b = 1 c = 3 d = 4 e = a > b or c and d -- what do you think e will be? e = a < b or c and d -- what do you think e will be? In the first case, e will be true, In the second case, e will be 4 Do you see what I mean now? Well, if you think about these 2, it makes sense but if you don't, you may end up with unexpected results. I'd advice you use them. It doesn't cost you anything but they are used in other languages and it's good to get used to them earlier. Brackets return true or false but or and and may return values that you don't want. So, one of your if statements would be: if ( ( i == #theText ) or ( i == 1 ) or ( spaceBefore ) ) then I'm not saying this is a bug in your script though. You should debug your function and check where the loop breaks or where it returns false and you'll find out why it returns false every time. If you will debug it and won't find out anything just tell us where the function returns or loop breaks. What's the point of current in this function? It's only assigned new values, nothing else.
-
Hey people, I tried to help him in Polish but he has real difficulties with making sentences even in Polish. I don't know how old you are Namorek, but my 7 year old nephew speaks better Polish then you do I feel sorry about you. It's very very hard to understand you. To all you Poles try to understand this: I can't even translate it to English because it doesn't even make sense to me
-
Saying "I want to make teleports" doesn't help at all... There are 100s of ways of doing it. You can teleport someone if he kills someone, enters marker, command or presses a key. To make a working teleport you need to know in what way you want to do it. You'll use setElementPosition to teleport players and you have to know the place where you want him to appear. You need to take a look into Interior IDs site to find your interior and coordinates. Besides, it's ridiculously hard to understand anything you say.
-
Add false to addEventHandler's as last argument. This is mainly why I made GUI Lib. With it, adding "on click" handlers is much easier.
-
You forgot to update the first post about XML classes.
-
What's Char_SelectionTAB?
-
It's not hard to make your own wanted level functions... Don't give up that easily because you'll never make a script that you dream of. Just use element data to indicate the wanted level. You can then just use getElementData to get his wanted level and show specific amount of stars. I think element data would be good enough for it.. You won't even have to export any functions because element data is shared by entire server and all resources can use getElementData to get the data that was set by other resource. So, don't give up.
-
The only downside of making your custom functions is that only you will use them.. I mean, other scripts will use setPlayerWantedLevel so the custom stars will be useless but if you run it on your own server you will be fine. You can export these functions and let other resources use them but other scripts which use setPlayerWantedLevel would have to be changed to use the exported functions instead.
-
I suppose they use a custom function because you don't see any stars when your wanted level is at 0.
-
I don't know mate... I made the script so it creates new resource for you and all you have to do is: - export collision mesh yourself manually (I can't figure out how to write collision exporter) - add some code to change textures of the exported models You can start the resource in map editor and it should replace the models for you because my MAXScript creates Lua script for you...
-
Yes it has to be a client-side script... If you have read my first post then you'd know the script has to be client-side. Your code will draw the text at the left bottom of the screen. If you'll use my script, you'll have the text above heads or rather on the head. My code is exactly what you want.. All you need to change is the variable I used in the 1st dxDrawText argument.
-
If you've scripted in the past (not necessarily in Lua) then you shouldn't have problems understanding this script. BTW, I don't know what's so big about that sentence you quoted me
-
I suppose there is none. If there isn't one on wiki then there isn't.
-
I'll help you again with your time lol Well, I don't like to see a number of minutes without an extra 0 at the front if number of minutes is less then 10 (like 2:5, when it's 2:05). time = hours .. ":" .. (((mins < 10) and "0"..mins) or mins)
-
It's the most accurate way I'd say and not hard at all. What's so hard about this snippet? addEventHandler( "onClientRender", getRootElement(), function( ) for _, plr in ipairs( getElementsByType( "player" ) ) do local x, y, z = getPedBonePosition( plr, 8 ); -- head local sX, sY = getScreenFromWorldPosition( x, y, z ); if sX then dxDrawText( get_your_player_modename, sX, sY ) end end end )
-
If you compare variables/strings/numbers/etc., you use 2 equal signs (==) not 1 (=), because 1 is used to set new value to a variable.
-
You want to use client-side drawing functions. If your function that returns mode is server-side, use setElementData and sync it so then you can use getElementData client-side to get mode. Check my peds resource and use https://wiki.multitheftauto.com/wiki/DxDrawText to draw the text instead of drawing health bars. You'll need to use onClientRender event to draw text every frame, getPedBonePosition to get player's neck position and getScreenFromWorldPosition to get screen position of that bone.
-
I wanted to create such resource one day but I gave up before I even started lol. So, here are 2 png that I planned to use. (If I remember rightly, this white star is 70% transparent. If you need 100% say so)
