Feefty Posted November 14, 2012 Posted November 14, 2012 this is what i get from debugmes. and i think this is the culprit for my charserver to crash. (11/14/2012 19:59:16) [ Warning ] : Unexpected type for argument 1. Expected string. (11/14/2012 19:59:16) [ Debug ] : Data: param name='killerrid' type=121 (11/14/2012 19:59:16) [ Debug ] : Function: debugmes (11/14/2012 19:59:16) [ Debug ] : Source (NPC): RiftPoints (invisible/not on a map) (11/14/2012 19:59:16) [ Debug ] : script debug : 2000224 110010134 : 2000003 (11/14/2012 19:59:16) [ Warning ] : Unexpected type for argument 1. Expected string. (11/14/2012 19:59:16) [ Debug ] : Data: param name='killedrid' type=122 (11/14/2012 19:59:16) [ Debug ] : Function: debugmes (11/14/2012 19:59:16) [ Debug ] : Source (NPC): RiftPoints (invisible/not on a map) (11/14/2012 19:59:16) [ Debug ] : script debug : 2000003 110010134 : 2000224 Quote
ossi0110 Posted November 14, 2012 Posted November 14, 2012 show the script where the NPC RiftPoints is in Quote
Feefty Posted November 14, 2012 Author Posted November 14, 2012 (edited) - script RiftPoints -1,{ function getRank; function getRank_; function Cm; function getIP; function partyShare; function getRecord; OnInit: setarray .RiftPointsMobGain[0],10,40,60,80,90,120,135,500; setarray .RiftPointsGain[0], 120,168,235,329,461,645,903,1264,1770,2124,2549,3059,3671,4405, 5268,6343,7612,9134; setarray .RiftPointsLost[0], 24,37,58,91,143,225,356,561,885,1195,1616,2184,2949,3981, 5374,7258,9799,13229; setarray .RiftPointsRequired[0], 0,1200,4220,10990,23500,42780,68700,105600,150800,214100,278700, 344500,411700,488200,565400,643200,721600,800700; setarray .RiftRank$[0], "Solider, Rank 9", "Solider, Rank 8", "Solider, Rank 7", "Solider, Rank 6", "Solider, Rank 5", "Solider, Rank 4", "Solider, Rank 3", "Solider, Rank 2", "Solider, Rank 1", "Army 1-Star Officer", "Army 2-Star Officer", "Army 3-Star Officer", "Army 4-Star Officer", "Army 5-Star Officer", "Army General", "Army Great General", "Army Commander", "Army Governor"; setarray .RiftMaps$[0],"prtg_cas01","prtg_cas02","prtg_cas03","prtg_cas04","prtg_cas05","lhz_dun04","lhz_dun03","moc_fild22", "guild_vs1", "guild_vs2", "guild_vs3", "guild_vs4", "guild_vs5"; end; OnPCDieEvent: getmapxy(@map$,@x,@y,0); for (set .@j,0; .@j<getarraysize(.RiftMaps$); set .@j,.@j+1) { if (@map$ == .RiftMaps$[.@j] && getcharid(2) != getcharid(2, rid2name(killerrid))) { debugmes(killerrid); if (BaseLevel >= 99) { if (@map$ == "guild_vs1") { query_sql("UPDATE `char` SET `deaths` = deaths + 1 WHERE `char_id` = "+getcharid(0)); } query_sql("SELECT `riftpoints` FROM `char` WHERE `char_id` = "+getcharid(0), @riftpoints); // get killed rank set @killedRank, getRank_(@riftpoints); if (compare(@map$, "g_cas")) { set @lost, .RiftPointsLost[@killedRank]*2; } else { set @lost, .RiftPointsLost[@killedRank]; } if (@riftpoints >= @lost) { set @minus, @riftpoints-@lost; } else { set @minus, 0; } // update rift points query_sql("UPDATE `char` SET `riftpoints` = "+@minus+", `riftpoints_last_timestamp` = NOW() WHERE `char_id` = "+getcharid(0)); query_sql("SELECT `riftpoints` FROM `char` WHERE `char_id` = "+getcharid(0), @newRiftPoints); } // announce the killing announce strcharinfo(0)+" "+.RiftRank$[getRank(getcharid(0))]+" was killed by "+rid2name(killerrid)+"'s attack.",bc_area; dispbottom("You have died."); if (BaseLevel >= 99) { dispbottom("Total Rift Points: "+ Cm(@newRiftPoints)); if (@map$ == "guild_vs1") { dispbottom("Kills: "+getRecord("kills", getcharid(0))+" Deaths: "+getRecord("deaths", getcharid(0))); } if (getRank_(@riftpoints) > getRank_(@newRiftPoints)) { dispbottom("You have been demoted to "+ .RiftRank$[getRank_(@newRiftPoints)]); } } } } end; OnPCKillEvent: getmapxy(@map$,@x,@y,0); for (set .@j,0; .@j<getarraysize(.RiftMaps$); set .@j,.@j+1) { if (@map$ == .RiftMaps$[.@j] && getcharid(2) != getcharid(2, rid2name(killedrid))) { debugmes(killedrid); if (@map$ == "guild_vs1") { query_sql("UPDATE `char` SET `kills` = kills + 1 WHERE `char_id` = "+getcharid(0)); } // if player below level 99 if (BaseLevel < 99) { dispbottom("You must be level 99 or higher to start gaining Rift Points."); break; } query_sql("SELECT `riftpoints` FROM `char` WHERE `char_id` = "+getcharid(0, rid2name(killedrid)), @riftpoints); // get my current rift points query_sql("SELECT `riftpoints` FROM `char` WHERE `char_id` = "+getcharid(0), @currentRiftPoints); // get killed rank set @killedRank, getRank_(@riftpoints); set @gain, .RiftPointsGain[@killedRank]; if (getgroupid() == 1) { set @gain, (@gain+((@gain*30)/100)); } if (KillPlayer$ == rid2name(killedrid)) { set @gain, (@gain-((@gain*70)/100)); } if (compare(@map$, "g_cas")) { set @gain, @gain*2; } set KillPlayer$, rid2name(killedrid); // update rift points query_sql("UPDATE `char` SET `riftpoints` = riftpoints + "+@gain+", `riftpoints_last_timestamp` = NOW() WHERE `char_id` = "+getcharid(0)); // get my new rift points query_sql("SELECT `riftpoints` FROM `char` WHERE `char_id` = "+getcharid(0), @newRiftPoints); // display messages dispbottom("You have gained "+Cm(@gain)+" Rift Points."); dispbottom("You have defeated "+rid2name(killedrid)+" "+.RiftRank$[getRank(getcharid(0, rid2name(killedrid)))]+"."); dispbottom("Total Rift Points: "+ Cm(@newRiftPoints)); if (@map$ == "guild_vs1") { dispbottom("Kills: "+getRecord("kills", getcharid(0))+" Deaths: "+getRecord("deaths", getcharid(0))); } if (getRank_(@currentRiftPoints) < getRank_(@newRiftPoints)) { dispbottom("You have been promoted to "+ .RiftRank$[getRank_(@newRiftPoints)]); if (getRank_(@newRiftPoints) >= 9) { announce strcharinfo(0)+" has been promoted to "+.RiftRank$[getRank_(@newRiftPoints)], b_all; } } sleep2 60000; set KillPlayer$, ""; break; } } end; OnNPCKillEvent: getmapxy(@map$,@x,@y,0); for (set .@j,0; .@j<getarraysize(.RiftMaps$); set .@j,.@j+1) { if (@map$ == .RiftMaps$[.@j]) { // if player below level 99 if (BaseLevel < 99) { dispbottom("You must be level 99 or higher to start gaining Rift Points."); break; } set @gain, (((getmonsterinfo(killedrid, MOB_LV)/3)*getmonsterinfo(killedrid, MOB_SIZE))/3); if (getgroupid() == 1) { set @gain, (@gain+((@gain*30)/100)); } // get my current rift points query_sql("SELECT `riftpoints` FROM `char` WHERE `char_id` = "+getcharid(0), @currentRiftPoints); // update rift points query_sql("UPDATE `char` SET `riftpoints` = riftpoints + "+@gain+", `riftpoints_last_timestamp` = NOW() WHERE `char_id` = "+getcharid(0)); // get my new rift points query_sql("SELECT `riftpoints` FROM `char` WHERE `char_id` = "+getcharid(0), @newRiftPoints); // display messages dispbottom("You have gained "+Cm(@gain)+" Rift Points."); dispbottom("Your Current Rift Points: "+ Cm(@newRiftPoints)); if (getRank_(@currentRiftPoints) < getRank_(@newRiftPoints)) { dispbottom("You have been promoted to "+ .RiftRank$[getRank(@newRiftPoints)]); if (getRank_(@newRiftPoints) >= 9) { announce strcharinfo(0)+" has been promoted to "+.RiftRank$[getRank_(@newRiftPoints)], b_all; } } break; } } end; OnPcLoginEvent: query_sql("SELECT `riftpoints` FROM `char` WHERE `char_id` = "+getcharid(0), @riftpoints); dispbottom("Your Current Rift Points: "+ Cm(@riftpoints)); dispbottom("Your Current Rank: "+ .RiftRank$[getRank_(@riftpoints)]); end; //OnPCLogoutEvent: //query_sql("SELECT `riftpoints` FROM `char` WHERE `char_id` = "+getcharid(0), @riftpoints); //set @myRank, getRank_(@riftpoints); //set @newName$, changeRankName(getcharid(0), @myRank, strcharinfo(0)); //changeGuildName(@newName$, getcharid(0)); //end; function getRecord { query_sql("SELECT `"+getarg(0)+"` FROM `char` WHERE `char_id` = "+getarg(1), @record); return @record; } function partyShare { if (getarg(0) != 0) { for (set .@j, 0; .@j < getarraysize(getarg(1)); set .@j,.@j+1) { } } } function Cm { set .@str$, getarg(0); for(set .@i,getstrlen(.@str$)-3; .@i>0; set .@i,.@i-3) set .@str$, insertchar(.@str$,",",.@i); return .@str$; } function getIP { query_sql("SELECT `last_ip` FROM `login` WHERE `account_id` = "+getarg(0), @ip$); return @ip$; } function getRank { query_sql("SELECT `riftpoints` FROM `char` WHERE `char_id` = "+getarg(0), @riftpoints); for (set .@j,getarraysize(.RiftPointsRequired)-1; .@j>=0; set .@j,.@j-1) { if (@riftpoints >= .RiftPointsRequired[.@j]) { return .@j; break; } } } function getRank_ { for (set .@j,getarraysize(.RiftPointsRequired)-1; .@j>=0; set .@j,.@j-1) { if (getarg(0) >= .RiftPointsRequired[.@j]) { return .@j; break; } } } } Edited November 14, 2012 by AnnieRuru use [codebox] if the script > 10 lines Quote
AnnieRuru Posted November 14, 2012 Posted November 14, 2012 change debugmes(killedrid); into debugmes(killedrid+""); 1 Quote
Emistry Posted November 14, 2012 Posted November 14, 2012 (edited) remove debugmes or change to debugmes( ""+killedrid ); because it have to be string in order to pass the value to debugmes Edited November 14, 2012 by Emistry LOL...Annie block in my way again..xD 1 Quote
Question
Feefty
this is what i get from debugmes.
and i think this is the culprit for my charserver to crash.
(11/14/2012 19:59:16) [ Warning ] : Unexpected type for argument 1. Expected string.
(11/14/2012 19:59:16) [ Debug ] : Data: param name='killerrid' type=121
(11/14/2012 19:59:16) [ Debug ] : Function: debugmes
(11/14/2012 19:59:16) [ Debug ] : Source (NPC): RiftPoints (invisible/not on a map)
(11/14/2012 19:59:16) [ Debug ] : script debug : 2000224 110010134 : 2000003
(11/14/2012 19:59:16) [ Warning ] : Unexpected type for argument 1. Expected string.
(11/14/2012 19:59:16) [ Debug ] : Data: param name='killedrid' type=122
(11/14/2012 19:59:16) [ Debug ] : Function: debugmes
(11/14/2012 19:59:16) [ Debug ] : Source (NPC): RiftPoints (invisible/not on a map)
(11/14/2012 19:59:16) [ Debug ] : script debug : 2000003 110010134 : 2000224
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.