llchrisll Posted November 30, 2011 Share Posted November 30, 2011 (edited) Update: Deleted the script samples to prevent the usage of them. (security first D:) Also close please . ------------------------------------------------------------------------------------------------------------ Hi guys, I got a few problems with the following two mapflags: mf_nosave & mf_noexppenalty I'm trying to make an PvP/GvG/MvP Arena with included ranking system. I though about the mapflags and since I saw in an script I could that via their numbers and an array, I did it that way. My only problem is that it doesn't work with those two mf_ above. I dunno why though. Here are screenshots, InGame Debug Messages & Map Server console. InGame - Here I skipped the mf_nosave but it stopped at the second one. Map Server Error: Uploaded with ImageShack.us Regards, Chris Edited December 7, 2011 by calciumkid Quote Link to comment Share on other sites More sharing options...
0 llchrisll Posted December 2, 2011 Author Share Posted December 2, 2011 * bump * (wanted to that too D: at least once) Can no one help me? My SVN is eAthena SQL 14484 Trunk (Test Server, so I don't need always the newest svn o.o) Quote Link to comment Share on other sites More sharing options...
0 Kenpachi Posted December 2, 2011 Share Posted December 2, 2011 Are you sure the error belongs to one of the snippets? Actually the error is thrown when you try to compare integers and strings: if( data_isstring(left) && data_isstring(right) ) {// ss => op_2str op_2str(st, op, left->u.str, right->u.str); script_removetop(st, -3, -1);// pop the two values before the top one } else if( data_isint(left) && data_isint(right) ) {// ii => op_2num int i1 = left->u.num; int i2 = right->u.num; script_removetop(st, -2, 0); op_2num(st, op, i1, i2); } else {// invalid argument ShowError("script:op_2: invalid data for operator %sn", script_op2name(op)); script_reportdata(left); script_reportdata(right); script_reportsrc(st); script_removetop(st, -2, 0); script_pushnil(st); st->state = END; } Quote Link to comment Share on other sites More sharing options...
0 llchrisll Posted December 2, 2011 Author Share Posted December 2, 2011 Are you sure the error belongs to one of the snippets? Actually the error is thrown when you try to compare integers and strings: Yeah, I wasn't testing any other script at the moment, cuz when I commented it out and "restarted" my server it continued till it stopped at MF 44 > mf_noexppenalty. I was confused about that first too >-<, why he shows errors at those mapflags.... To "restart" the server I used this OnWhisperGlobal: set [email protected]_in,0; set [email protected],0; if(select("- ReLoad:- Nevermind") == 2) end; if(select("- Debug: Without Debug") == 1) set [email protected],1; set [email protected]_in,1; goto OnInit; end; } That's my way to bug hunt and it worked always so far o.o. [email protected]_in is for to prevent "attachrid" error when the server really (re)start . Here is my whole script if you want, but it's with commented part.... //===== eAthena Script ======================================= //= Arena Master //===== By =================================================== //= lllchrislll //===== Version ============================================== //= 1.0 - Script Made //===== Compatible With ====================================== //= Every eAthena Version [sql] //===== Description ========================================== //= PvP / GvG & MvP Arena which also handles an ranking to it. //= PvP Types: // - Normal // - Dispell: You'll be dispelled on Room entry. // - Deathmatch: You'll be auto resurrect when you die. // If you type @die or similar, you'll be warped to your save point. // - Party PvP: 2vs2, 3vs3, 4vs4, 5vs5 //= PvP: // - There are 5 Rooms: Prontera, Alberta, Izlude, Morroc // PvP Types: Normal - Deathmatch has one of these. // That means 5*3. // - Party PvP: There are 4 types and those also has one of room each. // > So 5*4. // ----------------------------------------------- // = Total 35 Rooms !!!! // ----------------------------------------------- //= GvG: 5 Arenas, the default guild_vs1 - guild_vs5. //= MvP: For the MvP Part I'm using the scripts in npc/custom/MVP_arena/ // Enable both in npc/scripts_custom.conf // You can disable the warper of it or let it be as it is. //===== Comments & Credits ============================================= //= Credits: // - MvP Arena: Darkchild, massdriller, Silent //===== MySQL Entries ======================================== /* DROP TABLE IF EXISTS `arena_master`; CREATE TABLE `arena_master` ( `char_id` int(10) unsigned NOT NULL, `kills` smallint(5) unsigned DEFAULT '0', `death` smallint(5) unsigned DEFAULT '0', `hscore` smallint(5) unsigned DEFAULT '0', `killer` smallint(5) unsigned DEFAULT '0', `domi` smallint(5) unsigned DEFAULT '0', `mega` smallint(5) unsigned DEFAULT '0', `ridic` smallint(5) unsigned DEFAULT '0', `unstopp` smallint(5) unsigned DEFAULT '0', `holys` smallint(5) unsigned DEFAULT '0', `horren` smallint(5) unsigned DEFAULT '0', `godlike` smallint(5) unsigned DEFAULT '0', `mvp` smallint(5) unsigned DEFAULT '0', PRIMARY KEY (`char_id`) ) ENGINE=MyISAM; */ //============================================================ prontera,142,168,0 script Arena Master 808,{ set [email protected]$,"["+strnpcinfo(1)+"]"; function getPartyMapUsers; mes [email protected]$; mes "How can I help you?"; next; menu "- I wanna fight!!",-,"- See Rankings",R_Rank,"- Nevermind",R_Bye; mes [email protected]$; mes "Which room do you want?"; next; switch(select("- GvG:- PvP:- MvP:- Nevermind")) { case 1: mes [email protected]$; if(!getcharid(2)) { mes "I'm sorry, but you are not in a guild."; close; } mes "Please choose the room you want to join:"; mes "Each arena can hold up to "[email protected]+" player(s)."; if([email protected]_gld) mes "If guilds already are in this room, you have to be a member of it so that you can join."; next; set [email protected],select("- GvG 1 ["+getmapusers([email protected]$[0])+"]:- GvG 2 ["+getmapusers([email protected]$[1])+"]:- GvG 3 ["+getmapusers([email protected]$[2])+"]:- GvG 4 ["+getmapusers([email protected]$[3])+"]:- GvG 5 ["+getmapusers([email protected]$[4])+"]") - 1; set @gvgc,@menu; mes [email protected]$; if([email protected]_gld) { if(getd("[email protected]_"[email protected]+"_gld_1") == 0) { mes "I will warp you now."; close2; warp [email protected]$[[email protected]],[email protected]_gld1_x[[email protected]],[email protected]_gld1_y[[email protected]]; setd("[email protected]_"[email protected]+"_gld_1"),getcharid(2); setd("[email protected]_"[email protected]+"_1_ppl"),getd("[email protected]_"[email protected]+"_1_ppl") + 1; end; } else if(getd("[email protected]_"[email protected]+"_gld_2") == 0) { mes "I will warp you now."; close2; warp [email protected]$[[email protected]],[email protected]_gld2_x[[email protected]],[email protected]_gld2_x[[email protected]]; setd("[email protected]_"[email protected]+"_gld_2"),getcharid(2); setd("[email protected]_"[email protected]+"_2_ppl"),getd("[email protected]_"[email protected]+"_2_ppl") + 1; end; } if(getd("[email protected]_"[email protected]+"_gld_1") == getcharid(2)) { if(getd("[email protected]_"[email protected]+"_1_ppl") >= [email protected]) { mes "I'm sorry, but your guild's side is already full."; close; } mes "I will warp you now."; close2; warp [email protected]$[[email protected]],[email protected]_gld1_x[[email protected]],[email protected]_gld1_y[[email protected]]; setd("[email protected]_"[email protected]+"_1_ppl"),getd("[email protected]_"[email protected]+"_1_ppl") + 1; end; } else if(getd("[email protected]_"[email protected]+"_gld_2") == getcharid(2)) { if(getd("[email protected]_"[email protected]+"_2_ppl") >= [email protected]) { mes "I'm sorry, but your guild's side is already full."; close; } mes "I will warp you now."; close2; warp [email protected]$[[email protected]],[email protected]_gld2_x[[email protected]],[email protected]_gld2_x[[email protected]]; setd("[email protected]_"[email protected]+"_2_ppl"),getd("[email protected]_"[email protected]+"_2_ppl") + 1; end; } } else { if(getmapusers([email protected]$[[email protected]]) >= [email protected]) { mes "I'm sorry, but this Arena is already full."; close; } mes "I will warp you now."; close2; warp [email protected]$[[email protected]],0,0; end; } break; case 2: set @map,select("- Prontera:- Alberta:- Izlude:- Payon:- Morroc") - 1; mes [email protected]$; mes "Please choose the PvP Type:"; mes "Each arena can hold up to "[email protected]+" player(s)."; mes "Party PvP is different of course."; next; switch(select("- PvP (Dispell) ["+getmapusers([email protected]$[@map])+"]:- Normal PvP ["+getmapusers([email protected]$[@map])+"]:- PvP Deathmatch["+getmapusers([email protected]$[@map])+"]:- Party PvP["+getPartyMapUsers(6)+"]")) { case 1: mes [email protected]$; if(getmapusers([email protected]$[@map]) >= [email protected]) { mes "I'm sorry, but this room is already full."; close; } mes "I'll warp you now to the "+ [email protected]$[@map]+" PvP Room, also remove all your buffs."; close2; sc_end SC_ALL; warp [email protected]$[@map],0,0; end; case 2: mes [email protected]$; if(getmapusers([email protected]$[@map]) >= [email protected]) { mes "I'm sorry, but this room is already full."; close; } mes "I'll warp you now to the "+ [email protected]$[@map]+" PvP Room."; close2; warp [email protected]$[@map],0,0; end; case 3: mes [email protected]$; if(getmapusers([email protected]$[@map]) >= [email protected]) { mes "I'm sorry, but this room is already full."; close; } mes "I'll warp you now to the "+ [email protected]$[@map]+" PvP Deathmatch Room."; close2; warp [email protected]$[@map],0,0; end; case 4: mes [email protected]$; if(!getcharid(1)) { mes "I'm sorry, but you are not in a party."; mes "Please come back as soon you have found one."; close; } mes "Please choose the Party vs Party Mode:"; next; set [email protected],select("- 2vs2:- 3vs3:- 4vs4:- 5vs5") + 1; mes [email protected]$; if(getPartyMapUsers([email protected],@map) >= ([email protected]*[email protected])) { mes "I'm sorry, but this "[email protected]+"vs"[email protected]+" Arena is already full."; mes "Please try another."; close; } set @pty_id,getcharid(1); if(getpartyleader(@pty_id) != strcharinfo(0)) { mes "I'm sorry, but only your leader can register your party."; close; } getpartymember(@pty_id,1); set @ptymem,[email protected]; if(@ptymem != [email protected]) { mes "I'm sorry, but you have not the required amount of members in your party."; mes "Please make sure that you have exact "[email protected]+" members, not more not less."; close; } getpartymember(@pty_id,2); copyarray @ptymemid[0],[email protected],@ptymem; copyarray @ptymemaid[0],[email protected],@ptymem; set [email protected]_ct,0; for ( set [email protected],0; [email protected] < @ptymem; set [email protected],[email protected] + 1) if(isloggedin(@ptymemid[[email protected]],@ptymemaid[[email protected]]) == 0) set [email protected]_ct,[email protected]_ct + 1; if([email protected]_ct) { mes "It seems like that members are offline."; mes "Please kick them and gather new members."; close; } mes "I'll warp your party now."; mes "Good luck."; close2; warpparty getd("[email protected]"[email protected]+"pvp$["[email protected]+"]"),0,0,@pty_id; end; } case 3: mes [email protected]$; mes "I will now warp you to the MvP Master."; mes "There you can choose 4 Arena Types with each 8 seperate rooms."; close2; warp "quiz_00",50,24; end; case 4: goto R_Bye; break; } function getPartyMapUsers { // Total Map Users of the Party PvP Maps if(getarg(0) == 6) { set @pt2play,getmapusers([email protected]$[0]) + getmapusers([email protected]$[1]) + getmapusers([email protected]$[2]) + getmapusers([email protected]$[3]) + getmapusers([email protected]$[4]); set @pt3play,getmapusers([email protected]$[0]) + getmapusers([email protected]$[1]) + getmapusers([email protected]$[2]) + getmapusers([email protected]$[3]) + getmapusers([email protected]$[4]); set @pt4play,getmapusers([email protected]$[0]) + getmapusers([email protected]$[1]) + getmapusers([email protected]$[2]) + getmapusers([email protected]$[3]) + getmapusers([email protected]$[4]); set @pt5play,getmapusers([email protected]$[0]) + getmapusers([email protected]$[1]) + getmapusers([email protected]$[2]) + getmapusers([email protected]$[3]) + getmapusers([email protected]$[4]); return @pt2play + @pt3play + @pt4play + @pt5play; } else return getmapusers(getd("[email protected]"+getarg(0)+"pvp$["+getarg(1)+"]")); } R_Rank: mes [email protected]$; mes "Which ranking do you wanna see?"; next; switch(select("- Kill:- Death:- High Score:- Killing Sphree:- Dominating:- Mega Kill:- Ridiculous:- Unstoppable:- Holy Shit:- Horrendous:- GodLike:- MvP")) { case 1: set [email protected]$,"kill"; break; case 2: set [email protected]$,"death"; break; case 3: set [email protected]$,"hscore"; break; case 4: set [email protected]$,"killer"; break; case 5: set [email protected]$,"domi"; break; case 6: set [email protected]$,"mega"; break; case 7: set [email protected]$,"ridic"; break; case 8: set [email protected]$,"unstopp"; break; case 9: set [email protected]$,"holys"; break; case 10: set [email protected]$,"horren"; break; case 11: set [email protected]$,"godlike"; break; case 12: set [email protected]$,"mvp"; break; } set @rank,@menu; mes [email protected]$; mes "Which list do you want to see?"; next; switch(select("- Top 5:- Top 10:- Top 15:- Top 20:- Top 25:- Top 30:- Nevermind")) { default: set [email protected],5*@menu; break; case 7: goto R_Bye; break; } mes [email protected]$; mes "Ranking:"; switch(@rank) { case 1: mes set([email protected]$,"Top "[email protected]+" Killers"); set [email protected]$,"Kills"; break; case 2: mes set([email protected]$,"Top "[email protected]+" Victims"); set [email protected]$,"Deaths"; break; case 3: mes set([email protected]$,"Top "[email protected]+" High Scores"); set [email protected]$,"High Score"; break; default: mes set([email protected]$,"Top "[email protected]+" "[email protected]$[@rank-3]); set [email protected]$,[email protected]$[@rank-3]; break; } mes "Correct?"; next; if(select("- Yes:- No") == 2) goto R_Bye; mes [email protected]$; mes "I will now list the ranking in your Chat Box."; close2; dispbottom "======= "[email protected]$+" ==========="; dispbottom "Player Name: "[email protected]$; query_sql "SELECT `char_id` , `"[email protected]+"` FROM `arena_master` WHERE `"[email protected]+"` > 0 ORDER BY `"[email protected]+"` ASC LIMIT "[email protected],[email protected]_id,[email protected]_r; if([email protected]_r) { dispbottom "No Player found."; end; } for( set [email protected],0; [email protected] < getarraysize([email protected]_r); set [email protected],[email protected] + 1) { query_sql "SELECT `name` FROM `char` WHERE `char_id` = '"[email protected]_id[[email protected]]+"'",[email protected]_na$; dispbottom [email protected]_na$+": "[email protected]_r[[email protected]]; } end; R_Bye: mes [email protected]$; mes "Okay, see ya."; close; } - script PvPGvGMain -1,{ end; OnInit: if([email protected]) announce "====== Arena Master - Debug initiate... ========",bc_self; // ============ GvG Settings ============// setarray [email protected]$[0],"guild_vs1","guild_vs2","guild_vs3","guild_vs4","guild_vs5"; if([email protected]) announce "Guild Maps loaded: "[email protected]$[0],bc_self; // If you want to add more mapflags, add them before the "10" > mf_gvg_noparty setarray [email protected]_mf[0],0,1,/*2,*/3,4,5,9,11,13,15,22,33,34,35,38,41,44,10; if([email protected]) announce "Guild Mapflags loaded: "+getarraysize([email protected]_mf),bc_self; setarray [email protected]_gld1_x1[0],9,9,12,8,18; setarray [email protected]_gld1_y1[0],50,50,51,49,50; setarray [email protected]_gld1_x2[0],50,50,50,50,49; setarray [email protected]_gld1_y2[0],7,7,13,8,23; setarray [email protected]_gld2_x1[0],50,50,49,50,49; setarray [email protected]_gld2_y1[0],91,91,86,91,76; setarray [email protected]_gld2_x2[0],92,92,86,91,79; setarray [email protected]_gld2_y2[0],50,50,51,49,49; if([email protected]) announce "Guild 1 Map Coordinates 1 loaded: X - "+getarraysize([email protected]_gld1_x1) +" & Y - "+getarraysize([email protected]_gld1_y1),bc_self; if([email protected]) announce "Guild 1 Map Coordinates 2 loaded: X - "+getarraysize([email protected]_gld1_x2) +" & Y - "+getarraysize([email protected]_gld1_y2),bc_self; if([email protected]) announce "Guild 2 Map Coordinates 1 loaded: X - "+getarraysize([email protected]_gld2_x1) +" & Y - "+getarraysize([email protected]_gld2_y1),bc_self; if([email protected]) announce "Guild 2 Map Coordinates 2 loaded: X - "+getarraysize([email protected]_gld2_x2) +" & Y - "+getarraysize([email protected]_gld2_y2),bc_self; set [email protected]_gld,1; // Have to be same guild to be able to join? if([email protected]) announce "Same Guild Requirement loaded: "[email protected]_gld,bc_self; set [email protected],20; //Max Guild Members per Guild if([email protected]) announce "Max Members per Guild loaded: "[email protected],bc_self; set [email protected],[email protected]*2; // Total Members per Arena. if([email protected]) announce "Max Members per Arena loaded: "[email protected],bc_self; // ======= Auto Mapflag Adding ===============// for ( set [email protected],0; [email protected] < getarraysize([email protected]$); set [email protected],[email protected] + 1 ) { if([email protected]) announce "Array Reading of GvG Maps complete",bc_self; if([email protected]) announce "Mapflag set at "[email protected]$[[email protected]] + " initiate...",bc_self; // Use this if you disallows parties // for ( set [email protected],0; [email protected] < getarraysize([email protected]_mf); set [email protected],[email protected] + 1 ) { // Use this if you allow parties for ( set [email protected],0; [email protected] < (getarraysize([email protected]_mf) - 1); set [email protected]mf,[email protected] + 1 ) { /* if([email protected]_mf[[email protected]] == 2) { if([email protected]) announce "Mapflag 2 (mf_nosave) initiate...",bc_self; if(getmapflag([email protected]$[[email protected]],mf_nosave) == 0) setmapflagnosave [email protected]$[[email protected]],"prontera",156,191; if([email protected]) announce "Mapflag 2 (mf_nosave) completed...",bc_self; continue; } else */ if(getmapflag([email protected]$[[email protected]],[email protected]_mf[[email protected]]) == 0) setmapflag [email protected]$[[email protected]],[email protected]_mf[[email protected]]; if([email protected]) announce "Mapflag "+ [email protected]_mf[[email protected]] +" set at "[email protected]$[[email protected]] + " complete",bc_self; } } if([email protected]) announce "Guild Mapflag loading completed",bc_self; // ============ PvP Settings ============// // If you want to add more mapflags, add them before the "7" > mf_pvp_noparty setarray [email protected]_mf[0],0,1,2,3,4,5,7,11,13,22,33,34,35,38,41,44,7; if([email protected]) announce "PvP Mapflags loaded: "+getarraysize([email protected]_mf),bc_self; set [email protected],50; // Max Player each Arena. setarray [email protected]$[0],"Killing Sphree","Dominating","Mega Kill","Ridiculous","Unstoppable","Holy Shit","Horrendous","GodLike"; if([email protected]) announce "PvP Sphree Names loaded: "[email protected]$[0],bc_self; // Map Order: Prontera, Alberta, Izlude, Payon, Morroc setarray [email protected]$[0],"Prontera","Alberta","Izlude","Payon","Morroc"; if([email protected]) announce "PvP Town Maps loaded: "[email protected]$[0],bc_self; // Dispell PvP setarray [email protected]$[0],"pvp_y_1-1","pvp_y_1-4","pvp_y_1-2","pvp_y_1-3","pvp_y_1-5"; if([email protected]) announce "PvP Dispell Maps loaded: "[email protected]$[0],bc_self; // ======= Auto Mapflag Adding - Dispell PvP ===============// for ( set [email protected],0; [email protected] < getarraysize([email protected]$); set [email protected],[email protected] + 1 ) // Use this if you disallows parties // for ( set [email protected],0; [email protected] < getarraysize([email protected]_mf); set [email protected],[email protected] + 1 ) // Use this if you allow parties for ( set [email protected],0; [email protected] < (getarraysize([email protected]_mf) - 1); set [email protected],[email protected] + 1 ) if(getmapflag([email protected]$[[email protected]],[email protected]_mf[[email protected]]) == 0) setmapflag [email protected]$[[email protected]],[email protected]_mf[[email protected]]; if([email protected]) announce "PvP Dispell Mapflags loaded.",bc_self; // Normal PvP setarray [email protected]$[0],"pvp_y_2-1","pvp_y_2-4","pvp_y_2-2","pvp_y_2-3","pvp_y_2-5"; if([email protected]) announce "PvP Normal Maps loaded: "[email protected]$[0],bc_self; // ======= Auto Mapflag Adding - Normal PvP ===============// for ( set [email protected],0; [email protected] < getarraysize([email protected]$); set [email protected],[email protected] + 1 ) // Use this if you disallows parties // for ( set [email protected],0; [email protected] < getarraysize([email protected]_mf); set [email protected],[email protected] + 1 ) // Use this if you allow parties for ( set [email protected],0; [email protected] < (getarraysize([email protected]_mf) - 1); set [email protected],[email protected] + 1 ) if(getmapflag([email protected]$[[email protected]],[email protected]_mf[[email protected]]) == 0) setmapflag [email protected]$[[email protected]],[email protected]_mf[[email protected]]; if([email protected]) announce "PvP Normal Mapflags loaded.",bc_self; // ================== Deathmatch Settings + Maps ================ setarray [email protected]$[0],"pvp_y_3-1","pvp_y_3-4","pvp_y_3-2","pvp_y_3-3","pvp_y_3-5"; if([email protected]) announce "PvP DM Maps loaded: "[email protected]$[0],bc_self; // ======= Auto Mapflag Adding - DM PvP ===============// for ( set [email protected],0; [email protected] < getarraysize([email protected]$); set [email protected],[email protected] + 1 ) // Use this if you disallows parties // for ( set [email protected],0; [email protected] < getarraysize([email protected]_mf); set [email protected],[email protected] + 1 ) // Use this if you allow parties for ( set [email protected],0; [email protected] < (getarraysize([email protected]_mf) - 1); set [email protected],[email protected] + 1 ) if(getmapflag([email protected]$[[email protected]],[email protected]_mf[[email protected]]) == 0) setmapflag [email protected]$[[email protected]],[email protected]_mf[[email protected]]; if([email protected]) announce "PvP DM Mapflags loaded.",bc_self; set [email protected],5; // Kills required for Killing Sphree Start if([email protected]) announce "Kill Requiremnt for Killing Sphree Start loaded.",bc_self; // ================= Party PvP Settings ================= // ========= 2vs2 Party PvP ==========// setarray [email protected]$[0],"pvp_y_4-1","pvp_y_4-4","pvp_y_4-2","pvp_y_4-3","pvp_y_4-5"; if([email protected]) announce "Party PvP 2vs2 Maps loaded: "[email protected]$[0],bc_self; // 3vs3 Party PvP setarray [email protected]$[0],"pvp_y_5-1","pvp_y_5-4","pvp_y_5-2","pvp_y_5-3","pvp_y_5-5"; if([email protected]) announce "Party PvP 3vs3 Maps loaded: "[email protected]$[0],bc_self; // 4vs4 Party PvP setarray [email protected]$[0],"pvp_y_6-1","pvp_y_6-4","pvp_y_6-2","pvp_y_6-3","pvp_y_6-5"; if([email protected]) announce "Party PvP 4vs4 Maps loaded: "[email protected]$[0],bc_self; // 5vs5 Party PvP setarray [email protected]$[0],"pvp_y_7-1","pvp_y_7-4","pvp_y_7-2","pvp_y_7-3","pvp_y_7-5"; if([email protected]) announce "Party PvP 5vs5 Maps loaded: "[email protected]$[0],bc_self; // ======= Auto Mapflag Adding ===============// for ( set [email protected],0; [email protected] < getarraysize([email protected]$); set [email protected],[email protected] + 1 ) for ( set [email protected],0; [email protected] < (getarraysize([email protected]_mf) - 1); set [email protected],[email protected] + 1 ) { if(getmapflag([email protected]$[[email protected]],[email protected]_mf[[email protected]]) == 0) setmapflag [email protected]$[[email protected]],[email protected]_mf[[email protected]]; if(getmapflag([email protected]$[[email protected]],[email protected]_mf[[email protected]]) == 0) setmapflag [email protected]$[[email protected]],[email protected]_mf[[email protected]]; if(getmapflag([email protected]$[[email protected]],[email protected]_mf[[email protected]]) == 0) setmapflag [email protected]$[[email protected]],[email protected]_mf[[email protected]]; if(getmapflag([email protected]$[[email protected]],[email protected]_mf[[email protected]]) == 0) setmapflag [email protected]$[[email protected]],[email protected]_mf[[email protected]]; } if([email protected]) announce "Party PvP Mapflags loaded.",bc_self; function writeStats; if([email protected]) announce "Write Stats Function loaded.",bc_self; end; OnPCKillEvent: if(compare(strcharinfo(3),"pvp_y_") == 0 || compare(strcharinfo(3),"guild_vs") == 0) end; if(getmapflag(strcharinfo(3),mf_pvp) == 0 || getmapflag(strcharinfo(3),mf_gvg) == 0) end; set [email protected],getcharid(3); set [email protected],killedrid; mapannounce strcharinfo(3),strcharinfo(0) + " has killed "+rid2name([email protected])+".",0; set @killct,@killct + 1; if(@killct >= [email protected]) { if(@killct < 10) { set @sphr,1; set @killer,@killer + 1; } else if(@killct >= 10 && @killct < 15) { set @sphr,2; set @domi,@domi + 1; } else if(@killct >= 15 && @killct < 20) { set @sphr,3; set @mega,@mega + 1; } else if(@killct >= 20 && @killct < 25) { set @sphr,4; set @ridic,@ridic + 1; } else if(@killct >= 25 && @killct < 30) { set @sphr,5; set @unstopp,@unstopp + 1; } else if(@killct >= 30 && @killct < 50) { set @sphr,6; set @holys,@holys + 1; } else if(@killct >= 50 && @killct < 80) { set @sphr,7; set @horren,@horren + 1; } else if(@killct >= 80) { set @sphr,8; set @godlike,@godlike + 1; } mapannounce strcharinfo(3),strcharinfo(0) + " is now on "+ [email protected]$[@sphr]+"!!!!",0; message strcharinfo(0),"You have killed "[email protected]+" Player(s) so far."; } detachrid; attachrid([email protected]); writeStats(getcharid(0),@killct); set @killct,0; if([email protected]_gld) { if(getd("[email protected]_"[email protected]+"_gld_1") == getcharid(2)) setd("[email protected]_"[email protected]+"_1_ppl"),getd("[email protected]_"[email protected]+"_1_ppl") - 1; if(getd("[email protected]_"[email protected]+"_gld_2") == getcharid(2)) setd("[email protected]_"[email protected]+"_2_ppl"),getd("[email protected]_"[email protected]+"_2_ppl") - 1; } for ( set @d,0; @d < getarraysize([email protected]$); set @d,@d + 1) if(strcharinfo(3) == [email protected]$[@d]) { sleep2 1500; if([email protected] != getcharid(3)) { warp strcharinfo(3),0,0; if(HP == 0) atcommand "@alive"; percentheal 100,100; } else warp "SavePoint",0,0; } end; OnPCLogOutEvent: if(compare(strcharinfo(3),"pvp_y_") == 0 || compare(strcharinfo(3),"guild_vs") == 0) end; if(getmapflag(strcharinfo(3),mf_pvp) == 0 || getmapflag(strcharinfo(3),mf_gvg) == 0) end; writeStats(getcharid(0),@killct); if([email protected]_gld) { if(getd("[email protected]_"[email protected]+"_gld_1") == getcharid(2)) setd("[email protected]_"[email protected]+"_1_ppl"),getd("[email protected]_"[email protected]+"_1_ppl") - 1; if(getd("[email protected]_"[email protected]+"_gld_2") == getcharid(2)) setd("[email protected]_"[email protected]+"_2_ppl"),getd("[email protected]_"[email protected]+"_2_ppl") - 1; } end; OnNPCKillEvent: if(compare(strcharinfo(3),"pvp_n_") == 0) end; if(query_sql("SELECT `char_id` FROM `arena_master` WHERE `char_id` = '"[email protected]+"'",@charid) != 0) query_sql "UPDATE `arena_master` SET `mvp` = `mvp` + 1 WHERE `char_id` = '"[email protected]+"'"; else query_sql "INSERT INTO `arena_master` ( `char_id` , `mvp`) VALUES ( '"[email protected]+"' , '1' )"; end; function writeStats { set @c,getarg(0); set @k,getarg(1); if(query_sql("SELECT `char_id` FROM `arena_master` WHERE `char_id` = '"[email protected]+"'",@charid) != 0) { if(@k > query_sql("SELECT `hscore` FROM `arena_master` WHERE `char_id` = '"[email protected]+"'",@hscore)) set @hscore,@k; query_sql "UPDATE `arena_master` SET `kills` = `kills` + "[email protected]+", `death` = `death` + 1 , `hscore` = '"[email protected]+"' , `killer` = `killer` + "[email protected]+" , `domi` = `domi` + "[email protected]+" , `mega` = `mega` + "[email protected]+" , `ridic` = `ridic` + "[email protected]+" , `unstopp` = `unstopp` + "[email protected]+" , `holys` = `holys` + "[email protected]+" , `horren` = `horren` + "[email protected]+" , `godlike` = `godlike` + "[email protected]+" WHERE `char_id` = '"[email protected]+"'"; } else query_sql "INSERT INTO `arena_master` ( `char_id` , `kills` , `death` , `hscore` , `killer` , `domi` , `mega` , `ridic` , `unstopp` , `holys` , `horren` , `godlike` , `mvp`) VALUES ( '"[email protected]+"' , '"[email protected]+"' , '1' , '"[email protected]+"' , '"[email protected]+"' , '"[email protected]+"' , '"[email protected]+"' , '"[email protected]+"' , '"[email protected]+"' , '"[email protected]+"' , '"[email protected]+"' , '"[email protected]+"' , '0' )"; return; } OnWhisperGlobal: set [email protected]_in,0; set [email protected],0; if(select("- ReLoad:- Nevermind") == 2) end; if(select("- Debug: Without Debug") == 1) set [email protected],1; set [email protected]_in,1; goto OnInit; end; } Another question, see 'R_Rank:' : I saw you can insert table names like this too: query_sql "SELECT `char_id` , `"[email protected]+"` FROM `arena_master` WHERE `"[email protected]+"` > 0 ORDER BY `"[email protected]+"` ASC LIMIT "[email protected],[email protected]_id,[email protected]_r; Couldn't test it yet though :I. Wanna fix my mf_ errors first :I. Thanks Kenpachi for in advance . Regards, Chris Quote Link to comment Share on other sites More sharing options...
0 Toshiro Posted December 2, 2011 Share Posted December 2, 2011 (edited) getmapflag does not return any value for MF_NOSAVE, MF_NOEXPPENALTY and maybe some other map flags. Therefore the server says you tried to use invalid data. Edited December 2, 2011 by Toshiro Quote Link to comment Share on other sites More sharing options...
0 llchrisll Posted December 2, 2011 Author Share Posted December 2, 2011 And why is that o.o? Quote Link to comment Share on other sites More sharing options...
0 Toshiro Posted December 2, 2011 Share Posted December 2, 2011 And why is that o.o? Don't know. Probably someone just forgot to add it when adding the command and/or mapflags. Anyways, submitted a bug report about this matter. [bug]5097[/bug] Quote Link to comment Share on other sites More sharing options...
0 llchrisll Posted December 3, 2011 Author Share Posted December 3, 2011 (edited) Well, it could also be a bug in the eAthena version I'm using for my test server, 14424 SQL Trunk was it. I deleted the whole if(getmapflag part, but just in case... Would an error show up when he tries to readd an mapflag to the same map again? I didn't try it yet,so I'm asking first to prevent another "brain burner" . Would have an different solution too though. Regards, Chris Edit: Can be closed, solved it by deleting the "getmapflag" commands >_>, my server doesn't show any error so it should be fine. Edited December 3, 2011 by llchrisll Quote Link to comment Share on other sites More sharing options...
0 Kenpachi Posted December 5, 2011 Share Posted December 5, 2011 Well, removing parts of a script because the emulator is "broken" doesn't make sense. Here is a patch that allows you to check, set or remove every mapflag that's listed in the mapflag enumeration in script.c.RAthena-mapflags_15008_trunk.patch Quote Link to comment Share on other sites More sharing options...
Update: Deleted the script samples to prevent the usage of them. (security first D:)
Also close please
.
------------------------------------------------------------------------------------------------------------
Hi guys, I got a few problems with the following two mapflags:
mf_nosave & mf_noexppenalty
I'm trying to make an PvP/GvG/MvP Arena with included ranking system.
I though about the mapflags and since I saw in an script I could that via their numbers and an array, I did it that way.
My only problem is that it doesn't work with those two mf_ above.
I dunno why though.
Here are screenshots, InGame Debug Messages & Map Server console.
InGame - Here I skipped the mf_nosave but it stopped at the second one.
Map Server Error:
Uploaded with ImageShack.us
Regards,
Chris
Edited by calciumkidLink to comment
Share on other sites