Jump to content

Ajutor cu un script


Lally

Recommended Posts

Buna as dori ajutor intr-o problema.

Am un script de pe community mtasa.

El este un script cu boxa care merge cu URL de radio si se aude dar panoul de la boxa e pe o tasta (bind).

Eu vreau sa fie pe comanda gen:/boxa si sa apara panoul.

Uitati scriptu cu bind:poza3.png

Link to comment

Va cer si eu odata in viata ceva si gata dute descurcate de parca nu pentru asta a fost infiintat acest forum sa ne ajutam intre noi dar voi sunteti cei mai buni si va dati mari dar stiti nu insemnati nimik daca tineti pentru voi si va dati mari ca faceti ca dregeti.

Link to comment
Va cer si eu odata in viata ceva si gata dute descurcate de parca nu pentru asta a fost infiintat acest forum sa ne ajutam intre noi dar voi sunteti cei mai buni si va dati mari dar stiti nu insemnati nimik daca tineti pentru voi si va dati mari ca faceti ca dregeti.

Prietene, du-te pe la scoala si invata mai bine lb. romana si daca vrei sa te descurci si la script-uri invata si engleza.

P.S: Nu este prima data cand ceri ajutor.

P.S 2: Daca tu crezi ca acest forum este facut ca niste oameni care s-au documentat si s-au chinuit singuri sa invete ca sa vina astia ca tine si sa zica: vreau si eu aia, faceti si pt. mine aia... TE INSELI SI POTI SA NU MAI INTRI NICIODATA AICI !

Link to comment
In script ai bindKey() si o functie, stergi linia cu bindKey si inlocuiesti cu:

addCommandHandler("comanda", functia)

Poftim. E sub orgoliul meu sa-mi faca cineva glumite cu 'scripteri', mai ales cand n-am vazut niciun achievment concret din partea lor.

^^ Cauta prin postari ;) Inafara de ala cu pancardele. Si nu m-am referit la o persoana anume , sunt persoane aici care zic ca stiu sa lucreze in " lua " si cand cere cineva ajutorul imediat se gasesc sa comenteze in plus ....

Link to comment
In script ai bindKey() si o functie, stergi linia cu bindKey si inlocuiesti cu:

addCommandHandler("comanda", functia)

Poftim. E sub orgoliul meu sa-mi faca cineva glumite cu 'scripteri', mai ales cand n-am vazut niciun achievment concret din partea lor.

^^ Cauta prin postari ;) Inafara de ala cu pancardele. Si nu m-am referit la o persoana anume , sunt persoane aici care zic ca stiu sa lucreze in " lua " si cand cere cineva ajutorul imediat se gasesc sa comenteze in plus ....

Nu sunt scripter si sunt la inceput in lua, dar din moment ce eu nu cer ajutor pt. orice si imi intind nervii la maxim el nu putea cauta ?

Uite-te pe comunitatea romaneasca si zi-mi daca iti place ce vezi...

Astazi il ajuti, dar cand o sa se vada cu jucatori pe server si tu o sa fi concurenta o sa recurga la orice pt. a te distruge.

Link to comment
In script ai bindKey() si o functie, stergi linia cu bindKey si inlocuiesti cu:

addCommandHandler("comanda", functia)

Poftim. E sub orgoliul meu sa-mi faca cineva glumite cu 'scripteri', mai ales cand n-am vazut niciun achievment concret din partea lor.

^^ Cauta prin postari ;) Inafara de ala cu pancardele. Si nu m-am referit la o persoana anume , sunt persoane aici care zic ca stiu sa lucreze in " lua " si cand cere cineva ajutorul imediat se gasesc sa comenteze in plus ....

Faci referire la mine pe unde prinzi pe ascuns,crezi ca nu mi-am dat seama ca tu ai ceva cu mine de cand am RPP-ul? Daca nu as fi stiu sa lucrez in lua acum nu aveam scripturile pe care le am pe server. Daca tu ai timp sa lucrezi la scripturi,eu nu am timp. Vin acasa pe la 21-22 in fiecare zi si dupa nu imi mai arde de facut nimic. Macar daca comentezi,comenteaza cu dovezi si rost. :cry:

Link to comment
  • 5 months later...
Buna as dori ajutor intr-o problema.

Am un script de pe community mtasa.

El este un script cu boxa care merge cu URL de radio si se aude dar panoul de la boxa e pe o tasta (bind).

Eu vreau sa fie pe comanda gen:/boxa si sa apara panoul.

Uitati scriptu cu bind:poza3.png

Incearca asta

