Vincent Posted July 19, 2013 Group: Members Topic Count: 130 Topics Per Day: 0.03 Content Count: 528 Reputation: 18 Joined: 09/11/12 Last Seen: March 5, 2020 Share Posted July 19, 2013 My PvP NPC have this Chatbox for the Player counter. The problem is the box dont work. Allways 0. I think the problem is when i load the npc is check the counter but dont refresh it so the count is allways the same. waitingroom "PvP("+getmapusers("pvp_n_1-5")+") GvG("+getmapusers("pvp_y_1-2")+")",0; Also this error came up. Is this because of dumplicate the NPC? [Error]: chat_createnpcchat: npc 'Warper#1-1' already has a chatroom, cannot cre ate new one! Script: //--- Warper 1.0.0 -----------------------------------------// //----------------------------------------------------------------// // ttt 000000000 // ttt 000 000 // ttttttttt rrrrrrrrr 000 000 nnnnnnnnn // ttt rrr 000 000 nnn nnn // ttt rrr 000 000 nnn nnn // ttt rrr 000 000 nnn nnn // ttttt rrr 000000000 nnn nnn //----------------------------------------------------------------// //--- Changelogs: ------------------------------------------------// // 1.0.0 Release //----------------------------------------------------------------// //--- Main Script ------------------------------------------------// payon,97,121,3 script Warper#1-1 558,{ waitingroom "PvP("+getmapusers("pvp_n_1-5")+") GvG("+getmapusers("pvp_y_1-2")+")",0; function AddTown; function AddDungeon; function AddField; function LastWarp; //Activate|Deactivate menu here set .lastwarp, 1; set .towns, 1; set .dungeons, 1; set .fields, 1; /////////////////////////////////////////////////////////////////////////////////// set .@rentnpcdate,gettimetick(2)+604800; query_sql "SELECT `date` FROM `rentnpc` WHERE `char_id` = " + getcharid(0) + " AND `npc` = 2", .@renttime; if (.@renttime > gettimetick(2)){ //Set warp fee here set .townfee, 875; set .dungeonfee, 3750; set .fieldfee, 0; set .lastwarpfee, 475; } else { //Set warp fee here set .townfee, 1750; set .dungeonfee, 7500; set .fieldfee, 0; set .lastwarpfee, 950; } /////////////////////////////////////////////////////////////////////////////// //Checks if maps are loaded, (prevents out of index) if(.mapsloaded==1) goto L_warpmenu; set .mapsloaded, 1; //Add Towns here AddTown("Payon[Main Town]", "payon", 110, 115); AddTown("Prontera", "prontera", 155, 183); AddTown("Alberta", "alberta", 28, 234); AddTown("Aldebaran", "aldebaran", 140, 131); AddTown("Amatsu", "amatsu", 198, 84); AddTown("Ayothaya", "ayothaya", 150, 163); AddTown("Comodo", "comodo", 209, 143); //AddTown("Einbech (Mining Village);", "einbech", 70, 95); //AddTown("Einbroch", "einbroch", 64, 200); AddTown("Geffen", "geffen", 119, 59); AddTown("Gonryun", "gonryun", 160, 121); //AddTown("Hugel", "hugel", 96, 145); AddTown("Izlude", "izlude", 128, 114); //AddTown("Jawaii", "jawaii", 213, 230); //AddTown("Lighthalzen", "lighthalzen", 158, 92); AddTown("Louyang", "louyang", 210, 108); AddTown("Lutie", "xmas", 147, 134); //AddTown("Moscovia", "moscovia", 214, 183); AddTown("Morroc", "morocc", 156, 93); //AddTown("Nameless Island", "nameless_n", 256, 215); AddTown("Niflheim", "niflheim", 85, 154); //AddTown("Rachel", "rachel", 130, 137); //AddTown("Thor Camp", "thor_camp", 254, 90); //AddTown("Veins", "veins", 216, 123); AddTown("Yuno", "yuno", 157, 51); AddTown("Umbala", "umbala", 145, 155); //Add Dungeons here //AddDungeon("Abbey, Cursed Monastery", "abbey01", 51, 14); //AddDungeon("Abyss Lakes", "abyss_01", 192, 207); AddDungeon("Amatsu Dungeon", "ama_dun01", 228, 11); AddDungeon("Anthell", "anthell01", 35, 262); AddDungeon("Beach Dungeon", "beach_dun", 266, 67); AddDungeon("Ayothaya Dungeon", "ayo_dun01", 275, 19); AddDungeon("Byalan Dungeon", "iz_dun00", 168, 168); AddDungeon("Clock Tower", "c_tower1", 199, 159); AddDungeon("Coal Mines", "mjo_dun01", 52, 17); AddDungeon("Culverts", "prt_sewb1", 131, 247); //AddDungeon("Einbroch Dungeon", "ein_dun01", 22, 14); //AddDungeon("Gefenia", "gefenia01", 40, 103); AddDungeon("Geffen Dungeon", "gef_dun00", 104, 99); AddDungeon("Glast Heim", "glast_01", 367, 303); AddDungeon("Gonryun Dungeon", "gon_dun01", 153, 53); AddDungeon("Hidden Dungeon", "prt_maze01", 176, 7); //AddDungeon("Ice Dungeon", "ice_dun01", 157, 14); //AddDungeon("Juperos Dungeon", "juperos_01", 53, 247); //AddDungeon("Kiel Dungeon", "kh_dun01", 28, 226); //AddDungeon("Lighthalzen Dungeon", "lhz_dun01", 150, 288); //AddDungeon("The Royal Tomb", "lou_dun01", 218, 196); AddDungeon("Magma Dungeon", "mag_dun01", 126, 68); //AddDungeon("Les Forest", "mosk_dun01", 132, 124); AddDungeon("Orc Dungeon", "orcsdun01", 32, 170); AddDungeon("Payon Dungeon", "pay_dun00", 21, 183); AddDungeon("Pyramids", "moc_pryd01", 192, 9); //AddDungeon("Rachel Sanctuary", "ra_san01", 140, 11); AddDungeon("Sphinx", "in_sphinx1", 288, 9); AddDungeon("Sunken Ship", "treasure01", 69, 24); //AddDungeon("Thanatos Tower", "tha_t01", 150, 39); //AddDungeon("Thor Volcano", "thor_v01", 21, 228); AddDungeon("Toy Factory", "xmas_dun01", 205, 15); AddDungeon("Turtle Dungeon", "tur_dun01", 154, 49); AddDungeon("Umbala Dungeon", "um_dun01", 42, 31); //Add Fields here //AddField("<Map Menu Name>", <"map name">, <x>, <y>); AddField("Arena PvP", "pvp_n_1-5", 0, 0); AddField("Izlude GvG", "pvp_y_1-2", 0, 0); L_warpmenu: mes "[^FF7700 Warper^000000]"; mes "Welcome!"; switch(select(((.lastwarp)?"Last Warp [^0000FF"+((@lastwarpname$)?@lastwarpname$:"^0000FF-empty-^000000")+"^000000] (^FF0000"+.lastwarpfee+"z^000000)":""), ((.towns)?"Towns (^FF0000"+.townfee+"z^000000)":""), ((.dungeons)?"Dungeons (^FF0000"+.dungeonfee+"z^000000)":""), ((.fields)?"PVP (^FF0000"+.fieldfee+"z^000000)":""), "Exit")) { case 1: if (@lastwarpname$=="") close; if( Zeny < .lastwarpfee ) close; set Zeny,Zeny-.lastwarpfee; warp @lastwarpmap$, @lastwarpx, @lastwarpy; break; case 2: set .@townmenu$,""; for (set .@i,0; .@i < getarraysize(.townname$); set .@i,.@i+1) { if (.@i) set .@townmenu$,.@townmenu$+":"; set .@townmenu$,.@townmenu$+.townname$[.@i]; } set .@selection,select(.@townmenu$)-1; if( Zeny < .townfee ) close; set Zeny,Zeny-.townfee; warp .townmap$[.@selection],.townx[.@selection],.towny[.@selection]; LastWarp(.townname$[.@selection], .townmap$[.@selection], .townx[.@selection], .towny[.@selection]); break; case 3: set .@dungeonmenu$,""; for (set .@j,0; .@j < getarraysize(.dungeonname$); set .@j,.@j+1) { if (.@j) set .@dungeonmenu$,.@dungeonmenu$+":"; set .@dungeonmenu$,.@dungeonmenu$+.dungeonname$[.@j]; } set .@selection2,select(.@dungeonmenu$)-1; if( Zeny < .dungeonfee ) close; set Zeny,Zeny-.dungeonfee; warp .dungeonmap$[.@selection2],.dungeonx[.@selection2],.dungeony[.@selection2]; LastWarp(.dungeonname$[.@selection2], .dungeonmap$[.@selection2], .dungeonx[.@selection2], .dungeony[.@selection2]); break; case 4: set .@fieldmenu$,""; for (set .@k,0; .@k < getarraysize(.fieldname$); set .@k,.@k+1) { if (.@k) set .@fieldmenu$,.@fieldmenu$+":"; set .@fieldmenu$,.@fieldmenu$+.fieldname$[.@k]; } set .@selection3,select(.@fieldmenu$)-1; if( Zeny < .fieldfee ) close; set Zeny,Zeny-.fieldfee; warp .fieldmap$[.@selection3],.fieldx[.@selection3],.fieldy[.@selection3]; LastWarp(.fieldname$[.@selection3], .fieldmap$[.@selection3], .fieldx[.@selection3], .fieldy[.@selection3]); break; case 5: next; mes "[^FF7700 Warper^000000]"; mes "Bye!"; close; } function AddTown { if(getmapusers(getarg(1)) >= 0) { set .townname$[getarraysize(.townname$)], getarg(0); set .townmap$[getarraysize(.townmap$)], getarg(1); set .townx[getarraysize(.townx)], getarg(2); set .towny[getarraysize(.towny)], getarg(3); return; } return; } function AddDungeon { if(getmapusers(getarg(1)) >= 0) { set .dungeonname$[getarraysize(.dungeonname$)], getarg(0); set .dungeonmap$[getarraysize(.dungeonmap$)], getarg(1); set .dungeonx[getarraysize(.dungeonx)], getarg(2); set .dungeony[getarraysize(.dungeony)], getarg(3); return; } return; } function AddField { if(getmapusers(getarg(1)) >= 0) { set .fieldname$[getarraysize(.fieldname$)], getarg(0); set .fieldmap$[getarraysize(.fieldmap$)], getarg(1); set .fieldx[getarraysize(.fieldx)], getarg(2); set .fieldy[getarraysize(.fieldy)], getarg(3); return; } return; } function LastWarp { set @lastwarpname$, getarg(0); set @lastwarpmap$, getarg(1); set @lastwarpx, getarg(2); set @lastwarpy, getarg(3); return; } } geffen,112,64,4 duplicate(Warper#1-1) Warper#1-1983-1 612 alberta,35,240,4 duplicate(Warper#1-1) Warper#1-13-1 612 alberta,110,69,4 duplicate(Warper#1-1) Warper#1-13-2 612 aldebaran,147,117,4 duplicate(Warper#1-1) Warper#1-14-3 612 amatsu,190,86,1 duplicate(Warper#1-1) Warper#1-15-1 612 ayothaya,147,123,6 duplicate(Warper#1-1) Warper#1-16-1 612 comodo,206,77,4 duplicate(Warper#1-1) Warper#1-17-1 612 hugel,88,151,5 duplicate(Warper#1-1) Warper#1-110-1 612 izlude,131,110,3 duplicate(Warper#1-1) Warper#1-113-1 612 morocc,156,95,4 duplicate(Warper#1-1) Warper#1-115-1 612 prontera,151,187,4 duplicate(Warper#1-1) Warper#1-116-1 612 yuno,160,170,4 duplicate(Warper#1-1) Warper#1-117-1 612 gonryun,162,122,4 duplicate(Warper#1-1) Warper#1-130-1 612 louyang,221,120,4 duplicate(Warper#1-1) Warper#1-131-1 612 rachel,133,115,4 duplicate(Warper#1-1) Warper#1-135-1 612 Quote Link to comment Share on other sites More sharing options...
Capuche Posted July 19, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share Posted July 19, 2013 Add a delwaitingroom before waitingroom delwaitingroom; waitingroom "PvP("+getmapusers("pvp_n_1-5")+") GvG("+getmapusers("pvp_y_1-2")+")",0; Like your error display, you msut delete the previous waitingroom before create a new one npc 'Warper#1-1' already has a chatroom, cannot create new one! Quote Link to comment Share on other sites More sharing options...
Vincent Posted July 20, 2013 Group: Members Topic Count: 130 Topics Per Day: 0.03 Content Count: 528 Reputation: 18 Joined: 09/11/12 Last Seen: March 5, 2020 Author Share Posted July 20, 2013 The error is gone but the player counter only work if i warp new to a map. How it works if i stay at a map? Quote Link to comment Share on other sites More sharing options...
Capuche Posted July 20, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share Posted July 20, 2013 Replace to function LastWarp { set @lastwarpname$, getarg(0); set @lastwarpmap$, getarg(1); set @lastwarpx, getarg(2); set @lastwarpy, getarg(3); return; } OnPCLoadMapEvent: OnPCLoginEvent: OnPCLogoutEvent: .@map$ = strcharinfo(3); sleep 1000; if ( .@map$ == "pvp_n_1-5" || .@map$ == "pvp_n_1-2" ) { delwaitingroom; waitingroom "PvP("+getmapusers("pvp_n_1-5")+") GvG("+getmapusers("pvp_y_1-2")+")",0; } end; } pvp_n_1-2 mapflag loadevent pvp_n_1-5 mapflag loadevent geffen,112,64,4 duplicate(Warper#1-1) Warper#1-1983-1 612 alberta,35,240,4 duplicate(Warper#1-1) Warper#1-13-1 612 1 Quote Link to comment Share on other sites More sharing options...
Vincent Posted July 22, 2013 Group: Members Topic Count: 130 Topics Per Day: 0.03 Content Count: 528 Reputation: 18 Joined: 09/11/12 Last Seen: March 5, 2020 Author Share Posted July 22, 2013 Thanks works. Quote Link to comment Share on other sites More sharing options...
Question
Vincent
My PvP NPC have this Chatbox for the Player counter. The problem is the box dont work. Allways 0. I think the problem is when i load the npc is check the counter but dont refresh it so the count is allways the same.
Also this error came up. Is this because of dumplicate the NPC?
Script:
Link to comment
Share on other sites
4 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.