Sealbreaker Posted August 3, 2009 Author Share Posted August 3, 2009 so…. this is what i got... and i need help, cause it does nothing....```Sub NationFight(index)Dim TimeStartDim TimeEndTimeStart = GetServerTime(12,0,0)TimeEnd = GetServerTime(12,25,0)If TimeStart = True ThenCall GlobalMsg("Nation war started!", GREEN)Call PutVar("war.ini", "WAR", "war", 1)If TimeEnd = True ThenCall GlobalMsg("Nation war ended!", Green)Call PutVar("war.ini", "WAR", "war", 0)ElseEnd IfEnd Sub```and:```Case "/war"If GetVar("war.ini", "WAR", "war", 0) ThenCall PlayerMsg(index, "War is not active!, RED)ElseIf GetPlayerGuild(index, guildname) ThenCall Playerwarp(index, #, x, y)If GetPlayerGuild(index, guildname) ThenCall Playerwarp(index, #, x, y)End IfExit Sub``` Link to comment Share on other sites More sharing options...
emblem Posted August 3, 2009 Share Posted August 3, 2009 You're using ALL the functions wrong (except playermsg and globalmsg). That's why it wont work.This post would be more helpful, but I'm really tired and can't think so sorry. Link to comment Share on other sites More sharing options...
Admiral Refuge Posted August 3, 2009 Share Posted August 3, 2009 Yea, GetServerTime is being assigned wrong, and it's not a Boolean, and it's not in a loop to continuously check.Your best bet would be using timers Link to comment Share on other sites More sharing options...
Sealbreaker Posted August 3, 2009 Author Share Posted August 3, 2009 i dont know how to fix it…. so...can someone maybe give me the right code??? goin to be credited... and i'm really thankful then ;D Link to comment Share on other sites More sharing options...
Admiral Refuge Posted August 3, 2009 Share Posted August 3, 2009 You want the war to be active from 12:00 to 12:25, right? Link to comment Share on other sites More sharing options...
Sealbreaker Posted August 3, 2009 Author Share Posted August 3, 2009 right =) Link to comment Share on other sites More sharing options...
Admiral Refuge Posted August 3, 2009 Share Posted August 3, 2009 TimedEvent sub:```If Hours = 12 And Minutes = 0 Then Call GlobalMsg("Nation war started!", GREEN) Call PutVar("war.ini", "WAR", "war", "1")End IfIf Hours = 12 And Minutes = 25 Then Call GlobalMsg("Nation war ended!", GREEN) Call PutVar("war.ini", "WAR", "war", "0")End If```slash-command:```Case "/war"If GetVar("war.ini", "WAR", "war") = "1" Then Select Case GetPlayerGuild(index) Case "guildname" Call PlayerWarp(Index, MapNumber, X, Y) Case "guildname2" Call PlayerWarp(Index, MapNumber, X, Y) End SelectElse Call PlayerMsg(index, "War is not active!", RED)Exit Sub``` Link to comment Share on other sites More sharing options...
Sealbreaker Posted August 3, 2009 Author Share Posted August 3, 2009 thank you admiral =)you are helping every noob, almost every time… you're one of the nicest person on eclipse =)edit: it doesnt work right.... when war starts it says: nation war started! almost every second and if it ends it says nation war ended! every second... Link to comment Share on other sites More sharing options...
emblem Posted August 3, 2009 Share Posted August 3, 2009 Post your timed events sub.The whole thing. Link to comment Share on other sites More sharing options...
Sealbreaker Posted August 4, 2009 Author Share Posted August 4, 2009 ' Executes every second, based on the server time.Sub TimedEvent(Hours, Minutes, Seconds)If Hours = 12 And Minutes = 0 Then Call GlobalMsg("Nation war started!", GREEN) Call PutVar("war.ini", "WAR", "war", "1")End IfIf Hours = 12 And Minutes = 25 Then Call GlobalMsg("Nation war ended!", GREEN) Call PutVar("war.ini", "WAR", "war", "0")End IfEnd Sub Link to comment Share on other sites More sharing options...
emblem Posted August 4, 2009 Share Posted August 4, 2009 Ah. Admiral forgot that it will execute every second.```' Executes every second, based on the server time.Sub TimedEvent(Hours, Minutes, Seconds)If Hours = 12 And Minutes = 0 And Seconds = 0 Then Call GlobalMsg("Nation war started!", GREEN) Call PutVar("war.ini", "WAR", "war", "1")End IfIf Hours = 12 And Minutes = 25 And Seconds = 0 Then Call GlobalMsg("Nation war ended!", GREEN) Call PutVar("war.ini", "WAR", "war", "0")End IfEnd Sub``` Link to comment Share on other sites More sharing options...
Sealbreaker Posted August 4, 2009 Author Share Posted August 4, 2009 thank you..goin to test it tomorrow….;D ( its 2:40 here<.< )edit: LOL there was just the End If missing before exit sub xDDD ( in /war ) Link to comment Share on other sites More sharing options...
Sealbreaker Posted August 4, 2009 Author Share Posted August 4, 2009 first: sorry for doublepost ^^this is what i got till now ( tell me if it would work pls and maybe can someone complete my /enemy- command) :```' Executes every second, based on the server time.Sub TimedEvent(Hours, Minutes, Seconds)If Hours = 12 And Minutes = 0 And Seconds = 0 Then Call GlobalMsg("Nation war started!", RED) Call PutVar("war.ini", "WAR", "war", "1")End IfIf Hours = 12 And Minutes = 25 And Seconds = 0 Then Call GlobalMsg("Nation war ended!", RED) Call PutVar("war.ini", "WAR", "war", "0") Call PutVar("war.ini", "WAR", "a", "0") Call PutVar("war.ini", "WAR", "a", "0")End IfEnd Sub``````Case "/war"If GetVar("war.ini", "WAR", "war") = "1" Then Select Case GetPlayerGuild(index) Case "guildname" Call PlayerWarp(Index, MapNumber, X, Y) Call PlayerMsg(index, "You joined the natonwar", Green) Call PutVar("war.ini", "WAR", "a", Int(a) + 1) Case "guildname2" Call PlayerWarp(Index, MapNumber, X, Y) Call PlayerMsg(index, "You joined the nationwar", GREEN) Call PutVar("war.ini", "WAR", "b", Int(b) + 1) End SelectElse Call PlayerMsg(index, "War is not active!", RED)End IfExit Sub```and this ( i need help with it…. ) :```Case "/war"If GetVar("war.ini", "WAR", "war") = "1" Then Select Case GetPlayerGuild(index) Case "guildname" Call PlayerWarp(Index, MapNumber, X, Y) Call PlayerMsg(index, "You joined the natonwar", Green) Call PutVar("war.ini", "WAR", "a", Int(a) + 1) Case "guildname2" Call PlayerWarp(Index, MapNumber, X, Y) Call PlayerMsg(index, "You joined the nationwar", GREEN) Call PutVar("war.ini", "WAR", "b", Int(b) + 1) End SelectElse Call PlayerMsg(index, "War is not active!", RED)End IfExit Sub``` Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now