Jump to content

Ayuda,con este script


Madonz

Recommended Posts

Hola a todos,son nuevo en el tema :D y estoy aprendiendo de a poco,en este caso tengo un problema que me gustaria que vieran:

function okGUI(button,state) 
       if button == "left" and state == "up" then 
               if (source == ok) then 
                         local text = guiGetText ( memo ) 
                         outputChatBox ( text ) 
                         if (text == "stats") then 
                         outputChatBox("BLABLA",255,0,0); 
  
                 end 
     end 
    end 
end 

no funciona porque sera,lo que yo quiero es que cuando escribo una palabra especial en este caso "stats" salga el mensaje de chatbox.Cada vez que pongo stats sale la palabra stats que claro es la linea correspondiente a lo de arriba.

espero que me puedan ayudar gracias :D

Como uso debugscript 3?

Link to comment

Ok

function GUI() 
window = guiCreateWindow(15,75,500,500,"Admin Adding Car",false) 
guiWindowSetMovable( Window, false ) 
guiWindowSetSizable( Window, false ) 
memo = guiCreateMemo(150,100,250,50,"",false,window) 
ok = guiCreateButton(100, 100, 50, 50,"OK",false,window) 
label = guiCreateLabel(13,35,500,100,"Cars:",false,window) 
guiLabelSetColor(label,255,255,255) 
guiLabelSetVerticalAlign(label,"top") 
guiLabelSetHorizontalAlign(label,"left",false) 
exit = guiCreateButton(171,19,19,19,"X",false,window) 
guiSetVisible(window,false) 
  
addEventHandler("onClientGUIClick",exit,exitGUI); 
addEventHandler("onClientGUIClick",ok,okcar); 
  
end 
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()),  
    function () 
        GUI() 
    end 
) 
function openTeleportWindow() 
        local PlayerName = getPlayerName(getLocalPlayer()) 
        if PlayerName == "BLABLA" then 
    guiSetVisible(window,true) 
  
        showCursor(true,true) 
        else return 
        end 
end 
addCommandHandler("OpenGUI",openTeleportWindow) 
  
function exitGUI() 
if (source == exit) then 
guiSetVisible(window,false); 
showCursor(false); 
   end 
 end 
function okcar(button,state) 
       if button == "left" and state == "up" then 
               if (source == ok) then 
                         local text = guiGetText ( memo ) 
                         outputChatBox ( text ) 
                            if (text == "stats") then 
                         outputChatBox("BLABLA",255,0,0); 
  
                 end 
     end 
    end 
end 

Link to comment
function GUI() 
window = guiCreateWindow(15,75,500,500,"Admin Adding Car",false) 
guiWindowSetMovable( Window, false ) 
guiWindowSetSizable( Window, false ) 
memo = guiCreateMemo(150,100,250,50,"",false,window) 
ok = guiCreateButton(100, 100, 50, 50,"OK",false,window) 
label = guiCreateLabel(13,35,500,100,"Cars:",false,window) 
guiLabelSetColor(label,255,255,255) 
guiLabelSetVerticalAlign(label,"top") 
guiLabelSetHorizontalAlign(label,"left",false) 
exit = guiCreateButton(171,19,19,19,"X",false,window) 
guiSetVisible(window,false) 
  
addEventHandler("onClientGUIClick",exit,exitGUI,false); 
addEventHandler("onClientGUIClick",ok,okcar,false); 
end 
addEventHandler("onClientResourceStart",resourceRoot,GUI) 
  
function openTeleportWindow() 
    local PlayerName = getPlayerName(getLocalPlayer()) 
    if PlayerName == "BLABLA" then 
        guiSetVisible(window,true) 
        showCursor(true,true) 
    end 
end 
addCommandHandler("OpenGUI",openTeleportWindow) 
  
function exitGUI() 
    if (source == exit) then 
        guiSetVisible(window,false); 
        showCursor(false); 
    end 
end 
  
function okcar(button,state) 
    if (button == "left" and state == "up") then 
        local text = guiGetText ( memo ) 
        outputChatBox ( text ) 
        if (string.lower(text) == "stats") then 
            outputChatBox("BLABLA",255,0,0) 
        end 
    end 
end 

Link to comment

Cambie el "memo" a un "edit" y ahora funciona:

function GUI() 
window = guiCreateWindow(15,75,500,500,"Admin Adding Car",false) 
guiWindowSetMovable( window, false ) 
guiWindowSetSizable( window, false ) 
memo = guiCreateEdit(150,100,250,50,"",false,window) 
ok = guiCreateButton(100, 100, 50, 50,"OK",false,window) 
label = guiCreateLabel(13,35,500,100,"Cars:",false,window) 
guiLabelSetColor(label,255,255,255) 
guiLabelSetVerticalAlign(label,"top") 
guiLabelSetHorizontalAlign(label,"left",false) 
exit = guiCreateButton(171,19,19,19,"X",false,window) 
guiSetVisible(window,false) 
  
addEventHandler("onClientGUIClick",exit,exitGUI,false); 
addEventHandler("onClientGUIClick",ok,okcar,false); 
end 
addEventHandler("onClientResourceStart",resourceRoot,GUI) 
  
function openTeleportWindow() 
    local PlayerName = getPlayerName(getLocalPlayer()) 
    if PlayerName == "BLABLA" then 
        guiSetVisible(window,true) 
        showCursor(true,true) 
    end 
end 
addCommandHandler("OpenGUI",openTeleportWindow) 
  
function exitGUI() 
    if (source == exit) then 
        guiSetVisible(window,false) 
        showCursor(false) 
    end 
end 
  
function okcar(button,state) 
    if (button == "left" and state == "up") then 
        local text = tostring(guiGetText ( memo )) 
        outputChatBox ( text ) 
        if (text == "stats") then 
            outputChatBox("BLABLA",255,0,0) 
        end 
    end 
end 

Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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