cder Posted March 21, 2020 Group: Members Topic Count: 36 Topics Per Day: 0.01 Content Count: 96 Reputation: 0 Joined: 08/06/18 Last Seen: June 8, 2021 Share Posted March 21, 2020 (edited) Hello guys I need a very simple answer, it would be like to assign "+1" in a variable called "newday", when the server arrives at 00:00 Example: Spoiler - script DayNight -1,{ OnClock0000: set newday, newday + 1; end; } } Edited March 21, 2020 by cder Quote Link to comment Share on other sites More sharing options...
0 Mabuhay Posted March 21, 2020 Group: Members Topic Count: 105 Topics Per Day: 0.02 Content Count: 446 Reputation: 232 Joined: 03/20/12 Last Seen: October 22, 2020 Share Posted March 21, 2020 (edited) Use global variable. Example: $var or read script command in doc folder Edited March 21, 2020 by Mabuhay 1 Quote Link to comment Share on other sites More sharing options...
0 cder Posted March 21, 2020 Group: Members Topic Count: 36 Topics Per Day: 0.01 Content Count: 96 Reputation: 0 Joined: 08/06/18 Last Seen: June 8, 2021 Author Share Posted March 21, 2020 (edited) 17 minutes ago, Mabuhay said: Use global variable. Example: $var or read script command in doc folder I know about it, I did just one example up there, but what I want to assign is not global, but for each player ..., you know ? Edited March 21, 2020 by cder Quote Link to comment Share on other sites More sharing options...
0 Mabuhay Posted March 21, 2020 Group: Members Topic Count: 105 Topics Per Day: 0.02 Content Count: 446 Reputation: 232 Joined: 03/20/12 Last Seen: October 22, 2020 Share Posted March 21, 2020 You cannot do player bound variables if you dont attach players. It is better to check for the current day using gettime then update every time player uses that npc. More examples are best found in annieruru's blogspot. 1 Quote Link to comment Share on other sites More sharing options...
0 cder Posted March 21, 2020 Group: Members Topic Count: 36 Topics Per Day: 0.01 Content Count: 96 Reputation: 0 Joined: 08/06/18 Last Seen: June 8, 2021 Author Share Posted March 21, 2020 5 minutes ago, Mabuhay said: You cannot do player bound variables if you dont attach players. It is better to check for the current day using gettime then update every time player uses that npc. More examples are best found in annieruru's blogspot. Thx, please can you send the link? Quote Link to comment Share on other sites More sharing options...
0 Patskie Posted March 24, 2020 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 1702 Reputation: 241 Joined: 09/05/12 Last Seen: 9 hours ago Share Posted March 24, 2020 OnClock0000: addrid(0); set newday, newday + 1; end; You can use addrid. *addrid(<type>{,<flag>{,<parameters>}}); This command will attach other RIDs to the current script without detaching the invoking RID. It returns 1 if successful and 0 upon failure. <type> determines what RIDs are attached: 0: All players in the server. 1: All players in the map of the invoking player, or the invoking NPC if no player is attached. 2: Party members of a specified party ID. [ Parameters: <party id> ] 3: Guild members of a specified guild ID. [ Parameters: <guild id> ] 4: All players in a specified area of the map of the invoking player (or NPC). [ Parameters: <x0>,<y0>,<x1>,<y1> ] 5: All players in the map. [ Parameters: "<map name>" ] Account ID: If type is Account ID, attach the specified account ID. <flag> can prevent certain players from being attached: 0: Players are always attached. (default) 1: Players currently running another script will not be attached. 1 Quote Link to comment Share on other sites More sharing options...
0 cder Posted March 24, 2020 Group: Members Topic Count: 36 Topics Per Day: 0.01 Content Count: 96 Reputation: 0 Joined: 08/06/18 Last Seen: June 8, 2021 Author Share Posted March 24, 2020 (edited) 7 minutes ago, Patskie said: OnClock0000: addrid(0); set newday, newday + 1; end; You can use addrid. *addrid(<type>{,<flag>{,<parameters>}}); This command will attach other RIDs to the current script without detaching the invoking RID. It returns 1 if successful and 0 upon failure. <type> determines what RIDs are attached: 0: All players in the server. 1: All players in the map of the invoking player, or the invoking NPC if no player is attached. 2: Party members of a specified party ID. [ Parameters: <party id> ] 3: Guild members of a specified guild ID. [ Parameters: <guild id> ] 4: All players in a specified area of the map of the invoking player (or NPC). [ Parameters: <x0>,<y0>,<x1>,<y1> ] 5: All players in the map. [ Parameters: "<map name>" ] Account ID: If type is Account ID, attach the specified account ID. <flag> can prevent certain players from being attached: 0: Players are always attached. (default) 1: Players currently running another script will not be attached. Oops, how beautiful, I can't test it now but I am very grateful for that, thanks ... Edited March 24, 2020 by cder Quote Link to comment Share on other sites More sharing options...
Question
cder
Hello guys I need a very simple answer, it would be like to assign "+1" in a variable called "newday", when the server arrives at 00:00
Example:
- script DayNight -1,{
OnClock0000:
set newday, newday + 1;
end;
}
}
Link to comment
Share on other sites
6 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.