defaultlinks = {}       
defaultlinks[1] = {"", "Edit these from client.lua file"}
defaultlinks[2] = {"", ""}
defaultlinks[3] = {"", ""}
defaultlinks[4] = {"", ""}
defaultlinks[5] = {"", ""}
defaultlinks[6] = {"", ""}
defaultlinks[7] = {"", ""}
defaultlinks[8] = {"", ""}
 
maxdistance = 100
defaultdistance = 50
 
--//Dont edit these!
triggerServerEvent ("clientIsReady", getRootElement())
width, height = guiGetScreenSize ()
speakers = {}
linkTable = {}
selectedURLName = "N/A"
 
function startScript ()
    --//Create main GUI
    mainWindow = guiCreateWindow ((width/2) - (500/2), (height/2) - (417/2), 500, 417, "Speaker system", false)
    guiWindowSetSizable (mainWindow, false)
    --Buttons and event handlers
    closeButton = guiCreateButton (450, 25, 40, 35, "Close", false, mainWindow)
    addEventHandler ("onClientGUIClick", closeButton, closeGUI)
   
    createButton = guiCreateButton (30, 87, 80, 40, "Create speaker", false, mainWindow)
    addEventHandler ("onClientGUIClick", createButton, onCreateSpeakerKlick)
   
    destroyButton = guiCreateButton (130, 87, 80, 40, "Destroy speaker", false, mainWindow)
    addEventHandler ("onClientGUIClick", destroyButton, onDestroySpeakerClick)
   
    myLinksButton = guiCreateButton (420, 114, 70, 35, "My links", false, mainWindow)
    addEventHandler ("onClientGUIClick", myLinksButton, onMyLinksButtonClick)
    guiSetEnabled (myLinksButton, false)
    --URL Stuff
    guiCreateLabel (90, 23, 100, 30, "Radio URL:", false, mainWindow)
    urlEdit = guiCreateEdit (22, 44, 200, 35, "", false, mainWindow) --50
    --Max distance
    guiCreateLabel (259, 23, 200, 30, "Max distance (1 - " .. tostring(maxdistance) .. "):", false, mainWindow)
    distanceEdit = guiCreateEdit (290, 44, 50, 35, tostring(defaultdistance), false, mainWindow)
    --
    nowPlayingText = guiCreateLabel (34, 133, 70, 30, "Now playing:", false, mainWindow)
    guiSetVisible (nowPlayingText, false)
    nowPlayingEditLabel = guiCreateLabel (112, 133, 288, 30, "-", false, mainWindow)
    guiSetVisible (nowPlayingEditLabel, false)
    guiCreateLabel (25, 145, 600, 30, "_______________________________________________________________", false, mainWindow)
    --Links
        --Edit 1
        edit1 = guiCreateEdit (105, 168, 313, 23, defaultlinks[1][2], false, mainWindow)
        guiCreateLabel (30, 170, 200, 30, defaultlinks[1][1], false, mainWindow)
        guiEditSetReadOnly (edit1, true)
        defaultUseButton1 = guiCreateButton (423, 168, 40, 23, "use", false, mainWindow)
        --Edit 2
        edit2 = guiCreateEdit (105, 198, 313, 23, defaultlinks[2][2], false, mainWindow)
        guiCreateLabel (30, 200, 200, 30, defaultlinks[2][1], false, mainWindow)
        guiEditSetReadOnly (edit2, true)
        defaultUseButton2 = guiCreateButton (423, 198, 40, 23, "use", false, mainWindow)
        --Edit 3
        edit3 = guiCreateEdit (105, 228, 313, 23, defaultlinks[3][2], false, mainWindow)
        guiCreateLabel (30, 230, 200, 30, defaultlinks[3][1], false, mainWindow)
        guiEditSetReadOnly (edit3, true)
        defaultUseButton3 = guiCreateButton (423, 228, 40, 23, "use", false, mainWindow)
        --Edit 4
        edit4 = guiCreateEdit (105, 258, 313, 23, defaultlinks[4][2], false, mainWindow)
        guiCreateLabel (30, 260, 200, 30, defaultlinks[4][1], false, mainWindow)
        guiEditSetReadOnly (edit4, true)
        defaultUseButton4 = guiCreateButton (423, 258, 40, 23, "use", false, mainWindow)
        --Edit 5
        edit5 = guiCreateEdit (105, 288, 313, 23, defaultlinks[5][2], false, mainWindow)
        guiCreateLabel (30, 290, 200, 30, defaultlinks[5][1], false, mainWindow)
        guiEditSetReadOnly (edit5, true)
        defaultUseButton5 = guiCreateButton (423, 288, 40, 23, "use", false, mainWindow)
        --Edit 6
        edit6 = guiCreateEdit (105, 318, 313, 23, defaultlinks[6][2], false, mainWindow)
        guiCreateLabel (30, 320, 200, 30, defaultlinks[6][1], false, mainWindow)
        guiEditSetReadOnly (edit6, true)
        defaultUseButton6 = guiCreateButton (423, 318, 40, 23, "use", false, mainWindow)
        --Edit 7
        edit7 = guiCreateEdit (105, 348, 313, 23, defaultlinks[7][2], false, mainWindow)
        guiCreateLabel (30, 350, 200, 30, defaultlinks[7][1], false, mainWindow)
        guiEditSetReadOnly (edit7, true)
        defaultUseButton7 = guiCreateButton (423, 348, 40, 23, "use", false, mainWindow)
        --Edit 8
        edit8 = guiCreateEdit (105, 378, 313, 23, defaultlinks[8][2], false, mainWindow)
        guiCreateLabel (30, 380, 200, 30, defaultlinks[8][1], false, mainWindow)
        guiEditSetReadOnly (edit8, true)
        defaultUseButton8 = guiCreateButton (423, 378, 40, 23, "use", false, mainWindow)
        --//--
    guiSetVisible (mainWindow, false)
   
    --Add some events
    addEvent ("speakerStuffFromServer", true)
    addEventHandler ("speakerStuffFromServer", getRootElement(), createSpeaker)
   
    addEvent ("destroySpeaker", true)
    addEventHandler ("destroySpeaker", getRootElement(), destroySpeaker)
   
    addEvent ("onPQuit", true)
    addEventHandler ("onPQuit", getRootElement(), onPlayerQuit)
   
    addEvent ("createMyLinksGUI", true)
    addEventHandler ("createMyLinksGUI", getRootElement(), createMyLinksGUI)
   
    addEvent ("onPlayerLogout", true)
    addEventHandler ("onPlayerLogout", getRootElement(), onPlayerLogout)
