Jump to content

[Req]Help for Freeroam GUI


Cardell

Recommended Posts

Hi all, Can you Scripters help me out im new,

1.teach me how to log in as admin,

2.teach me how to edit the stuff in GUI

3.Teach me how to Make Cars Spawn at places, (Like a Ingame Object tool)

4.Teach me how to make Certain GUI commands Admin Only

5.Teach me how to add peds (Would be nice if you gave me a code with peds everywhere)

6.Teach me how to make Public Places open like for Ex.Ammunation or The Four Dragons

7.please tell me how to add jobs like taxi driver etc to be able to be used to gain cash,

8.admin commands for money,and stuff, gonna add houses with KIHC :D

9.Give or Tell me how to make a Script for Registering/Logging In with Accounts

10.Other GUI servers i see log in with rules and regulations,please tell me or give script to add

11.Please Tell me How to Add Godmode Command For Admins

Please Answer Questions with the number ex.

im answering number 1

1.bla bla bla bla

Etc, Thanks

Feel Free To ask Scripters If you have problems here,

I really wanna make the /wp and the car spawn commands admin only,

No Flaming, Telling people to search in this thread,Help, be nice, if ur a meany GTFO

Thanks people

Link to comment

just tell you on here? So you want us to copy and paste large chunks of stuff from the wiki because you're too damn lazy to look yourself? Your server = EPIC FAIL because it's owner = EPIC FAIL. Sorry sunshine, but round here, you only get rewards when you put in some effort yourself. Otherwise you WILL get shot down in flames. Nobody is going to help you unless you're willing to help yourself. The reason? We're all too busy with life, and our own projects to help people with their every little question that they need answering, when the answers are already available to them somewhere else.

So how about you start by reading up the MTA DM server and the introductions to scripting, etc, and then at least TRY to answer those questions yourself. When you come unstuck and have demonstrably tried to make things work yourself, then we'll be more inclined to help.

I'm afraid most of the replies below will now say the same thing, with you replying "GTFO meanies, I just want some help, if you're not willing to help, FO"...because no-one will pander to your laziness.

Link to comment
just tell you on here? So you want us to copy and paste large chunks of stuff from the wiki because you're too damn lazy to look yourself? Your server = EPIC FAIL because it's owner = EPIC FAIL. Sorry sunshine, but round here, you only get rewards when you put in some effort yourself. Otherwise you WILL get shot down in flames. Nobody is going to help you unless you're willing to help yourself. The reason? We're all too busy with life, and our own projects to help people with their every little question that they need answering, when the answers are already available to them somewhere else.

So how about you start by reading up the MTA DM server and the introductions to scripting, etc, and then at least TRY to answer those questions yourself. When you come unstuck and have demonstrably tried to make things work yourself, then we'll be more inclined to help.

I'm afraid most of the replies below will now say the same thing, with you replying "GTFO meanies, I just want some help, if you're not willing to help, FO"...because no-one will pander to your laziness.

Tbh, I only want Short Stories, Not ANYTHING else. so dont act like a 13 year old,

Link to comment
just tell you on here? So you want us to copy and paste large chunks of stuff from the wiki because you're too damn lazy to look yourself? Your server = EPIC FAIL because it's owner = EPIC FAIL. Sorry sunshine, but round here, you only get rewards when you put in some effort yourself. Otherwise you WILL get shot down in flames. Nobody is going to help you unless you're willing to help yourself. The reason? We're all too busy with life, and our own projects to help people with their every little question that they need answering, when the answers are already available to them somewhere else.

So how about you start by reading up the MTA DM server and the introductions to scripting, etc, and then at least TRY to answer those questions yourself. When you come unstuck and have demonstrably tried to make things work yourself, then we'll be more inclined to help.

I'm afraid most of the replies below will now say the same thing, with you replying "GTFO meanies, I just want some help, if you're not willing to help, FO"...because no-one will pander to your laziness.

Tbh, I only want Short Stories, Not ANYTHING else. so dont act like a 13 year old,

