Jump to content

Help me for my project


Lander

Recommended Posts

Hi everyone

Im going to make a gamemode about RPG Racing, such like the videogame Drift City. Well , the gamemode is inspired in Drift City =P.

The trouble is that im not scripter, i follow the wiki of MTA and is examples, but nothing. I have 2 friends that are good scripters, but one said "goodbye" to the project, and the other is making is own gamemode.

I know that make a Racing RPG its maybe impossible, but i have the idea to make the most simple possible.

First to all, i'm making a register/login system based on the example of the wiki, but the problem is the other system

register/login from the MTA client. My friend told me that add the resource to the ACL.xml, but nothing. And the car lot (Grotti, Wang Cars, Otto Cars, Bahn, etc....) in first instance, i choose the Image system, but later i think the setCameraPosition and a Gui for the car selection, but i don't know about coding this script =/

So please MTA coders and LUA experts, help with my project

PD: Im chilean, but I study very well english =P Today I got 5.7/7.0 (the highest note)

Link to comment
If you don't want people to login using the MTA command just add the following rule to the ACL.

  
<acl name="Default"> 
... 
  <right name="command.login" access="false"/> 
... 
</acl> 
  

This will restrict all users from accessing that particular command.

Also I put on the ACL

And now, how i can put in the code when someone try to register, but the account already exist?????

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 accountAdded = addAccount( getClientName(source), password ) 
                if ( accountAdded ) then 
                        --  Tell the user all is done 
                        outputChatBox ( "Gracias " .. getClientName(source) .. ", 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 ", source ) 
        end 
end 
addCommandHandler ( "registro", registerPlayer ) -- add the command handler  

Thanks

PD: I repeat, im from chile, that why some lines are in spanish.

Link to comment
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  

Link to comment

Thanks, but i got a problem in line 12, the server tell me: Warning registro.lua: access denied @ 'addAccount' - Line 12, and in the client i can't register. It's a bug?????

Registro = Register in english

And now i'm gonna make the GUI for the first car select. When i finish it, i will put here for the comments

Thanks again

Link to comment
Thanks, but i got a problem in line 12, the server tell me: Warning registro.lua: access denied @ 'addAccount' - Line 12, and in the client i can't register. It's a bug?????

Registro = Register in english

And now i'm gonna make the GUI for the first car select. When i finish it, i will put here for the comments

Thanks again

you need to give permission to the script for add accounts :)

(how i sayed you before modify the ACL.xml)

PD: im the other guy who is making his own gamemode. :lol:

Link to comment
Thanks, but i got a problem in line 12, the server tell me: Warning registro.lua: access denied @ 'addAccount' - Line 12, and in the client i can't register. It's a bug?????

Registro = Register in english

And now i'm gonna make the GUI for the first car select. When i finish it, i will put here for the comments

Thanks again

you need to give permission to the script for add accounts :)

(how i sayed you before modify the ACL.xml)

PD: im the other guy who is making his own gamemode. :lol:

It's works, thanks

PD: Im still making the GUI, i will make the gui on GUI Editor =P

Link to comment

Well, I want to put a welcome message when someone enter to my server, also i want to put tabs for the rules and credits, and a button for enter (for later to register/login).

That all i got

function WelcomeWindow () 
    primero = guiCreateWindow ( 0.16, 0.9, 0.1, 0.1, "Bienvenido", true ) 
    guiSetVisibe ( primero, true ) 
end 
  
addCommandHandler ( hola, WelcomeWindow ) 

I know, i forget the tabs, but i add it later =P

Link to comment
Thanks, but i got a problem in line 12, the server tell me: Warning registro.lua: access denied @ 'addAccount' - Line 12, and in the client i can't register. It's a bug?????

Registro = Register in english

And now i'm gonna make the GUI for the first car select. When i finish it, i will put here for the comments

Thanks again

you need to give permission to the script for add accounts :)