end
addEventHandler ("onClientResourceStart", getResourceRootElement(), startScript)
 
 
function openOrCloseGUI ()
    if guiGetVisible (mainWindow) then
        guiSetVisible (mainWindow, false)
        guiSetVisible (linkWindow, false)
        showCursor (false)
    else
        guiSetVisible (mainWindow, true)
        showCursor (true)
    end
end
addCommandHandler ("boxa", openOrCloseGUI)
 
 
function closeGUI ()
    if source == closeButton then
        guiSetVisible (mainWindow, false)
        showCursor (false)
    end
end
 
 
function createMyLinksGUI (tableoflinks)
    linkTable = tableoflinks
    guiSetEnabled (myLinksButton, true)
   
    --//Create my links window
    linkWindow = guiCreateWindow ((width/2) - (483/2), (height/2) - (375/2), 483, 375, "My links", false)
    guiWindowSetSizable (linkWindow, false)
    guiSetAlpha (linkWindow, 0.-- s8) -->
    guiSetVisible (linkWindow, false)
    saveLinksButton = guiCreateButton (428, 25, 40, 35, "Close", false, linkWindow)
    guiCreateLabel (63, 48, 100, 30, "Name", false, linkWindow)
    guiCreateLabel (260, 48, 100, 30, "Link", false, linkWindow)
   
    --Link pad 1
    linkname1 = guiCreateEdit (17, 70, 125, 23, linkTable[1]["name"], false, linkWindow)
    linkedit1 = guiCreateEdit (145, 70, 253, 23, linkTable[1]["link"], false, linkWindow)
    linkUseButton1 = guiCreateButton (428, 70, 40, 23, "use", false, linkWindow)
    removeButton1 = guiCreateButton (400.5, 70, 23, 23, "X", false, linkWindow)
   
    --Link pad 2
    linkname2 = guiCreateEdit (17, 100, 125, 23, linkTable[2]["name"], false, linkWindow)
    linkedit2 = guiCreateEdit (145, 100, 253, 23, linkTable[2]["link"], false, linkWindow)
    linkUseButton2 = guiCreateButton (428, 100, 40, 23, "use", false, linkWindow)
    removeButton2 = guiCreateButton (400.5, 100, 23, 23, "X", false, linkWindow)
   
    --Link pad 3
    linkname3 = guiCreateEdit (17, 130, 125, 23, linkTable[3]["name"], false, linkWindow)
    linkedit3 = guiCreateEdit (145, 130, 253, 23, linkTable[3]["link"], false, linkWindow)
    linkUseButton3 = guiCreateButton (428, 130, 40, 23, "use", false, linkWindow)
    removeButton3 = guiCreateButton (400.5, 130, 23, 23, "X", false, linkWindow)
   
    --Link pad 4
    linkname4 = guiCreateEdit (17, 160, 125, 23, linkTable[4]["name"], false, linkWindow)
    linkedit4 = guiCreateEdit (145, 160, 253, 23, linkTable[4]["link"], false, linkWindow)
    linkUseButton4 = guiCreateButton (428, 160, 40, 23, "use", false, linkWindow)
    removeButton4 = guiCreateButton (400.5, 160, 23, 23, "X", false, linkWindow)
   
    --Link pad 5
    linkname5 = guiCreateEdit (17, 190, 125, 23, linkTable[5]["name"], false, linkWindow)
    linkedit5 = guiCreateEdit (145, 190, 253, 23, linkTable[5]["link"], false, linkWindow)
    linkUseButton5 = guiCreateButton (428, 190, 40, 23, "use", false, linkWindow)
    removeButton5 = guiCreateButton (400.5, 190, 23, 23, "X", false, linkWindow)
   
    --Link pad 6
    linkname6 = guiCreateEdit (17, 220, 125, 23, linkTable[6]["name"], false, linkWindow)
    linkedit6 = guiCreateEdit (145, 220, 253, 23, linkTable[6]["link"], false, linkWindow)
    linkUseButton6 = guiCreateButton (428, 220, 40, 23, "use", false, linkWindow)
    removeButton6 = guiCreateButton (400.5, 220, 23, 23, "X", false, linkWindow)
   
    --Link pad 7
    linkname7 = guiCreateEdit (17, 250, 125, 23, linkTable[7]["name"], false, linkWindow)
    linkedit7 = guiCreateEdit (145, 250, 253, 23, linkTable[7]["link"], false, linkWindow)
    linkUseButton7 = guiCreateButton (428, 250, 40, 23, "use", false, linkWindow)
    removeButton7 = guiCreateButton (400.5, 250, 23, 23, "X", false, linkWindow)
   
    --Link pa d8
    linkname8 = guiCreateEdit (17, 280, 125, 23, linkTable[8]["name"], false, linkWindow)
    linkedit8 = guiCreateEdit (145, 280, 253, 23, linkTable[8]["link"], false, linkWindow)
    linkUseButton8 = guiCreateButton (428, 280, 40, 23, "use", false, linkWindow)
    removeButton8 = guiCreateButton (400.5, 280, 23, 23, "X", false, linkWindow)
   
    --Link pad 9
    linkname9 = guiCreateEdit (17, 310, 125, 23, linkTable[9]["name"], false, linkWindow)
    linkedit9 = guiCreateEdit (145, 310, 253, 23, linkTable[9]["link"], false, linkWindow)
    linkUseButton9 = guiCreateButton (428, 310, 40, 23, "use", false, linkWindow)
    removeButton9 = guiCreateButton (400.5, 310, 23, 23, "X", false, linkWindow)
   
    --Link pad 10
    linkname10 = guiCreateEdit (17, 340, 125, 23, linkTable[10]["name"], false, linkWindow)
    linkedit10 = guiCreateEdit (145, 340, 253, 23, linkTable[10]["link"], false, linkWindow)
    linkUseButton10 = guiCreateButton (428, 340, 40, 23, "use", false, linkWindow)
    removeButton10 = guiCreateButton (400.5, 340, 23, 23, "X", false, linkWindow)
