Jump to content

Dialog


{_AntiFreak_}

Recommended Posts

Hello,

i want to create a dialog in my script, but i need some help

For example i take the dialog out of PRS:

dialog prs { 
  title "MTASA:PRS By [uVA]Scooby" 
  size -1 -1 197 108 
  option dbu 
  tab "PRS Main", 100, -1 -3 198 111 
  text "Welcome Msg:", 1, 5 15 35 8, tab 100 
  edit "Welcome To My Server.", 2, 41 14 154 10, tab 100 autovs 
} 

I don't know what these values behind the tabs, texts or edits say (, 2, 41 14 154 10, tab 100 autovs). which number is for what (height, width...) and what is autovs and "option dbu"???

Hope for help, thx

Link to comment

now, i made a dialog, but it doesn't really work. The dialog is shown, but the buttons don't work.

Here, the dialog:

alias empty !halt $input(Error - Empty $1 Field,douw,MRS - Error!) 
alias w_n { 
  if (!$dialog(w_n)) { 
    !dialog -md w_n w_n 
  } 
} 
on *:start: { 
  mta 
  !dialog -md w_n w_n 
} 
dialog w_n { 
  title "[MRS]Mega-RCON-Script by !!TheTruthGER - Messages" 
  size -1 -1 290 57 
  option dbu 
  text "Welcome-Message:", 2, 8 8 48 8 
  text "News:", 3, 8 24 25 8 
  edit "", 4, 56 8 177 10, autovs 
  button "Welcome: On", 5, 248 8 37 12 
  edit "", 6, 56 24 178 10, autovs 
  button "News: On", 7, 248 24 37 12 
  button "Save Changes", 1, 8 40 128 12 
  button "Close", 9, 144 40 141 12, ok cancel 
} 
on *:DIALOG:w_n:sclick:*: { 
  if ($did == 1) { 
    if (!did(w_n,4)) && ($did(w_n,5) == Welcome: On) empty Welcome-Message 
    elseif (!$did(w_n,6)) && ($did(w_n,7) == News: On) empty News 
    else { 
      !write -dl $+ 1 " $+ $scriptdir $+ welcomemsg.txt" 
      !write " $+ $scriptdir $+ welcomemsg.txt" $did(w_n,4) 
      !write -dl $+ 1 " $+ $scriptdir $+ newsmsg.txt" 
      !write " $+ $scriptdir $+ newsmsg.txt" $did(w_n,6) 
      !halt $input(Welcome/News-Msg Saved,dou,Welcome/News-Msg Saved) 
    } 
  } 
  elseif ($did == 5) { 
    if ($did(prs,5) == Welcome: On) { 
      !write -dl $+ 1 " $+ $scriptdir $+ welcomemsg.txt" 
      !write " $+ $scriptdir $+ welcomemsg.txt" Off 
      !did -a w_n 5 Welcome: Off 
      !did -a w_n 4 Off 
    } 
    else { 
      !write -dl $+ 1 " $+ $scriptdir $+ welcomemsg.txt" 
      !write " $+ $scriptdir $+ welcomemsg.txt" $did(w_n,4) 
      !did -a w_n 5 Welcome: On 
    } 
  } 
  elseif ($did == 7) { 
    if ($did(prs,7) == News: On) { 
      !write -dl $+ 1 " $+ $scriptdir $+ newsmsg.txt" 
      !write " $+ $scriptdir $+ newsmsg.txt" Off 
      !did -a w_n 7 News: Off 
      !did -a w_n 6 Off 
    } 
    else { 
      !write -dl $+ 1 " $+ $scriptdir $+ newsmsg.txt" 
      !write " $+ $scriptdir $+ newsmsg.txt" $did(w_n,6) 
      !did -a w_n 7 News: On 
    } 
  } 
} 
on *:DIALOG:w_n:init:*: { 
  if ($read($scriptdir $+ welcomemsg.txt,1)) !did -ra w_n 4 $v1 
  if ($read($scriptdir $+ newsmsg.txt,1)) !did -ra w_n 6 $v1 
} 
on *:SIGNAL:mta.adcon: { 
  if ($3 == !w_n) w_n 
} 

