OK論壇

 找回密碼
 註冊
查看: 1154|回復: 1

要怎麼正確在公會倉庫加入密碼功能

 關閉 [複製鏈接]
  • TA的每日心情
    開心
    2019-5-11 02:04 AM
  • 簽到天數: 39 天

    連續簽到: 1 天

    [LV.5]常住居民I

    發表於 2012-8-21 23:00:34 | 顯示全部樓層 |閱讀模式
    本帖最後由 0716 於 2012-8-22 01:46 AM 編輯

    我對腳本撰寫還不是很熟悉
    目前還在學習{:soso__14993238364229783703_3:}
    我現在會個人倉庫的密碼腳本
    而用相同方式寫公會倉庫密碼
    會變成建立密碼的人才需輸入密碼
    其他會員不需要輸入就能開啟
    爬過文沒研究出個所以然{:soso__13004497297541996587_2:}
    所以才來發這個帖
    懇請指點一下迷津吧{:soso__16796506287819407486_3:}
    這是腳本內容
    1. Serve_05_02:
    2.         mes "["+$@NPC_Name$+"]";
    3.         mes "歡迎使用保管服務";
    4.         mes "請選擇您要的保管項目";
    5.         next;
    6.         menu         "公會倉庫",Serve_05_02_01,
    7.         (strcharinfo(0) == getguildmaster(getcharid(2))?"^ff0000密碼保護^000000":""),Serve_05_02_02,
    8.                 "回上一層",Serve_05_Main,
    9.                 "離開",Exit_System;

    10. Serve_05_02_01:
    11.         if ( getcharid(2) == 0 ) {
    12.                 mes "["+$@NPC_Name$+"]";
    13.                 mes "不好意思,您沒有加入任何公會唷";
    14.                 close2; cutin "",255; end;
    15.         }
    16.         if(#Keyin_Chance2>2){
    17.                 goto Cannot_USE2;
    18.         }
    19.         if ( zeny < $@GSS_Zeny ) {
    20.                 mes "["+$@NPC_Name$+"]";
    21.                 mes "使用此服務需要^FF0000"+$@GSS_Zeny+"^000000z";
    22.                 mes "您身上擁有的金錢不足";
    23.                 close2; cutin "",255; end;
    24.         }
    25.         if(@Private_Password2!=0){
    26.                 mes "["+$@NPC_Name$+"]";
    27.                 mes "[^669900剩餘輸入機會^000000 : "+(3-#Keyin_Chance2)+" ]";
    28.                 mes "系統偵測到您有設定^0000ff防護密碼^000000";
    29.                 mes "需要輸入密碼,才能使用倉庫服務";
    30.                 next;
    31.                 input .@Keyin_Password2;
    32.                 if(.@Keyin_Password2==0){
    33.                         next;
    34.                         goto Serve_05_02;
    35.                 }else if(.@Keyin_Password2!=@Private_Password2){
    36.                         mes "["+$@NPC_Name$+"]";
    37.                         mes "^ff0000密碼錯誤,請重新輸入^000000";
    38.                         next;
    39.                         set #Keyin_Chance2,#Keyin_Chance2+1;
    40.                         if(#Keyin_Chance2>2){
    41.                                 mes "["+$@NPC_Name$+"]";
    42.                                 mes "由於您輸入^ff0000錯誤次數^000000過多";
    43.                                 mes "^996600本服務將凍結30分鐘,已確保防護安全^000000";
    44.                                 mes "^996600若要解凍,請在線上待滿30分鐘^000000";
    45.                                 mes "^996600(重登將會清除累計時間)^000000";
    46.                                 addtimer 1800000, strnpcinfo(3)+"::OnUNLOCK2";
    47.                                 set @storage_lock2,1;
    48.                                 close2; cutin "",255;
    49.                                 end;
    50.                         }
    51.                         goto Serve_05_Main;
    52.                 }else{
    53.                         mes "["+$@NPC_Name$+"]";
    54.                         mes "^0000ff密碼正確,關閉對話視窗後開啟倉庫^000000";
    55.                         close2;
    56.                         cutin "",255;
    57.                         set zeny,zeny - $@GSS_Zeny;
    58.                         guildopenstorage();
    59.                         end;
    60.                         }
    61.                 }
    62.         if ( guildopenstorage() == 1 ) {
    63.                 mes "["+$@NPC_Name$+"]";
    64.                 mes "不好意思,請您稍等一下";
    65.                 mes "有其它的成員正在使用倉庫";
    66.                 close2; cutin "",255;
    67.         }
    68.         close2;
    69.         cutin "",255;
    70.         set zeny,zeny - $@GSS_Zeny;
    71.         end;

    72. Serve_05_02_02:
    73.         mes "["+$@NPC_Name$+"]";
    74.         mes "請選擇您要進行的設定";
    75.         next;
    76.         menu         "設定密碼",Serve_05_02_02_01,
    77.                 (@Private_Password2!=0?"移除密碼":""),Serve_05_02_02_02,
    78.                 "回上一層",Serve_05_02,
    79.                 "離開",Exit_System;

    80. Serve_05_02_02_01:
    81. if(#Keyin_Chance2>2){        goto Cannot_USE2;        }
    82. if(@Private_Password2==0){
    83.                 mes "["+$@NPC_Name$+"]";
    84.                 mes "請輸入^0000ff 4至6位數的半形數字^000000 做為密碼";
    85.                 next;
    86.                 input .@S_Password2;
    87.                 next;
    88.                 if((.@S_Password2<1000) || (.@S_Password2>999999))
    89.                 {
    90.                         mes "["+$@NPC_Name$+"]";
    91.                         mes "^ff0000範圍不正確^000000";
    92.                         mes "您輸入的數字為^0000ff"+.@S_Password2+"^000000";
    93.                         next;
    94.                         goto Serve_05_02_02;
    95.                 }
    96.                 mes "["+$@NPC_Name$+"]";
    97.                 mes "請再^669900重複輸入^000000一次核對密碼";
    98.                 next;
    99.                 input .@C_Password2;
    100.                 next;
    101.                 if(.@S_Password2!=.@C_Password2)
    102.                 {
    103.                         mes "["+$@NPC_Name$+"]";
    104.                         mes "您輸入的密碼^0000ff兩次核對不一樣^000000";
    105.                         mes "請再重新輸入一次";
    106.                         next;
    107.                         goto Serve_05_02_02_01;
    108.                 }else{
    109.                 set @Private_Password2,.@C_Password2;
    110.                 mes "["+$@NPC_Name$+"]";
    111.                 mes "^669900個人防護密碼已設定成功^000000";
    112.                 mes "您設定的密碼為^0000ff"+.@C_Password2+"^000000";
    113.                 mes "^ff0000請妥善保存,切勿洩漏給自身以外人知道^000000";
    114.                 next;
    115.                 goto Serve_05_02;
    116.                 }
    117.                 }else{
    118.                 mes "["+$@NPC_Name$+"]";
    119.                 mes "您已經有設定過密碼了";
    120.                 mes "請問您要更改設定的密碼嗎?";
    121.                 next;
    122.                 menu         "^0000ff更改密碼^000000",Change_Password2,
    123.                         "回上一層",Serve_05_02_02,
    124.                         "離開",Exit_System;
    125. }

    126. Change_Password2:
    127. if(#Keyin_Chance2>2){        goto Cannot_USE2;        }
    128.                 mes "["+$@NPC_Name$+"]";
    129.                 mes "請輸入原先的密碼";
    130.                 next;
    131.                 input .@Change_Password2;
    132.                 next;
    133.                 if(.@Change_Password2!=@Private_Password2){
    134.                         mes "["+$@NPC_Name$+"]";
    135.                         mes "密碼錯誤,無法繼續下一步驟";
    136.                         next;
    137.                         goto Serve_05_02_02;
    138.                 }else{
    139.                         mes "["+$@NPC_Name$+"]";
    140.                         mes "請輸入^0000ff 4至6位數的半形數字^000000 做為密碼";
    141.                         next;
    142.                         input .@S2_Password2;
    143.                         next;
    144.                         if((.@S_Password2<1000) || (.@S_Password2>=999999))
    145.                         {
    146.                                 mes "["+$@NPC_Name$+"]";
    147.                         mes "^ff0000範圍不正確^000000";
    148.                         mes "您輸入的數字為^0000ff"+.@S2_Password2+"^000000";
    149.                                 next;
    150.                                 goto Change_Password2;
    151.                         }
    152.                         mes "["+$@NPC_Name$+"]";
    153.                         mes "請再^669900重複輸入^000000一次核對密碼";
    154.                         next;
    155.                         input .@C2_Password2;
    156.                         next;
    157.                         if(.@S2_Password2!=.@C2_Password2)
    158.                         {
    159.                                 mes "["+$@NPC_Name$+"]";
    160.                                 mes "您輸入的密碼^0000ff兩次核對不一樣^000000";
    161.                                 mes "請再重新輸入一次";
    162.                                 next;
    163.                                 goto Change_Password2;
    164.                         }else{
    165.                                 set @Private_Password2,.@C2_Password2;
    166.                                 mes "["+$@NPC_Name$+"]";
    167.                                 mes "^006699個人防護密碼已更改成功^000000";
    168.                                 mes "您設定的密碼為^0000ff"+.@C2_Password2+"^000000";
    169.                                 mes "^ff0000請妥善保存,切勿洩漏給自身以外人知道^000000";
    170.                                 next;
    171.                                 goto Serve_05_02_02;
    172.                         }
    173.                 }

    174. Serve_05_02_02_02:
    175. if(#Keyin_Chance2>2){        goto Cannot_USE2;        }
    176.                 mes "["+$@NPC_Name$+"]";
    177.                 mes "請輸入原先的密碼";
    178.                 next;
    179.                 input .@Change_Password2;
    180.                 next;
    181.                 if(.@Change_Password2!=@Private_Password2){
    182.                         mes "["+$@NPC_Name$+"]";
    183.                         mes "密碼錯誤,無法繼續下一步驟";
    184.                         next;
    185.                         goto Serve_05_02_02;
    186.                 }else{
    187.                         mes "["+$@NPC_Name$+"]";
    188.                         mes "^0000ff已成功移除密碼^000000";
    189.                         mes "^669900您隨時可以在新增您的防護密碼^000000";
    190.                         set @Private_Password2,0;
    191.                         next;
    192.                         goto Serve_05_02_02;
    193.                 }
    複製代碼
    感謝{:soso__11311968200164124650_1:}
    回復

    使用道具 舉報

  • TA的每日心情
    開心
    2020-10-27 09:10 PM
  • 簽到天數: 2555 天

    連續簽到: 1 天

    [LV.Master]伴壇終老

    發表於 2012-8-21 23:12:34 | 顯示全部樓層
    本帖最後由 he01204046 於 2012-8-21 11:23 PM 編輯

    不知道3CEAM跟你的架設檔的程式上有沒有差別,我以3CEAM來說:

    @Private_Password2

    "@"是角色暫存用的變數(登出消失),你用這個當然不能

    要用到公會的變數,就需要用到伺服器永久儲存變數"$"

    而公會又因為每個公會的倉庫都要分開,總不能混在一起

    所以這邊我使用:(取用變數的值使用getd,設定變數的值使用setd)

    setd "$Private_Password"+getcharid(2),????;

    getd("$Private_Password"+getcharid(2))

    簡單說明,假設某公會會長的公會編號5,則

    setd "$Private_Password"+getcharid(2),????;

    同等於

    set $Private_Password5,????;


    沒測試過,你測試看看吧

    1. Serve_05_02:
    2.         mes "["+$@NPC_Name$+"]";
    3.         mes "歡迎使用保管服務";
    4.         mes "請選擇您要的保管項目";
    5.         next;
    6.         menu         "公會倉庫",Serve_05_02_01,
    7.         (strcharinfo(0) == getguildmaster(getcharid(2))?"^ff0000密碼保護^000000":""),Serve_05_02_02,
    8.                 "回上一層",Serve_05_Main,
    9.                 "離開",Exit_System;

    10. Serve_05_02_01:
    11.         if ( getcharid(2) == 0 ) {
    12.                 mes "["+$@NPC_Name$+"]";
    13.                 mes "不好意思,您沒有加入任何公會唷";
    14.                 close2; cutin "",255; end;
    15.         }
    16.         if(#Keyin_Chance2>2){
    17.                 goto Cannot_USE2;
    18.         }
    19.         if ( zeny < $@GSS_Zeny ) {
    20.                 mes "["+$@NPC_Name$+"]";
    21.                 mes "使用此服務需要^FF0000"+$@GSS_Zeny+"^000000z";
    22.                 mes "您身上擁有的金錢不足";
    23.                 close2; cutin "",255; end;
    24.         }
    25.         if(getd("$Private_Password2"+getcharid(2))!=0){
    26.                 mes "["+$@NPC_Name$+"]";
    27.                 mes "[^669900剩餘輸入機會^000000 : "+(3-#Keyin_Chance2)+" ]";
    28.                 mes "系統偵測到您有設定^0000ff防護密碼^000000";
    29.                 mes "需要輸入密碼,才能使用倉庫服務";
    30.                 next;
    31.                 input .@Keyin_Password2;
    32.                 if(.@Keyin_Password2==0){
    33.                         next;
    34.                         goto Serve_05_02;
    35.                 }else if(.@Keyin_Password2!=getd("$Private_Password2"+getcharid(2))){
    36.                         mes "["+$@NPC_Name$+"]";
    37.                         mes "^ff0000密碼錯誤,請重新輸入^000000";
    38.                         next;
    39.                         set #Keyin_Chance2,#Keyin_Chance2+1;
    40.                         if(#Keyin_Chance2>2){
    41.                                 mes "["+$@NPC_Name$+"]";
    42.                                 mes "由於您輸入^ff0000錯誤次數^000000過多";
    43.                                 mes "^996600本服務將凍結30分鐘,已確保防護安全^000000";
    44.                                 mes "^996600若要解凍,請在線上待滿30分鐘^000000";
    45.                                 mes "^996600(重登將會清除累計時間)^000000";
    46.                                 addtimer 1800000, strnpcinfo(3)+"::OnUNLOCK2";
    47.                                 set @storage_lock2,1;
    48.                                 close2; cutin "",255;
    49.                                 end;
    50.                         }
    51.                         goto Serve_05_Main;
    52.                 }else{
    53.                         mes "["+$@NPC_Name$+"]";
    54.                         mes "^0000ff密碼正確,關閉對話視窗後開啟倉庫^000000";
    55.                         close2;
    56.                         cutin "",255;
    57.                         set zeny,zeny - $@GSS_Zeny;
    58.                         guildopenstorage();
    59.                         end;
    60.                         }
    61.                 }
    62.         if ( guildopenstorage() == 1 ) {
    63.                 mes "["+$@NPC_Name$+"]";
    64.                 mes "不好意思,請您稍等一下";
    65.                 mes "有其它的成員正在使用倉庫";
    66.                 close2; cutin "",255;
    67.         }
    68.         close2;
    69.         cutin "",255;
    70.         set zeny,zeny - $@GSS_Zeny;
    71.         end;

    72. Serve_05_02_02:
    73.         mes "["+$@NPC_Name$+"]";
    74.         mes "請選擇您要進行的設定";
    75.         next;
    76.         menu         "設定密碼",Serve_05_02_02_01,
    77.                 (getd("$Private_Password2"+getcharid(2))!=0?"移除密碼":""),Serve_05_02_02_02,
    78.                 "回上一層",Serve_05_02,
    79.                 "離開",Exit_System;

    80. Serve_05_02_02_01:
    81. if(#Keyin_Chance2>2){        goto Cannot_USE2;        }
    82. if(getd("$Private_Password2"+getcharid(2))==0){
    83.                 mes "["+$@NPC_Name$+"]";
    84.                 mes "請輸入^0000ff 4至6位數的半形數字^000000 做為密碼";
    85.                 next;
    86.                 input .@S_Password2;
    87.                 next;
    88.                 if((.@S_Password2<1000) || (.@S_Password2>999999))
    89.                 {
    90.                         mes "["+$@NPC_Name$+"]";
    91.                         mes "^ff0000範圍不正確^000000";
    92.                         mes "您輸入的數字為^0000ff"+.@S_Password2+"^000000";
    93.                         next;
    94.                         goto Serve_05_02_02;
    95.                 }
    96.                 mes "["+$@NPC_Name$+"]";
    97.                 mes "請再^669900重複輸入^000000一次核對密碼";
    98.                 next;
    99.                 input .@C_Password2;
    100.                 next;
    101.                 if(.@S_Password2!=.@C_Password2)
    102.                 {
    103.                         mes "["+$@NPC_Name$+"]";
    104.                         mes "您輸入的密碼^0000ff兩次核對不一樣^000000";
    105.                         mes "請再重新輸入一次";
    106.                         next;
    107.                         goto Serve_05_02_02_01;
    108.                 }else{
    109.                 setd "$Private_Password2"+getcharid(2),.@C_Password2;
    110.                 mes "["+$@NPC_Name$+"]";
    111.                 mes "^669900個人防護密碼已設定成功^000000";
    112.                 mes "您設定的密碼為^0000ff"+.@C_Password2+"^000000";
    113.                 mes "^ff0000請妥善保存,切勿洩漏給自身以外人知道^000000";
    114.                 next;
    115.                 goto Serve_05_02;
    116.                 }
    117.                 }else{
    118.                 mes "["+$@NPC_Name$+"]";
    119.                 mes "您已經有設定過密碼了";
    120.                 mes "請問您要更改設定的密碼嗎?";
    121.                 next;
    122.                 menu         "^0000ff更改密碼^000000",Change_Password2,
    123.                         "回上一層",Serve_05_02_02,
    124.                         "離開",Exit_System;
    125. }

    126. Change_Password2:
    127. if(#Keyin_Chance2>2){        goto Cannot_USE2;        }
    128.                 mes "["+$@NPC_Name$+"]";
    129.                 mes "請輸入原先的密碼";
    130.                 next;
    131.                 input .@Change_Password2;
    132.                 next;
    133.                 if(.@Change_Password2!=getd("$Private_Password2"+getcharid(2))){
    134.                         mes "["+$@NPC_Name$+"]";
    135.                         mes "密碼錯誤,無法繼續下一步驟";
    136.                         next;
    137.                         goto Serve_05_02_02;
    138.                 }else{
    139.                         mes "["+$@NPC_Name$+"]";
    140.                         mes "請輸入^0000ff 4至6位數的半形數字^000000 做為密碼";
    141.                         next;
    142.                         input .@S2_Password2;
    143.                         next;
    144.                         if((.@S_Password2<1000) || (.@S_Password2>=999999))
    145.                         {
    146.                                 mes "["+$@NPC_Name$+"]";
    147.                         mes "^ff0000範圍不正確^000000";
    148.                         mes "您輸入的數字為^0000ff"+.@S2_Password2+"^000000";
    149.                                 next;
    150.                                 goto Change_Password2;
    151.                         }
    152.                         mes "["+$@NPC_Name$+"]";
    153.                         mes "請再^669900重複輸入^000000一次核對密碼";
    154.                         next;
    155.                         input .@C2_Password2;
    156.                         next;
    157.                         if(.@S2_Password2!=.@C2_Password2)
    158.                         {
    159.                                 mes "["+$@NPC_Name$+"]";
    160.                                 mes "您輸入的密碼^0000ff兩次核對不一樣^000000";
    161.                                 mes "請再重新輸入一次";
    162.                                 next;
    163.                                 goto Change_Password2;
    164.                         }else{
    165.                                 setd "$Private_Password2"+getcharid(2),.@C2_Password2;
    166.                                 mes "["+$@NPC_Name$+"]";
    167.                                 mes "^006699個人防護密碼已更改成功^000000";
    168.                                 mes "您設定的密碼為^0000ff"+.@C2_Password2+"^000000";
    169.                                 mes "^ff0000請妥善保存,切勿洩漏給自身以外人知道^000000";
    170.                                 next;
    171.                                 goto Serve_05_02_02;
    172.                         }
    173.                 }

    174. Serve_05_02_02_02:
    175. if(#Keyin_Chance2>2){        goto Cannot_USE2;        }
    176.                 mes "["+$@NPC_Name$+"]";
    177.                 mes "請輸入原先的密碼";
    178.                 next;
    179.                 input .@Change_Password2;
    180.                 next;
    181.                 if(.@Change_Password2!=getd("$Private_Password2"+getcharid(2))){
    182.                         mes "["+$@NPC_Name$+"]";
    183.                         mes "密碼錯誤,無法繼續下一步驟";
    184.                         next;
    185.                         goto Serve_05_02_02;
    186.                 }else{
    187.                         mes "["+$@NPC_Name$+"]";
    188.                         mes "^0000ff已成功移除密碼^000000";
    189.                         mes "^669900您隨時可以在新增您的防護密碼^000000";
    190.                         setd "$Private_Password2"+getcharid(2),0;
    191.                         next;
    192.                         goto Serve_05_02_02;
    193.                 }
    複製代碼
    回復 支持 反對

    使用道具 舉報

    您需要登錄後才可以回帖 登錄 | 註冊

    本版積分規則

    Archiver|手機版|小黑屋|OK討論區

    GMT+8, 2024-4-29 10:11 PM , Processed in 0.048215 second(s), 19 queries , Gzip On.

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回復 返回頂部 返回列表