-
Posts
1,193 -
Joined
-
Last visited
Everything posted by tosfera
-
Well, you can try to use the processLineOfSight and see if that does hit the ground. Else I'm not sure. What about the editor? It's using the drag method too, I guess that is using the processLineOfSight.
-
Nope, GTA is using 'nodes'. Well atleast, that's the name I can still remember. these nodes are points ingame that are used for pathfinding. I'm currently working on speed limits for my server and instead of creating a table with millions and millions of coords, I wanted to use these 'nodes'. but I can't find this *** file anymore haha!
-
Hey guys, I can still remember that there was a big file with all the nodes of GTA in it. I quite need that file but like always, when I need it. I can't find it! So if anyone has this file, or knows where to get it. Please let me know. - Thanks
-
I tried your code, rewrote your code, tried it again and I found out that the 3th, 4th and 5th coordinates are totally ignoring the floor. If you output the actual numbers it will give you a position that's quite far away. not only the height, but also the X and Y are wrong.
-
Thanks There is a way, 'chatbubbles' ( the resource ) used this way. It's an insane way. They created a rectangle that kept growing 1px bigger in the width and moving 1px down to finally create the rounded rectangle. I wouldn't recommend it, but it's a way.
-
I would've done it like this, but there are more ways leading to Rome. ^^ local markers = { }; addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource() ), function () local markerData = -- your sql query for i, m in ipairs ( markerData ) do table.insert ( markers, { [ "x" ] = markerData [ "x" ], [ "y" ] = markerData [ "y" ], [ "z" ] = markerData [ "z" ], [ "type" ] = markerData [ "type" ], [ "size" ] = markerData [ "size" ], [ "r" ] = markerData [ "r" ], [ "g" ] = markerData [ "g" ], [ "b" ] = markerData [ "b" ], [ "a" ] = markerData [ "a" ] } ); createMarker ( markerData [ "x" ], markerData [ "y" ], markerData [ "z" ], markerData [ "type" ], markerData [ "size" ], markerData [ "r" ], markerData [ "g" ], markerData [ "b" ], markerData [ "a" ] ); end end ); function addMarker ( x, y, z, type, size, r, g, b, a ) table.insert ( markers, { [ "x" ] = x, [ "y" ] = y, [ "z" ] = z, [ "type" ] = type, [ "size" ] = size, [ "r" ] = r, [ "g" ] = g, [ "b" ] = b, [ "a" ] = a } ); -- insert your marker into the database. end addCommandHandler ( "addMarker", addMarker );
-
onPlayerWasted getPedWeapon giveWeapon getPedTotalAmmo setWeaponAmmo setElementData -- to set its data, it's a way to do it getElementData -- get the weapons, it's a way to do it Think that'll do.
-
Nikolai, why did you give every vehicle the value '100' when someone joins the server ( onPlayerJoin ). This means that whenever someone joins the server, every vehicle will be refilled on the client side. You can better make it server sided and give the data on the onResourceStart. Don't forget to use the resourceRootElement ( getThisResource() ) to make sure it only does it when that resource starts, which is also a bad thing if they want to save the fuel into a database.
-
well, everything can be found here; https://wiki.multitheftauto.com/wiki/ExecuteSQLQuery here is a simple query to store money, not receiving it! addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource() ), function () executeSQLQuery ( "CREATE TABLE IF NOT EXISTS players (id INT, name TEXT, money INT)") end ); addCommandHandler ( "givemehmuniess", function ( thePlayer ) givePlayerMoney ( 200 ); executeSQLQuery ( "INSERT INTO `players`(`name`,`money`) VALUES(?,?)", getPlayerName ( thePlayer ), getPlayerMoney ( thePlayer ) ); end );
-
You should try this. local fuelTimer; function downgradeFuel ( element ) if ( isElement ( element ) ) then if ( getVehicleEngineState ( element ) ) then local remainingFuel = getElementData ( element, "fuelbalance" ); if ( remainingFuel ) then if ( tonumber ( remainingFuel ) > 0 ) then setElementData ( element, "fuelbalance", tonumber ( remainingFuel ) - 1 ); outputChatBox ( "Remaining fuel: ".. getElementData ( element, "fuelbalance" ) ); else outputChatBox ( "The engine turns off due to the lack of fuel" ); end else setElementData ( element, "fuelbalance", 0 ); end end end end addEventHandler ( "onClientVehicleEnter", root, function ( thePlayer, theSeat ) if ( ( thePlayer == getLocalPlayer() ) and ( theSeat == 0 ) ) then fuelTimer = setTimer ( downgradeFuel, 2000, -1, getPedOccupiedVehicle ); end end ); addEventHandler ( "onClientVehicleExit", root, funciton ( thePlayer, theSeat ) if ( ( thePlayer == getLocalPlayer() ) and ( theSeat == 0 ) ) then if ( isTimer ( fuelTimer ) ) then killTimer ( fuelTimer ); end fuelTimer = nil; end end ); Please note that this doesn't have a function to stop the timer when your engine turns off, it isn't calculating if you're actually moving, how fast you're moving and so forth. It only starts the timer when you enter a vehicle and when the engine is on. Only works if you are on seat 0 ( driver ). Beside that, the data is set in a client sided script, if you're doing this. You have to sync it every 2 seconds with the server too. I'd rather do it server sided, but that's my point of view!
-
Jesus, thank you! I thought we lost people with knowledge on this forum. Using math in your size and positions is the only way to make them "responsive". Like we call it in the Web development world.
-
So, with a bit of logical thinking. You should output the actual value that has been given with the dataName of "Occupation".
-
Could you replace your 'return' with a debug message? Maybe you've messed up with capitals or such.
-
Another thing that's being used in PHP is to initalize the variable in the condition of your while loop, not sure if it works in Lua but you can give it a shot; local impoundedVehicles = mysql:query ( "SELECT `vehicles`.`id`, `vehicles`.`model` FROM `vehicles` WHERE `vehicles`.`Impounded` != 0 AND `vehicles`.`Impounded` < ( ".. getRealTime().yearday .." - 28 ) " ); if ( impoundedVehicles ) then while ( local row = mysql:fetch_assoc ( impoundedVehicles ) ) do mysql:query_free ( "DELETE FROM `vehicles` WHERE `id` = '".. tonumber ( row["id"] ) .."' " ); mysql:query_free ( "DELETE FROM `items` WHERE `type` = 2 AND `owner` = '".. tonumber ( row [ "id" ] ) .."' " ); end end
-
You can read all you like but you'll never be able to fix a problem if you keep working out of a book or wiki page. Trying and gettings errors, that's what makes you better. Understanding every bit of code step by step, that's what makes you a great scripter / programmer. As a tip from me; grab someone his code, an easy script. Read it, understand it, rewrite it.
-
There sure is an easier way to do so, here is an example of the impounded vehicles; local impoundedVehicles = mysql:query ( "SELECT `vehicles`.`id`, `vehicles`.`model` FROM `vehicles` WHERE `vehicles`.`Impounded` != 0 AND `vehicles`.`Impounded` < ( ".. getRealTime().yearday .." - 28 ) " ); if ( impoundedVehicles ) then while ( mysql:fetch_assoc ( impoundedVehicles ) ) do local row = mysql:fetch_assoc ( impoundedVehicles ); mysql:query_free ( "DELETE FROM `vehicles` WHERE `id` = '".. tonumber ( row["id"] ) .."' " ); mysql:query_free ( "DELETE FROM `items` WHERE `type` = 2 AND `owner` = '".. tonumber ( row [ "id" ] ) .."' " ); end end I've removed the following things and added a comment why; while true do -- playing with a true, breaking when you have no row. Can be replaces with the mysql:fetch_assoc ( if I'm right ) local vehicleID = tonumber(row["id"]) -- I removed this, added it into the query itself. Not sure if it works, you should try. local vehiclemodel = tonumber(row["model"]) -- this isn't getting used. local vehicleID2 = (row["id"]) -- this isn't getting used either Also, you should use mysql_real_escape to ensure that your database can't be hacked with simple injections.
-
This will be a bumb to this topic, and I'm not sorry for it. Alot of people are actually using 3Ds max and I'm not sure why. Sure, the program is wonderful and it does its job. But I do love Maya too, I actually love Maya. Not sure why but it feels more.... comfortable. So, since you're creating scripts for 3Ds max. And it isn't possible to actually export from Maya directly to GTA / MTA. Maybe you could try and give it a shot to actually write a plugin to exports objects from Maya to GTA / MTA?
-
You'd prove me that you got some nice professional skills in designing. Keep that up, who knows what comes in your way. Also, I prefer blue normally but, this green picture is just stunning!
-
You can use different kind of 3D programs to actually model something, but the easiest way to design and actually model these objects is to use 3Ds Max. Why? There are different plugins and scripts to actually export these objects to use in GTA. You can't just import or convert any random object to GTA. As an example, you've to do quite some converting and remoddeling if you're using Maya. You can't randomly import the GTA models in Maya either.
-
well, that's not hard. Just take a speak at where it goes wrong; local houses = executeSQLQuery("SELECT * FROM `housingdata` WHERE `id` = ?", getElementData(currentIcon, "houseID")) If you have basic knowledge of sql, you'll know that this query is working and will return false or a row. Only if there is some actual data. Since you are using ( it's not your resource, it's from SANS ) the following line to see if the house is actually there. You'll see that it's not, so your data is corrupt. ^^ if #houses == 1 then
-
I got a GUI drawn with dxDraw functions, but not everything fits onto these small windows. Making them fit will screw up the entire gui. It would be easier if you could create a scrollbar functional. Whenever you scroll down, the elements should change. But I'm not sure how to cut off the elements inside the rectangle and keep track of the actual position of the scrollbar. I think it'll be a huge ehh.. mindcracking thing to actually do.
-
^bumping this, still looking for someone that'll be able to give me a brief description of the way how to create them haha. ^^
-
If you want to replace the random pickup once in a time, use a timer. If that's what you mean...
-
The only way to remove them is by deleting the entire object ( it's part of an interior for the object, if I'm right ). If you don't want to delete the entire object and only the brushes, you should consider removing them from the object using 3Ds Max.