-
Posts
2,973 -
Joined
-
Last visited
-
Days Won
3
Everything posted by 50p
-
http://development.mtasa.com/index.php? ... yerContact
-
Then you're lucky.
-
You can safely use setAccountData, just check if user is logged in I don't know how many times I have to say that.. but why don't you check first (or second) version of my bank resource and see that people were complaining... I didn't want "not logged in" users to save their money so I had to check if they are logged in first. I will always tell people not to use setAccountData in DP2 because my "well known" bank resource was built with this and failed at the beginning. You can safely use setAccountData, just check if user is logged in Hmm that might explain why i never had problems with that in the beginning. You must be one of those lucky guys. Maybe OS has got something to do with this, I don't know because I never had Linux, UNIX, etc. servers, so people be aware of accounts being wiped after setAccountData been used.
-
You should use setElementData on objects not players and then getElementData from object. When you use one variable "creator" it will always contain one data.
-
1. You use setAccountData(), don't use it untill DP3. 2. You getClientAccount() when he joins, his account is guest account until he logs in (I'm not sure if it would work if auto-login is enabled).
-
Then you'd need setAccountData to save anything, right? But didn't that delete accounts.xml? I know this should be fixed in DP3 in whatever function this was the problem, but I just wanted to give some advice for DP2 for now. You can save your stuff anywhere you want, still using mta accounts. And it does not delete accounts.xml if you check for guest account before setting account data. Hmm, I wonder why I always had problems with wiping out accounts from accounts.xml. It doesn't metter if I check if the account is guest or not, it just wipes them out. My bank resource was first written with these functions but people were complaining about this problem, why? I did check for guest account, why did they say this deletes their accounts? "Use properly", hmm... if you like, download one of the first versions of bank resource and try to tell me what was wrong in the code. I still check if the account is guest-account with SQL solution because only logged in users should be able to save their money.
-
Open mta_sdk.php, go to line 196 (as you can see at the end of the error message),
-
Lua is case-sensitive language. showcursor is not same as showCursor.
-
setElementPosition is a function that (as its name says) sets element's (player/vehicle/marker, etc) position. addCommandHandler( "teleport", function( player ) setElementPosition( player, 0, 0, 3 ) -- teleport player to the centre of SA end )
-
First of all, remember to learn and don't count on somebody to make something for you. The idea on how to make this image changing is to use guiStaticImageLoadImage in onClientGUIClick (on radio buttons).
-
It should be fine without custom event because one event is triggered when you successfully log in (which is clientLoginSuccess). Remove guiSetVisible( wdwSelect, false ) from createSelectWindow function and add it somewhere else (where player is successfully spawned). Also don't hide cursor if you still need to use it (player logged in and you show new window but you hide cursor therefore he can't use the new window).
-
Yes, that's they way you have to do it but also you must understand how it works, otherwise you won't know how to make something that uses triggerClientEvent/triggerServerEvent. That's the whole point in your script, you have to tell server he wants to log in (triggerServerEvent, in client-side script) and if he logged in successfully, tell the client script that he logged in and you want to show a new window (triggerClientEvent, in server-side script). What I see is a function to create & hide a window (which is not called, unless you used triggerClientEvent to trigger SelectCreate). What exactly doesn't work? If you successfully log in the "Log in" window disappear and a new window doesn't appear? I see you have an event "clientLoginSuccess", you can create a window in this event or call createSelectWindow() from clientLoginSuccessHandler.
-
When you log in using gui (I guess you send the password to server using triggerServerEvent) if the password is correct and he logged in successfully you can triggerClientEvent to tell client he logged in and do some action on client's side, in your case show another window. Follow tutorial on wiki, it should help you. http://development.mtasa.com/index.php? ... ng_the_GUI
-
Tabs should be children of TabPanels. Just change the ventana to tabPanel in guiCreateTab.
-
Anyway, if you use addEventHandler outside a function the elements that you add this handler should exist. When resource starts it goes through the file (script), it tries to attach handler to "undefined" element because the element will be created when player shoots (which is after resource start and all the resource files are loaded).
-
function registerPlayer ( source, commandName, password ) -- Check if the password field is blank or not (only blank if they didnt enter one) if ( password ~= "" and password ~= nil ) then --Attempt to add the account, and save its value in a var local playerName = getClientName(source) local account = getAccount( playerName ) -- find account with his name if account then -- if account exists, tell him that: outputChatBox( "Account with your name already exists!", source, 255, 0, 0 ) return end local accountAdded = addAccount( playerName, password ) if ( accountAdded ) then -- Tell the user all is done outputChatBox ( "Gracias " .. playerName .. ", ahora estas registrado, puedes loguear con /login", source ) else -- There was an error making the account, tell the user outputChatBox ( "Error al crear la cuenta, contactese con el administrador", source ) end else -- There was an error in the syntax, tell the user the correct syntax. outputChatBox ( "Error al crear la cuenta, la forma correcta es: /registro <clave>", source ) end end addCommandHandler ( "registro", registerPlayer ) -- add the command handler
-
It is fixed in DP3.
-
LOL. You are trying to say that there was no client script support prior to DP2 ? I wouldn't know because I came back from my internship and found out the DP version was up 2 already . In DP1 there was support for client scripts (gamemodes like Stealth use GUI). This script was written before any public releases.
-
Why didn't you say so yesterday? I've wasted at least 4 hours!
-
It seems like executeSQLCreateTable doesn't create a table. Try to create the table manually using SQLite Database Browser. 1. Using this application open registry.db file (it is located in MTA server directory). (Now in "Database Structure" tab you should see tables which are in the database) 2. If you can't see bank_accounts table, create it. (Edit -> Create Table) 3. Add 2 fields: username (type: TEXT) and balance (type: NUMERIC) 4. Save and exit. 5. Start the server.
-
Try to make a simple command that will set vehicle's speed which you are seating in. I'm sure this function works. Also make sure your script has not got any errors, nor warnings.
-
Take a look here: https://community.multitheftauto.com/index.html?p ... ils&id=113 And to the 2nd question, you'd have to use setElementVelocity to change vehicle's speed and setVehicleEngineState to turn off the engine.
-
Right... I'm going to add parameters to each function in that xml file. So far, 150 functions have parameters, only ~560 remaining! If somebody wants to speed it up, PM me and we'll divide the functions so we won't have the same function twice.
-
We had a topic like this and I used my .api for quiet long. After an update from 4.x to 5.0 it stopped working. I've checked the settings and it seems to be fine (Auto-completion is enabled). So not everyone can use it because Notepad++ is bugged.