What's wrong with being 13? And what's wrong with his reply? He's doing as he's supposed to do! The wiki is made so there won't be a spamlist of "How to do this?" "How to do that?" etc.

And you don't like long stories? Well don't think scripting is such an easy thing! Scripting is something that takes time and you really need to learn it! If we tell you here, you won't understand it and then you're still not even the slightest bit on your way to scripter. You're only delaying the time it'll take for you to learn how to script by waiting for us to give an answer...

And we're not meanies just if you thought. As I said we're doing what we're actually are supposed to do.

Hope you understand it.

Link to comment

Dont Understand adding long GUI, My GUI

looks like this

  
 
function CreateLoginWindow()
 
        local X = 0.375
        local Y = 0.375
        local Width = 0.25
        local Height = 0.25
        wdwLogin = guiCreateWindow(X, Y, Width, Height, "Please Log In", true)
       
        X = 0.0825
        Y = 0.2
        Width = 0.25
        Height = 0.25
        guiCreateLabel(X, Y, Width, Height, "Username", true, wdwLogin)
        Y = 0.5
        guiCreateLabel(X, Y, Width, Height, "Password", true, wdwLogin)
       
        X = 0.415
        Y = 0.2
        Width = 0.5
        Height = 0.15
        edtUser = guiCreateEdit(X, Y, Width, Height, "", true, wdwLogin)
        Y = 0.5
        edtPass = guiCreateEdit(X, Y, Width, Height, "", true, wdwLogin)
        guiEditSetMaxLength(edtUser, 50)
        guiEditSetMaxLength(edtPass, 50)
       
        X = 0.415
        Y = 0.7
        Width = 0.25
        Height = 0.2
        btnLogin = guiCreateButton(X, Y, Width, Height, "Log In", true, wdwLogin)
       
        guiSetVisible(wdwLogin, false)
end
 
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()),
 
        function ()
                CreateLoginWindow()
 
                outputChatBox("Welcome to My MTA DM Server, please log in.  ")
 
                if (wdwLogin ~= nil) then
                         guiSetVisible(wdwLogin, true)
                end
 
                showCursor(true)
                guiSetInputEnabled(true)
        end
)
 
addEventHandler("onClientGUIClick", theButtonElement, theHandlerFunction, false)
addEventHandler("onClientGUIClick", theButtonElement, theHandlerFunction, false)
 
function clientSubmitLogin(button)
 
        if button == "left" then
               
                triggerServerEvent("SubmitLogin", getRootElement(), guiGetText(edtUser), guiGetText(edtPass))
                guiSetInputEnabled(false)
                guiSetVisible(wdwLogin, false)
                showCursor(false)
        end
end
 
function joinHandler(username, password)
 
        local x,y,z
        x = 1959.55
        y = -1714.46
        z = 10
              spawnPlayer(client, x, y, z)
              fadeCamera(client, true)
              outputChatBox("Welcome to CardellAutoMTA", client)
        end
end
 
addEvent("SubmitLogin", true)
addEventHandler("SubmitLogin", getRootElement(), joinHandler)
 
 
 
 
 
 
 
 
 
 
 
 
g_gridListContents = {}   -- info about binded gridlists
g_openedWindows = {}      -- {window1table = true, window2table = true, ...}
 
GRIDLIST_UPDATE_CHUNK_SIZE = 10
 
classInfo = {
    wnd = {className = 'Window', padding = {25, 10, 10, 10}, isContainer = true},
    tbp = {className = 'TabPanel'},
    tab = {className = 'Tab', padding = 10, isContainer = true},
    lbl = {className = 'Label', height = 20},
    btn = {className = 'Button', height = 20, padding = {0, 4}},
    chk = {className = 'CheckBox', height = 20, padding = {0, 6}},
    rad = {className = 'RadioButton', height = 20, padding = {0, 10}},
    txt = {className = 'Edit', width=100, height = 24},
    lst = {className = 'GridList', width = 250, height = 400},
    img = {className = 'StaticImage'}
}
 
function getTextWidth(text)
    return 8*text:len()
end
 