(how i sayed you before modify the ACL.xml)

PD: im the other guy who is making his own gamemode. :lol:

It's works, thanks

PD: Im still making the GUI, i will make the gui on GUI Editor =P

You forgot the "" in the Command Handler:

   1. function WelcomeWindow () 
   2.     primero = guiCreateWindow ( 0.16, 0.9, 0.1, 0.1, "Bienvenido", true ) 
   3.     guiSetVisibe ( primero, true ) 
   4. end 
   5.   
   6. addCommandHandler ( "hola", WelcomeWindow ) 

Link to comment

You forgot the "" in the Command Handler:

   1. function WelcomeWindow () 
   2.     primero = guiCreateWindow ( 0.16, 0.9, 0.1, 0.1, "Bienvenido", true ) 
   3.     guiSetVisibe ( primero, true ) 
   4. end 
   5.   
   6. addCommandHandler ( "hola", WelcomeWindow ) 

/me slap himself

Well, i got working on the gui, i add a tabPanel and some Tabs, but it doesn't show on the gui

Thats all i got

function WelcomeWindow () 
    local ventana = guiCreateWindow ( 0.50, 0.40, 0.40, 0.45, "Bienvenido", true ) 
    guiSetVisibe ( ventana, true ) 
    local tabPanel = guiCreateTabPanel ( 0, 0.1, 1, 1, true, ventana ) 
    local tabIntro = guiCreateTab ( "Intro", ventana ) 
    local tabCreditos = guiCreateTab ( "Creditos", ventana ) 
end 
  
addCommandHandler ( "hola", WelcomeWindow ) 

Link to comment

1-. I forgot the login function =P. I saw in the wiki that has no example of the logIn function. Someone can write me a simple login system?

2-. I am working in another gui, now this is for the first car selection. When i finish the gui. I will put here for your comments.

I got the gui

GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Label = {} 
GUIEditor_Radio = {} 
GUIEditor_Image = {} 
GUIEditor_Window[1] = guiCreateWindow(244,172,364,264,"Selecciona tu primer auto",false) 
guiWindowSetMovable(GUIEditor_Window[1],false) 
guiWindowSetSizable(GUIEditor_Window[1],false) 
GUIEditor_Button[2] = guiCreateButton(0.5687,0.7917,0.3709,0.1591,"COMPRAR",true,GUIEditor_Window[1]) 
GUIEditor_Label[1] = guiCreateLabel(0.0412,0.5644,0.4423,0.375,"Selecciona tu primer auto en la cual usaras en tus primeras carreras. Una vez elegido, haz click en COMPRAR",true,GUIEditor_Window[1]) 
guiLabelSetVerticalAlign(GUIEditor_Label[1],"top") 
guiLabelSetHorizontalAlign(GUIEditor_Label[1],"left",true) 
GUIEditor_Radio[1] = guiCreateRadioButton(0.0549,0.1136,0.3599,0.0985,"Perennial",true,GUIEditor_Window[1]) 
guiRadioButtonSetSelected(GUIEditor_Radio[1],true) 
GUIEditor_Radio[2] = guiCreateRadioButton(0.0549,0.2273,0.3544,0.1136,"Oceanic",true,GUIEditor_Window[1]) 
GUIEditor_Radio[3] = guiCreateRadioButton(0.0549,0.375,0.3599,0.1061,"Glendale",true,GUIEditor_Window[1]) 
GUIEditor_Image[1] = guiCreateStaticImage(0.5385,0.1629,0.4368,0.4242,"images/mtalogo.png",true,GUIEditor_Window[1]) 

I got the idea of the car selection, in every radio button, appear the image of the car selected (that remplace the MTA Logo), and the bottom comprar (buy), makes the car spawn for drive it.

3-. Everyone who helped me on this gamemode, will appear on the final credits (now Ace_Gambit, 50p, Gothem and =FAS=Shigawire helped me. Thanks guys :D )

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...