
csiguusz
Members-
Posts
500 -
Joined
-
Last visited
Everything posted by csiguusz
-
How to really return a something out of a table?
csiguusz replied to HeavyMetal's topic in Scripting
I think I've alredy told this you in my first post. And to learn how lua tables work: http://lua-users.org/wiki/TablesTutorial -
How to really return a something out of a table?
csiguusz replied to HeavyMetal's topic in Scripting
What do you mean by 'stopping' a table? -
How to really return a something out of a table?
csiguusz replied to HeavyMetal's topic in Scripting
You can count a table's elements with the #. -
You can't get ( and save ) an account's password.
-
Is your file correctly added to the meta.xml?
-
How to really return a something out of a table?
csiguusz replied to HeavyMetal's topic in Scripting
If you like to read and learn yourself: https://wiki.multitheftauto.com/wiki/ExecuteSQLQuery If not, try: tostring( result[1].Name ) -
First try to do something yourself then if you have problmens we can help. Some useful functions you may need: givePlayerMoney setTimer addCommandHandler
-
You are welcome.
-
Yes, i saw this, and i also tought its server-sided. But in his original script the command handler functions did not have a player argumet, so i added it. Now he has an error that this player element is nil... that can only happen if he tried to use it on client side or he called the function without adding player element ( that's not likely ). He said that he hadn't put yet the setTimer when he got that error. So, strange
-
Thanks Gr0x that, i could not make it him cause im from my phone now... that should work if he would use it on server side.
-
Maybe... then you'd better learn english isntead of using google translate I asked, that how do you use the code what i gave you? Is your LUA script file client-sided or server-sided?
-
Hm? Just answer my question
-
This happens when you write the command? Do you you use the code on server or client-side?
-
There is a setTimer function in MTA
-
I think he meant something like this: function createTheGate () myGate1 = createObject ( 988, 313.599, -61.799, 1.6499, 0, 0, 0 ) end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate ) function openMyGate ( player ) if string.find( getPlayerName( player ) , "[out]", 1, true ) then moveObject ( myGate1, 2500, 308.5, -61.799, 1.6499 ) end end addCommandHandler("open",openMyGate) function movingMyGateBack ( player ) if string.find( getPlayerName( player ) , "[out]", 1, true ) then moveObject ( myGate1, 2500, 313.599, -61.799, 1.6499 ) end end addCommandHandler("close",movingMyGateBack) But of course, it's not the best way to check permissions by the name
-
I don't know if setPedControlState is bugged or just we can't use it right, but it never worked for me... I remebmer i could make peds jump with this but nothing else. You can maybe use setPedAnimation instead.
-
Modify the X coordinate to move them to the right: dxDrawColorText("#ffffff".. messageJoin,x-100,y/2-20,574.0,20.0,tocolor(200,0,0,255),1,"default-bold","left","top",false,false,false) dxDrawImage (x-120,x/2-20,16,16,"icon/join.png",0,-120)
-
There are different positions for different buildings inside of the interiors. You are welcome.
-
local ped = createPed( modelid, x, y, z ) setElementInterior( ped, 10 )
-
No. Peds and markers will be created only in one dimension (default 0). You can set their dimension with the setElementDimension, but if you want peds and markers in more dims. then you must create them separately in every single dimension, where you want them to be. Ohh sorry, you asked about interiors not dimensions... I'm a bit tired now. Just like at dimensions a ped can be only in one interior. You can set its interior with setElementInterior. As far as i know, if you make a marker itt will be present in all interiors.
-
-- you have some markers: local marker = createMarker ( arguments_here ) -- and you have a ped: local ped = createPed( args ) -- to make the ped walk to the right direction, you have to turn the ped to the right direction local markerX, markerY, markerZ = getElementPosition( marker ) local pedX, pedY, pedZ = getElementPosition( ped ) -- to get the 'right direction' use the findRotation (wich you must include in the script ) function. Z coordinates are not needed. local rotation = findRotation( pedX, pedY, markerX, markerY ) -- then make the ped face the marker: setPedRotation( ped, rotation) -- then make the ped walk like you want with setPedControlState or even with setPedAnimation functions.
-
It's peretty easy, you should just understand it once, what the function does. Give the funtion your ped's x and y coordinate, then the point's x and y coordinate, where you want your ped look at. It will return a number, which you can use for setPedRotation, to make the ped face the given point.
-
As well as positions, size can be relative or absolute, you can set this with the last argument of guiCreateWindow. If it's relative, the size ( and the positions ) should be beetwen 0 and 1. This is relative to any resolution and actually position can be counted so: screenWidht*relative_gui_widht (and so with height and positions of course). 0 at sizes is 0 and 1 is equal to the screen's width or height. For example 0.5 is half of the screens height or width. If you use 0.5 as relative width on your resolutin (1920x1080) the window's width will be 1920*0.5=960. On 1024x768 the same window's width would be 1024*0.5=512. Absolute sizes are in pixels. If you want a 50 width window with absolute sizes, then you have to use 50 as width and so on... I hope this helps.
-
Nice collection of errors But I don't understand what's your problem... they are very helplful, they say where is the problem and how can you repair it. I can't adivce you anything else (if those all are really your errors) but to try to do what is written on those windows.