Case 4 If GetPlayerLevel(index) > 49 Then Call playerquerybox(index, "How do you want to name your guild?", 0) Exit Sub End If Call PlayerMsg(index, "Guild Admin: You have to be level 50 to create a guild!", 2) Exit Sub
Sub ScriptedNPC(index, Script) Select Case Script Case 4 If GetPlayerLevel(index) > 49 Then Call playerquerybox(index, "How do you want to name your guild?", 0) Exit Sub End If Call PlayerMsg(index, "Guild Admin: You have to be level 50 to create a guild!", 2) Exit SubEnd Select End Sub
Case 0If response = "<GM>" then If GetPlayerAccess(index) = 0 Then Call PlayerMsg(index, "You cannot create this guild!", 12) Exit Sub End IfEnd IfCall PutVar("tempvars.ini", "GuildCreate", "Login", GetPlayerLogin(index))Call PutVar("tempvars.ini", "GuildCreate", "CharNum", GetPlayerCharNum(index))Call PutVar("tempvars.ini", "GuildCreate", "GuildName", response & "")Call SetTimer("tmrTest " & 0 & ",5", 5000)Call GlobalMsg(GetPlayerName(index) & " has created the guild: " & response & "!", 10)Call AlertMsg(index, "Your Guild: " & response & " will be created, please relog into the game AFTER 15 seconds!")Exit Sub
Sub Querybox(index, script)On Error Resume nextDim responseresponse=getvar("\responses.ini","Responses",Int(index))Select Case scriptCase 0If response = "<GM>" then If GetPlayerAccess(index) = 0 Then Call PlayerMsg(index, "You cannot create this guild!", 12) Exit Sub End IfEnd IfCall PutVar("tempvars.ini", "GuildCreate", "Login", GetPlayerLogin(index))Call PutVar("tempvars.ini", "GuildCreate", "CharNum", GetPlayerCharNum(index))Call PutVar("tempvars.ini", "GuildCreate", "GuildName", response & "")Call SetTimer("tmrTest " & 0 & ",5", 5000)Call GlobalMsg(GetPlayerName(index) & " has created the guild: " & response & "!", 10)Call AlertMsg(index, "Your Guild: " & response & " will be created, please relog into the game AFTER 15 seconds!")Exit SubEnd SelectEnd Sub
Case 5 Call RemoveTimer("tmrtest " & index & "," & 5) login = GetVar("tempvars.ini", "GuildCreate", "Login") charnum = GetVar("tempvars.ini", "GuildCreate", "CharNum") GuildName = GetVar("tempvars.ini", "GuildCreate", "GuildName") If CharNum > 1 Then Call PutVar("Banks\" & login & ".ini", "Char" & charnum, "Guild", GuildName & "") Call PutVar("Banks\" & login & ".ini", "Char" & charnum, "Guildaccess", "4") Else Call PutVar("accounts\" & login & ".ini", "Char" & charnum, "Guild", GuildName & "") Call PutVar("accounts\" & login & ".ini", "Char" & charnum, "Guildaccess", "4") End If Exit Sub
'********************************Sub tmrTest(index, script)'********************************Dim guildnameDim charnumDim loginOn Error Resume NextSelect case scriptCase 5 Call RemoveTimer("tmrtest " & index & "," & 5) login = GetVar("tempvars.ini", "GuildCreate", "Login") charnum = GetVar("tempvars.ini", "GuildCreate", "CharNum") GuildName = GetVar("tempvars.ini", "GuildCreate", "GuildName") If CharNum > 1 Then Call PutVar("Banks\" & login & ".ini", "Char" & charnum, "Guild", GuildName & "") Call PutVar("Banks\" & login & ".ini", "Char" & charnum, "Guildaccess", "4") Else Call PutVar("accounts\" & login & ".ini", "Char" & charnum, "Guild", GuildName & "") Call PutVar("accounts\" & login & ".ini", "Char" & charnum, "Guildaccess", "4") End If Exit SubEnd SelectEnd Sub