אהלן,
מה קורה כולם?
נכון שפעם ראיתם שבשרת יש טיפים לדוגמא כמו זה:
ואתם רוצים שהטיפים ישתנו/יהיו יותר טיפים?קוד PHP:[Tip] No.15 ~ Don't Mess With Me
אז הגעתם למקום הנכון!
לכו לתיקיית הריפאק שלכם,
אח"כ לתיקייה Scripts,
אח"כ לתיקייה Events
ואז תכנסו לקובץ automsg.js.
הנה הסקריפט שאמור להיות:
[אני לקחתי את הסקריפט מZombie Repack]
קוד:נכון שיש את החלק הזה:var setupTask;
function init() {
scheduleNew();
}
function scheduleNew() {
setupTask = em.scheduleAtFixedRate("start", 1000 * 60 * 10);
}
function cancelSchedule() {
setupTask.cancel(true);
}
function start() {
var Message = new Array("@zombie for all in one NPC","Tommy in henesys will warp you to a map where monsters drop NX!","Mr.Pickall can exchange NX cards for NX","Do @rebirth to Rebirth! Or @zombie and do the Rebirth Quest","@slime command will open up a shop selling slime erasers for 1b each, You can use it to recieve rewards at @reward/@reward1.","Vote every 12 hours so we can get more players! Check the website for link!","Use @commands or @help to show you a list of commands!","Type @shop for the EVERTHING shop!","Cesar in henesys can teach you monster rider skill and much more!");
em.getChannelServer().broadcastPacket(net.sf.odinms.tools.MaplePacketCreator.sen dYellowTip("[Zombie'sTip] " + Message[Math.floor(Math.random() * Message.length)]));
}
אז כל מה שבין הסוגריים [ () ] זה הטיפים,קוד PHP:var Message = new Array("@zombie for all in one NPC","Tommy in henesys will warp you to a map where monsters drop NX!","Mr.Pickall can exchange NX cards for NX","Do @rebirth to Rebirth! Or @zombie and do the Rebirth Quest","@slime command will open up a shop selling slime erasers for 1b each, You can use it to recieve rewards at @reward/@reward1.","Vote every 12 hours so we can get more players! Check the website for link!","Use @commands or @help to show you a list of commands!","Type @shop for the EVERTHING shop!","Cesar in henesys can teach you monster rider skill and much more!");
מצדידי כל טיפ יש מרחאות ["] ואחרי שרושמים טיפ אחד צריך לעשות פסיק [,] ואז עושים שוב מרחאות ["] ורושמים את הטיפ הבא,
אם רוצים להוסיף טיפ פשוט לפני הסוגריים שבסוף [ ( ] אז עושים פסיק ואז מרחאות [ " ] ורושמים עוד טיפ.
עכשיו בכל פעם לפני הטיפ יהיה רשום משהו הנה השורה של זה:
השורה הזאת בעצם אומרת מה בעצם יקרה,קוד PHP:em.getChannelServer().broadcastPacket(net.sf.odinms.tools.MaplePacketCreator.sendYellowTip("[Zombie'sTip] " + Message[Math.floor(Math.random() * Message.length)]));
כלומר מה שזה אומר:
"תשלח לכל הסרבר הודעת טיפ בצבע צהוב:
כלומר תשלח [Zombie's Tip] ואז תשלח טיפ רנדומלי מהרשומים.קוד PHP:[Zombie'sTip]Randomally Tip
~אני יודע שאפשר לשנות כל כמה זמן יהיה טיפ והנה השורה:
הנה ציטוט של מישהו שמסביר איך משנים את הזמנים:קוד PHP:setupTask = em.scheduleAtFixedRate("start", 1000 * 60 * 10);
ציטוט:
פורסם במקור על ידי NoGuts_NoGlory
יפה אחי!!
בקשר לזמן 1000 זה שניה 60 זה כאילו כפול שישים שזה יוצא דקה ואז כפול 10 זה יוצא כל 10 דקות מבין?
ככה שאם אתה רוצה למשל חצי דקה אתה יכול לעשות 1000*30
~
*מי שירצה לשים תמונה של דוגמא לטיפ מוזמן =] *