What is wrong? Can someone help me, please???

Link to comment

alias empty !halt $input(Error - Empty $1 Field,douw,MRS - Error!) 
alias w_n { 
  if (!$dialog(w_n)) { 
    !dialog -md w_n w_n 
  } 
} 
dialog w_n { 
  title "[MRS]Mega-RCON-Script by !!TheTruthGER - Messages" 
  size -1 -1 290 57 
  option dbu 
  text "Welcome-Message:", 2, 8 8 48 8 
  text "News:", 3, 8 24 25 8 
  edit "", 4, 56 8 177 10, autovs 
  button "Welcome: On", 5, 248 8 37 12 
  edit "", 6, 56 24 178 10, autovs 
  button "News: On", 7, 248 24 37 12 
  button "Save Changes", 1, 8 40 128 12 
  button "Close", 9, 144 40 141 12, ok cancel 
} 
on *:DIALOG:w_n:sclick:*: { 
  if ($did == 1) { 
    if ($did(w_n,5) == Welcome: On) { 
      !write -dl $+ 1 " $+ $scriptdir $+ welcomemsg.txt" 
      !write " $+ $scriptdir $+ welcomemsg.txt" $did(w_n,4) 
    } 
    else { 
      !write -dl $+ 1 " $+ $scriptdir $+ welcomemsg.txt" 
      !write " $+ $scriptdir $+ welcomemsg.txt" Off 
    } 
    if ($did(w_n,7) == News: On) { 
      !write -dl $+ 1 " $+ $scriptdir $+ newsmsg.txt" 
      !write " $+ $scriptdir $+ newsmsg.txt" News: $did(w_n,6) 
    } 
    else { 
      !write -dl $+ 1 " $+ $scriptdir $+ newsmsg.txt" 
      !write " $+ $scriptdir $+ newsmsg.txt" Off 
    } 
    !halt $input(Messages have been saved,dou,Messages have been saved) 
  } 
  elseif ($did == 5) { 
    if ($did(w_n,5) == Welcome: On) { 
      !did -a w_n 5 Welcome: Off 
      !did -ra w_n 4 Off 
    } 
    else { 
      !did -a w_n 5 Welcome: On 
    } 
  } 
  elseif ($did == 7) { 
    if ($did(w_n,7) == News: On) { 
      !did -a w_n 7 News: Off 
      !did -ra w_n 6 Off 
    } 
    else { 
      !did -a w_n 7 News: On 
    } 
  } 
} 
on *:DIALOG:w_n:init:*: { 
  if ($read(welcomemsg.txt,1)) !did -ra w_n 4 $v1 
  if ($read(newsmsg.txt,1)) !did -ra w_n 6 $v1 
} 
on *:SIGNAL:mta.adcon: { 
  if ($3 == !messages) w_n 
} 

NOW IT WORKS!!!!! I'm so good^^ :wink::D

Link to comment

small error unless you want it to do that look

elseif ($did == 5) { 
    if ($did(w_n,5) == Welcome: On) { 
      !did -a w_n 5 Welcome: Off 
  [color=#FF0000]!did -ra w_n 4 Off[/color] 
    } 
    else { 
      !did -a w_n 5 Welcome: On 
    } 
  } 
  elseif ($did == 7) { 
    if ($did(w_n,7) == News: On) { 
      !did -a w_n 7 News: Off 
     [color=#FF0000] !did -ra w_n 6 Off[/color] 
    } 
    else { 
      !did -a w_n 7 News: On 
    } 
  } 
} 

?? why do you want the red bit to show that the button is "off" in the edit box ?

Link to comment
  • 2 weeks later...
  • Recently Browsing   0 members

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