end
 
 
function onMyLinksButtonClick ()
    if source == myLinksButton then
        guiSetVisible (linkWindow, true)
        guiMoveToBack (mainWindow)
    end
end
 
 
function closeLinkWindow ()
    if source == closeLinkWindowButton then
        guiSetVisible (linkWindow, false)
        reloadLinkPads ()
    end
end
 
 
function onCreateSpeakerKlick ()
    if source == createButton then
        if speakers[player] then
            outputChatBox ("You already have a speaker!", 255, 0, 0)
        else
            local guiText = guiGetText (urlEdit)
            if guiText == "" then
                outputChatBox ("You need to type radio url!", 255, 0, 0)
            else
                local distance = guiGetText (distanceEdit)
                distance = tonumber (distance)
                if type (distance) ~= "number" then
                    outputChatBox ("Distance have to be number!", 255, 0, 0)
                else
                    if distance > maxdistance then
                        outputChatBox ("Distance have to be between 1 - " .. maxdistance .. "!", 255, 0, 0)
                        return false
                    else
                        if distance < 1 then
                            outputChatBox ("Distance have to be between 1 - " .. maxdistance .. "!", 255, 0, 0)
                            return false
                        else
                            player = localPlayer
                            local url = guiGetText (urlEdit)
                            local distance = guiGetText (distanceEdit)
                            triggerServerEvent ("onSpeakerCreate", getRootElement(), player, url, distance)
                        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...