-
Posts
1,193 -
Joined
-
Last visited
Everything posted by tosfera
-
Double post, you can't bump your post which its latest reply was 9 minutes ago. Way to go man, anyway. If you only want to edit the Elegy, just add a check in there; if ( getElementModel ( veh ) == ) then like so; function setHandling() for key,veh in ipairs ( getElementsByType ( "vehicle" ) ) do if ( getElementModel ( veh ) == 562 ) then if ( getElementData ( veh, "faction" ) == 72 ) then setVehicleHandling ( veh, "engineAcceleration", 20 ); setVehicleHandling ( veh, "maxVelocity", 165 ); setVehicleHandling ( veh, "steeringLock", 45 ); end if ( getElementData ( veh, "faction" ) == 72) then setVehicleHandling ( veh, "engineAcceleration", 22 ); setVehicleHandling ( veh, "maxVelocity", 200 ); setVehicleHandling ( veh, "steeringLock", 50 ); end if ( getElementData ( veh, "faction" ) == 72) then setVehicleHandling ( veh, "engineAcceleration", 15 ); setVehicleHandling ( veh, "maxVelocity", 180 ); setVehicleHandling ( veh, "brakeDeceleration", 1000 ); setVehicleHandling ( veh, "tractionMultiplier", 0.9 ); end if ( getElementData ( veh, "faction" ) == 72) then setVehicleHandling ( veh, "engineAcceleration", 22 ); setVehicleHandling ( veh, "maxVelocity", 200 ); setVehicleHandling ( veh, "steeringLock", 50 ); setVehicleHandling ( veh, "brakeDeceleration", 1000 ); end end end end addEventHandler ( "onResourceStart", getRootElement(), setHandling ) And why do you have the if-statement 4 times btw? I'm talking about this one; if ( getElementData ( veh, "faction" ) == 72 ) then
-
use this if-statement to see if the table is empty; if ( next ( attachedElements ) == nil ) then
-
It is possible, create a colshape around the pickup, make it trigger whenever an elements hits it and get the vehiclecontroller to remove the wanted level from.
-
He said he already has an account system, which comes with a login script else you won't have an account system. So idk what he's doing or what he wants.
-
So, if you made an account system why do you need another login system?
-
Well, the function itself already checks if there is a _ in the given string. So don't worry about that, you should rename players without the underscore. Just remove it while typing etc. To remove numbers you can use the parameter %W like this; local name = name:gsub ( "%W", "" );
-
That's possible, just use FileCreate
-
Sure, you can store it in xml files but I wouldn't recommend it. You can also use the built in account system for that.
-
you can use gsub to replace something in a centain word or sentence, let say the players name for roleplay servers; local name = "angelica_mitten":gsub ( "_", " " ) This will replace _ with a space, transforming Angelica_Mitten into Angelica Mitten. You can use this as a bad word filter too. read all about it on the lua wiki; http://lua-users.org/wiki/StringLibraryTutorial
-
You can just use the onClientRender and some math to move your GUI. Won't be all to hard if you ask me, just make sure you add a check in there for the FPS of a player, so it doesn't move to fast for others.
-
HAHAHAHAHAHA, oke. I just died at this part; "you need guieditor", to get it even more clear for you; "need". You don't 'need' it, it's only usefull. ontopic; creating a login and register system, you should understand the basic functions of GUI's, with the following functions you'll be able to retrieve data and register or login an account ( this does not include how to create your gui ) guiGetText logIn spawnPlayer getAccountData setAccountData getAccount -- if it's already an account, you can't register it addAccount
-
Since your table from mysql doesn't have an numeric index, you can't use a numeric index. You have to use strings.
-
Oh, I see. You are using sqlite... my fault. ^^" Just a tip, don't call it table. Because table is also the name for... tables / arrays. Will be confusing and might create some errors.
-
Oracle are like... 90% of the servers. There are a few non-supported mysql platforms out there which aren't based on Oracle. I meant: Heyooo, i think we are in MTA, Windows/Linux Oh I think you don't get it, Oracle isn't an operating system. Oracle is like... the fundament of SQL. Just try to select from the tables and see if you have the right permissions for it to select from it.
-
Oracle are like... 90% of the servers. There are a few non-supported mysql platforms out there which aren't based on Oracle.
-
Don't forget; your database is built based on a database. There is a table holding all of your data, the table which holds the names of all your tables is; "all_tables" ( only on oracle systems as far as I know ). So you can just select it like this; SELECT `table_name` FROM `all_tables` There are 4 tables in total that holds data like that, they are as following; tabs dba_tables all_tables user_tables
-
You should start by installing your sql service and get to know with the internal db* functions.
-
I would not recommend this, if some people aim for your website while hacking. Your game won't be safe either, would be a bummer. Another thing, if your server is hosted on a different place than your website, it will cause some lag to retrieve the money of a player. Just use the PHP SDK to call a php function ( or a lua function ) to give the money, it's not that hard. People with a little knowledge of PHP and Lua can do it. ^^
-
Not sure if that would work, but I was having trouble using the brackets at my arrays too. You'll be creating new arrays with a different key, value pattern again. I would recommend to use [ model ], just like so; local vehicles = { [ 550 ] = "BMW M5", [ 551 ] = "Dacia 1310 Brek", [ 480 ] = "Porshe 911 Sport Clssic", [ 402 ] = "BMW E46 Ursuleț", [ 494 ] = "Nissan GTR", [ 502 ] = "Ford Mustang Boss", [ 503 ] = "BMW M3 Sport", [ 555 ] = "BMW M5 Sport", [ 526 ] = "Audi A6", [ 400 ] = "Dacia Duster", [ 507 ] = "Dacia Logan", [ 404 ] = "Dacia 1300", [ 474 ] = "Mercedes E500", [ 496 ] = "Ford Focus", [ 412 ] = "Mazda RX-8", [ 603 ] = "Shelby", [ 574 ] = "Căruță & Cal", [ 411 ] = "Lamborghini Veneno", [ 471 ] = "ATV Honda", [ 419 ] = "Chevrolet Camaro SS", [ 489 ] = "BMW X6", [ 445 ] = "Dacia 1310", [ 533 ] = "Nenault Cleo Sport", [ 544 ] = "Chevrolet Co", [ 589 ] = "Peugeot 206", [ 429 ] = "Chevrolet Corvette", [ 579 ] = "Range Rover", [ 490 ] = "BMW X5" }; function getVehicleName ( model ) return vehicles [ model ] or 'Unknown'; end addEvent ( "getVehicleName", true ) addEventHandler ( "getVehicleName", getRootElement(), getVehicleName ) edit; ^ up was faster, haha.
-
A ped that follows you? Sounds something like slothbot, I wouldn't prefer to use it but you can check it out here; https://community.multitheftauto.com/in ... ils&id=672
-
As far as I know, the os library has been disabled due the following functions; os.execute([command]) - Execute an operating system shell command. This is like the C system() function. The system dependent status code is returned. os.exit( )[/b] - [i]Calls the C function exit, with an optional code, to terminate the host program. The default value for code is the success code.[/i][b]os.remove(filename)[/b] - [i]Deletes the file with the given name. If this function fails, it returns nil, plus a string describing the error.[/i] [i]source: http://lua-users.org/wiki/OsLibraryTutorial[/i]
-
Make sure you are in a team before using the command, you can also avoid that by using getPlayerTeam. If it returns false, you know the player isn't in a team. Another thing you can do, is to use isPlayerInTeam which will also return true or false.
-
I would more say; RPG server 9000, the server which isn't different from any other RPG server!
-
I would strongly recommend Wamp. Just because I'm using it every day. If you're working with a linux based server, try using Lamp. ^^