Jump to content
  • 0

add new day variable


Question

Posted (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 by cder

6 answers to this question

Recommended Posts

  • 0
Posted (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 by cder
  • 0
Posted

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. 

  • Like 1
  • 0
Posted
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?

  • 0
Posted
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.

 

  • MVP 1
  • 0
Posted (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 by cder

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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