function createWindow(wnd, rebuild)
    if wnd.element then
        if rebuild then
            destroyElement(wnd.element)
        else
            guiSetVisible(wnd.element, true)
            guiBringToFront(wnd.element)
            g_openedWindows[wnd] = true
            if wnd.oncreate then
                wnd.oncreate()
            end
            return
        end
    end
   
    _planWindow(wnd)
    _buildWindow(wnd)
end
 
function _planWindow(wnd, baseWnd, parentWnd, x, y, maxHeightInLine)
    -- simulate building a window to get the proper height
    local wndClass = wnd[1]
   
    if not maxHeightInLine then
        maxHeightInLine = LINE_HEIGHT
    end
   
    local text, padding, parentPadding
    if wndClass ~= 'br' then
        padding = classInfo[wndClass].padding
        if type(padding) == 'number' then
            padding = table.rep(padding, 4)
            classInfo[wndClass].padding = padding
        elseif type(padding) == 'table' then
            if #padding == 1 then
                padding = table.rep(padding[1], 4)
                classInfo[wndClass].padding = padding
            elseif #padding == 2 then
                padding = table.flatten(table.rep(padding, 2))
                classInfo[wndClass].padding = padding
            elseif #padding == 3 then
                table.insert(padding, padding[2])
                classInfo[wndClass].padding = padding
            end
        elseif not padding then
            padding = table.rep(0, 4)
            classInfo[wndClass].padding = padding
        end
       
        text = wnd.text or wnd.id or ''
        if not wnd.width then
            wnd.width = (classInfo[wndClass].width or getTextWidth(text)) +
                (not classInfo[wndClass].isContainer and (padding[2] + padding[4]) or 0)
        end
        if not wnd.height and not classInfo[wndClass].isContainer then
            wnd.height = (classInfo[wndClass].height or LINE_HEIGHT) + padding[1] + padding[3]
        end
    end
    parentPadding = parentWnd and classInfo[parentWnd[1]].padding
   
    if wndClass == 'br' or (not classInfo[wndClass].isContainer and x + wnd.width > parentWnd.width - parentPadding[2]) then
        -- line wrap
        x = parentPadding[4]
        y = y + maxHeightInLine + LINE_MARGIN
 
        maxHeightInLine = LINE_HEIGHT
        if wndClass == 'br' then
            return nil, x, y, maxHeightInLine
        end
    end
    if not wnd.x then
        wnd.x = x
    end
    if not wnd.y then
        wnd.y = y
    end
    wnd.parent = parentWnd
   
    if wnd.controls then
        local childX, childY = padding[4], padding[1]
        local childMaxHeightInLine = LINE_HEIGHT
        local control
        for id, controlwnd in pairs(wnd.controls) do
            control, childX, childY, childMaxHeightInLine = _planWindow(controlwnd, baseWnd or wnd, wnd, childX, childY, childMaxHeightInLine)
        end
        if classInfo[wndClass].isContainer then
            wnd.height = childY + childMaxHeightInLine + padding[3]
        end
    end
   
    if wnd.tabs then
        local maxTabHeight = 0
        for id, tab in pairs(wnd.tabs) do
            tab[1] = 'tab'
            tab.width = wnd.width
            _planWindow(tab, baseWnd, wnd)
            if tab.height > maxTabHeight then
                maxTabHeight = tab.height
            end
        end
        wnd.height = maxTabHeight
    end
   
    if classInfo[wndClass].isContainer then
        return elem
    else
        if wnd.height > maxHeightInLine then
            maxHeightInLine = wnd.height
        end
        return elem, x + wnd.width + CONTROL_MARGIN_RIGHT, y, maxHeightInLine
    end
end
 
function _buildWindow(wnd, baseWnd, parentWnd)
    local wndClass = wnd[1]
    if wndClass == 'br' then
        return
    end
   
    local relX, relY, relWidth, relHeight
    if parentWnd then
        if wnd.x and wnd.y then
            relX = wnd.x/parentWnd.width
            relY = wnd.y/parentWnd.height
        end
        relWidth = wnd.width / parentWnd.width
        relHeight = wnd.height / parentWnd.height
    end
   
    local elem
    if wndClass == 'wnd' then
        local screenWidth, screenHeight = guiGetScreenSize()
        if not wnd.x then
            wnd.x = screenWidth/2 - wnd.width/2
        else
            local i, f = math.modf(wnd.x)
            if f ~= 0 then
Link to comment
Dont Understand adding long GUI, My GUI

looks like this

((removed due to too long post otherwise :P))

but when i log in its just blank, can only talk, no login or my fr gui, know where i put login and where i can edit the stuff in FR GUI, ex.take weapons,create vechiles,etc out? thanks

Did you add it as an client side code in the meta.xml? If you know what I mean?

Something like...

... 
<script src="something.lua" type="client"/> 
... 

If you have some trouble with it, feel free to say so. But I do note that this is in the wiki. ;)

Edited by Guest
Link to comment
Dont Understand adding long GUI, My GUI

looks like this

((removed due to too long post otherwise :P))

but when i log in its just blank, can only talk, no login or my fr gui, know where i put login and where i can edit the stuff in FR GUI, ex.take weapons,create vechiles,etc out? thanks

Did you add it as an client side code in the meta.xml? If you know what I mean?

Something like...

... 
<script src="something.lua" [u]type="client"[/u]/> 
... 

If you have some trouble with it, feel free to say so. But I do note that this is in the wiki. ;)

gui was already there, im editting freeroam gua, you know any job scripts i can use for people to make money, and too see people run after each other?

Link to comment
What you exactly mean?

Hey Snert, i logged on to my server, made a gui edit of freeroam gui's normal gui, i type /guioutpet and it doesnt do anything??

Wanna come on my serv and help?

You can't SEE what guioutput does. Until you close MTA, look in the guiedit folder, and see a file with your GUI data. :P

If you want to see it and be capable of doing Ctrl+C, then you need to do /guiprint.

Link to comment
What you exactly mean?

Hey Snert, i logged on to my server, made a gui edit of freeroam gui's normal gui, i type /guioutpet and it doesnt do anything??

Wanna come on my serv and help?

You can't SEE what guioutput does. Until you close MTA, look in the guiedit folder, and see a file with your GUI data. :P

If you want to see it and be capable of doing Ctrl+C, then you need to do /guiprint.

Ive done that, it only says

--- --- ----

And on Guiprint its blank :S

Link to comment
just tell you on here? So you want us to copy and paste large chunks of stuff from the wiki because you're too damn lazy to look yourself? Your server = EPIC FAIL because it's owner = EPIC FAIL. Sorry sunshine, but round here, you only get rewards when you put in some effort yourself. Otherwise you WILL get shot down in flames. Nobody is going to help you unless you're willing to help yourself. The reason? We're all too busy with life, and our own projects to help people with their every little question that they need answering, when the answers are already available to them somewhere else.

So how about you start by reading up the MTA DM server and the introductions to scripting, etc, and then at least TRY to answer those questions yourself. When you come unstuck and have demonstrably tried to make things work yourself, then we'll be more inclined to help.

I'm afraid most of the replies below will now say the same thing, with you replying "GTFO meanies, I just want some help, if you're not willing to help, FO"...because no-one will pander to your laziness.

Yeah like i did, ppl help me because they don't need to copy and paste 100000 lines of code.

I do the most stuff myself and get help by people with small codes and if it's big then they send links or just tell me how to do, try do like me and you'll get respect and friends.

EDIT:

Don't act like a 13 year old
Dude i think gamesnert is 14 and i'm too LOL you got pwned to death man.
Link to comment
EDIT:
Don't act like a 13 year old
Dude i think gamesnert is 14 and i'm too LOL you got pwned to death man.

Lol nevermind that, I think he already knows that by now. ;)

btw, so i would put

if hasObjectPermissionTo ( player, "resource.YourResourceName.accessPrivateArea", false )

ontop in my GUI?

Well, a little different.

if hasObjectPermissionTo ( player, "function.createResource", false ) then 
    ((Your GUI code)) 
end 

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...